I’m using A86 as my assembler for my assembly codes. Click here to download assembler
1st lesson: Just a simple “Hello World” display MSG DB ‘Hello World$’
MOV AH, 09 ; print function
LEA DX, MSG ; string
INT 21H ; call dos
INT 20H ; return to dos
2nd lesson: Asking and displaying a number input
xxx:
MOV AH, 08 ; keyboard input w/ echo function
INT 21H ; call dos
CMP AL, 30H ; compare input with 0
JB xxx
CMP AL, 39H ; compare input with 9
JA xxx
MOV AH, 02 ; display a character function
MOV DL, AL ; copy character to DL, and display DL
INT 21H ; call dos
INT 20H ; exit dos
3rd lesson: More on conditions
msg db ‘Hello Guys!$’
here:
mov ah, 01 ; keyboard input with display function
int 21h ; call dos
cmp al, ‘x’ ; compare input with character ‘x’
je exit ; if input is ‘x’, go to exit
cmp al, ‘y’ ; compare input with character ‘y’
jne here ; if not equal to ‘y’, loop
mov ah, 09 ; if equal, display function
lea dx, msg ; display string ‘Hello Guys!’
int 21h ; call dos
exit:
int 20h ; exit dos
All comments are moderated. Your comments will not appear here unless approved by the blog owner. Thank you.