Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- org 100h
- section .text
- start:
- MOV CX, 320
- .MainLoop:
- MOV ES, CX ;Save counter in ES
- CALL GetCurPos
- MOV CX, CS ;Set DS to CS (where the strings are)
- MOV DS, CX
- MOV CX, ES ;Restore the counter
- LEA DX, [ln11] ;Get address of last line
- SUB DX, CX ;Adjust pointer to current line
- MOV AH, 9
- INT 21h ;Print it
- MOV ES, CX ;Save counter in ES
- CALL FinishLine
- MOV CX, ES ;Restore counter
- SUB CX, 32
- JNZ .MainLoop
- ;TEST CX, 8000h
- ;JE .MainLoop
- end:
- ; Beep
- MOV AX, 0200h
- MOV DX, 07h
- INT 21h
- MOV CX, CS ;Set DS to CS (where the strings are)
- MOV DS, CX
- LEA DX, [ln11] ;Get address of last line
- MOV AH, 9
- INT 21h
- RET
- GetCurPos:
- MOV AX, 0300h ;BIOS function to get cursor position
- MOV BX, 0000h ;Returns DL, DH (X, Y)
- INT 10h
- MOV [CS:CurPos], DX ;Save Cursor position
- RET
- FinishLine:
- MOV DX, WORD [CurPos]
- ;Set (X, Y) to (CX, BX)
- XOR BX, BX
- MOV BL, DH
- XOR CX, CX
- MOV CL, DL
- ;Set DI to cursor position [DI = X + (Y * 80)]
- IMUL AX, BX, 80
- ADD AX, CX
- MOV DI, AX
- SHL DI, 1 ;Fix offset for 2 byte per text cell
- INC DI ;Second byte is color attribute
- MOV BX, 0B800h ;Text mode screen segment
- MOV DS, BX
- MOV CX, 31 ;ASCII is 32 characters wide
- .FixAttributes:
- MOV [DI], BYTE 70h ;set to black text on black background
- ADD DI, 2 ;Each text cell is 2 bytes
- DEC CX
- JNZ .FixAttributes
- .NewLine:
- MOV AX, 0200h
- MOV DX, 10
- INT 21h
- RET
- section .data
- ln1 db "°°°°ÜÜÜÜßßßßßßßßÜÜÜÜÜÜÜ°°°°°° ", "$"
- ln2 db "°°°Û±±°ÜÜßßßßÜ°±°ÜÜÜÜÜ°ßßÜ°°°°°", "$"
- ln3 db "°°Û±°Üß°±±±±±°ßÜß°±±±±±±±Û°°°°°", "$"
- ln4 db "°Û±±±±±±±±±ÛÛß±±±±±±ÛÛßܱ۰°°° ", "$"
- ln5 db "Üß±±±±±±±±±ßßß±±±±±±ßßß±±±Û°° ", "$"
- ln6 db "Û±±±±±±±±±±±±±±±ÛÛ±°°°°°°°±Û ", "$"
- ln7 db "Û°±±ßÜܱ°°°°°°±ÜßÜÜ°°°°°°±Û ", "$"
- ln8 db "°Û°±±±±ßÜÜÜÜÜÛÛÛÛÛÛÛÜÜÜÜÜß ", "$"
- ln9 db "°°Û°±±±±±±ßÜßßÛÛÛÛßßÜß±±Û ", "$"
- ln10 db "°°°ßßßÜÜÜÜÜÜßÜÜÜÜÜÜßÜÜÜß ", "$"
- ln11 db " Fugggg :DDDDD", "$"
- CurPos dw 00h
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement