My registers were always mixed up when ever I returned from my screen printing functions. I checked my printing function over and over again, but nothing appeared to be wrong. My solution was to 'call tower_of_hanoi' after each print, a function that would play an interesting game of Tower of Hanoi and re-arrange my registers in the correct order.
I soon found out all of this wasn't required, because of some sillyness in the 'pop'ing and 'push'ing of the registers in my printing function:
Code: Select all
print:
push edi
push eax
push ebx
; more code here
pop eax
pop edi
pop ebx
ret
Moral of the story: if your registers are screwed, save yourself a lot of headache by checking your 'pop'ing and 'push'ing!