Skip to content

Instantly share code, notes, and snippets.

@SegHaxx
Created December 1, 2021 21:54
Show Gist options
  • Save SegHaxx/5eb2a768aa1ede38e8236e3fc04bb1c5 to your computer and use it in GitHub Desktop.
Save SegHaxx/5eb2a768aa1ede38e8236e3fc04bb1c5 to your computer and use it in GitHub Desktop.
NASM string spewer for DOS
; 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