From ce7317daf7c9740bc8595f14f7248fa1b050afcf Mon Sep 17 00:00:00 2001 From: xeno Date: Thu, 23 Feb 2017 23:49:18 +0100 Subject: initial commit with some old assembly stuff --- printb.asm | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 printb.asm (limited to 'printb.asm') diff --git a/printb.asm b/printb.asm new file mode 100644 index 0000000..a8fa788 --- /dev/null +++ b/printb.asm @@ -0,0 +1,36 @@ +org 0x0500 + + +SECTION .data +boot: db 'Welcome to the second stage!', 0x0A, 0x0D, 0x00 +foo: db 'What a nice message this is!', 0x0A, 0x0D, 0x00 + +SECTION .text + + +jmp start + +print: + push ax + cld + mov ah, 0x0E + + .loop: + lodsb + cmp al, 0x00 + je .out + int 0x10 + jmp .loop + .out: + pop ax + ret + +start: + mov si, boot + call print + + mov si, foo + call print + +; maybe to something here... +; e.g.: how to keep CPU from spinning at 100% -- cgit