Code: Select all
! Read a character from the console and return it
ReadConsole: ! Integer ReadConsole( void );
push %r0 ! reserve space for return value
pus %r1 ! backup...
push %r2
sethi BASE,%r1
ReadConsolePolling:
ldub [%r1+CICTL], %r2
andcc %r2, 0x80, %r0
be ReadConsolePolling !hier springt hij naar ReadConsolePolling
ldub [%r1+CIN], %r2
st %r2,[%r14+8]
pop %r2
pop %r1
return