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
Get step-by-step solutions from verified subject matter experts
