我有一个汇编 x86 问题
INCLUDE Irvine32.inc
.data
day WORD 0
month WORD 0
year WORD 0
count BYTE 0
prompt1 BYTE "enter month: ",0
prompt2 BYTE "enter day: ",0
prompt3 BYTE "enter an year: ",0
prompt4 BYTE " the day of the week is ",0
.code
main PROC
mov edx, OFFSET prompt1
call writeString
mov edx, 0
mov eax, OFFSET month
mov ecx, 19
call readInt
call crlf
mov eax, 0
mov ecx, 0
mov edx, OFFSET prompt2
call writeString
mov edx, 0
mov eax, OFFSET day
mov ecx, 19
call readInt
call crlf
mov eax, 0
mov ecx, 0
mov edx, OFFSET prompt3
call writeString
mov edx, 0
mov eax, OFFSET year
mov ecx, 19
call readInt
call crlf
mov eax, 0
mov ecx, 0
mov ebx, 0
mov ax, 14
sub ax, month
mov bx, 12
div bx
mov ebx, 0
sub year, ax
mov ecx, 0
mov cx, year
exit
main ENDP
END main
所以我必须为这段代码做 2 个算术方程
a = (14 - month) / 12
y = year - a
这是我的输入
enter month: 4
enter day: 15
enter an year: 2013
我期望最后一条指令后 y 的值为 7dd(2013)
但是我得到寄存器 ecx 的值是 0000FFFF,为什么 y 的值不是 7dd,而是 FFFF
谁能帮忙?预先感谢