/ Published in: Assembler
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
.model small .stack 64h .data msg db"Input a letter:$" msg1 db"Output:$" msga db"a$" msgb db"ab$" msgc db"abc$" .code main: mov ax,@data mov ds,ax mov ah,0003h int 10h lea dx,msg mov ah,09h int 21h mov ah,01h int 21h mov bh,al int 21h lea dx,msg1 mov ah,09h int 21h jmp a a: cmp bh,"a" int 21h je aprint jne b aprint: lea dx,msga mov ah,09h int 21h jmp close b: cmp bh,"b" int 21h je bprint jne c bprint: lea dx,msgb mov ah,09h int 21h jmp close c: cmp bh,"b" int 21h je cprint jne c cprint: lea dx,msgc mov ah,09h int 21h jmp close close: mov ah,4ch int 21h end main