Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- .model small
- .data
- Mystr db "a"
- Str_Length dw 1
- Color db 00001010b
- Row db 0
- Col db 40
- .stack 100h
- .code
- main:
- call Initsegs
- endless:
- call GoDown
- call GoUp
- loop endless
- ;===PROCS===
- PROC Initsegs
- push ax
- mov ax, @data
- mov ds, ax
- mov es, ax
- pop ax
- RET
- ENDP Initsegs
- PROC CheckKey
- push ax
- mov ah, 01h
- int 16h
- cmp al, 'x'
- jz finish
- jnz continue
- finish:
- call Exit
- continue:
- pop ax
- RET
- ENDP CheckKey
- PROC GoDown
- push cx
- mov cx, 24
- redo:
- call PrintStr
- call Delay
- call ClearScreen
- call CheckKey
- inc Row
- loop redo
- pop cx
- RET
- ENDP GoDown
- PROC GoUp
- push cx
- mov cx, 24
- redo2:
- call PrintStr
- call Delay
- call ClearScreen
- call CheckKey
- dec Row
- loop redo2
- pop cx
- RET
- ENDP GoUp
- PROC PrintStr
- push ax bx cx dx bp
- mov ah, 13h
- mov al, 1
- mov bh, 0
- mov bl, Color
- mov cx, Str_Length
- mov dh, Row
- mov dl, Col
- mov bp, offset Mystr
- int 10h
- pop bp dx cx bx ax
- RET
- ENDP PrintStr
- PROC Delay
- push ax bx
- mov bx, 08000h
- reload_ax:
- mov ax, 0fffh
- dec_ax:
- dec ax
- jnz dec_ax
- dec bx
- jnz reload_ax
- pop bx ax
- RET
- ENDP Delay
- PROC ClearScreen
- push ax bx cx dx
- mov ah, 7h
- mov al, 0
- mov bh, 07h
- mov ch, 0
- mov cl, 0
- mov dh, 24d
- mov dl, 79d
- int 10h
- pop dx cx bx ax
- RET
- ENDP ClearScreen
- PROC Exit
- push ax
- mov ah, 4ch
- int 21h
- pop ax
- RET
- ENDP Exit
- end main
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement