polmon: no moar es

This commit is contained in:
2025-09-26 16:51:05 +02:00
parent bbaefabf8a
commit c49d00422a

View File

@@ -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"