简体   繁体   中英

LOOP instruction fails to loop even though (--cx != 0)

I'm implementing a multiplication algorithm for school, so please no help with the algorithm. I'm using C subroutine conventions, so I don't need to push CX , and the result is returned in DX:AX . I'm using codeview to do the debugging.

At the LOOP line, CX is seen to be 16:

在此处输入图片说明

After stepping with F10 , I believe it should put me back at the shiftR label. What happens is that CX becomes 0, and I continue to exit the subroutine as is seen in this screenshot:

在此处输入图片说明

As well, you can see that the Carry and Overflow flags are set after stepping! I didn't think LOOP could do that? What gives? What am I overlooking?

SOLVED: I jumped the gun. As David Wohlferd mentioned, F8 is step and F10 is next using GDB terminology.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM