Please note, this is a STATIC archive of website www.tutorialspoint.com from 11 May 2019, cach3.com does not collect or store any user information, there is no "phishing" involved.
Tutorialspoint

Compile and Execute Assembly Online

data Segment
MESSAGE DB "ENTER CHARACTER : $"
NUM1 DB ?
NUM2 DB ?
NUM3 DB ?
NUM4 DB ?
BCD DW ?
data ENDS
code Segment
ASSUME DS:data ,CS:code
Start:
MOV AX ,DATA
MOV DS,AX
LEA DX,MESSAGE 
MOV AH,9
int 21h
MOV NUM1,AL
SUB NUM1,30h
LEA DX,MESSAGE
int 21h
MOV NUM2,AL
SUB NUM2,30h
MOV AH,1
LEA DX,MESSAGE
int 21h
MOV NUM3,AL
SUB NUM3,30h
MOV AH,1
LEA DX, MESSAGE
int 21h
MOV NUM4,AL
SUB NUM4,30h
SUB AL,30h
MOV DH,00h
MOV DL,O1h
MOV DH,NUM1
ROL DH,4
Add DH,NUM2
MOV DL,NUM3
ROL DL,4
Add DL,NUM4
MOV BCD,DX
MOV AH,4Ch
int 21h
code ENDS
END START

Advertisements
Loading...

We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy.