Use the volatile keyword with all inline assembly to make sure the optimizer does not discard it.
This commit is contained in:
parent
beb9d2666f
commit
75f85b94e8
Binary file not shown.
Binary file not shown.
|
@ -50,7 +50,7 @@ tPuzzle thePuzzle;
|
|||
void fileReadProblem(char *filename)
|
||||
{
|
||||
clrscr();
|
||||
asm ("STA %w", 0xc051);
|
||||
asm volatile ("STA %w", 0xc051);
|
||||
printf("\n\nUnable to read file %s\nPress any key to quit", filename);
|
||||
cgetc();
|
||||
exit(0);
|
||||
|
|
|
@ -201,13 +201,13 @@ void shutdownUI(void)
|
|||
void textMode(void)
|
||||
{
|
||||
clrscr();
|
||||
asm ("STA %w", 0xc051);
|
||||
asm volatile ("STA %w", 0xc051);
|
||||
}
|
||||
|
||||
|
||||
void graphicsMode(void)
|
||||
{
|
||||
asm ("STA %w", 0xc050);
|
||||
asm volatile ("STA %w", 0xc050);
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue