From 064cc21e554b607eef7a8940fea1301785ac75c6 Mon Sep 17 00:00:00 2001 From: xiacijie Date: Tue, 12 Mar 2019 22:16:37 -0600 Subject: [PATCH] set the tty mode at the beginning instead of keeping setting it at each iteration. It will save some CPU cycles --- 05-bootsector-functions-strings/boot_sect_print.asm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/05-bootsector-functions-strings/boot_sect_print.asm b/05-bootsector-functions-strings/boot_sect_print.asm index b066e0d..70e3eb2 100644 --- a/05-bootsector-functions-strings/boot_sect_print.asm +++ b/05-bootsector-functions-strings/boot_sect_print.asm @@ -1,5 +1,6 @@ print: pusha + mov ah, 0x0e ; keep this in mind: ; while (string[i] != 0) { print string[i]; i++ } @@ -11,7 +12,7 @@ start: je done ; the part where we print with the BIOS help - mov ah, 0x0e + int 0x10 ; 'al' already contains the char ; increment pointer and do next loop