From 1dd05ebe61c95985b16d170bf2d3f081a02dfd7d Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Tue, 28 Nov 2017 16:49:24 -0500 Subject: Initial commit --- stdio.asm | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 stdio.asm (limited to 'stdio.asm') 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 -- cgit