Home > other >  Of new judgment from the leap year, write their own, divide after running the input error, and bosse
Of new judgment from the leap year, write their own, divide after running the input error, and bosse

Time:04-05

DATAS SEGMENT
Bin dw 2 dup (?)
Y 0 db dh, 0 ah, 'This is a leap year! $'
N the db 0 dh, 0 ah, 'This is not a leap year! $'
DATAS ENDS

CODES SEGMENT
ASSUME CS: CODES, DS: DATAS
START:
MOV AX, DATAS
MOV DS, AX

Mov si, 4
Mov bx, 0



Input:
Mov ah, 1
Int 21 h
Sub al, 30 h
Mov cl, 4
SHL bx, cl
Mov ah, 0
The add bx, ax
Mov bin, bx
Dec si
CMP si, 0
Ja input
Mov ax, bin
Judge1:
Mov bx, 4

Div bx
CMP ax, 0
Developed judge1
CMP dl, 0
Developed next1
Mov ax, bin
Judge2:
Mov bx, 100

Div bx
CMP ax, 0
Developed judge2
CMP dl, 0
Developed next2
Mov ax, bin
Judge3:
Mov bx, 400

Div bx
CMP ax, 0
Developed judge3
CMP dl, 0
Je next2
Next1:
Lea dx, n
Mov ah, 9
Int 21 h
Mov ah, 4 ch
Int 21 h
Next2:
Lea dx, y
Mov ah, 9
Int 21 h
Mov ah, 4 ch
Int 21 h
CODES ENDS
The END START

CodePudding user response:

The debug to find 0888 except 4 result unexpectedly is 4222, and then an infinite loop, a stop on the judge1 this step

CodePudding user response:

Bosses give advice or comments,,,,,,,

CodePudding user response:

On the phone, not exactly, probably is for dx has value (some debugging programs will clear the dx 0 will not, DOS is not
Add xor dx before), each div, dx instruction to try?
  • Related