From bdeec2132d0c4b227ccd457114531f84956a188a Mon Sep 17 00:00:00 2001 From: "Juan J. Martinez" Date: Mon, 1 Jul 2024 12:13:56 +0100 Subject: According to DJGPP's docs, we better save ebp --- src/vga.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/vga.c b/src/vga.c index fc041d6..12d5928 100644 --- a/src/vga.c +++ b/src/vga.c @@ -125,6 +125,7 @@ void ubox_blit_c(const uint8_t *sprite, const ubox_rect *dst, uint8_t c) uint8_t *dtarget = target + dst->x + dst->y * 320; asm volatile ( + "push %%ebp\n\t" "movl $320, %%ebp\n\t" "subl %%ecx, %%ebp\n\t" "blit_c_w:\n\t" @@ -146,11 +147,12 @@ void ubox_blit_c(const uint8_t *sprite, const ubox_rect *dst, uint8_t c) "addl %%ebp, %%edi\n\t" "decl %%ebx\n\t" "jne blit_c_w\n\t" + "pop %%ebp\n\t" : /*no output */ : "S" (sprite), "D" (dtarget), "b" ((uint32_t)dst->h), "d" ((uint32_t)c), "c" ((uint32_t)dst->w), "i" (UBOX_TRANSPARENT) - : "eax", "ebp" + : "eax" ); } @@ -161,6 +163,7 @@ void ubox_blitrc(const uint8_t *sprite, const ubox_rect *src, const ubox_rect *d sprite += src->x + src->y * src->w; asm volatile ( + "push %%ebp\n\t" "movl $320, %%ebp\n\t" "subl %%ecx, %%ebp\n\t" "blitrc_w:\n\t" @@ -179,11 +182,12 @@ void ubox_blitrc(const uint8_t *sprite, const ubox_rect *src, const ubox_rect *d "addl %%ebp, %%edi\n\t" "decl %%ebx\n\t" "jne blitrc_w\n\t" + "push %%ebp\n\t" : /*no output */ : "S" (sprite), "D" (dtarget), "b" ((uint32_t)dst->h), "d" ((uint32_t)(src->w - dst->w)), "c" ((uint32_t)dst->w), "i" (UBOX_TRANSPARENT) - : "eax", "ebp" + : "eax" ); } -- cgit v1.2.3