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
23 KiB
Plaintext

eject
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; ;
; equates part 1 ;
; ;
; by ;
; fern bachman jr. ;
; ;
; Copyright Apple Computer, Inc. 1985-1993 ;
; All Rights Reserved. ;
; ;
; ;
; 08/13/87 RBM Change: DISKREG is now in bank $E1 ;
; Added IWM equates ;
; ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;---------->> real zero page equates <<----------
cswl equ $000036 ;character output hook
cswh equ $000037
kswl equ $000038 ;character input hook
kswh equ $000039
;---------->> screen hole equates <<----------
mslot equ $0007f8 ;=$cn ;n=slot using $c800
;---------->> bank 1 / page 1 permanent storage <<----------
mnemstkptr equ $010100 ;main stack pointer
alemstkptr equ $010101 ;alternate stack pointer
;---------->> page 3 vectors <<----------
oswmstrt equ $0003d0 ;quitmon jumps here
brkv equ $0003f0 ;vectors here after break
softev equ $0003f2 ;warm RESET vector
pwredup equ $0003f4 ;this must = eor #$A5 of softev+1
amperv equ $0003f5 ;Applesoft "&" vector
usradr equ $0003f8 ;monitor Ctrl-Y vector
nmi equ $0003fb ;NMI vector
irqloc equ $0003fe ;maskable interrupt vector
pro8mli equ $00bf00 ;address of prodos8 mli entry point
;---------->> hardware equates <<----------
ioadr equ $c000 ;all i/o is at $cxxx
kbd equ $c000 ;bit 7=1 if keystroke
clr80col equ $c000 ;disable 80 column store
set80col equ $c001 ;enable 80 column store
rdmainram equ $c002 ;read from main 48k ram
rdcardram equ $c003 ;read from alt. 48k ram
wrmainram equ $c004 ;write to main 48k ram
wrcardram equ $c005 ;write to alt. 48k ram
setslotcxrom equ $c006 ;use roms on cards
setintcxrom equ $c007 ;use internal rom
setstdzp equ $c008 ;use main zero page/stack
setaltzp equ $c009 ;use alt. zero page/stack
setintc3rom equ $c00a ;enable internal slot 3 rom
setslotc3rom equ $c00b ;enable external slot 3 rom
clr80vid equ $c00c ;disable 80 column hardware
set80vid equ $c00d ;enable 80 column hardware
clraltchar equ $c00e ;normal lc, flashing uc
setaltchar equ $c00f ;normal inverse, lc; no flash
kbdstrb equ $c010 ;turn off key pressed flag
rdlcbnk2 equ $c011 ;bit 7=1 if LC bank 2 is in
rdlcram equ $c012 ;bit 7=1 if LC ram read enabled
rdramrd equ $c013 ;bit 7=1 if reading alt 48k
rdramwrt equ $c014 ;bit 7=1 if writing alt 48k
rdcxrom equ $c015 ;bit 7=1 if using int rom
rdaltzp equ $c016 ;bit 7=1 if slot zp enabled
rdc3rom equ $c017 ;bit 7=1 if slot c3 space enabled
rd80col equ $c018 ;bit 7=1 if 80 column store
rdvblbar equ $c019 ;bit 7=1 if not vbl
rdtext equ $c01a ;bit 7=1 if text (not graphics)
rdmix equ $c01b ;bit 7=1 if mixed mode on
rdpage2 equ $c01c ;bit 7=1 if txtpage2 switched in
rdhires equ $c01d ;bit 7=1 if hires is on
altcharset equ $c01e ;bit 7=1 if alternate char set in use
rd80vid equ $c01f ;bit 7=1 if 80 column hardware in
; __7______6______5______4______3______2______1______0___
;| | | | | | | | |
;| vgc | 1sec | scan | ext | | 1sec | scan | ext |
;| int | int | int | int |unused| int | int | int |
;|active|active|active|active| |enable|enable|enable|
;|______|______|______|______|______|______|______|______|
; ^^^^^ vgcint status byte ^^^^^
; vgcint bits defined as follows
; bit 7= 1 if interrupt generated by vgc
; bit 6= 1 if 1 second timer interrupt
; bit 5= 1 if scan line interrupt
; bit 4= 1 if external interrupt
; bit 3= unused
; bit 2= 1 second timer interrupt enable
; bit 1= scan line interrupt enable
; bit 0= external interrupt enable
vgcint equ $c023 ;vgc interrupt register
; __7______6______5______4______3______2______1______0___
;| | |update| | | | | |
;| open |closed| mod |keypad|repeat| caps | ctrl |shift |
;| apple| apple|no key| key |active| lock | key | key |
;| key | key | press|active| |active|active|active|
;|______|______|______|______|______|______|______|______|
; ^^^^^ keymodreg status byte ^^^^^
; keymodreg bits defined as follows
; bit 7= open apple key active
; bit 6= closed apple key active
; bit 5= updated modifier latch without keypress
; bit 4= keypad key active
; bit 3= repeat active
; bit 2= caps lock active
; bit 1= control key active
; bit 0= shift key active
keymodreg equ $c025 ;key modifier register
; __7______6______5______4______3______2______1______0___
;| | | | | | | | |
;| |
;| data to/from keyboard micro |
;| |
;|______|______|______|______|______|______|______|______|
; ^^^^^ datareg byte ^^^^^
; datareg bits defined as follows
; bit 7,6,5,4,3,2,1,0 = data to/from keyboard micro
;
; data at interrupt time in this register is defined as
; bit 7= response byte if set, otherwise status byte
; bit 6= abort valid if set and all other bits reset
; bit 5= desktop manager key sequence pressed
; bit 4= flush buffer key sequence pressed
; bit 3= srq valid if set
; bit 2,1,0 if all bits clear then no fdb data valid,
; else the bits indicate the number of valid
; bytes received minus 1. (2-8 bytes total)
datareg equ $c026 ;data register in keyglu chip
; __7______6______5______4______3______2______1______0___
;| | | | | | | | |
;| mouse| mouse| data | data | key | key | mouse| cmd |
;| reg | int | reg | int | data | int |x/yreg| reg |
;| full |enable| full |enable| full |enable| data | full |
;|______|______|______|______|______|______|______|______|
; ^^^^^ kmstatus status byte ^^^^^
; kmstatus bits defined as follows
; bit 7= 1 if mouse register full
; bit 6= mouse interrupt disable/enable
; bit 5= 1 if data register full
; bit 4= data interrupt enable
; bit 3= 1 if key data full <<<<<------never use, won't work
; bit 2= key data interrupt enable <<<<<------never use, won't work
; bit 1= 0 = mouse 'x' register data available
; 1 = mouse 'y' register data available
; bit 0= command register full
kmstatus equ $c027 ;keyboard/mouse status register
; __7______6______5______4______3______2______1______0___
;| | | | | | | | |
;|slot7 |slot6 |slot5 |slot4 | |slot2 |slot1 | |
;|intext|intext|intext|intext| 0 |intext|intext| 0 |
;|enable|enable|enable|enable| |enable|enable| |
;|______|______|______|______|______|______|______|______|
; ^^^^^ sltromsel byte ^^^^^
; sltromsel bits defined as follows
; bit 7= 0 enables internal slot 7 -- 1 enables slot rom
; bit 6= 0 enables internal slot 6 -- 1 enables slot rom
; bit 5= 0 enables internal slot 5 -- 1 enables slot rom
; bit 4= 0 enables internal slot 4 -- 1 enables slot rom
; bit 3= must be 0
; bit 2= 0 enables internal slot 2 -- 1 enables slot rom
; bit 1= 0 enables internal slot 1 -- 1 enables slot rom
; bit 0= must be 0
sltromsel equ $c02d ;slot rom select
spkr equ $c030 ;clicks the speaker
; __7______6______5______4______3______2______1______0___
;| | | | | | | | |
;| 3.5" | 3.5" | | | | | | |
;| head | drive| 0 | 0 | 0 | 0 | 0 | 0 |
;|select|enable| | | | | | |
;|______|______|______|______|______|______|______|______|
; ^^^^^ diskreg status byte ^^^^^
; diskreg bits defined as follows
; bit 7= 1 to select head on 3.5" drive to use
; bit 6= 1 to enable 3.5" drive
; bit 5,4,3,2,1,0= unused
diskreg equ $E1C031 ;used for 3.5" disk drives
; __7______6______5______4______3______2______1______0___
;| | | | | | | | |
;| | stop | | stop | stop | stop | stop | stop |
;| 0 |i/o/lc| 0 |auxh-r|suprhr|hires2|hires1|txt pg|
;| |shadow| |shadow|shadow|shadow|shadow|shadow|
;|______|______|______|______|______|______|______|______|
; ^^^^^ shadow byte ^^^^^
; shadow bits defined as follows
; bit 7= must write 0
; bit 6= 1 to inhibit i/o and language card operation
; bit 5= must write 0
; bit 4= 1 to inhibit shadowing aux hi-res page
; bit 3= 1 to inhibit shadowing 32k video buffer
; bit 2= 1 to inhibit shadowing hires page 2
; bit 1= 1 to inhibit shadowing hires page 1
; bit 0= 1 to inhibit shadowing text pages
shadow equ $c035 ;shadow register
; __7______6______5______4______3______2______1______0___
;| | | | | | | | |
;| slow/| | |shadow|slot 7|slot 6|slot 5|slot 4|
;| fast | 0 | 0 |in all|motor |motor | motor| motor|
;| speed| | | ram |detect|detect|detect|detect|
;|______|______|______|______|______|______|______|______|
; ^^^^^ cyareg byte ^^^^^
; cyareg bits defined as follows
; bit 7= 0=slow system speed -- 1=fast system speed
; bit 6= must write 0
; bit 5= must write 0
; bit 4= shadow in all ram banks
; bit 3= slot 7 disk motor on detect
; bit 2= slot 6 disk motor on detect
; bit 1= slot 5 disk motor on detect
; bit 0= slot 4 disk motor on detect
cyareg equ $c036 ;speed and motor on detect
; __7______6______5______4______3______2______1______0___
;| | | | | | | | |
;| | | |enable|enable|enable|enable|enable|
;| 0 | 0 | 0 |1/4sec| vbl |switch| move | mouse|
;| | | | ints | ints | ints | ints | |
;|______|______|______|______|______|______|______|______|
; ^^^^^ inten byte ^^^^^
; inten bits defined as follows
; bit 7= must be 0
; bit 6= must be 0
; bit 5= must be 0
; bit 4= 1 to enable 1/4 second interrupts
; bit 3= 1 to enable vbl interrupts
; bit 2= 1 to enable mega // mouse switch interrupts
; bit 1= 1 to enable mega // mouse movement interrupts
; bit 0= 1 to enable mega // mouse operation
inten equ $c041 ;interrupt enable register
; __7______6______5______4______3______2______1______0___
;| | | | | | | | |
;|mmouse|mmouse|status|status|status|status|status|status|
;| now | last | an3 |1/4sec| vbl |switch| move |system|
;|button|button| | int | int | int | int | irq |
;|______|______|______|______|______|______|______|______|
; ^^^^^ intflag byte ^^^^^
; intflag bits defined as follows
; bit 7= 1 if mouse button currently down
; bit 6= 1 if mouse button was down on last read
; bit 5= status of an3
; bit 4= 1 if 1/4 second interrupted
; bit 3= 1 if vbl interrupted
; bit 2= 1 if mega // mouse switch interrupted
; bit 1= 1 if mega // mouse movement interrupted
; bit 0= 1 if system irq line is asserted
intflag equ $c046 ;interrupt flag register
clrvblint equ $c047 ;clear the vbl and 3.75hz interrupt flags
txtclr equ $c050 ;switch in graphics (not text)
txtset equ $c051 ;switch in text (not graphics)
mixclr equ $c052 ;clear mixed-mode
mixset equ $c053 ;set mixed-mode (4 lines text)
txtpage1 equ $c054 ;switch in text page 1
txtpage2 equ $c055 ;switch in text page 2
lores equ $c056 ;low-resolution graphics
hires equ $c057 ;high-resolution graphics
setan0 equ $c058 ;clear annunciator 0
clran0 equ $c059 ;set annunciator 0
setan1 equ $c05a ;clear annunciator1
clran1 equ $c05b ;set annunciator 1
setan2 equ $c05c ;clear annunciator 2
clran2 equ $c05d ;set annunciator 2
setan3 equ $c05e ;clear annunciator 3
clran3 equ $c05f ;set annunciator 3
butn3 equ $c060 ;read switch 3
butn0 equ $c061 ;open apple key
butn1 equ $c062 ;closed apple key
butn2 equ $c063 ;read switch 2
; __7______6______5______4______3______2______1______0___
;| | | | | | | | |
;| alzp | page2| ramrd|ramwrt| rdrom|lcbnk2|rombnk| intcx|
;|status|status|status|status|status|status|status|status|
;| | | | | | | | |
;|______|______|______|______|______|______|______|______|
; ^^^^^ statereg status byte ^^^^^
; statereg bits defined as follows
; bit 7= alzp status
; bit 6= page2 status
; bit 5= ramrd status
; bit 4= ramwrt status
; bit 3= rdrom status (read only ram/rom (0/1))
; important note:
; do two reads to $c083 then change statereg
; to change lcram/rom banks (0/1) and still
; have the language card write enabled.
; bit 2= lcbnk2 status 0=LC bank 0 - 1=LC bank 1
; bit 1= rombank status
; bit 0= intcxrom status
statereg equ $c068 ;state register
;---------->> language card soft switches <<----------
romin equ $c081 ;enable rom read, 2 reads write enb LC ram
lcbank2 equ $c083 ;sel LC ram bank2, 2 rds wrt enb LC ram
lcbank1 equ $c08b ;sel LC ram bank1, 2 rds wrt enb LC ram
clrrom equ $cfff ;switch out $c8 roms
eject
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; ;
; equates part 2 ;
; ;
; by ;
; Fern Bachman ;
; ;
; Copyright Apple Computer, Inc. 1985-1987 ;
; All Rights Reserved. ;
; ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;---------->> tool set numbers and call numbers <<----------
mtn equ $03 ;miscellaneous tool number
rthfn equ $0d ;read time hex function number
wthfn equ $0e ;write time hex function number
mmn equ $02 ;memory manager tool number
initdismgr equ $fe0000 ;init dispatch handler (tool locator)
;---------->> bank $e1 equates <<----------
brambuffer equ $e102c0 ;image of batteryram
osvariables equ brambuffer+$80+$01 ;32 bytes of operating system vari
;---------->> important vectors the user may change
;---------->> ram space from locations $e10000->$e102b7 are allocated
;---------->> for monitor and ram vectors use.
dispatch1 equ $e10000 ;jmp vector to tool locator1
dispatch2 equ $e10004 ;jmp vector to tool locator2
udispatch1 equ $e10008 ;jmp vector to user's tool locator1
udispatch2 equ $e1000c ;jmp vector to user's tool locator2
intmgrv equ $e10010 ;jmp vector to interrupt manager
copmgrv equ $e10014 ;jmp vector to cop manager
abortmgrv equ $e10018 ;jmp vector to abort manager
sysdmgrv equ $e1001c ;jmp vector to system death manager
;---------->> tool/internal interrupt vectors <<----------
irq_aptlk equ $e10020 ;jmp vector to aptlk interrupt handler
irq_serial equ $e10024 ;jmp vector to serial port int handler
irq_scan equ $e10028 ;jmp vector to scan line interrupt handler
irq_sound equ $e1002c ;jmp vector to sound interrupt handler
irq_vbl equ $e10030 ;jmp vector to vbl interrupt handler
irq_mouse equ $e10034 ;jmp vector to mouse interrupt handler
irq_qtr equ $e10038 ;jmp vector to 1/4 sec interrupt handler
irq_kbd equ $e1003c ;jmp vector to keyboard interrupt handler
irq_response equ $e10040 ;jmp vctr to fdb response byte int handler
irq_srq equ $e10044 ;jmp vector to srq int handler
irq_dskacc equ $e10048 ;jmp vector to desk accessory int handler
irq_flush equ $e1004c ;jmp vector to flush buffer int handler
irq_micro equ $e10050 ;jmp vector to key micro int handler
irq_1sec equ $e10054 ;jmp vector to 1 second interrupt handler
irq_ext equ $e10058 ;jmp vector to ext vgc interrupt handler
irq_other equ $e1005c ;jmp vector to other interrupt handler
cupdate equ $e10060 ;jmp vector to cursor update handler
incbusyflg equ $e10064 ;jmp vector to increment busyflag routine
decbusyflg equ $e10068 ;jmp vector to decrement busyflag routine
;---------->> end of user changable interrupt vectors <<----------
;---------->> prodos bank $e1 vectors/data bytes <<----------
pro16mli equ $e100a8 ;1st os vector is prodos16 mli entry poi
os_switch equ $e100ac ;called before application launch
stkpro16mli equ $e100b0 ;stack based entry to prodos16
os_p8_switch equ $e100b4 ;called by GQuit when GQuit is about to remove P8
os_public_flags equ $e100b8 ;2 bytes reserved for public GS/OS flags
;currently, bit 15 is set if GLoader doesn't
;load any INITs or DAs.
zero_word equ $e100ba ;guaranteed 2 zeros
os_kind equ $e100bc ;0/1-p8/p16 current os running
os_boot equ $e100bd ;0/1-p8/p16 booted os
os_flag equ $e100be ;word for prodos 16 flags
warm_cold_flag equ $e101d0 ;word: 0=cold startup/shutdown, 1=warm startup/shutdown
;----------->> System Service Calls Bank $E1 Vectors/Handles <<---------------
e1_move equ $E10200 ; Move routine
e1_set_speed equ $E10204 ; Set system speed routine
e1_slot_arbiter equ $E10208 ; Request a slot
*****************************************************************
*
* EQUATES for the IWM
*
*****************************************************************
ph0off equ $E1C080 ; phase 0 off
ph0on equ $E1C081 ; phase 0 on
ph1off equ $E1C082 ; phase 1 off
ph1on equ $E1C083 ; phase 1 on
ph2off equ $E1C084 ; phase 2 off
ph2on equ $E1C085 ; phase 2 on
ph3off equ $E1C086 ; phase 3 off
ph3on equ $E1C087 ; phase 3 on
motor_off equ $E1C088 ; disk motor off
motor_on equ $E1C089 ; disk motor on
drive0 equ $E1C08A ; select drive 0
drive1 equ $E1C08B ; select drive 1
q6l equ $E1C08C ; Q6 low
q6h equ $E1C08D ; Q6 high
q7l equ $E1C08E ; Q7 low
q7h equ $E1C08F ; Q7 high
*
* ____ ____ __________
* | | | |
* | Q7 | Q6 | MOTOR_ON |
* |____|____|__________|
*
* 0 0 0 Read all ones
* 0 0 1 Read data register
* 0 1 X Read status register
* 1 0 X Read write-handshake register
* 1 1 0 Write mode register
* 1 1 1 write data register
*
*
* ___ ___ ___ ___ ___ ___ ___ ___
* | | | | | | | | |
* | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | IWM Mode Register (write only)
* |___|___|___|___|___|___|___|___|
* | | | | | | | |____ 1 = Latch mode
* | | | | | | |________ 0 = sychronous, 1 = asynchronous
* | | | | | |____________ 0 = timer enable, 1 = timer disable
* | | | | |________________ 0 = slow mode, 1 = fast mode
* | | | |____________________ 0 = 7mHz clock, 1 = 8 mHz clock
* | | |________________________ 1 = test mode, 0 = normal mode
* | |____________________________ 1 = mz reset (not used)
* |________________________________ RESERVED
*
* ___ ___ ___ ___ ___ ___ ___ ___
* | | | | | | | | |
* | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | IWM Status Register (read only)
* |___|___|___|___|___|___|___|___|
* | | | | | | | |____ 1 = Latch mode
* | | | | | | |________ 0 = sychronous, 1 = asynchronous
* | | | | | |____________ 0 = timer enable, 1 = timer disable
* | | | | |________________ 0 = slow mode, 1 = fast mode
* | | | |____________________ 0 = 7mHz clock, 1 = 8 mHz clock
* | | |________________________ 1 = enbl is active
* | |____________________________ 1 = mz
* |________________________________ 1 = sense high, 0 = sense low
*
* ___ ___ ___ ___ ___ ___ ___ ___
* | | | | | | | | |
* | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | IWM Handshake Register (read only)
* |___|___|___|___|___|___|___|___|
* | | |___|___|___|___|___|____ RESERVED (read as ones)
* | |____________________________ 1 = write state, 0 = write underrun
* |________________________________ 1 = write data buffer register ready
*