From a280069ec4a4a7d2e69698536fd7d4ccb32b07a9 Mon Sep 17 00:00:00 2001 From: Cesar Blum Date: Sun, 27 Sep 2020 20:37:43 -0700 Subject: [PATCH] Fix possible AX clobbering in writechar --- sectorforth.asm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sectorforth.asm b/sectorforth.asm index db037f8..c8fa340 100644 --- a/sectorforth.asm +++ b/sectorforth.asm @@ -419,9 +419,11 @@ token: ; a line, but does not move it back to the previous line. ; writechar addresses that. writechar: + push ax ; INT 10h/AH=03h clobbers AX in some BIOSes mov bh,0 ; video page 0 for all BIOS calls mov ah,3 ; get cursor position (DH=row, DL=column) int 0x10 + pop ax ; restore AX mov ah,0x0e ; teletype output mov bl,0x7 ; black background, light grey text int 0x10 @@ -435,7 +437,7 @@ writechar: int 0x10 .1: ret - times 510-($-$$) db 0 + ;times 510-($-$$) db 0 db 0x55, 0xaa ; New dictionary entries will be written starting here.