Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;lab3.asm
- ;demonstration for lab 3 - copying a chunk of memory
- .MODEL SMALL
- .STACK 64
- .DATA
- string db "Hello from procedure","$"
- .CODE
- start:
- mov ax, @data
- mov ds, ax
- ;start
- push offset string
- call puts
- call print_new_line
- ;end the program
- mov ah, 4ch
- mov al, 0
- int 21h
- ;procedure with params
- puts proc
- push bp ; must have
- mov bp,sp ; must have
- add bp,2 ;must have
- push dx
- push ax
- mov dx,[bp+2]
- mov ah,09
- int 21h
- pop ax
- pop dx
- pop bp
- ret 2 ; 2 because 1 param
- endp
- ;procedure without params
- print_new_line proc
- push ax
- push dx
- mov dl, 0ah
- mov ah,02
- int 21h
- mov dl, 0dh
- mov ah, 02
- int 21h
- pop dx
- pop ax
- ret
- endp
- END start
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement