11-2
Status Functions
CALL 36 – Get Number of
Characters in PRT2
Buffers
Publication 1746-RM001A-US-P
Purpose
Use CALL 36 to retrieve the number of characters in the chosen buffer of port
PRT2.
You must PUSH the buffer that you want examined:
PUSH 1 for the input buffer
PUSH 0 for the output buffer
One POP is required to get the number of characters.
Syntax
PUSH [buffer selection]
CALL 36
POP [number of characters]
Example
>1
REM EXAMPLE PROGRAM
>10 PUSH 0 : REM EXAMINES THE OUTPUT BUFFER
>20 CALL 36
>30 POP X : REM GET THE NUMBER OF CHARACTERS
>40 PRINT "NUMBER OF CHARACTERS IN OUTPUT BUFFER IS",X
>50 END
READY
>RUN
NUMBER OF CHARACTERS IN OUTPUT BUFFER IS 0
READY
>