diff options
author | Joseph Hunkeler <jhunkeler@gmail.com> | 2017-11-28 16:49:24 -0500 |
---|---|---|
committer | Joseph Hunkeler <jhunkeler@gmail.com> | 2017-11-28 16:49:24 -0500 |
commit | 1dd05ebe61c95985b16d170bf2d3f081a02dfd7d (patch) | |
tree | 216d65aa993cba84c1b58e7152efd516b37121cc /stdio.asm | |
download | minos-1dd05ebe61c95985b16d170bf2d3f081a02dfd7d.tar.gz |
Initial commit
Diffstat (limited to 'stdio.asm')
-rw-r--r-- | stdio.asm | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/stdio.asm b/stdio.asm new file mode 100644 index 0000000..e6f7290 --- /dev/null +++ b/stdio.asm @@ -0,0 +1,28 @@ +%ifndef _STDIO_ASM +%define _STDIO_ASM + +%include "console.asm" + +puts: + ; Write string buffer at cursor position + push bp + mov bp, sp + pusha + + mov si, [bp + 4] ; address of string buffer + mov bx, 0000h ; + mov ah, 0eh ; BIOS - teletype + +.loop: + lodsb ; load byte at [si] into al + or al, 0 ; 0 | 0 = 0 (detect null terminator) + je .end + int 10h ; BIOS video service + jmp .loop +.end: + popa + mov sp, bp + pop bp + ret + +%endif |