【发布时间】:2011-08-07 04:58:27
【问题描述】:
好的,我是 PC Assembler 的新手。我正在尝试编写一个程序,但它不会停止循环。我猜 ECX 寄存器正在被修改?我该如何解决这个问题?谢谢。
DATA SECTION
;
KEEP DD 0 ;temporary place to keep things
;
CODE SECTION
;
START:
MOV ECX,12
TOPOFLOOP:
PUSH -11 ;STD_OUTPUT_HANDLE
CALL GetStdHandle ;get, in eax, handle to active screen buffer
PUSH 0,ADDR KEEP ;KEEP receives output from API
PUSH 5,'bruce' ;5=length of string
PUSH EAX ;handle to active screen buffer
CALL WriteFile
XOR EAX,EAX ;return eax=0 as preferred by Windows
LOOP TOPOFLOOP
ENDLABEL:
RET
【问题讨论】:
标签: windows loops x86 dos assembly