이 질문이 정말 간단하다면 죄송합니다.하지만 알고있는 모든 것을 시도해 보았습니다. 알아 내지 못했습니다.MASM32 어셈블리 - 콘솔에서 숫자 읽기
문자열과 Count를 콘솔에서 가져 와서 Count로 지정된 문자열 번호를 인쇄하는 간단한 절차를 만들려고합니다.
모든 것이 좋지만 루프를 위해 Count를 eax로 할 때 값이 엉망이되어 무한 루프로 끝납니다.
Count를 DWORD로 변경하려고 시도했지만 작동하지 않았습니다. - 문자열의 주소 - Printer
두 번째 인수로
PrintString PROTO :DWORD, :DWORD
.data
String db 100 DUP(0)
Count db 10 DUP(0)
.code
start:
;1- get user input
invoke StdIn, addr String, 99
invoke StdIn, addr Count, 10
;2- Remove the CRLF from count
invoke StripLF, addr Count
;3- Convert the count to DWORD
invoke atodw, addr InputCount
mov Counter, eax
;4- Call the Printer function
invoke Printer, addr String, addr Count
Printer PROC StringToPrint:DWORD, count:DWORD
mov eax,count ;;;;;; This is the problem I think
Looppp:
push eax
invoke StdOut, StringToPrint
pop eax
dec eax
jnz Looppp
ret
Printer endp
덕분에 많이,이 문제를 해결 -
제쳐두고,
eax
결국 제로가 있으므로 인쇄 루프가 무한되지 않습니다 도달해야한다. 헝가리 표기법을 좀 더 우아하고 효율적으로 보입니다. –