Add some contents to array a,and you will make the following code displaying a character c in the middle of screen.
The code is :
Code: Select all
char a[200] = {......};
int main ()
{
((void (far *) ()) (long)a) ();
}
these hex number is:
Code: Select all
0xBB,0x00,0xB8,0x8E,0xC3,0xBB,0x90,0x06,0x26,0xC6,0x07,0x63,0xBB,0x00,0xB8,0x8E,0xC3,0xBB,0x91,0x06,0x26,0xC6,0x07,0x02,0xC3
Code: Select all
*(char far*) (0xb8000000 + 160 * 10 + 80) = 'c';
*(char far*) (0xb8000000 + 160 * 10 + 81) = 2;
But today someone told me another method to achieve this:
Code: Select all
char main[201] = {0xBB,0x00,0xB8,0x8E,0xC3,0xBB,0x90,0x06,0x26,0xC6,0x07,0x63,0xBB,0x00,0xB8,0x8E,0xC3,0xBB,0x91,0x06,0x26,0xC6,0x07,0x02,0xC3};
You can compile it using tcc.exe,and run the created exe files,it can also show a character c in the middle of screen.
But why this can effect??I don`t know clearly.please give me an answer,thank you.