Use the volatile keyword with all inline assembly to make sure the optimizer does not discard it.

This commit is contained in:
Jeremy Rand 2018-10-21 14:24:03 -04:00
parent beb9d2666f
commit 75f85b94e8
4 changed files with 3 additions and 3 deletions

Binary file not shown.

View File

@ -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);

View File

@ -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);
}