From c49d00422abb7bf2e4c16e4d401e1ccb798f0241 Mon Sep 17 00:00:00 2001 From: Paul Mathieu Date: Fri, 26 Sep 2025 16:51:05 +0200 Subject: [PATCH] polmon: no moar es --- polmon.cc | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/polmon.cc b/polmon.cc index 7be0641..76c3df2 100644 --- a/polmon.cc +++ b/polmon.cc @@ -72,15 +72,15 @@ void puts(const char* s) { } // arguments on the stack in reverse order -extern "C" uint16_t Jump(uint16_t addr, int nargs); +extern "C" uint16_t FarJump(uint16_t addr, uint16_t seg, int nargs); asm ( - ".section .text.Jump \n" - "Jump: \n" + ".section .text.FarJump \n" + "FarJump: \n" " push %bx \n" " push %si \n" " push %di \n" " push %bp \n" - " push %es \n" + " push %cx \n" // seg " push %ax \n" // addr " movw %sp, %bp \n" " movw %dx, %si \n" // nargs @@ -237,11 +237,11 @@ void Status(uint8_t status) { "movw $77, %%dx \n\t" "int $0x10 \n\t" "movb %0, %%al \n\t" - "call _ZN12_GLOBAL__N_110WriteUint8Eh \n\t" + "call %1 \n\t" "movb $0x02, %%ah \n\t" "movw %%di, %%dx \n\t" "int $0x10" - :: "rm" (status) + :: "rm" (status), "l" (WriteUint8) : "ax", "bh", "dx", "cx", "di", "cc" ); } @@ -270,7 +270,7 @@ bool ParseCommand(const char* buf, uint16_t& cur_addr, uint16_t& cur_seg) { nargs++; ptr += 4; } - uint16_t ret = Jump(cur_addr, nargs); + uint16_t ret = FarJump(cur_addr, cur_seg, nargs); asm volatile ( "shl %0 \n\t" "add %0, %%sp"