Question: MASM/IRVINE/X86/ASSEMBLY SHOW AN EXAMPLE using the CMP INSTRUCTIONwith the following code: .data array SWORD 50 DUP(?) sentinel SWORD 0FFFFh .code movesi,OFFSETarray movecx,LENGTHOFarray L1:cmpWORD PTR [esi],0

MASM/IRVINE/X86/ASSEMBLY

SHOW AN EXAMPLE using the CMP INSTRUCTIONwith the following code:

.data

array SWORD 50 DUP(?)

sentinel SWORD 0FFFFh

.code

movesi,OFFSETarray

movecx,LENGTHOFarray

L1:cmpWORD PTR [esi],0 ; check for zero

pushfd; push flags on stack

addesi,TYPEarray

popfd; pop flags from stack

loopeL1 ; continue loop

jzquit ; none found

subesi,TYPEarray ; ESI points to value

quit:

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!