Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Addition Of Two 4bit numbers
- ASSUME CS:CODE,DS:DATA
- DATA SEGMENT
- msg1 DB "Enter the first number : $"
- msg2 DB 0ah,0dh,"Enter the second number : $"
- msg3 DB 0ah,0dh,"Result :$"
- DATA ENDS
- CODE SEGMENT
- START: MOV AX,data
- MOV DS,AX
- LEA DX,msg1
- MOV AH,09H
- INT 21H
- MOV AH,01H
- INT 21H
- SUB AL,30H
- MOV BL,AL
- LEA DX,msg2
- MOV AH,09H
- INT 21H
- MOV AH,01H
- INT 21H
- SUB AL,30H
- ADD AL,BL
- AAA
- ADD AL,30H
- LEA DX,msg3
- MOV AH,09H
- INT 21H
- MOV DL,AL
- MOV AH,02H
- INT 21H
- MOV AH,4CH
- INT 21H
- CODE ENDS
- END START
- Output
- C:\><filename.exe>
- Enter the first number : 2
- Enter the second number : 5
- Result : 7
- DosBox Commands
- accessing directory
- MOUNT C: ~/Downloads/masm
- C: //accesing to C
- masm <filename.asm> //compiling
- link <filename.obj>
- <filename.exe> //executing file
- debug <filename.exe> //incase an error occur, debug the file
- -g
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement