Everything

FEOF


Checks for end of file.

[Function Code (R1 Register)]

[Parameter Block (R2 Register)]

Example 1.

[Parameters]

Parameter

Description

Execution result (output)

0: Not EOF

-1: EOF detected

File number (input)

Number that is returned when a file is opened

[Detailed Description]

-

Checks for end of file.

[Example]

_fpeof:
        MOV.L       #PARM,R2        ; Set the address of the parameter block in R2.
        MOV.B       R1,1h:5[R2]  ; Set the value of R1 (file number) in R2 + 1 bytes.
        MOV.L       #010B0000h,R1   ; Set the function code of FEOF in R1.
        MOV.L       #SIM_IO,R3      ; Set the address of the system call in R3.
        JSR         R3              ; System call
        NOP
        MOV.L       #PARM,R2  ; Set the address of the parameter block in R2.
        MOV.B       [R2],R1   ; Set the first byte of R2 (result of execution) in R1.
        RTS                   ; Return to the address where the function was called.
 
         .SECTION  B,DATA,ALIGN=4
PARM:       .BLKL   1               ; Parameter block area