in listing2-2 I've commented out two lines of code, since I thought, there is nothing happening in these registers:
Code: Select all
Extract from asmMain:
...
lea rcx, fmtStr1
mov edx, leftOp
mov r8d, rightOp1
mov r9d, edx
and r9d, r8d
call printf
;lea rex, fmtStr1
;mov edx, leftOp
mov r8d, rightOp2
mov r9d, r8d
and r9d, edx
call printf
...
When I remove the semicolons, the result is as shown in the book. I thought the register rcx would be untouched, until the address of fmtStr2 is loaded into it, but I must be missing something. Why do the two registers rcx and edx have to be reloaded?calling listing2-2:
f0f0f0f AND f0f0f0f0 = 0
<I can't show this character, but it looks like an "L" written with two lines>aH#%f0f0f0f OR f0f0f0f0 = 0
...
Thank you very much in advance!
Best regards,
sahu