Files
Shawn Quick dfcaae62dd Add qlink, the disk tools, and a bootable ProDOS 8 image.
Move the assembler to src/qasm. qlink links OMF 1.0 and 2.0 from a script. makeBin flattens a load file, qomf dumps OMF, and qpro builds ProDOS volumes. APW and MPW assemble through the ORCA front end. Relocatable modules emit OMF objects. Listings stay off unless -l is set.

make boot assembles the GS/OS 6.0.1 ProDOS 8 kernel and BASIC.SYSTEM into an 800K volume. BASIC.SYSTEM accepts ls and pfx, and its splash reports PRODOS BASIC 2.0, copyright 1983-2026. IIGS.601.SRC is the source and the BASIC.SYSTEM oracle that image is built from.
2026-10-16 14:41:55 -07:00

1 line
61 KiB
Plaintext

;==========================================================================
;This file contains debug code
;
;Link List
; Link Pointer 4 Bytes
; $AABB 2 Bytes (For Monitor)
; Call Number 2 Bytes
; Error Code 2 Bytes
; Path Flag 2 Bytes
; PathName Pointer 4 Bytes
; Call Parameter Block -n- Bytes
;
;==========================================================================
EXPORT debugger
debugger PROC
jmp debug_start
entry debugger_out
export debug_flag
debug_flag DC.W 00
debug_address DC.L debug_buffer ;local buffer for debug data
debug_wait DC.W 0000
curr_wait DC.W 0000
debug_count DC.W 0000
debug_error DC.W 0000
debug_path DC.W 0000
debug_header equ $0008
export debug_buffer
debug_buffer ds.b 256 ;buffer for debugger
size_table ;
DC.W $11 ;create
DC.W $03 ;destroy
DC.W $00 ;cmd_error
DC.W $07 ;change_path
DC.W $15 ;set_file_info
DC.W $19 ;get_file_info
DC.W $00 ;cmd_error
DC.W $11 ;volume
DC.W $00 ;cmd_error
DC.W $00 ;cmd_error
DC.W $03 ;clear_backup
DC.W $00 ;cmd_error
DC.W $00 ;cmd_error
DC.W $00 ;cmd_error
DC.W $00 ;cmd_error
DC.W $09 ;open
DC.W $00 ;cmd_error
DC.W $0D ;read
DC.W $0D ;write
DC.W $01 ;close
DC.W $01 ;flush
DC.W $05 ;set_mark
DC.W $05 ;get_mark
DC.W $05 ;set_eof
DC.W $05 ;get_eof
DC.W $00 ;cmd_error
DC.W $00 ;cmd_error
DC.W $2F ;get_dir_entry
DC.W $00 ;cmd_error
DC.W $00 ;cmd_error
DC.W $00 ;cmd_error
DC.W $05 ;get_dev_num
DC.W $00 ;cmd_error
DC.W $09 ;read_block
DC.W $09 ;write_block
DC.W $00 ;cmd_error
DC.W $00 ;cmd_error
Path_table ;
DC.W $ff ;create
DC.W $ff ;destroy
DC.W $00 ;cmd_error
DC.W $ff ;change_path
DC.W $ff ;set_file_info
DC.W $ff ;get_file_info
DC.W $00 ;cmd_error
DC.W $ff ;volume
DC.W $00 ;cmd_error
DC.W $00 ;cmd_error
DC.W $ff ;clear_backup
DC.W $00 ;cmd_error
DC.W $00 ;cmd_error
DC.W $00 ;cmd_error
DC.W $00 ;cmd_error
DC.W $ff ;open
DC.W $00 ;cmd_error
DC.W $00 ;read
DC.W $00 ;write
DC.W $00 ;close
DC.W $00 ;flush
DC.W $00 ;set_mark
DC.W $00 ;get_mark
DC.W $00 ;set_eof
DC.W $00 ;get_eof
DC.W $00 ;cmd_error
DC.W $00 ;cmd_error
DC.W $00 ;get_dir_entry
DC.W $00 ;cmd_error
DC.W $00 ;cmd_error
DC.W $00 ;cmd_error
DC.W $ff ;get_dev_num
DC.W $00 ;cmd_error
DC.W $00 ;read_block
DC.W $00 ;write_block
DC.W $00 ;cmd_error
DC.W $00 ;cmd_error
c1_size_table ;
DC.W $17 ;create
DC.W $06 ;destroy
DC.W $00 ;cmd_error
DC.W $0A ;change_path
DC.W $38 ;set_file_info
DC.W $38 ;get_file_info
DC.W $00 ;cmd_error
DC.W 30 ;volume
DC.W $00 ;cmd_error
DC.W $00 ;cmd_error
DC.W $06 ;clear_backup
DC.W $00 ;cmd_error
DC.W $00 ;cmd_error
DC.W $00 ;cmd_error
DC.W $00 ;cmd_error
DC.W $4A ;open
DC.W $00 ;cmd_error
DC.W 18 ;read
DC.W 18 ;write
DC.W 04 ;close
DC.W 04 ;flush
DC.W 10 ;set_mark
DC.W 08 ;get_mark
DC.W 10 ;set_eof
DC.W 08 ;get_eof
DC.W $00 ;cmd_error
DC.W $00 ;cmd_error
DC.W 60 ;get_dir_entry
DC.W $00 ;cmd_error
DC.W $00 ;cmd_error
DC.W $00 ;cmd_error
DC.W 08 ;get_dev_num
DC.W $00 ;cmd_error
DC.W $00 ;read_block
DC.W $00 ;write_block
DC.W $00 ;cmd_error
DC.W $00 ;cmd_error
debug_start ;
stz debug_error
bcc @no_error
sta debug_error
@no_error ;
lda call_number
tax
and #$FF00 ;class 0?
beq @class0
cmp #$2000 ;class 1?
beq @class1
rts
@class0
txa
asl a
tax
lda size_table-2,x ;get the number of bytes to move
sta debug_count
bne do_path_tbl
rts
@class1
lda call_number ;fix X please
cmp #$2033 ;FST specific
bne @not_fst
rts
@not_fst
and #$00FF
asl a
tax
lda c1_size_table-2,x ;get the number of bytes to move
sta debug_count
bne do_path_tbl
rts
do_path_tbl
lda path_table-2,x
sta debug_path
chk_flag ;
lda debug_flag ;are we debugging?
bmi debug_true
rts
debug_true ;
clc
lda debug_address
sta temp_ptr ;use a temp pointer please
lda debug_address+2
sta temp_ptr+2 ;pointer to location to store the call
find_free ;
ldy #$0002 ;high word of link
lda [temp_ptr],y
tax
lda [temp_ptr]
bne get_next
txy
beq found_last
get_next ;
clc
adc temp_ptr
sta temp_ptr
txa
adc temp_ptr+2
sta temp_ptr+2
bra find_free
found_last ;
ldy #$0004 ;index to monitor Pattern
lda #$BBAA
sta [temp_ptr],y
iny
iny
lda call_number ;save the user's call number
sta [temp_ptr],y
iny
iny
lda debug_error
sta [temp_ptr],y ;save the error code
iny
iny
ldx debug_path
lda path_flag ;save the path flag
and #path1_mask
bne store_path
ldx #$0000
store_path ;
txa
sta [temp_ptr],y
iny
iny ;point to the parameter block
txa
beq @zero_path
clc
lda temp_ptr
adc #$000D+4 ;header overhead
adc debug_count
sta [temp_ptr],y
iny
iny
lda temp_ptr+2
adc #$0000
sta [temp_ptr],y
bra @non_zero
@zero_path
lda #$0000
sta [temp_ptr],y
iny
iny
sta [temp_ptr],y ;zero the pathname pointer
@non_zero
iny
iny
tya
clc
adc temp_ptr ;make a pointer to parameter area
sta temp2_ptr
lda #$0000
adc temp_ptr+2
sta temp2_ptr+2
ldy debug_count
longa off
sep #$20 ;8 Bit Accum
debug_loop ;
lda [param_blk_ptr],y
sta [temp2_ptr],y
dey
bpl debug_loop ;store the parameter block
longa on
rep #$20
inc debug_count
clc
lda temp2_ptr ;point past the parameter block
adc debug_count
sta temp2_ptr
lda temp2_ptr+2
adc #$0000
sta temp2_ptr+2
lda #$0000 ;zero the pathname length if there is
sta [temp2_ptr] ;one
ldy #$0002
sta [temp2_ptr],y
lda debug_path ;are we done?
beq end_debug ;yes
lda path_flag ;load the path flag please
and #path1_mask
beq end_debug ;sorry no path name
lda [path1_ptr] ;get the length please
tay ;store the length in Y
iny
tyx
debug_name ;
lda [path1_ptr],y
sta [temp2_ptr],y
dey
bpl debug_name
txy
iny
lda #$0000
sta [temp2_ptr],y
iny
iny
sta [temp2_ptr],y
dey
dey
tya
clc
adc temp2_ptr
sta temp2_ptr
lda #$0000
adc temp2_ptr+2
sta temp2_ptr+2
end_debug ;
ldy #$0002
sec
lda temp2_ptr ;points to next entry
sbc temp_ptr
sta [temp_ptr]
lda temp2_ptr+2
sbc temp_ptr+2
sta [temp_ptr],y
lda debug_wait ;should we wait?
beq no_wait
lda curr_wait
cmp debug_wait ;are we there yet?
bcc no_wait ;no
ldx #$2c03
jsl $e10000 ;ring the bell
key_loop ;
lda >$e0c000
bpl key_loop
lda >$e0C010
no_wait
jsr debugger_out
inc curr_wait
rts
ENDP
longa on
longi on
EXPORT debugger_out
debugger_out PROC
import debug_buffer
import debug_flag
;------------------------------------------
;
; Equates from procedure
;
;------------------------------------------
cmd_error equ $0000
word equ $0000
lword equ $0002
eight equ $0006
pointer equ $0002
data_start equ debug_buffer
zp equ $00
temp_ptr equ $04
temp2_ptr equ $08
table_ptr equ $0C
entry_ptr equ $10
ascii_ptr equ $14
zp_size equ ascii_ptr+4
jmp bug_routine
zp_hold ds.b $19 ;save restore buffer
debug_path DC.W 00
param_index DC.W 00
temp DC.W 00
class0_table ;
DC.W create
DC.W destroy
DC.W cmd_error
DC.W change_path
DC.W set_file_info
DC.W get_file_info
DC.W cmd_error
DC.W volume
DC.W cmd_error
DC.W cmd_error
DC.W clear_backup
DC.W cmd_error
DC.W cmd_error
DC.W cmd_error
DC.W cmd_error
DC.W open
DC.W cmd_error
DC.W read
DC.W write
DC.W close
DC.W flush
DC.W set_mark
DC.W get_mark
DC.W set_eof
DC.W get_eof
DC.W cmd_error
DC.W cmd_error
DC.W get_dir_entry
DC.W cmd_error
DC.W cmd_error
DC.W cmd_error
DC.W get_dev_num
DC.W cmd_error
DC.W read_block
DC.W write_block
DC.W cmd_error
DC.W cmd_error
class1_table
DC.W c1_create
DC.W c1_destroy
DC.W cmd_error
DC.W c1_change_path
DC.W c1_set_file_info
DC.W c1_get_file_info
DC.W cmd_error
DC.W c1_volume
DC.W cmd_error
DC.W cmd_error
DC.W c1_clear_backup
DC.W cmd_error
DC.W cmd_error
DC.W cmd_error
DC.W cmd_error
DC.W c1_open
DC.W cmd_error
DC.W c1_read
DC.W c1_write
DC.W c1_close
DC.W c1_flush
DC.W c1_set_mark
DC.W c1_get_mark
DC.W c1_set_eof
DC.W c1_get_eof
DC.W cmd_error
DC.W cmd_error
DC.W c1_get_dir_entry
DC.W cmd_error
DC.W cmd_error
DC.W cmd_error
DC.W c1_get_dev_num
DC.W cmd_error
DC.W cmd_error
DC.W cmd_error
DC.W cmd_error
DC.W cmd_error
;===========================================================================
create
DC.W ascii_01 ;ascii data to write.
DC.W size_01 ;length to write
DC.W word
DC.W err_01 ;error returned
DC.W pointer ;type = pointer
DC.W name_01 ;address of pathname pointer
DC.W word ;type = word
DC.W access_01
DC.W word
DC.W file_type_01
DC.W lword
DC.W aux_type_01
DC.W word
DC.W storage_01
DC.W word
DC.W createA_01
DC.W word
DC.W createB_01
DC.W $FFFF ;end of table
ascii_01 ;
DC.B 'Call = CREATE'
DC.B $0D
DC.B 'Error Code = $'
err_01 DC.B 'FFFF'
DC.B $0D
DC.B 'Pathname ptr = $'
name_01 DC.B '00FFFFFF'
DC.B $0D
DC.B 'Access = $'
access_01 DC.B 'FFFF'
DC.B $0D
DC.B 'File Type = $'
file_type_01 DC.B 'FFFF'
DC.B $0D
DC.B 'Aux Type = $'
aux_type_01 DC.B 'FFFFFFFF'
DC.B $0D
DC.B 'Storage = $'
storage_01 DC.B 'FFFF'
DC.B $0D
DC.B 'Create Date = $'
createA_01 DC.B 'FFFF'
DC.B $0D
DC.B 'Create Time = $'
createB_01 DC.B 'FFFF'
DC.B $0D
DC.B $0D
size_01 equ *-ascii_01
;===========================================================================
c1_create
DC.W c1_ascii_01 ;ascii data to write.
DC.W c1_create_pcnt ;pointer to length table
DC.W word
DC.W c1_err_01 ;error returned
dc.w word ;PCount field
dc.w c1_pcnt_01
DC.W pointer ;type = pointer
DC.W c1_name_01 ;address of pathname pointer
DC.W word ;type = word
DC.W c1_access_01
DC.W word
DC.W c1_file_type_01
DC.W lword
DC.W c1_aux_type_01
DC.W word
DC.W c1_storage_01
DC.W lword
DC.W c1_eof_01
DC.W lword
DC.W c1_res_01
DC.W $FFFF ;end of table
c1_create_pcnt dc.w $0007 ;size of the PCount table
dc.w c1_pcnt_01_1
dc.w c1_pcnt_01_2
dc.w c1_pcnt_01_3
dc.w c1_pcnt_01_4
dc.w c1_pcnt_01_5
dc.w c1_pcnt_01_6
dc.w c1_pcnt_01_7
c1_ascii_01
DC.B 'Call = CREATE'
DC.B $0D
DC.B 'Error Code = $'
c1_err_01 DC.B 'FFFF'
DC.B $0D
dc.b 'PCount = $'
c1_pcnt_01 dc.b 'FFFF'
dc.b $0d
DC.B 'Pathname ptr = $'
c1_name_01 DC.B '00FFFFFF'
DC.B $0D
c1_pcnt_01_1 equ *-c1_ascii_01 ;size of write with PCount of 1
DC.B 'Access = $'
c1_access_01 DC.B 'FFFF'
DC.B $0D
c1_pcnt_01_2 equ *-c1_ascii_01 ;size of write with PCount of 2
DC.B 'File Type = $'
c1_file_type_01 DC.B 'FFFF'
DC.B $0D
c1_pcnt_01_3 equ *-c1_ascii_01 ;size of write with PCount of 3
DC.B 'Aux Type = $'
c1_aux_type_01 DC.B 'FFFFFFFF'
DC.B $0D
c1_pcnt_01_4 equ *-c1_ascii_01 ;size of write with PCount of 4
DC.B 'Storage = $'
c1_storage_01 DC.B 'FFFF'
DC.B $0D
c1_pcnt_01_5 equ *-c1_ascii_01 ;size of write with PCount of 5
DC.B 'Data Fork Size = $'
c1_eof_01 DC.B 'FFFFFFFF'
DC.B $0D
c1_pcnt_01_6 equ *-c1_ascii_01 ;size of write with PCount of 6
DC.B 'Resource Fork Size = $'
c1_res_01 DC.B 'FFFFFFFF'
DC.B $0D
DC.B $0D
c1_pcnt_01_7 equ *-c1_ascii_01 ;size of write with PCount of 7
;===========================================================================
destroy ;
DC.W ascii_02 ;pointer to ascii data
DC.W size_02
DC.W word
DC.W err_02 ;error returned
DC.W pointer ;type = pointer
DC.W path_02
DC.W $FFFF
ascii_02 ;
DC.B 'Call = DESTROY'
DC.B $0D
DC.B 'Error Code = $'
err_02 DC.B 'FFFF'
DC.B $0D
DC.B 'Pathname ptr = $'
path_02 DC.B '00FFFFFF'
DC.B $0D
DC.B $0D
size_02 equ *-ascii_02
;===========================================================================
c1_destroy
DC.W c1_ascii_02 ;pointer to ascii data
DC.W c1_destroy_pcnt
DC.W word
DC.W c1_err_02 ;error returned
dc.w word
dc.w c1_pcnt_02
DC.W pointer ;type = pointer
DC.W c1_path_02
DC.W $FFFF
c1_destroy_pcnt dc.w $0001
dc.w c1_pcnt_02_01
c1_ascii_02
DC.B 'Call = DESTROY'
DC.B $0D
DC.B 'Error Code = $'
c1_err_02 DC.B 'FFFF'
DC.B $0D
dc.b 'PCount = $'
c1_pcnt_02 dc.b 'FFFF'
dc.b $0d
DC.B 'Pathname ptr = $'
c1_path_02 DC.B '00FFFFFF'
DC.B $0D
DC.B $0D
c1_pcnt_02_01 equ *-c1_ascii_02
;===========================================================================
change_path ;
DC.W ascii_04
DC.W size_04
DC.W word
DC.W err_04 ;error returned
DC.W pointer
DC.W path1_04
DC.W pointer
DC.W path2_04
DC.W $FFFF
ascii_04 ;
DC.B 'Call = CHANGE PATH'
DC.B $0D
DC.B 'Error Code = $'
err_04 DC.B 'FFFF'
DC.B $0D
DC.B 'Pathname ptr = $'
path1_04 DC.B '00FFFFFF'
DC.B $0D
DC.B 'Pathname ptr = $'
path2_04 DC.B '00FFFFFF'
DC.B $0D
DC.B $0D
size_04 equ *-ascii_04
;===========================================================================
c1_change_path ;
DC.W c1_ascii_04
DC.W c1_change_pcnt
DC.W word
DC.W c1_err_04 ;error returned
dc.w word
dc.w c1_pcnt_04
DC.W pointer
DC.W c1_path1_04
DC.W pointer
DC.W c1_path2_04
DC.W $FFFF
c1_change_pcnt dc.w $0002
dc.w $0000
dc.w c1_pcnt_04_01 ;size
c1_ascii_04 ;
DC.B 'Call = CHANGE PATH'
DC.B $0D
DC.B 'Error Code = $'
c1_err_04 DC.B 'FFFF'
DC.B $0D
dc.b 'PCount = $'
c1_pcnt_04 dc.b 'FFFF'
dc.b $0D
DC.B 'Pathname ptr = $'
c1_path1_04 DC.B '00FFFFFF'
DC.B $0D
DC.B 'Pathname ptr = $'
c1_path2_04 DC.B '00FFFFFF'
DC.B $0D
DC.B $0D
c1_pcnt_04_01 equ *-c1_ascii_04
;===========================================================================
set_file_info ;
DC.W ascii_05 ;ascii data to write.
DC.W size_05 ;length to write
DC.W word
DC.W err_05 ;error returned
DC.W pointer ;type = pointer
DC.W name_05 ;address of pathname pointer
DC.W word ;type = word
DC.W access_05
DC.W word
DC.W file_type_05
DC.W lword
DC.W aux_type_05
DC.W word
DC.W null_05
DC.W word
DC.W createA_05
DC.W word
DC.W createB_05
DC.W word
DC.W modA_05
DC.W word
DC.W modB_05
DC.W $FFFF ;end of table
ascii_05 ;
DC.B 'Call = SET FILE INFO'
DC.B $0D
DC.B 'Error Code = $'
err_05 DC.B 'FFFF'
DC.B $0D
DC.B 'Pathname ptr = $'
name_05 DC.B '00FFFFFF'
DC.B $0D
DC.B 'Access = $'
access_05 DC.B 'FFFF'
DC.B $0D
DC.B 'File Type = $'
file_type_05 DC.B 'FFFF'
DC.B $0D
DC.B 'Aux Type = $'
aux_type_05 DC.B 'FFFFFFFF'
DC.B $0D
DC.B 'Storage = $'
null_05 DC.B 'FFFF'
DC.B $0D
DC.B 'Create Date = $'
createA_05 DC.B 'FFFF'
DC.B $0D
DC.B 'Create Time = $'
createB_05 DC.B 'FFFF'
DC.B $0D
DC.B 'Mod. Date = $'
ModA_05 DC.B 'FFFF'
DC.B $0D
DC.B 'Mod. Time = $'
ModB_05 DC.B 'FFFF'
DC.B $0D
DC.B $0D
size_05 equ *-ascii_05
;===========================================================================
c1_set_file_info ;
DC.W c1_ascii_05 ;ascii data to write.
DC.W c1_set_file_pcnt
DC.W word
DC.W c1_err_05 ;error returned
dc.w word
dc.w c1_pcnt_05
DC.W pointer ;type = pointer
DC.W c1_name_05 ;address of pathname pointer
DC.W word ;type = word
DC.W c1_access_05
DC.W word
DC.W c1_file_type_05
DC.W lword
DC.W c1_aux_type_05
DC.W word
DC.W c1_null_05
DC.W eight
DC.W c1_create_05
DC.W eight
DC.W c1_mod_05
DC.W lword
DC.W c1_opt_05
dc.w lword
dc.w c1_null1_05
dc.w lword
dc.w c1_null2_05
dc.w lword
dc.w c1_null3_05
dc.w lword
dc.w c1_null4_05
DC.W $FFFF ;end of table
c1_set_file_pcnt dc.w $000C
dc.w $0000 ;no pcount of 1 allowed
dc.w c1_pcnt_05_02
dc.w c1_pcnt_05_03
dc.w c1_pcnt_05_04
dc.w c1_pcnt_05_05
dc.w c1_pcnt_05_06
dc.w c1_pcnt_05_07
dc.w c1_pcnt_05_08
dc.w c1_pcnt_05_09
dc.w c1_pcnt_05_0A
dc.w c1_pcnt_05_0B
dc.w c1_pcnt_05_0C
c1_ascii_05 ;
DC.B 'Call = SET FILE INFO'
DC.B $0D
DC.B 'Error Code = $'
c1_err_05 DC.B 'FFFF'
DC.B $0D
dc.b 'PCount = $'
c1_pcnt_05 dc.b 'FFFF'
dc.b $0D
DC.B 'Pathname ptr = $'
c1_name_05 DC.B '00FFFFFF'
DC.B $0D
DC.B 'Access = $'
c1_access_05 DC.B 'FFFF'
DC.B $0D
c1_pcnt_05_02 equ *-c1_ascii_05
DC.B 'File Type = $'
c1_file_type_05 DC.B 'FFFF'
DC.B $0D
c1_pcnt_05_03 equ *-c1_ascii_05
DC.B 'Aux Type = $'
c1_aux_type_05 DC.B 'FFFFFFFF'
DC.B $0D
c1_pcnt_05_04 equ *-c1_ascii_05
DC.B 'Storage = $'
c1_null_05 DC.B 'FFFF'
DC.B $0D
c1_pcnt_05_05 equ *-c1_ascii_05
DC.B 'Create Date = $'
c1_create_05 DC.B 'FFFFFFFFFFFFFFFF'
DC.B $0D
c1_pcnt_05_06 equ *-c1_ascii_05
DC.B 'Mod. Date = $'
c1_Mod_05 DC.B 'FFFFFFFFFFFFFFFF'
DC.B $0D
c1_pcnt_05_07 equ *-c1_ascii_05
dc.b 'Option List = $'
c1_opt_05 dc.b 'FFFFFFFF'
dc.b $0D
c1_pcnt_05_08 equ *-c1_ascii_05
dc.b 'Null Field = $'
c1_null1_05 dc.b 'FFFFFFFF'
dc.b $0d
c1_pcnt_05_09 equ *-c1_ascii_05
dc.b 'Null Field = $'
c1_null2_05 dc.b 'FFFFFFFF'
dc.b $0d
c1_pcnt_05_0A equ *-c1_ascii_05
dc.b 'Null Field = $'
c1_null3_05 dc.b 'FFFFFFFF'
dc.b $0d
c1_pcnt_05_0B equ *-c1_ascii_05
dc.b 'Null Field = $'
c1_null4_05 dc.b 'FFFFFFFF'
dc.b $0d
c1_pcnt_05_0C equ *-c1_ascii_05
;===========================================================================
get_file_info ;
DC.W ascii_06 ;ascii data to write.
DC.W size_06 ;length to write
DC.W word
DC.W err_06 ;error returned
DC.W pointer ;type = pointer
DC.W name_06 ;address of pathname pointer
DC.W word ;type = word
DC.W access_06
DC.W word
DC.W file_type_06
DC.W lword
DC.W aux_type_06
DC.W word
DC.W storage_06
DC.W word
DC.W createA_06
DC.W word
DC.W createB_06
DC.W word
DC.W modA_06
DC.W word
DC.W modB_06
DC.W lword
DC.W blocks_06
DC.W $FFFF ;end of table
ascii_06 ;
DC.B 'Call = GET FILE INFO'
DC.B $0D
DC.B 'Error Code = $'
err_06 DC.B 'FFFF'
DC.B $0D
DC.B 'Pathname ptr = $'
name_06 DC.B '00FFFFFF'
DC.B $0D
DC.B 'Access = $'
access_06 DC.B 'FFFF'
DC.B $0D
DC.B 'File Type = $'
file_type_06 DC.B 'FFFF'
DC.B $0D
DC.B 'Aux Type = $'
aux_type_06 DC.B 'FFFFFFFF'
DC.B $0D
DC.B 'Storage = $'
storage_06 DC.B 'FFFF'
DC.B $0D
DC.B 'Create Date = $'
createA_06 DC.B 'FFFF'
DC.B $0D
DC.B 'Create Time = $'
createB_06 DC.B 'FFFF'
DC.B $0D
DC.B 'Mod. Date = $'
modA_06 DC.B 'FFFF'
DC.B $0D
DC.B 'Mod. Time = $'
modB_06 DC.B 'FFFF'
DC.B $0D
DC.B 'Blocks used = $'
blocks_06 DC.B 'FFFFFFFF'
DC.B $0D
DC.B $0D
size_06 equ *-ascii_06
;===========================================================================
c1_get_file_info ;
DC.W c1_ascii_06 ;ascii data to write.
DC.W c1_get_file_pcnt
DC.W word
DC.W c1_err_06 ;error returned
dc.w word
dc.w c1_pcnt_06
DC.W pointer ;type = pointer
DC.W c1_name_06 ;address of pathname pointer
DC.W word ;type = word
DC.W c1_access_06
DC.W word
DC.W c1_file_type_06
DC.W lword
DC.W c1_aux_type_06
DC.W word
DC.W c1_storage_06
DC.W eight
DC.W c1_create_06
DC.W eight
DC.W c1_mod_06
DC.W lword
DC.W c1_opt_06
dc.w lword
dc.w c1_data_eof_06
dc.w lword
dc.w c1_data_used_06
dc.w lword
dc.w c1_res_eof_06
dc.w lword
dc.w c1_res_used_06
DC.W $FFFF ;end of table
c1_get_file_pcnt dc.w $000C
dc.w $0000 ;no pcount of 1 allowed
dc.w c1_pcnt_06_02
dc.w c1_pcnt_06_03
dc.w c1_pcnt_06_04
dc.w c1_pcnt_06_05
dc.w c1_pcnt_06_06
dc.w c1_pcnt_06_07
dc.w c1_pcnt_06_08
dc.w c1_pcnt_06_09
dc.w c1_pcnt_06_0A
dc.w c1_pcnt_06_0B
dc.w c1_pcnt_06_0C
c1_ascii_06 ;
DC.B 'Call = GET FILE INFO'
DC.B $0D
DC.B 'Error Code = $'
c1_err_06 DC.B 'FFFF'
DC.B $0D
dc.b 'PCount = $'
c1_pcnt_06 dc.b 'FFFF'
dc.b $0D
DC.B 'Pathname ptr = $'
c1_name_06 DC.B '00FFFFFF'
DC.B $0D
DC.B 'Access = $'
c1_access_06 DC.B 'FFFF'
DC.B $0D
c1_pcnt_06_02 equ *-c1_ascii_06
DC.B 'File Type = $'
c1_file_type_06 DC.B 'FFFF'
DC.B $0D
c1_pcnt_06_03 equ *-c1_ascii_06
DC.B 'Aux Type = $'
c1_aux_type_06 DC.B 'FFFFFFFF'
DC.B $0D
c1_pcnt_06_04 equ *-c1_ascii_06
DC.B 'Storage = $'
c1_storage_06 DC.B 'FFFF'
DC.B $0D
c1_pcnt_06_05 equ *-c1_ascii_06
DC.B 'Create Date = $'
c1_create_06 DC.B 'FFFFFFFFFFFFFFFF'
DC.B $0D
c1_pcnt_06_06 equ *-c1_ascii_06
DC.B 'Mod. Date = $'
c1_Mod_06 DC.B 'FFFFFFFFFFFFFFFF'
DC.B $0D
c1_pcnt_06_07 equ *-c1_ascii_06
dc.b 'Option List = $'
c1_opt_06 dc.b 'FFFFFFFF'
dc.b $0D
c1_pcnt_06_08 equ *-c1_ascii_06
dc.b 'Data Fork EOF = $'
c1_data_eof_06 dc.b 'FFFFFFFF'
dc.b $0d
c1_pcnt_06_09 equ *-c1_ascii_06
dc.b 'Blocks Used = $'
c1_data_used_06 dc.b 'FFFFFFFF'
dc.b $0d
c1_pcnt_06_0A equ *-c1_ascii_06
dc.b 'Resource Fork EOF = $'
c1_res_eof_06 dc.b 'FFFFFFFF'
dc.b $0d
c1_pcnt_06_0B equ *-c1_ascii_06
dc.b 'Blocks Used = $'
c1_res_used_06 dc.b 'FFFFFFFF'
dc.b $0d
c1_pcnt_06_0C equ *-c1_ascii_06
;===========================================================================
volume ;
DC.W ascii_08 ;ascii data to write.
DC.W size_08 ;length to write
DC.W word
DC.W err_08 ;error returned
DC.W pointer ;type = pointer
DC.W name_08 ;address of pathname pointer
DC.W pointer ;type = pointer
DC.W vol_name_08 ;address of pathname pointer
DC.W lword
DC.W blocks_08
DC.W lword
DC.W free_blocks_08
DC.W word
DC.W file_sys_08
DC.W $FFFF ;end of table
ascii_08 ;
DC.B 'Call = VOLUME'
DC.B $0D
DC.B 'Error Code = $'
err_08 DC.B 'FFFF'
DC.B $0D
DC.B 'Pathname ptr = $'
name_08 DC.B '00FFFFFF'
DC.B $0D
DC.B 'Volume name ptr = $'
vol_name_08 DC.B '00FFFFFF'
DC.B $0D
DC.B 'Total Blocks = $'
blocks_08 DC.B 'FFFFFFFF'
DC.B $0D
DC.B 'Free Blocks = $'
Free_blocks_08 DC.B 'FFFFFFFF'
DC.B $0D
DC.B 'File Sys ID = $'
file_sys_08 DC.B 'FFFF'
DC.B $0D
DC.B $0D
size_08 equ *-ascii_08
;===========================================================================
c1_volume
DC.W c1_ascii_08 ;ascii data to write.
DC.W c1_volume_pcnt
DC.W word
DC.W c1_err_08 ;error returned
dc.w word
dc.w c1_pcnt_08
DC.W pointer ;type = pointer
DC.W c1_name_08 ;address of pathname pointer
DC.W pointer ;type = pointer
DC.W c1_vol_name_08 ;address of pathname pointer
DC.W lword
DC.W c1_blocks_08
DC.W lword
DC.W c1_free_blocks_08
DC.W word
DC.W c1_file_sys_08
dc.w word
dc.w c1_blk_size_08
DC.W $FFFF ;end of table
c1_volume_pcnt dc.w $0006
dc.w $0000
dc.w c1_pcnt_08_02 ;minimum PCount
dc.w c1_pcnt_08_03
dc.w c1_pcnt_08_04
dc.w c1_pcnt_08_05
dc.w c1_pcnt_08_06
c1_ascii_08
DC.B 'Call = VOLUME'
DC.B $0D
DC.B 'Error Code = $'
c1_err_08 DC.B 'FFFF'
DC.B $0D
dc.b 'PCount = $'
c1_pcnt_08 dc.b 'FFFF'
dc.b $0D
DC.B 'Pathname ptr = $'
c1_name_08 DC.B '00FFFFFF'
DC.B $0D
DC.B 'Volume name ptr = $'
c1_vol_name_08 DC.B '00FFFFFF'
DC.B $0D
c1_pcnt_08_02 equ *-c1_ascii_08
DC.B 'Total Blocks = $'
c1_blocks_08 DC.B 'FFFFFFFF'
DC.B $0D
c1_pcnt_08_03 equ *-c1_ascii_08
DC.B 'Free Blocks = $'
c1_Free_blocks_08 DC.B 'FFFFFFFF'
DC.B $0D
c1_pcnt_08_04 equ *-c1_ascii_08
DC.B 'File Sys ID = $'
c1_file_sys_08 DC.B 'FFFF'
DC.B $0D
c1_pcnt_08_05 equ *-c1_ascii_08
dc.b 'Block Size = $'
c1_blk_size_08 dc.b 'FFFF'
DC.B $0D
c1_pcnt_08_06 equ *-c1_ascii_08
;===========================================================================
clear_backup ;
DC.W ascii_0B ;pointer to ascii data
DC.W size_0B
DC.W word
DC.W err_0b ;error returned
DC.W pointer ;type = pointer
DC.W path_0B
DC.W $FFFF
ascii_0B ;
DC.B 'Call = CLEAR BACKUP BIT'
DC.B $0D
DC.B 'Error Code = $'
err_0b DC.B 'FFFF'
DC.B $0D
DC.B 'Pathname ptr = $'
path_0B DC.B '00FFFFFF'
DC.B $0D
DC.B $0D
size_0B equ *-ascii_0B
;===========================================================================
c1_clear_backup ;
DC.W c1_ascii_0B ;pointer to ascii data
DC.W c1_clear_pcnt
DC.W word
DC.W c1_err_0b ;error returned
dc.w word
dc.w c1_pcnt_0b
DC.W pointer ;type = pointer
DC.W c1_path_0B
DC.W $FFFF
c1_clear_pcnt dc.w $0001
dc.w c1_pcnt_0b_01
c1_ascii_0B
DC.B 'Call = CLEAR BACKUP BIT'
DC.B $0D
DC.B 'Error Code = $'
c1_err_0b DC.B 'FFFF'
DC.B $0D
dc.b 'PCount = $'
c1_pcnt_0b dc.b 'FFFF'
dc.b $0D
DC.B 'Pathname ptr = $'
c1_path_0B DC.B '00FFFFFF'
DC.B $0D
c1_pcnt_0b_01 equ *-c1_ascii_0B
;===========================================================================
open
DC.W ascii_10 ;pointer to ascii data
DC.W size_10
DC.W word
DC.W err_10 ;error returned
DC.W word
DC.W ref_10
DC.W pointer ;type = pointer
DC.W path_10
DC.W lword
DC.W reserved_10
DC.W $FFFF
ascii_10
DC.B 'Call = OPEN'
DC.B $0D
DC.B 'Error Code = $'
err_10 DC.B 'FFFF'
DC.B $0D
DC.B 'Reference number = $'
ref_10 DC.B 'FFFF'
DC.B $0D
DC.B 'Pathname ptr = $'
path_10 DC.B '00FFFFFF'
DC.B $0D
DC.B 'RESERVED = $'
reserved_10 DC.B 'FFFFFFFF'
DC.B $0D
DC.B $0D
size_10 equ *-ascii_10
;===========================================================================
c1_open
DC.W c1_ascii_10 ;ascii data to write.
DC.W c1_open_pcnt
DC.W word
DC.W c1_err_10 ;error returned
dc.w word
dc.w c1_pcnt_10
dc.w word
dc.w c1_ref_num_10 ;open ref num
DC.W pointer ;type = pointer
DC.W c1_name_10 ;address of pathname pointer
dc.w word
dc.w c1_req_acc_10
dc.w word
dc.w c1_res_num_10
DC.W word ;type = word
DC.W c1_access_10
DC.W word
DC.W c1_file_type_10
DC.W lword
DC.W c1_aux_type_10
DC.W word
DC.W c1_storage_10
DC.W eight
DC.W c1_create_10
DC.W eight
DC.W c1_mod_10
DC.W lword
DC.W c1_opt_10
dc.w lword
dc.w c1_data_eof_10
dc.w lword
dc.w c1_data_used_10
dc.w lword
dc.w c1_res_eof_10
dc.w lword
dc.w c1_res_used_10
DC.W $FFFF ;end of table
c1_open_pcnt dc.w $000F
dc.w $0000 ;no pcount of 1 allowed
dc.w c1_pcnt_10_1
dc.w c1_pcnt_10_2
dc.w c1_pcnt_10_3
dc.w c1_pcnt_10_02
dc.w c1_pcnt_10_03
dc.w c1_pcnt_10_04
dc.w c1_pcnt_10_05
dc.w c1_pcnt_10_06
dc.w c1_pcnt_10_07
dc.w c1_pcnt_10_08
dc.w c1_pcnt_10_09
dc.w c1_pcnt_10_0A
dc.w c1_pcnt_10_0B
dc.w c1_pcnt_10_0C
c1_ascii_10 ;
DC.B 'Call = OPEN'
DC.B $0D
DC.B 'Error Code = $'
c1_err_10 DC.B 'FFFF'
DC.B $0D
dc.b 'PCount = $'
c1_pcnt_10 dc.b 'FFFF'
dc.b $0D
dc.b 'Reference number = $'
c1_ref_num_10 dc.b 'FFFF'
dc.b $0D
DC.B 'Pathname ptr = $'
c1_name_10 DC.B '00FFFFFF'
DC.B $0D
c1_pcnt_10_1 equ *-c1_ascii_10
dc.b 'Requested access = $'
c1_req_acc_10 dc.b 'FFFF'
dc.b $0D
c1_pcnt_10_2 equ *-c1_ascii_10
dc.b 'Data/Resource flag = $'
c1_res_num_10 dc.b 'FFFF'
dc.b $0D
c1_pcnt_10_3 equ *-c1_ascii_10
DC.B 'Access = $'
c1_access_10 DC.B 'FFFF'
DC.B $0D
c1_pcnt_10_02 equ *-c1_ascii_10
DC.B 'File Type = $'
c1_file_type_10 DC.B 'FFFF'
DC.B $0D
c1_pcnt_10_03 equ *-c1_ascii_10
DC.B 'Aux Type = $'
c1_aux_type_10 DC.B 'FFFFFFFF'
DC.B $0D
c1_pcnt_10_04 equ *-c1_ascii_10
DC.B 'Storage = $'
c1_storage_10 DC.B 'FFFF'
DC.B $0D
c1_pcnt_10_05 equ *-c1_ascii_10
DC.B 'Create Date = $'
c1_create_10 DC.B 'FFFFFFFFFFFFFFFF'
DC.B $0D
c1_pcnt_10_06 equ *-c1_ascii_10
DC.B 'Mod. Date = $'
c1_Mod_10 DC.B 'FFFFFFFFFFFFFFFF'
DC.B $0D
c1_pcnt_10_07 equ *-c1_ascii_10
dc.b 'Option List = $'
c1_opt_10 dc.b 'FFFFFFFF'
dc.b $0D
c1_pcnt_10_08 equ *-c1_ascii_10
dc.b 'Data Fork EOF = $'
c1_data_eof_10 dc.b 'FFFFFFFF'
dc.b $0d
c1_pcnt_10_09 equ *-c1_ascii_10
dc.b 'Blocks Used = $'
c1_data_used_10 dc.b 'FFFFFFFF'
dc.b $0d
c1_pcnt_10_0A equ *-c1_ascii_10
dc.b 'Resource Fork EOF = $'
c1_res_eof_10 dc.b 'FFFFFFFF'
dc.b $0d
c1_pcnt_10_0B equ *-c1_ascii_10
dc.b 'Blocks Used = $'
c1_res_used_10 dc.b 'FFFFFFFF'
dc.b $0d
c1_pcnt_10_0C equ *-c1_ascii_10
;===========================================================================
read ;
DC.W ascii_12 ;ascii data to write.
DC.W size_12 ;length to write
DC.W word
DC.W err_12 ;error returned
DC.W word
DC.W ref_12
DC.W pointer ;type = pointer
DC.W data_buf_12
DC.W lword
DC.W req_12
DC.W lword
DC.W tran_12
DC.W $FFFF ;end of table
ascii_12 ;
DC.B 'Call = READ'
DC.B $0D
DC.B 'Error Code = $'
err_12 DC.B 'FFFF'
DC.B $0D
DC.B 'Reference Number = $'
ref_12 DC.B 'FFFF'
DC.B $0D
DC.B 'Data Buffer ptr = $'
data_buf_12 DC.B '00FFFFFF'
DC.B $0D
DC.B 'Request Count = $'
req_12 DC.B 'FFFFFFFF'
DC.B $0D
DC.B 'Transfer Count = $'
tran_12 DC.B 'FFFFFFFF'
DC.B $0D
DC.B $0D
size_12 equ *-ascii_12
;===========================================================================
c1_read
DC.W c1_ascii_12 ;ascii data to write.
DC.W c1_read_pcnt ;length to write
DC.W word
DC.W c1_err_12 ;error returned
dc.w word
dc.w c1_pcnt_12
DC.W word
DC.W c1_ref_12
DC.W pointer ;type = pointer
DC.W c1_data_buf_12
DC.W lword
DC.W c1_req_12
DC.W lword
DC.W c1_tran_12
dc.w word
dc.w c1_cache_12
DC.W $FFFF ;end of table
c1_read_pcnt dc.w $0005
dc.w 0000 ;no PCount of one
dc.w 0000
dc.w 0000
dc.w c1_pcnt_12_04
dc.w c1_pcnt_12_05
c1_ascii_12
DC.B 'Call = READ'
DC.B $0D
DC.B 'Error Code = $'
c1_err_12 DC.B 'FFFF'
DC.B $0D
dc.b 'PCount = $'
c1_pcnt_12 dc.b 'FFFF'
dc.b $0D
DC.B 'Reference Number = $'
c1_ref_12 DC.B 'FFFF'
DC.B $0D
DC.B 'Data Buffer ptr = $'
c1_data_buf_12 DC.B '00FFFFFF'
DC.B $0D
DC.B 'Request Count = $'
c1_req_12 DC.B 'FFFFFFFF'
DC.B $0D
DC.B 'Transfer Count = $'
c1_tran_12 DC.B 'FFFFFFFF'
DC.B $0D
c1_pcnt_12_04 equ *-c1_ascii_12
dc.b 'Cache Priority = $'
c1_cache_12 dc.b 'FFFF'
dc.b $0D
c1_pcnt_12_05 equ *-c1_ascii_12
;===========================================================================
write ;
DC.W ascii_13 ;ascii data to write.
DC.W size_13 ;length to write
DC.W word
DC.W err_13 ;error returned
DC.W word
DC.W ref_13
DC.W pointer ;type = pointer
DC.W data_buf_13
DC.W lword
DC.W req_13
DC.W lword
DC.W tran_13
DC.W $FFFF ;end of table
ascii_13 ;
DC.B 'Call = WRITE'
DC.B $0D
DC.B 'Error Code = $'
err_13 DC.B 'FFFF'
DC.B $0D
DC.B 'Reference Number = $'
ref_13 DC.B 'FFFF'
DC.B $0D
DC.B 'Data Buffer ptr = $'
data_buf_13 DC.B '00FFFFFF'
DC.B $0D
DC.B 'Request Count = $'
req_13 DC.B 'FFFFFFFF'
DC.B $0D
DC.B 'Transfer Count = $'
tran_13 DC.B 'FFFFFFFF'
DC.B $0D
DC.B $0D
size_13 equ *-ascii_13
;===========================================================================
c1_write
DC.W c1_ascii_13 ;ascii data to write.
DC.W c1_write_pcnt ;length to write
DC.W word
DC.W c1_err_13 ;error returned
dc.w word
dc.w c1_pcnt_13
DC.W word
DC.W c1_ref_13
DC.W pointer ;type = pointer
DC.W c1_data_buf_13
DC.W lword
DC.W c1_req_13
DC.W lword
DC.W c1_tran_13
dc.w word
dc.w c1_cache_13
DC.W $FFFF ;end of table
c1_write_pcnt dc.w $0005
dc.w 0000
dc.w 0000
dc.w 0000
dc.w c1_pcnt_13_04
dc.w c1_pcnt_13_05
c1_ascii_13
DC.B 'Call = WRITE'
DC.B $0D
DC.B 'Error Code = $'
c1_err_13 DC.B 'FFFF'
DC.B $0D
dc.b 'PCount = $'
c1_pcnt_13 dc.b 'FFFF'
dc.b $0d
DC.B 'Reference Number = $'
c1_ref_13 DC.B 'FFFF'
DC.B $0D
DC.B 'Data Buffer ptr = $'
c1_data_buf_13 DC.B '00FFFFFF'
DC.B $0D
DC.B 'Request Count = $'
c1_req_13 DC.B 'FFFFFFFF'
DC.B $0D
DC.B 'Transfer Count = $'
c1_tran_13 DC.B 'FFFFFFFF'
DC.B $0D
c1_pcnt_13_04 equ *-c1_ascii_13
dc.b 'Cache Priority = $'
c1_cache_13 dc.b 'FFFF'
dc.b $0D
c1_pcnt_13_05 equ *-c1_ascii_13
;===========================================================================
close ;
DC.W ascii_14 ;ascii data to write.
DC.W size_14 ;length to write
DC.W word
DC.W err_14 ;error returned
DC.W word
DC.W ref_14
DC.W $FFFF ;end of table
ascii_14 ;
DC.B 'Call = CLOSE'
DC.B $0D
DC.B 'Error Code = $'
err_14 DC.B 'FFFF'
DC.B $0D
DC.B 'Reference Number = $'
ref_14 DC.B '00FF'
DC.B $0D
DC.B $0D
size_14 equ *-ascii_14
;===========================================================================
c1_close ;
DC.W c1_ascii_14 ;ascii data to write.
DC.W c1_pcnt_close
DC.W word
DC.W c1_err_14 ;error returned
dc.w word
dc.w c1_pcnt_14
DC.W word
DC.W c1_ref_14
DC.W $FFFF ;end of table
c1_pcnt_close dc.w $0001
dc.w c1_pcnt_14_01
c1_ascii_14 ;
DC.B 'Call = CLOSE'
DC.B $0D
DC.B 'Error Code = $'
c1_err_14 DC.B 'FFFF'
DC.B $0D
dc.b 'PCount = $'
c1_pcnt_14 dc.b 'FFFF'
dc.b $0D
DC.B 'Reference Number = $'
c1_ref_14 DC.B '00FF'
DC.B $0D
c1_pcnt_14_01 equ *-c1_ascii_14
;===========================================================================
flush ;
DC.W ascii_15 ;ascii data to write.
DC.W size_15 ;length to write
DC.W word
DC.W err_15 ;error returned
DC.W word
DC.W ref_15
DC.W $FFFF ;end of table
ascii_15 ;
DC.B 'Call = FLUSH'
DC.B $0D
DC.B 'Error Code = $'
err_15 DC.B 'FFFF'
DC.B $0D
DC.B 'Reference Number = $'
ref_15 DC.B '00FF'
DC.B $0D
DC.B $0D
size_15 equ *-ascii_15
;===========================================================================
c1_flush ;
DC.W c1_ascii_15 ;ascii data to write.
DC.W c1_pcnt_flush
DC.W word
DC.W c1_err_15 ;error returned
dc.w word
dc.w c1_pcnt_15
DC.W word
DC.W c1_ref_15
DC.W $FFFF ;end of table
c1_pcnt_flush dc.w $0001
dc.w c1_pcnt_15_01
c1_ascii_15 ;
DC.B 'Call = FLUSH'
DC.B $0D
DC.B 'Error Code = $'
c1_err_15 DC.B 'FFFF'
DC.B $0D
dc.b 'PCount = $'
c1_pcnt_15 dc.b 'FFFF'
dc.b $0D
DC.B 'Reference Number = $'
c1_ref_15 DC.B '00FF'
DC.B $0D
c1_pcnt_15_01 equ *-c1_ascii_15
;===========================================================================
set_mark
DC.W ascii_16 ;ascii data to write.
DC.W size_16 ;length to write
DC.W word
DC.W err_16 ;error returned
DC.W word
DC.W ref_16
DC.W lword
DC.W pos_16
DC.W $FFFF ;end of table
ascii_16 ;
DC.B 'Call = SET MARK'
DC.B $0D
DC.B 'Error Code = $'
err_16 DC.B 'FFFF'
DC.B $0D
DC.B 'Reference Number = $'
ref_16 DC.B 'FFFF'
DC.B $0D
DC.B 'Position = $'
pos_16 DC.B 'FFFFFFFF'
DC.B $0D
DC.B $0D
size_16 equ *-ascii_16
;===========================================================================
c1_set_mark
DC.W c1_ascii_16 ;ascii data to write.
DC.W c1_pcnt_set_mark
DC.W word
DC.W c1_err_16 ;error returned
dc.w word
dc.w c1_pcnt_16
DC.W word
DC.W c1_ref_16
dc.w word
dc.w c1_base_16
DC.W lword
DC.W c1_pos_16
DC.W $FFFF ;end of table
c1_pcnt_set_mark dc.w $0003
dc.w 0000
dc.w 0000
dc.w c1_pcnt_16_03
c1_ascii_16 ;
DC.B 'Call = SET MARK'
DC.B $0D
DC.B 'Error Code = $'
c1_err_16 DC.B 'FFFF'
DC.B $0D
DC.B 'Reference Number = $'
c1_ref_16 DC.B 'FFFF'
DC.B $0D
dc.b 'PCount = $'
c1_pcnt_16 dc.b 'FFFF'
dc.b $0D
dc.b 'Base = $'
c1_base_16 dc.b 'FFFF'
dc.b $0D
DC.B 'Displacement = $'
c1_pos_16 DC.B 'FFFFFFFF'
DC.B $0D
c1_pcnt_16_03 equ *-c1_ascii_16
;===========================================================================
get_mark ;
DC.W ascii_17 ;ascii data to write.
DC.W size_17 ;length to write
DC.W word
DC.W err_17 ;error returned
DC.W word
DC.W ref_17
DC.W lword
DC.W pos_17
DC.W $FFFF ;end of table
ascii_17 ;
DC.B 'Call = GET_MARK'
DC.B $0D
DC.B 'Error Code = $'
err_17 DC.B 'FFFF'
DC.B $0D
DC.B 'Reference Number = $'
ref_17 DC.B 'FFFF'
DC.B $0D
DC.B 'Position = $'
pos_17 DC.B 'FFFFFFFF'
DC.B $0D
DC.B $0D
size_17 equ *-ascii_17
;===========================================================================
c1_get_mark
DC.W c1_ascii_17 ;ascii data to write.
DC.W c1_pcnt_get_mark
DC.W word
DC.W c1_err_17 ;error returned
dc.w word
dc.w c1_pcnt_17
DC.W word
DC.W c1_ref_17
DC.W lword
DC.W c1_pos_17
DC.W $FFFF ;end of table
c1_pcnt_get_mark dc.w $0002
dc.w 0000
dc.w c1_pcnt_17_02
c1_ascii_17 ;
DC.B 'Call = GET_MARK'
DC.B $0D
DC.B 'Error Code = $'
c1_err_17 DC.B 'FFFF'
DC.B $0D
dc.b 'PCount = $'
c1_pcnt_17 dc.b 'FFFF'
dc.b $0D
DC.B 'Reference Number = $'
c1_ref_17 DC.B 'FFFF'
DC.B $0D
DC.B 'Position = $'
c1_pos_17 DC.B 'FFFFFFFF'
DC.B $0D
c1_pcnt_17_02 equ *-c1_ascii_17
;===========================================================================
set_EOF ;
DC.W ascii_18 ;ascii data to write.
DC.W size_18 ;length to write
DC.W word
DC.W err_18 ;error returned
DC.W word
DC.W ref_18
DC.W lword
DC.W pos_18
DC.W $FFFF ;end of table
ascii_18 ;
DC.B 'Call = SET EOF'
DC.B $0D
DC.B 'Error Code = $'
err_18 DC.B 'FFFF'
DC.B $0D
DC.B 'Reference Number = $'
ref_18 DC.B 'FFFF'
DC.B $0D
DC.B 'Position = $'
pos_18 DC.B 'FFFFFFFF'
DC.B $0D
DC.B $0D
size_18 equ *-ascii_18
;===========================================================================
c1_set_EOF
DC.W c1_ascii_18 ;ascii data to write.
DC.W c1_pcnt_set_eof
DC.W word
DC.W c1_err_18 ;error returned
dc.w word
dc.w c1_pcnt_18
DC.W word
DC.W c1_ref_18
dc.w word
dc.w c1_base_18
DC.W lword
DC.W c1_pos_18
DC.W $FFFF ;end of table
c1_pcnt_set_eof dc.w 0003
dc.w 0000
dc.w 0000
dc.w c1_pcnt_18_03
c1_ascii_18 ;
DC.B 'Call = SET EOF'
DC.B $0D
DC.B 'Error Code = $'
c1_err_18 DC.B 'FFFF'
DC.B $0D
dc.b 'PCount = $'
c1_pcnt_18 dc.b 'FFFF'
dc.b $0D
DC.B 'Reference Number = $'
c1_ref_18 DC.B 'FFFF'
DC.B $0D
dc.b 'Base = $'
c1_base_18 dc.b 'FFFF'
dc.b $0D
DC.B 'Displacemet = $'
c1_pos_18 DC.B 'FFFFFFFF'
DC.B $0D
c1_pcnt_18_03 equ *-c1_ascii_18
;===========================================================================
get_EOF ;
DC.W ascii_19 ;ascii data to write.
DC.W size_19 ;length to write
DC.W word
DC.W err_19 ;error returned
DC.W word
DC.W ref_19
DC.W lword
DC.W pos_19
DC.W $FFFF ;end of table
ascii_19 ;
DC.B 'Call = GET EOF'
DC.B $0D
DC.B 'Error Code = $'
err_19 DC.B 'FFFF'
DC.B $0D
DC.B 'Reference Number = $'
ref_19 DC.B 'FFFF'
DC.B $0D
DC.B 'Position = $'
pos_19 DC.B 'FFFFFFFF'
DC.B $0D
DC.B $0D
size_19 equ *-ascii_19
;===========================================================================
c1_get_EOF ;
DC.W c1_ascii_19 ;ascii data to write.
DC.W c1_pcnt_get_eof
DC.W word
DC.W c1_err_19 ;error returned
dc.w word
dc.w c1_pcnt_19
DC.W word
DC.W c1_ref_19
DC.W lword
DC.W c1_pos_19
DC.W $FFFF ;end of table
c1_pcnt_get_eof dc.w $0002
dc.w 0000
dc.w c1_pcnt_19_02
c1_ascii_19 ;
DC.B 'Call = GET EOF'
DC.B $0D
DC.B 'Error Code = $'
c1_err_19 DC.B 'FFFF'
DC.B $0D
dc.b 'PCount = $'
c1_pcnt_19 dc.b 'FFFF'
dc.b $0D
DC.B 'Reference Number = $'
c1_ref_19 DC.B 'FFFF'
DC.B $0D
DC.B 'EOF = $'
c1_pos_19 DC.B 'FFFFFFFF'
DC.B $0D
c1_pcnt_19_02 equ *-c1_ascii_19
;===========================================================================
get_dir_entry ;
DC.W ascii_1C
DC.W size_1c
DC.W word
DC.W err_1c
DC.W word
DC.W ref_1c
DC.W word
DC.W flag_1c
DC.W word
DC.W base_1c
DC.W word
DC.W disp_1c
DC.W pointer
DC.W ptr_1c
DC.W word
DC.W entry_1c
DC.W word
DC.W file_type_1c
DC.W lword
DC.W eof_1c
DC.W lword
DC.W blks_1c
DC.W eight
DC.W create_1c
DC.W eight
DC.W mod_1c
DC.W word
DC.W access_1c
DC.W lword
DC.W aux_1c
DC.W word
DC.W file_sys_1c
DC.W $FFFF
ascii_1c ;
DC.B 'Call = GET DIR ENTRY'
DC.B $0D
DC.B 'Error Code = $'
err_1c DC.B 'FFFF'
DC.B $0D
DC.B 'Reference Number = $'
ref_1c DC.B 'FFFF'
DC.B $0D
DC.B 'Flags = $'
flag_1c DC.B 'FFFF'
DC.B $0D
DC.B 'Base = $'
base_1c DC.B 'FFFF'
DC.B $0D
DC.B 'Displacement = $'
disp_1c DC.B 'FFFF'
DC.B $0D
DC.B 'Pathname Ptr = $'
ptr_1c DC.B 'FFFFFFFF'
DC.B $0D
DC.B 'Absolute Entry Num = $'
entry_1c DC.B 'FFFF'
DC.B $0D
DC.B 'File Type = $'
file_type_1c DC.B 'FFFF'
DC.B $0D
DC.B 'EOF = $'
eof_1c DC.B 'FFFFFFFF'
DC.B $0D
DC.B 'Blocks Used = $'
blks_1c DC.B 'FFFFFFFF'
DC.B $0D
DC.B 'Create Date = $'
create_1c DC.B 'FFFFFFFFFFFFFFFF'
DC.B $0D
DC.B 'Mod Date = $'
mod_1c DC.B 'FFFFFFFFFFFFFFFF'
DC.B $0D
DC.B 'Access = $'
access_1c DC.B 'FFFF'
DC.B $0d
DC.B 'Aux Type = $'
aux_1c DC.B 'FFFFFFFF'
DC.B $0D
DC.B 'File Sys = $'
file_sys_1c DC.B 'FFFF'
DC.B $0D
DC.B $0D
size_1c equ *-ascii_1c
;===========================================================================
c1_get_dir_entry ;
DC.W c1_ascii_1C
DC.W c1_pcnt_get_dir
DC.W word
DC.W c1_err_1c
dc.w word
dc.w c1_pcnt_1c
DC.W word
DC.W c1_ref_1c
DC.W word
DC.W c1_flag_1c
DC.W word
DC.W c1_base_1c
DC.W word
DC.W c1_disp_1c
DC.W pointer
DC.W c1_ptr_1c
DC.W word
DC.W c1_entry_1c
DC.W word
DC.W c1_file_type_1c
DC.W lword
DC.W c1_eof_1c
DC.W lword
DC.W c1_blks_1c
DC.W eight
DC.W c1_create_1c
DC.W eight
DC.W c1_mod_1c
DC.W word
DC.W c1_access_1c
DC.W lword
DC.W c1_aux_1c
DC.W word
DC.W c1_file_sys_1c
DC.W $FFFF
c1_pcnt_get_dir dc.w $000E
dc.w 0
dc.w 0
dc.w 0
dc.w 0
dc.w c1_pcnt_1c_05
dc.w c1_pcnt_1c_06
dc.w c1_pcnt_1c_07
dc.w c1_pcnt_1c_08
dc.w c1_pcnt_1c_09
dc.w c1_pcnt_1c_0A
dc.w c1_pcnt_1c_0B
dc.w c1_pcnt_1c_0C
dc.w c1_pcnt_1c_0D
dc.w c1_pcnt_1c_0E
c1_ascii_1c ;
DC.B 'Call = GET DIR ENTRY'
DC.B $0D
DC.B 'Error Code = $'
c1_err_1c DC.B 'FFFF'
DC.B $0D
dc.b 'PCount = $'
c1_pcnt_1c dc.b 'FFFF'
dc.b $0D
DC.B 'Reference Number = $'
c1_ref_1c DC.B 'FFFF'
DC.B $0D
DC.B 'Flags = $'
c1_flag_1c DC.B 'FFFF'
DC.B $0D
DC.B 'Base = $'
c1_base_1c DC.B 'FFFF'
DC.B $0D
DC.B 'Displacement = $'
c1_disp_1c DC.B 'FFFF'
DC.B $0D
DC.B 'Pathname Ptr = $'
c1_ptr_1c DC.B 'FFFFFFFF'
DC.B $0D
c1_pcnt_1c_05 equ *-c1_ascii_1c
DC.B 'Absolute Entry Num = $'
c1_entry_1c DC.B 'FFFF'
DC.B $0D
c1_pcnt_1c_06 equ *-c1_ascii_1c
DC.B 'File Type = $'
c1_file_type_1c DC.B 'FFFF'
DC.B $0D
c1_pcnt_1c_07 equ *-c1_ascii_1c
DC.B 'EOF = $'
c1_eof_1c DC.B 'FFFFFFFF'
DC.B $0D
c1_pcnt_1c_08 equ *-c1_ascii_1c
DC.B 'Blocks Used = $'
c1_blks_1c DC.B 'FFFFFFFF'
DC.B $0D
c1_pcnt_1c_09 equ *-c1_ascii_1c
DC.B 'Create Date = $'
c1_create_1c DC.B 'FFFFFFFFFFFFFFFF'
DC.B $0D
c1_pcnt_1c_0A equ *-c1_ascii_1c
DC.B 'Mod Date = $'
c1_mod_1c DC.B 'FFFFFFFFFFFFFFFF'
DC.B $0D
c1_pcnt_1c_0B equ *-c1_ascii_1c
DC.B 'Access = $'
c1_access_1c DC.B 'FFFF'
DC.B $0d
c1_pcnt_1c_0C equ *-c1_ascii_1c
DC.B 'Aux Type = $'
c1_aux_1c DC.B 'FFFFFFFF'
DC.B $0D
c1_pcnt_1c_0D equ *-c1_ascii_1c
DC.B 'File Sys = $'
c1_file_sys_1c DC.B 'FFFF'
DC.B $0D
c1_pcnt_1c_0E equ *-c1_ascii_1c
;===========================================================================
get_dev_num ;
DC.W ascii_20 ;ascii data to write.
DC.W size_20 ;length to write
DC.W word
DC.W err_20 ;error returned
DC.W pointer
DC.W path_20
DC.W word
DC.W dev_num_20
DC.W $FFFF ;end of table
ascii_20 ;
DC.B 'Call = GET DEV NUM'
DC.B $0D
DC.B 'Error Code = $'
err_20 DC.B 'FFFF'
DC.B $0D
DC.B 'Dev Name Ptr = $'
path_20 DC.B '00FFFFFF'
DC.B $0D
DC.B 'Device Number = $'
dev_num_20 DC.B 'FFFF'
DC.B $0D
DC.B $0D
size_20 equ *-ascii_20
;===========================================================================
c1_get_dev_num ;
DC.W c1_ascii_20 ;ascii data to write.
DC.W c1_pcnt_get_dev
DC.W word
DC.W c1_err_20 ;error returned
dc.w word
dc.w c1_pcnt_20
DC.W pointer
DC.W c1_path_20
DC.W word
DC.W c1_dev_num_20
DC.W $FFFF ;end of table
c1_pcnt_get_dev dc.w $0002
dc.w 0000
dc.w c1_pcnt_20_02
c1_ascii_20 ;
DC.B 'Call = GET DEV NUM'
DC.B $0D
DC.B 'Error Code = $'
c1_err_20 DC.B 'FFFF'
DC.B $0D
dc.b 'PCount = $'
c1_pcnt_20 dc.b 'FFFF'
dc.b $0D
DC.B 'Dev Name Ptr = $'
c1_path_20 DC.B '00FFFFFF'
DC.B $0D
DC.B 'Device Number = $'
c1_dev_num_20 DC.B 'FFFF'
DC.B $0D
DC.B $0D
c1_pcnt_20_02 equ *-c1_ascii_20
;===========================================================================
read_block ;
DC.W ascii_22 ;ascii data to write.
DC.W size_22 ;length to write
DC.W word
DC.W err_22 ;error returned
DC.W word
DC.W dev_num_22
DC.W pointer
DC.W data_buf_22
DC.W lword
DC.W blk_num_22
DC.W $FFFF ;end of table
ascii_22 ;
DC.B 'Call = READ BLOCK'
DC.B $0D
DC.B 'Error Code = $'
err_22 DC.B 'FFFF'
DC.B $0D
DC.B 'Device Number = $'
dev_num_22 DC.B 'FFFF'
DC.B $0D
DC.B 'Data Buffer = $'
data_buf_22 DC.B 'FFFFFFFF'
DC.B $0D
DC.B 'Block Number = $'
blk_num_22 DC.B 'FFFF'
DC.B $0D
DC.B $0D
size_22 equ *-ascii_22
;===========================================================================
write_block ;
DC.W ascii_23 ;ascii data to write.
DC.W size_23 ;length to write
DC.W word
DC.W err_23 ;error returned
DC.W word
DC.W dev_num_23
DC.W pointer
DC.W data_buf_23
DC.W lword
DC.W blk_num_23
DC.W $FFFF ;end of table
ascii_23 ;
DC.B 'Call = WRITE BLOCK'
DC.B $0D
DC.B 'Error Code = $'
err_23 DC.B 'FFFF'
DC.B $0D
DC.B 'Device Number = $'
dev_num_23 DC.B 'FFFF'
DC.B $0D
DC.B 'Data Buffer = $'
data_buf_23 DC.B 'FFFFFFFF'
DC.B $0D
DC.B 'Block Number = $'
blk_num_23 DC.B 'FFFF'
DC.B $0D
DC.B $0D
size_23 equ *-ascii_23
name_buffer DS.B 256 ;save room for the name
call_class dc.w 00
pcount dc.w 00
path_addr dc.l 00
hold_stack dc.w 00
hold_dp dc.w 00
zp_handle dc.l 00
last_dev_acc dc.w 00
;===========================================================================
bug_routine
longa on
longi on
rep #$30 ;set 16 bit mode
lda #$0001 ;priority 1
ldx #signal_handler
ldy #^signal_handler
jsl signal
rts
signal_handler
longa on
longi on
tsc ;save stack pointer
sta >hold_stack ;save the stack please
lda >$00BD00 ;last accessed device
sta >last_dev_acc ;save the last device accessed
pea $0000 ;push space for result
pea $0000
pea $0000 ;high word of zero
lda #$0100 ;allocate 256 bytes please
pha
pea $300f ;user id
pea %1100000000010101
pea $0000
pea $0000
ldx #$0902 ;allocate a handle
jsl $e10000
lda #$bd00 ;gs/os direct page
tcd
pla ;no error checking.
sta >zp_handle
sta 00
pla
sta >zp_handle+2
sta 02
ldy #$0002 ;get the address of my memory
lda [00],y ;get the high word
beq @good_addr
brk $BA
@good_addr
lda [00]
bne @great
brk $BB
@great
tcd ;our new direct page
clc
adc #$00FE ;make a new stack please
tcs ;we now have a new stack
;========== At this point we now have our own stack and direct page ==================
phk
plb ;set our bank register
php ;save the process state
cli ;I could be killed for this!!!
phk
phk
pla
and #$00FF
sta bank9
sta table_ptr+2
sta entry_ptr+2
sta temp2_ptr+2
sta ascii_ptr+2
stz debug_flag ;turn off debug please
lda #^data_start ;start of debug data
sta zp+2
lda #data_start
sta zp
ldy #$0002
lda #$0000
sta [zp]
sta [zp],y
jsr send_debug ;send the debug info please
lda #$FFFF ;re-enable debug
sta debug_flag
plp ;restore processor status
lda zp_handle+2
pha
lda zp_handle
pha
ldx #$1002
jsl $e10000 ;release my stack and direct page
lda >last_dev_acc ;restore the last device accessed for Apps
sta >$00BD00 ;restore last device accessed
lda >hold_stack ;restore the stack please
tcs
rtl ;restore to GS/OS
save_zp
pea $0000 ;push space for result
pea $0000
pea $0000 ;high word of zero
lda #$0100 ;allocate 256 bytes please
pha
pea $300f ;user id
pea %1100000000010101
pea $0000
pea $0000
ldx #$0902 ;allocate a handle
jsl $e10000
lda #$bd00 ;gs/os direct page
tcd
pla ;no error checking.
sta zp_handle
sta 00
pla
sta zp_handle+2
sta 02
ldy #$0002 ;get the address of my memory
lda [00],y ;get the high word
beq @good_addr
brk $BA
@good_addr
lda [00]
bne @great
brk $BB
@great
tcd ;our new direct page
rts
restore_zp
lda zp_handle+2
pha
lda zp_handle
pha
ldx #$1002
jsl $e10000
rts
send_debug
lda #^data_start ;start of debug data
sta zp+2
sta temp_ptr+2
lda #data_start
sta zp
sta temp_ptr
lda open_list
sta write_list ;setup the reference number
sta write_ret_list
bra do_one
loop
jsr get_next_entry
bcs done
do_one
jsr process_entry
bcs done
bra loop
done
rts
;===========================================================================
get_next_entry ;
ldy #$0002
lda [zp],y
tax
lda [zp]
bne active
txy
beq not_active
active
pha
lda zp
sta temp_ptr ;return pointer to entry
lda zp+2
sta temp_ptr+2
pla
clc
adc zp
sta zp
txa
adc zp+2
sta zp+2
clc
rts
not_active ;
sec
rts
;===========================================================================
process_entry ;
stz call_class ;class 0 call
ldy #$0006 ;index to the call number
lda [temp_ptr],y
tax
and #$FF00 ;check the class
beq @class0 ;this is a class 0 call
lda [temp_ptr],y ;get the call again
and #$00FF
asl a
tax
lda class1_table-2,x
sta entry_ptr
dec call_class ;call class is 1
bra @common
@class0
txa
asl a ;times two for the word table
tax
lda class0_table-2,x
sta entry_ptr ;point to the entry to process
@common
iny
iny ;get the error code please
lda [temp_ptr],y
tax
iny
iny ;points to path flag
lda [temp_ptr],y
sta debug_path ;save the flag please
iny
iny
lda [temp_ptr],y
sta path_addr
iny
iny
lda [temp_ptr],y
sta path_addr+2
iny
iny ;points to the parameter block
phy ;save y please
ldy #$000C+4 ;pointer to PCount value
lda [temp_ptr],y
sta pcount
ply
tya
clc
adc temp_ptr ;make a pointer to param block
sta temp_ptr
lda #$0000
adc temp_ptr+2
sta temp_ptr+2
txa
jsr convert_error
lda [entry_ptr] ;get the address to write
sta write_data
lda call_class ;class 0 or one please
beq @standard
ldy #$0002
lda [entry_ptr],y ;get pointer to size table
sta temp2_ptr
lda [temp2_ptr]
cmp Pcount
bcc @use_max
lda Pcount
@use_max asl a ;time 2 for word table
tay
lda [temp2_ptr],y
sta write_count ;number of bytes to write
bra @continue
@standard
ldy #$0002 ;get the number of bytes to write for class 0
lda [entry_ptr],y
sta write_count
@continue
ldy #$0006 ;start of type,address -2
process_loop ;
iny
iny
lda [entry_ptr],y
cmp #$FFFF ;are we done?
beq write_to_file
tax ;save the type to process
iny
iny
lda [entry_ptr],y ;get the address to patch
jsr fill_entry ;fill the entry with data
bcs end_process
bra process_loop
to_end_process brl end_process
write_to_file ;
jsr write_file
bcc chk_path ;see if we need to write a path
rts
chk_path ;
jsr write_return
lda debug_path
beq end_process ;no Pathname to move
lda path_addr
sta temp_ptr
lda path_addr+2
sta temp_ptr+2
lda [temp_ptr] ;get the length please
tay ;save the length
inc a
inc a ;add in for return chars
sta write_count
iny
lda #$0D0D
sta name_buffer-1,y
dey
lda #name_buffer
sta write_data
inc temp_ptr
bne not_high
inc temp_ptr+2
not_high
longa off
sep #$20
name_loop ;
lda [temp_ptr],y
sta name_buffer-1,y
; cmp #':' ;is this a seperator
; bne no_delimiter
; lda #'/'
; sta name_buffer-1,y
no_delimiter ;
dey
bne name_loop
longa on
rep #$20
jsr write_file
jsr write_return
rts
end_process
clc
rts
convert_error ;
pha ;save the error code
ldy #$0006 ;get the address of ascii area
lda [entry_ptr],y
sta ascii_ptr
pla
jsr store_word
rts
longa on
longi on
fill_entry ;
phy ;save Y please
sta ascii_ptr ;pointer to the data area
txy ;use as index
fill_loop ;
lda [temp_ptr],y
phy
jsr store_word
ply
dey
dey
bpl fill_loop
clc
txa
adc #$0002
adc temp_ptr ;bump pointer by the number of bytes
sta temp_ptr ;converted to ascii.
lda #$0000
adc temp_ptr+2
sta temp_ptr+2
ply
clc
rts
store_word ;
sta temp
longa off
sep #$20
lda temp+1 ;high word the the error
jsr hex_convert
lda char_one
sta [ascii_ptr]
ldy #$0001
lda char_two
sta [ascii_ptr],y
lda temp
jsr hex_convert
iny
lda char_one
sta [ascii_ptr],y
iny
lda char_two
sta [ascii_ptr],y
longa on
rep #$20
clc
lda ascii_ptr ;move to next position
adc #$0004
sta ascii_ptr
rts
longa off
hex_convert ;
pha
lsr a
lsr a
lsr a
lsr a
jsr do_conv
sta char_one
pla
and #$0F
jsr do_conv
sta char_two
rts
do_conv cmp #$0A
bcc z29
adc #$36
rts
z29 ora #$30
rts
char_one DC.B 00
char_two DC.B 00
longa on
longi on
;===========================================================================
destroy_file ;
jsl $e100A8
DC.W $02
dc.l destroy_list
rts
destroy_list
dc.l pathname
;===========================================================================
create_file ;
jsl $e100a8
DC.W $01
dc.l create_list
rts
create_list
dc.l pathname
DC.W $E3
DC.W $04
DC.L 0
DC.W 0
DC.L 0
;===========================================================================
set_new_level
jsl $e100a8 ;call GS/OS
dc.w $1B ;get system level
dc.l level_list
lda level
sta close_level
inc level
bra set_the_level
set_old_level
lda close_level
sta level
set_the_level
jsl $e100a8
dc.w $1a
dc.l level_list
rts
level_list
level dc.w 00
close_level dc.w 00
;===========================================================================
open_file ;
jsl $e100A8
DC.W $10
dc.l open_list
rts
open_list ;
DC.W 00 ;reference number
dc.l pathname
DC.L 0000
string pascal
pathname DC.B 'DEBUG.FILE'
ds.b 256-10
string asis
;===========================================================================
write_file
jsl $e100a8
DC.W $13
dc.l write_list
bcc @no_error
cmp #$004E ;invalid access?
beq @re_open
cmp #$0043 ;invalid ref num?
bne @not_close
@re_open
jsr open_file ;reopen the file please
lda open_list ;setup the ref number again
sta write_list
sta write_ret_list
bra write_file
@not_close
sec
@no_error
rts
write_list
DC.W 00 ;reference number
write_data DC.W 000 ;data to write
bank9 DC.W 0000
write_count DC.L 00 ;bytes to write
DC.L 00 ;transfer count
write_return jsl $e100a8
dc.w $13
dc.l write_ret_list
rts
write_ret_list dc.w 00
dc.l ret_chars
dc.l 0001
dc.l 00
ret_chars
dc.b $0D
;===========================================================================
close_file ;
jsl $e100A8
DC.W $14 ;close the file please
dc.l open_list
rts
;===========================================================================
export fst_debug
fst_debug
ldy #$0004 ;index to command number
lda [param_blk_ptr],y
cmp #debugger_cmnd ;is this a start command
beq start_it_up
cmp #debugger_status ;should we stop
beq status_debugger
lda #invalid_fst_op
sec
rts
status_debugger
lda [param_blk_ptr] ;verify the Pcount
cmp #$0004
bne bad_pcnt
iny
iny ;point to the stamp size
lda debug_flag
sta [param_blk_ptr],y
iny
iny
lda #pathname
sta [param_blk_ptr],y
iny
iny
lda #^pathname
sta [param_blk_ptr],y
clc
rts
parm_range
lda #parm_range_err ;parameter out of range
bra error_out
bad_pcnt
lda #invalid_pcount
error_out
sec
rts
;==========================================================================
;This call allows the user to start the FST debugger running.
;
; pcount = 3 or 4
; fst_num
; command
; debug_flag $0000 = stop debug
; $FFFF = start debug
; debug_path pathname to output file
;==========================================================================
start_it_up
lda param_blk_ptr
sta users_pblk
lda param_blk_ptr+2
sta users_pblk+2
lda [param_blk_ptr] ;verify the Pcount
tax
cmp #$0006
bcs bad_pcnt
cmp #$0003
bcc bad_pcnt ;sorry to few
iny
iny ;point to the debug_flag field
lda [param_blk_ptr],y
sta debug_flag ;save the flag please
beq deactivate ;turn off debugging
cpx #$0004 ;is there a pathname?
bcc no_pathname ;user did not supply name
iny
iny ;get the pointer to the name
lda [param_blk_ptr],y
tax
iny
iny
lda [param_blk_ptr],y
tay
bne @good_ptr
txa
beq parm_range ;sorry a bad pointer
@good_ptr
stx temp_ptr
sty temp_ptr+2
lda [temp_ptr] ;get the size
and #$00FF
beq parm_range ;out of range bud
tay
@loop
lda [temp_ptr],y
sta pathname,y
dey
bpl @loop
no_pathname
jsr activate_debug
clc
rts
deactivate
lda #$0001 ;priority 1
ldx #stop_handler
ldy #^stop_handler
jsl signal
rts
activate_debug
lda #$0001 ;priority 1
ldx #startup_handler
ldy #^startup_handler
jsl signal
rts
stop_handler
phk
plb
stz debug_flag
jsr save_zp
lda open_list ;is the file open?
beq end_stop
jsr close_file
end_stop
jsr restore_zp
stz debug_flag ;stop the debug please
stz open_list
rtl
startup_handler
phk
plb
stz debug_flag ;disable debug list
jsr save_zp
jsr destroy_file ;destroy the old file.
jsr create_file ;create the file if possible
jsr set_new_level ;raise the system level so I do not get closed.
jsr open_file
bcc @do_it
stz debug_flag
stz open_list
jsr set_old_level
jsr restore_zp
rtl
@do_it
lda #$FFFF
sta debug_flag
lda users_pblk
sta zp
lda users_pblk+2
sta zp+2
lda [zp] ;verify the Pcount
cmp #0005 ;user wants ref number?
bne @no_ref
ldy #$000C
lda open_list ;return the reference number please
sta [zp],y
@no_ref
jsr restore_zp
rtl
users_pblk dc.l 00
ENDP
internal_debug proc
lda #$0001 ;priority 1
ldx #startup2_handler
ldy #^startup2_handler
jsl signal
rts
startup2_handler
tdc
pha
lda #$0000
tcd
jsl $e100a8 ;call the OS
dc.w $2033 ;FST specific
dc.l parm_list
pla
tcd ;restore direct page
rts
parm_list
dc.w $0003
dc.w $0001 ;my FST
dc.w $0002 ;Command number
dc.w $ffff ;command flag
endp