I am attempting to mix C++ and Assembly. I have the following code:
MIX.C
Code:
extern void sayhi(void);
extern void quit(void);
int CurrPos = (int)0xb8f9a;
char CurrChar = 'H';
//--------------------------------------------------------------------
int main(void)
{
sayhi();
quit();
}
MIX.ASM
Code:
GLOBAL _sayhi
GLOBAL _quit
extern _CurrPos
extern _CurrChar
SECTION .text
_sayhi: mov byte [_CurrPos],'H'
mov byte [0xb8f9e],_CurrChar
ret
When I try to compile, i get the following error:
Error: COFF format does not support non-32-bit relocations.
This is for the line "mov byte [0xb8f9e],_CurrChar".
Will I have to declare CurrChar as an int so that its 32 Bits?
Paul