copy/prodos.s

47 lines
932 B
ArmAsm
Raw Permalink Normal View History

2018-10-08 05:07:48 +00:00
.export _get_file_info
MLI = $bf00
GET_FILE_INFO = $c4
2018-11-13 02:27:27 +00:00
COUT = $FDED ;SUB TO OUTPUT A CHARACTER
PRBYTE = $FDDA ;SUB TO PRINT A BYTE
CROUT = $FD8E ;SUB TO OUTPUT CARRIAGE RETURN
2018-10-08 05:07:48 +00:00
2018-11-13 02:27:27 +00:00
.code
2018-10-08 05:07:48 +00:00
2018-11-13 02:27:27 +00:00
; This function is defined as "fastcall" which puts the right-most
; parameter into A/X and the return value in A/X.
2018-10-08 05:07:48 +00:00
2018-11-13 02:27:27 +00:00
.proc _get_file_info
2018-10-08 05:07:48 +00:00
2018-11-13 02:27:27 +00:00
sta params
stx params+1
2018-10-08 05:07:48 +00:00
2018-11-13 02:27:27 +00:00
; Switch in ROM
bit $c082
2018-10-08 05:07:48 +00:00
2018-11-13 02:27:27 +00:00
lda params
jsr PRBYTE
jsr CROUT
2018-10-08 05:07:48 +00:00
2018-11-13 02:27:27 +00:00
lda params+1
jsr PRBYTE
jsr CROUT
2018-10-08 05:07:48 +00:00
jsr MLI
.byte GET_FILE_INFO
2018-11-13 02:27:27 +00:00
params: .word 0
2018-10-08 05:07:48 +00:00
; The system call leaves the error status in the Accumulator.
; The "fastcall" calling convention returns the A register,
; which is what we want.
rts
2018-11-13 02:27:27 +00:00
.endproc
.bss
file_info_addr: .res 2
2018-10-08 05:07:48 +00:00