1
這是我第一次寫這裏...我嘗試解釋我的問題! 我在MASM32printf error在masm32中打印一個字符
.586
.model flat
.data
mess db "digita un carattere ",0
res db "x = %c",10,0
.data?
salva db ?
.code
extern _printf:proc
extern _scanf:proc
_funzione proc
;pre
push ebp
mov ebp,esp
push ebx
push edi
push esi
mov eax, offset mess
push eax
call _printf ;puting out the message
mov eax, offset salva
push eax
mov eax, offset res
push eax
call _scanf ;taking the char and saving it in "salva"
add esp,12
xor eax,eax
mov eax,offset salva
push eax
mov eax, offset res
push eax
call _printf ;printing the char
add esp,8
;post
pop esi
pop edi
pop ebx
pop ebp
ret
_funzione endp
end
寫了這個代碼時,我編譯它的輸出是:
我不明白爲什麼_printf犯規打印字符( 'Y'),其_scanf讀過。 .. 請幫幫我!