Use named registers

This commit is contained in:
Aaron Culliney 2014-05-10 16:39:51 -07:00
parent f3ea9fa256
commit 7fd9857102

View File

@ -17,6 +17,7 @@
#define __ASSEMBLY__ #define __ASSEMBLY__
#include "apple2.h" #include "apple2.h"
#include "misc.h" #include "misc.h"
#include "cpu.h"
#define GLUE_FIXED_READ(func,address) \ #define GLUE_FIXED_READ(func,address) \
E(func) movb SN(address)(%edi),%al; \ E(func) movb SN(address)(%edi),%al; \
@ -59,30 +60,30 @@ E(func) addl SN(pointer),%edi; \
// TODO FIXME : implement CDECL prologue/epilogues... // TODO FIXME : implement CDECL prologue/epilogues...
#define GLUE_C_WRITE(func) \ #define GLUE_C_WRITE(func) \
E(func) pushl %eax; \ E(func) pushl %eax; \
pushl %ecx; \ pushl FF_Reg; \
pushl %edx; \ pushl SP_Reg; \
andl $0xff,%eax; \ andl $0xff,%eax; \
pushl %eax; \ pushl %eax; \
pushl %edi; \ pushl EffectiveAddr_E; \
call SN(c_##func); \ call SN(c_##func); \
popl %edx; /* dummy */ \ popl %edx; /* dummy */ \
popl %edx; /* dummy */ \ popl %edx; /* dummy */ \
popl %edx; \ popl SP_Reg; \
popl %ecx; \ popl FF_Reg; \
popl %eax; \ popl %eax; \
ret; ret;
// TODO FIXME : implement CDECL prologue/epilogues... // TODO FIXME : implement CDECL prologue/epilogues...
#define GLUE_C_READ(func) \ #define GLUE_C_READ(func) \
E(func) /*pushl %eax;*/ \ E(func) /*pushl %eax;*/ \
pushl %ecx; \ pushl FF_Reg; \
pushl %edx; \ pushl SP_Reg; \
pushl %edi; \ pushl EffectiveAddr_E; \
call SN(c_##func); \ call SN(c_##func); \
/*movb %al,12(%esp);*/ \ /*movb %al,12(%esp);*/ \
popl %edx; /* dummy */ \ popl %edx; /* dummy */ \
popl %edx; \ popl SP_Reg; \
popl %ecx; \ popl FF_Reg; \
/*popl %eax;*/ \ /*popl %eax;*/ \
ret; ret;