有一个汇编题目,编好了感觉没错,但结果就是不对,求帮忙,谢谢!
题目就是输入出生日期比如2011-11-11,输出满百日、千日、万日后的日期。我输入输出都是对的(应该),累加日期的宏有问题。
PUSH1 POP1就是保护寄存期的
然后ISRN是判断闰年的,闰年就JUDGE置1,非闰年就置0
下面是我编的累加日期的宏,哪里错了啊?
FILL MACRO N
LOCAL JUDGEM,MONTHB,MONTHS,MONTH2,FINISH
LOCAL LOP3,LOP4,LOP5
LOCAL JYEARB,JDAYB,JDAYS,JDAY2
PUSH1
JUDGEM: CMP MONTH,2;;判断月份并转移
JE MONTH2
CMP MONTH,4
JE MONTHS
CMP MONTH,6
JE MONTHS
CMP MONTH,9
JE MONTHS
CMP MONTH,11
JE MONTHS
MONTHB: CMP N,0;;大月补齐天数并返回判断下一月份
JE FINISH
LOP3: CMP DAY,31
JB JDAYB
MOV DAY,1
DEC N
CMP MONTH,12
JE JYEARB
INC MONTH
JMP JUDGEM
JYEARB: MOV MONTH,1
INC YEAR
JMP MONTHB
JDAYB: INC DAY
DEC N
JMP MONTHB
MONTHS: CMP N,0;;小月补齐天数并返回判断下一月份
JE FINISH
LOP4: CMP DAY,30
JB JDAYS
MOV DAY,1
INC MONTH
DEC N
JMP MONTHB
JDAYS: INC DAY
DEC N
JMP MONTHS
MONTH2: CMP N,0;;二月补齐天数并返回判断下一月份
JE FINISH
CALL ISRN
CMP JUDGE,0
JE LOP5
CMP DAY,29
JB JDAY2
MOV DAY,1
INC MONTH
DEC N
JMP MONTHB
LOP5: CMP DAY,28
JB JDAY2
MOV DAY,1
INC MONTH
DEC N
JMP MONTHB
JDAY2: INC DAY
DEC N
JMP MONTH2
FINISH: NOP
POP1
ENDM