Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- .model small
- .stack 100h
- .data
- menu db '1 - Print Hello', 13,10
- db '2 - Print message', 13, 10
- db '3 - Exit prorgamm', 13,10, '$'
- select db 13,10, 'Select task >$'
- hello db 13, 10, 'Hello world!', 13,10,13,10, '$'
- go_away db 13,10, 'I like apples', 13, 10, 13, 10, '$'
- .code
- start:
- mov ax, @data
- mov ds, ax
- mov ah, 09h
- mov dx, offset menu
- int 21h
- _select_loop:
- mov ah, 09h
- mov dx, offset select
- int 21h
- mov ah, 01h
- int 21h
- cmp al, '1'
- je _c1
- cmp al, '2'
- je _c2
- cmp al, '3'
- je _exit
- jmp _select_loop
- _c1:
- mov ah, 09h
- mov dx, offset hello
- int 21h
- jmp start
- _c2:
- mov ah, 09h
- mov dx, offset go_away
- int 21h
- jmp start
- _exit:
- mov ax, 4c00h
- int 21h
- end start
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement