Hello everyone.
I am porting my emulator to Android Platform.
At this point, I meet a strange thing.
See below.
MinGW outputs
--------------------------------------------------
c = FF, result = C001 + (char)c = C000
Compiled by 4.8.1
--------------------------------------------------
Android outputs
<see attachment>
The result should be "C000", but Android's output is error.
How to deal with it?
I am porting my emulator to Android Platform.
At this point, I meet a strange thing.
See below.
Code:
// C/C++ code, modified from 6502 relative addressing mode of my emulator
char Buf[1025];
int Result;
unsigned char c = 0xFF;
Result = 0xC001 + (char) c;
sprintf(Buf, "c = %X, result = C001 + (char)c = %X\nCompiled by %d.%d.%d",
c, Result, __GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__);
cout<<Buf<<endl;
char Buf[1025];
int Result;
unsigned char c = 0xFF;
Result = 0xC001 + (char) c;
sprintf(Buf, "c = %X, result = C001 + (char)c = %X\nCompiled by %d.%d.%d",
c, Result, __GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__);
cout<<Buf<<endl;
MinGW outputs
--------------------------------------------------
c = FF, result = C001 + (char)c = C000
Compiled by 4.8.1
--------------------------------------------------
Android outputs
<see attachment>
The result should be "C000", but Android's output is error.
How to deal with it?