SYSTEM CALLS
M68CPU32BUG/D REV 1
5-13
.INSTAT
Input Serial Port Status
.INSTAT
5.2.9
Input Serial Port Status
SYSCALL
.INSTAT
TRAP CODE:
$0001
Checks the default input port buffer for characters. The condition codes are set to indicate the
result of the operation.
Entry Conditions:
No arguments or stack allocation required
Exit Conditions:
Z (zero) = 1 if the receiver buffer is empty
EXAMPLE
LOOP
SYSCALL
.INSTAT
Any characters?
BEQ.S
EMPTY
If no, branch
SUBQ.L
#2,A7
If yes, then read them in buffer
SYSCALL
.INCHR
MOVE.B
(A7)+,(A0)+
BRA.S
LOOP
Check for more
EMPTY