a2d/inc/prodos.inc

118 lines
3.2 KiB
PHP
Raw Normal View History

2018-01-06 05:03:10 +00:00
;;; ------------------------------------------------------------
;;; ProDOS MLI
2018-01-06 05:03:10 +00:00
;;; ------------------------------------------------------------
;;; Entry point / Global Page
2018-01-06 05:03:10 +00:00
MLI := $BF00 ; Entry point
DEVNUM := $BF30 ; Most recent accessed device
DEVCNT := $BF31 ; Number of on-line devices minus 1
DEVLST := $BF32 ; Up to 14 units
BITMAP := $BF58 ; System memory bitmap
BITMAP_SIZE := $18 ; Bits for pages $00 to $BF
DATELO := $BF90 ; Date lo
DATEHI := $BF91 ; Date hi
TIMELO := $BF92 ; Time lo
TIMEHI := $BF93 ; Time hi
MACHID := $BF98 ; Machine ID
2017-09-13 15:09:33 +00:00
;;; Patch Locations
SELECTOR := $D100
2018-01-06 05:03:10 +00:00
;;; ------------------------------------------------------------
;;; MLI Calls
;;; Housekeeping Calls
CREATE := $C0
DESTROY := $C1
RENAME := $C2
SET_FILE_INFO := $C3
GET_FILE_INFO := $C4
ON_LINE := $C5
SET_PREFIX := $C6
GET_PREFIX := $C7
2018-01-06 05:03:10 +00:00
;;; Filing Calls
OPEN := $C8
NEWLINE := $C9
READ := $CA
WRITE := $CB
CLOSE := $CC
FLUSH := $CD
SET_MARK := $CE
GET_MARK := $CF
SET_EOF := $D0
GET_EOF := $D1
SET_BUF := $D2
GET_BUF := $D3
2018-01-06 05:03:10 +00:00
;;; System Calls
GET_TIME := $82
ALLOC_INTERRUPT := $40
DEALLOC_INTERRUPT := $41
2018-01-06 05:03:10 +00:00
QUIT := $65
;;; Direct Disk Access Commands
READ_BLOCK := $80
2018-01-17 04:16:31 +00:00
WRITE_BLOCK := $81
2018-01-06 05:03:10 +00:00
;;; ------------------------------------------------------------
2018-01-18 17:32:25 +00:00
;;; Device Types (low nibble of unit number in DEVLST)
2018-01-06 05:03:10 +00:00
DT_DISKII := $0
DT_PROFILE := $4
DT_RAM := $F
2018-01-18 17:32:25 +00:00
;;; See ProDOS Tech Note #21 - other than the above types, there
;;; is not an "ID nibble". The nibble is a copy of $CnFE's high
;;; nibble, with this meaning:
;;; bit 3 = removable
;;; bit 2 = interruptable
;;; bit 1-0 = number of volumes (0-1)
;;; "You should ignore the low nibble in the unit number..."
2018-01-06 05:03:10 +00:00
;;; ------------------------------------------------------------
2017-09-28 15:45:05 +00:00
;;; File Types
2018-01-06 05:03:10 +00:00
2017-09-28 15:45:05 +00:00
FT_TYPELESS := $00
FT_BAD := $01
FT_TEXT := $04
FT_BINARY := $06
FT_DIRECTORY := $0F
2018-01-05 19:16:47 +00:00
FT_SRC := $B0 ; IIgs system type; re-used?
FT_S16 := $B3 ; IIgs Application Program
2017-09-28 15:45:05 +00:00
FT_BASIC := $FC
FT_SYSTEM := $FF
2018-01-20 03:41:20 +00:00
;;; ------------------------------------------------------------
;;; Storage Types
ST_STANDARD_FILE := $01
ST_LINKED_DIRECTORY := $0D
ST_VOLUME_DIRECTORY := $0F
2018-02-13 05:14:23 +00:00
;;; ------------------------------------------------------------
;;; Errors
PDERR_PATH_NOT_FOUND := $44
PDERR_VOL_NOT_FOUND := $45
2018-01-06 05:03:10 +00:00
;;; ------------------------------------------------------------
;;; Macros
2018-01-06 05:03:10 +00:00
.macro MLI_CALL op, addr
jsr MLI
.byte op
.addr addr
.endmacro
2018-01-05 05:57:50 +00:00
2018-01-23 15:48:49 +00:00
.macro PASCAL_STRING str,res ; Length-prefixed string
2018-01-05 05:57:50 +00:00
.local data ; Can include control chars by using:
.local end ; PASCAL_STRING {"abc",$0D,"def"}
.byte end - data
data: .byte str
end:
2018-01-23 15:48:49 +00:00
.if .paramcount > 1
.res res - (end - data), 0
.endif
2018-01-05 05:57:50 +00:00
.endmacro