Everything

GETC


Accepts 1 byte from standard input.

[Function Code (R1 Register)]

[Parameter Block (R2 Register)]

[Parameters]

Parameter

Description

Beginning address of input buffer (input)

Beginning address of the input buffer to which input data is written

[Detailed Description]

-

Accepts 1 byte from standard input.

[Example]

_charget:
        MOV.L       #1210000h,R1    ; Set the function code of GETC in R1.
        MOV.L       #IO_BUF,R2      ; Set the address of the input buffer in R2.
        MOV.L       #PARM,R3        ; Set the address of the parameter block in R3.
        MOV.L       R2,[R3]         ; Set the address of the input buffer in the 
                                    ; parameter block.
        MOV.L       R3,R2           ; Set the value of R3 (address of the parameter 
                                    ; block) in R2.
        MOV.L       #SIM_IO,R3      ; Set the address of the system call in R3.
        JSR         R3              ; System call
        MOV.L       #IO_BUF,R2      ; Set the address of the input buffer in R2.
        MOVU.B      [R2],R1         ; Set the first byte of the input buffer 
                                    ; (acquired 1-byte character) in R1.
        RTS                         ; Return to the address where the function was 
                                    ; called.
 
         .SECTION  B,DATA,ALIGN=4
PARM:       .BLKL   1               ; Parameter block area
         .SECTION  B_1,DATA
IO_BUF:     .BLKL   1               ; Input/output buffer