Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- .CODE
- MOV AH, 9 ; set print option for int 21h
- MOV DX, OFFSET DisplayString ; set DS:DX to point to DisplayStirng
- INT 21h
- MOV AH, 1 ; set read option for int 21h
- INT 21h ; read
- MOV d1 ,AL
- MOV DisplayStringResY[2],AL ; Put insert user digit in the original string
- SUB d1, '0' ; Ascii to int
- MOV AH, 1 ; set read option for int 21h
- INT 21h ; read
- MOV d2 ,AL
- MOV DisplayStringResY[3],AL; Put insert user digit in the original string
- MOV DisplayStringResY[15],AL
- SUB d2, '0' ; Ascii to int
- MOV AH, 1 ; set read option for int 21h
- INT 21h ; read
- MOV d3 ,AL
- MOV DisplayStringResY[4],AL; Put insert user digit in the original string
- MOV DisplayStringResY[16],AL
- MOV DisplayStringResY[27],AL
- SUB d3, '0'; Ascii to int
- MOV AH, 9 ; set print option for int 21h
- MOV DX, OFFSET DisplayStringDIG ;
- INT 21h
- MOV AH, 1 ; set read option for int 21h
- INT 21h ; read
- MOV dig ,AL
- MOV DisplayStringResY[10],AL; Put insert user digit in the original string
- MOV DisplayStringResY[22],AL
- MOV DisplayStringResY[33],AL
- SUB dig, '0'
- MOV AL ,d3
- MOV AH,0
- DIV dig
- MOV rem, ah
- ADD AH,'0' ; int to Ascii
- MOV DisplayStringResY[37],AH; Put insert rem digit in the original string
- mov al,d2
- mul ten
- add al,d3
- MOV NUM,AL
- MOV AH,0
- DIV dig
- CMP AH,rem
- JNE WorngRES ; Jump and print mess if not Equal
- MOV AL,d1
- mul handret
- add AL,NUM
- MOV AH,0
- DIV dig
- CMP AH,rem
- JNE WorngRES ; Jump and print mess if not Equal
- MOV AH, 9 ; set print option for int 21h
- MOV DX, OFFSET DisplayStringResY ; set DS:DX to point to DisplayStirng
- INT 21h
- JMP EXIT
- mov ah,4ch
- INT 21h ; Return to DOS (terminate program)
- END ProgStart
Advertisement
Add Comment
Please, Sign In to add comment