A2osX/SYS/KERNEL.S.MLI.txt

229 lines
5.4 KiB
Plaintext
Raw Normal View History

2015-03-14 21:48:35 +00:00
PR#3
2015-06-03 18:30:57 +00:00
PREFIX /A2OSX.SRC
2015-03-14 21:48:35 +00:00
NEW
INC 1
AUTO 6
.LIST OFF
*--------------------------------------
* PUBLIC
*--------------------------------------
2016-01-06 22:05:12 +00:00
S.MLICreateFile >PULLW MLICALL.PARAMS+1
>PULLB MLICALL.PARAMS+3 Access
>PULLB MLICALL.PARAMS+4 File type
>PULLW MLICALL.PARAMS+5 Aux type
lda #$01
sta MLICALL.PARAMS+7 Storage=Standard Files
>MLICALL MLICREATE
2015-06-03 18:30:57 +00:00
rts
*--------------------------------------
S.MLICreateDirA jsr S.GetMemPtrA
S.MLICreateDirYA
>STYA MLICALL.PARAMS+1
lda #$C3
sta MLICALL.PARAMS+3 Access
lda #$0F
sta MLICALL.PARAMS+4 type=Directory
lda #$0D
sta MLICALL.PARAMS+7 Storage=Linked List
>MLICALL MLICREATE
rts
*--------------------------------------
S.MLIDestroyA jsr S.GetMemPtrA
S.MLIDestroyYA >STYA MLICALL.PARAMS+1
>MLICALL MLIDESTROY
rts
*--------------------------------------
S.MLIRename >PULLW MLICALL.PARAMS+3
>PULLW MLICALL.PARAMS+1
>MLICALL MLIRENAME
rts
*--------------------------------------
2015-03-14 21:48:35 +00:00
S.MLISetFileInfo
*--------------------------------------
* S.MLIGetFileInfoA
* in :
* A = hMem To FileName
* out :
* Y,A = PTR To Buffer (L=15)
*--------------------------------------
S.MLIGetFileInfoA
jsr S.GetMemPtrA
2015-06-03 18:30:57 +00:00
S.MLIGetFileInfoYA
2015-03-14 21:48:35 +00:00
>STYA MLICALL.PARAMS+1
2015-06-03 18:30:57 +00:00
>MLICALL MLIGETFILEINFO
2015-03-14 21:48:35 +00:00
bcs .9
>LDYAI MLICALL.PARAMS+3
.9 rts
*--------------------------------------
* S.MLIOnline
* in :
* PULLB = Device
* PULLW = Dest PTR
*--------------------------------------
S.MLIOnline >PULLB MLICALL.PARAMS+1
>PULLW MLICALL.PARAMS+2
2015-06-03 18:30:57 +00:00
>MLICALL MLIONLINE
2015-03-14 21:48:35 +00:00
rts
*--------------------------------------
2015-06-03 18:30:57 +00:00
S.MLISetPrefixA jsr S.GetMemPtrA
S.MLISetPrefixYA
>STYA MLICALL.PARAMS+1
>MLICALL MLISETPREFIX
rts
2015-03-14 21:48:35 +00:00
*--------------------------------------
S.MLIGetPrefixA jsr S.GetMemPtrA
2015-06-03 18:30:57 +00:00
S.MLIGetPrefixYA
>STYA MLICALL.PARAMS+1
>MLICALL MLIGETPREFIX
2015-03-14 21:48:35 +00:00
rts
*--------------------------------------
* S.MLIOpenA
* in :
* A = hMem To FileName
* out :
* A = ref_num
* X = buf hMem
*--------------------------------------
S.MLIOpenA jsr S.GetMemPtrA
2015-06-03 18:30:57 +00:00
S.MLIOpenYA >STYA MLICALL.PARAMS+1
2015-03-14 21:48:35 +00:00
>PUSHWI 1024 get a ProDOS IO buffer
2015-06-03 18:30:57 +00:00
>PUSHBI S.MEM.F.ALIGN+S.MEM.F.NOMOVE
2015-03-14 21:48:35 +00:00
jsr S.GetMem
bcs .99
2015-06-03 18:30:57 +00:00
2015-03-14 21:48:35 +00:00
phx save Prodos Buffer hMem
>STYA MLICALL.PARAMS+3
2015-06-03 18:30:57 +00:00
>MLICALL MLIOPEN
2015-03-14 21:48:35 +00:00
bcs .98
lda MLICALL.PARAMS+5 get ref_num
plx get back Prodos Buffer hMem
rts CC
2015-06-03 18:30:57 +00:00
2015-03-14 21:48:35 +00:00
.98 plx get back Prodos Buffer hMem
pha save MLI error
txa
jsr S.FreeMemA discard Prodos Buffer
pla get back MLI error
sec
.99 rts
*--------------------------------------
* S.MLINewline
* in :
* PULLB = ref_num
* PULLB = Enable Mask
* PULLB = Newline Char
*--------------------------------------
S.MLINewLine >PULLB MLICALL.PARAMS+1
>PULLB MLICALL.PARAMS+2
>PULLB MLICALL.PARAMS+3
2015-06-03 18:30:57 +00:00
>MLICALL MLINEWLINE
2015-03-14 21:48:35 +00:00
rts
*--------------------------------------
* S.MLIRead
* in :
* PULLB = ref_num
* PULLW = Dest PTR
* PULLW = Bytes To Read
* out :
* Y,A = Bytes Read
*--------------------------------------
S.MLIRead >PULLB MLICALL.PARAMS+1
>PULLW MLICALL.PARAMS+2
>PULLW MLICALL.PARAMS+4
2015-06-03 18:30:57 +00:00
>MLICALL MLIREAD
2015-03-14 21:48:35 +00:00
bcs .9
>LDYA MLICALL.PARAMS+6
.9 rts
*--------------------------------------
* S.MLIWrite
* in :
* PULLB = ref_num
2016-01-06 22:05:12 +00:00
* PULLW = Src PTR
* PULLW = Bytes To Write
2015-03-14 21:48:35 +00:00
* out :
* Y,A = Bytes Written
*--------------------------------------
S.MLIWrite >PULLB MLICALL.PARAMS+1
>PULLW MLICALL.PARAMS+2
>PULLW MLICALL.PARAMS+4
2015-06-03 18:30:57 +00:00
>MLICALL MLIWRITE
2015-03-14 21:48:35 +00:00
bcs .9
>LDYA MLICALL.PARAMS+6
.9 rts
*--------------------------------------
2015-06-03 18:30:57 +00:00
* S.MLICloseA
2015-03-14 21:48:35 +00:00
* in :
* A = ref_num
* out :
*--------------------------------------
S.MLICloseA sta MLICALL.PARAMS+1
2015-06-03 18:30:57 +00:00
>MLICALL MLICLOSE
rts
*--------------------------------------
S.MLIFlushA sta MLICALL.PARAMS+1
>MLICALL MLIFLUSH
2015-03-14 21:48:35 +00:00
rts
*--------------------------------------
S.MLISetMark
2015-06-03 18:30:57 +00:00
*--------------------------------------
* S.MLIGetMarkA
* in :
* A = ref_num
* out :
* Y,A,X = EOF
*--------------------------------------
S.MLIGetMarkA sta MLICALL.PARAMS+1
>MLICALL MLIGETMARK
bcs .9
>LDYA MLICALL.PARAMS+2
ldx MLICALL.PARAMS+4
clc
.9 rts
*--------------------------------------
2015-03-14 21:48:35 +00:00
S.MLISetEOF
*--------------------------------------
* S.MLIGetEOF
* in :
* A = ref_num
* out :
* Y,A,X = EOF
*--------------------------------------
S.MLIGetEOFA sta MLICALL.PARAMS+1
2015-06-03 18:30:57 +00:00
>MLICALL MLIGETEOF
2015-03-14 21:48:35 +00:00
bcs .9
>LDYA MLICALL.PARAMS+2
ldx MLICALL.PARAMS+4
clc
.9 rts
*--------------------------------------
2015-06-03 18:30:57 +00:00
S.MLISetBuf clc
rts
*--------------------------------------
S.MLIGetBuf clc
rts
*--------------------------------------
S.MLIGetTime >MLICALL MLIGETTIME
rts
*--------------------------------------
S.MLIAllocIRQ >PULLW MLICALL.PARAMS+2
2015-06-03 18:30:57 +00:00
>MLICALL MLIALLOCIRQ
bcs .9
lda MLICALL.PARAMS+1
.9 rts
2015-06-03 18:30:57 +00:00
*--------------------------------------
S.MLIDeallocIRQA
sta MLICALL.PARAMS+1
>MLICALL MLIDEALLOCIRQ
rts
*--------------------------------------
S.MLIReadBlock clc
rts
*--------------------------------------
S.MLIWriteBlock clc
rts
*--------------------------------------
2015-03-14 21:48:35 +00:00
MAN
SAVE SYS/KERNEL.S.MLI
LOAD SYS/KERNEL.S
ASM