Created
December 1, 2021 21:54
-
-
Save SegHaxx/5eb2a768aa1ede38e8236e3fc04bb1c5 to your computer and use it in GitHub Desktop.
NASM string spewer for DOS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; vi:ft=nasm | |
cpu 8086 | |
org 100h | |
section .text | |
xor bx,bx ; attrib | |
mov cx,1 ; just one thanks | |
.again: inc bx ; next attrib | |
and bl,0x7F ; no flashing please | |
mov si,rulz | |
mov ah,0Bh ; check for keypress | |
int 21h ; DOS | |
test al,al | |
jnz .return | |
.loop: lodsb ; load next char | |
test al,al | |
jz .again | |
mov ah,09h ; write char with attrib | |
int 10h ; BIOS | |
mov ah,0Eh ; write char and advance | |
int 10h ; BIOS | |
jmp .loop | |
.return: | |
ret | |
section .data | |
rulz db 'seg rulz ok ',0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment