Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- org 100h
- start:
- MOV CX, 320 ;(32*10 lines)
- .MainLoop:
- MOV ES, CX ;Save counter in ES
- ;INT 10h/AH=03h overwrites all general registers
- MOV AH, 03h ;BIOS function to get cursor position
- MOV BH, 00h ;Returns DL, DH (X, Y)
- INT 10h
- MOV SI, DX ;Save Cursor position in SI
- MOV CX, ES ;Restore the counter
- MOV AX, CS ;Set DS to CS (where the strings are)
- MOV DS, AX
- LEA DX, [ln11] ;Get address of last line
- SUB DX, CX ;Adjust pointer to current line
- MOV AH, 09h
- INT 21h ;Print it
- MOV ES, CX ;Save counter in ES
- CALL FinishLine ;Invert colors of this line of art
- MOV CX, ES ;Restore counter
- SUB CX, 32 ;We just drew 32 more character
- JNZ .MainLoop ;Loop if out counter isn't at zero
- end:
- ; Beep
- MOV AH, 02h
- MOV DL, 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, 09h
- INT 21h ;Print the last line
- RET ;Return to DOS
- FinishLine:
- MOV DX, SI ;Restore cursor position before text draw
- ;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 white background
- ADD DI, 2 ;Each text cell is 2 bytes
- DEC CX
- JNZ .FixAttributes
- .NewLine:
- MOV AH, 0Eh
- MOV AL, 10
- INT 10h ;\n
- MOV AH, 0Eh
- MOV AL, 13
- INT 10h ;\r
- 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", "$"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement