mirror of
https://github.com/cc65/cc65.git
synced 2024-12-25 02:29:52 +00:00
272b8e7185
git-svn-id: svn://svn.cc65.org/cc65/trunk@5852 b7a2c559-68d2-44c3-8de9-860c34a00d81
39 lines
713 B
ArmAsm
39 lines
713 B
ArmAsm
;
|
|
; Oliver Schmidt, 24.03.2005
|
|
;
|
|
; dhandle_t __fastcall__ dio_open (unsigned char device);
|
|
;
|
|
|
|
.export _dio_open
|
|
.import return0, __dos_type, isdevice
|
|
|
|
.include "errno.inc"
|
|
.include "mli.inc"
|
|
|
|
_dio_open:
|
|
; Check for ProDOS 8
|
|
ldx __dos_type
|
|
bne :+
|
|
lda #$01 ; "Bad system call number"
|
|
bne oserr ; Branch always
|
|
|
|
; Check for valid device
|
|
: tax
|
|
jsr isdevice
|
|
beq :+
|
|
lda #$28 ; "No device connected"
|
|
|
|
; Return oserror
|
|
oserr: sta __oserror
|
|
jmp return0
|
|
|
|
; Return success
|
|
: txa
|
|
asl
|
|
asl
|
|
asl
|
|
asl
|
|
ldx #$00
|
|
stx __oserror
|
|
rts
|