From 2a7087a21fa1c7f213986606f649b081f480f5d4 Mon Sep 17 00:00:00 2001 From: Ain <41307858+nero@users.noreply.github.com> Date: Mon, 18 May 2020 18:23:37 +0200 Subject: [PATCH] debug: Reduce stack usage on entry from 5 to 4 words --- rom/debug.asm | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/rom/debug.asm b/rom/debug.asm index 3f5a7e9..8424bb3 100644 --- a/rom/debug.asm +++ b/rom/debug.asm @@ -28,7 +28,7 @@ pnp: db "$PnP" dw 0 ; boot disconnect vector dw 0 ; bootstrap entry point dw 0 ; reserved - dw 0 +zero: dw 0 name: db "rdos debug", 0 @@ -107,20 +107,15 @@ print16: ret int3entry: - ; save DS and AX + ; save DS and load bss segment from IVT push ds - push ax - ; DS=0 - xor ax, ax - mov ds, ax - ; load bss segment + mov ds, [cs:zero] mov ds, [bssvec*4] - ; pop AX and DX - pop ax + ; save AX so we can work with it mov [reg_ax], ax + ; pop DS, IP, CS and flags from stack pop ax mov [reg_ds], ax - ; pop IP, CS and flags from stack pop ax mov [reg_ip], ax pop ax