A2osX/SYS/KERNEL.S.MLI.txt
2016-09-21 17:20:37 +02:00

160 lines
3.7 KiB
Plaintext
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

PR#3
PREFIX /A2OSX.SRC
NEW
INC 1
AUTO 6
.LIST OFF
*--------------------------------------
* PUBLIC
*--------------------------------------
K.MLICreateFile >PULLW MLICALL.PARAMS+1
>PULLB MLICALL.PARAMS+3 Access
>PULLB MLICALL.PARAMS+4 File type
>PULLW MLICALL.PARAMS+5 Aux type
lda #$01 Storage=Standard Files
sta MLICALL.PARAMS+7
>MLICALL MLICREATE
rts
*--------------------------------------
* K.MLISetFileInfo
*--------------------------------------
K.MLISetFileInfo
>PULLW ZPQuickPtr1
>PULLW MLICALL.PARAMS+1
ldy #$E
.1 lda (ZPQuickPtr1),y
sta MLICALL.PARAMS+3,y
dey
bpl .1
>MLICALL MLISETFILEINFO
rts
*--------------------------------------
* K.MLIGetFileInfoYA
* in :
* Y,A = FileName
* out :
* Y,A = PTR To Buffer (L=15)
*--------------------------------------
K.MLIGetFileInfoYA
>STYA MLICALL.PARAMS+1
>MLICALL MLIGETFILEINFO
bcs .9
>LDYAI MLICALL.PARAMS+3
.9 rts
*--------------------------------------
* K.MLIOnline
* in :
* PULLB = Device
* PULLW = Dest PTR
*--------------------------------------
K.MLIOnline >PULLB MLICALL.PARAMS+1
>PULLW MLICALL.PARAMS+2
>MLICALL MLIONLINE
rts
*--------------------------------------
K.MLIGetPrefixYA
>STYA MLICALL.PARAMS+1
>MLICALL MLIGETPREFIX
rts
*--------------------------------------
* K.MLIOpenYA
* in :
* YA = FileName
* out :
* A = ref_num
* X = buf hMem
*--------------------------------------
K.MLIOpenYA >STYA MLICALL.PARAMS+1
>PUSHWI 1024 get a ProDOS IO buffer
>PUSHBI S.MEM.F.ALIGN+S.MEM.F.NOMOVE
jsr K.GetMem
bcs .99
phx save Prodos Buffer hMem
>STYA MLICALL.PARAMS+3
>MLICALL MLIOPEN
bcs .98
lda MLICALL.PARAMS+5 get ref_num
plx get back Prodos Buffer hMem
rts CC
.98 plx get back Prodos Buffer hMem
pha save MLI error
txa
jsr K.FreeMemA discard Prodos Buffer
pla get back MLI error
sec
.99 rts
*--------------------------------------
* K.MLINewline
* in :
* PULLB = ref_num
* PULLB = Enable Mask
* PULLB = Newline Char
*--------------------------------------
K.MLINewLine >PULLB MLICALL.PARAMS+1
>PULLB MLICALL.PARAMS+2
>PULLB MLICALL.PARAMS+3
>MLICALL MLINEWLINE
rts
*--------------------------------------
* K.MLIRead
* in :
* PULLB = ref_num
* PULLW = Dest PTR
* PULLW = Bytes To Read
* out :
* Y,A = Bytes Read
*--------------------------------------
K.MLIRead >PULLB MLICALL.PARAMS+1
>PULLW MLICALL.PARAMS+2
>PULLW MLICALL.PARAMS+4
>MLICALL MLIREAD
bcs .9
>LDYA MLICALL.PARAMS+6
.9 rts
*--------------------------------------
* K.MLIWrite
* in :
* PULLB = ref_num
* PULLW = Src PTR
* PULLW = Bytes To Write
* out :
* Y,A = Bytes Written
*--------------------------------------
K.MLIWrite >PULLB MLICALL.PARAMS+1
>PULLW MLICALL.PARAMS+2
>PULLW MLICALL.PARAMS+4
>MLICALL MLIWRITE
bcs .9
>LDYA MLICALL.PARAMS+6
.9 rts
*--------------------------------------
* K.MLICloseA
* in :
* A = ref_num
* out :
*--------------------------------------
K.MLICloseA sta MLICALL.PARAMS+1
>MLICALL MLICLOSE
rts
*--------------------------------------
* K.MLIGetEOF
* in :
* A = ref_num
* out :
* Y,A,X = EOF
*--------------------------------------
K.MLIGetEOFA sta MLICALL.PARAMS+1
>MLICALL MLIGETEOF
bcs .9
>LDYA MLICALL.PARAMS+2
ldx MLICALL.PARAMS+4
clc
.9 rts
*--------------------------------------
MAN
SAVE SYS/KERNEL.S.MLI
LOAD SYS/KERNEL.S
ASM