2018-09-28 17:05:11 +00:00
|
|
|
; Copyright 2018 faddenSoft. All Rights Reserved.
|
|
|
|
; See the LICENSE.txt file for distribution terms (Apache 2.0).
|
|
|
|
;
|
|
|
|
; Sources:
|
|
|
|
; NiftyList, by Dave Lyons
|
|
|
|
; What's Where in the Apple, by William F. Luebbert
|
|
|
|
|
|
|
|
*SYNOPSIS Symbols from the Apple II monitor ROM
|
|
|
|
|
2020-08-13 03:40:56 +00:00
|
|
|
; zero page usage
|
2019-09-16 23:58:32 +00:00
|
|
|
MON_WNDLEFT @ $20 ;left column of scroll window
|
|
|
|
MON_WNDWDTH @ $21 ;width of scroll window
|
|
|
|
MON_WNDTOP @ $22 ;top of scroll window
|
2020-01-20 00:49:02 +00:00
|
|
|
MON_WNDBTM @ $23 ;bottom of scroll window
|
2019-09-16 23:58:32 +00:00
|
|
|
MON_CH @ $24 ;cursor horizontal displacement
|
|
|
|
MON_CV @ $25 ;cursor vertical displacement
|
|
|
|
MON_GBASL @ $26 ;base address for lo-res drawing (lo)
|
|
|
|
MON_GBASH @ $27 ;base address for lo-res drawing (hi)
|
2020-01-20 00:49:02 +00:00
|
|
|
MON_BASL @ $28 ;base address for text output (lo)
|
|
|
|
MON_BASH @ $29 ;base address for text output (hi)
|
|
|
|
;MON_BAS2L @ $2A ;used when scrolling text
|
|
|
|
;MON_BAS2H @ $2B ;used when scrolling text
|
2019-09-16 23:58:32 +00:00
|
|
|
MON_H2 @ $2C ;right end of horizontal line drawn by HLINE
|
|
|
|
MON_V2 @ $2D ;bottom of vertical line drawn by VLINE
|
2019-10-27 18:12:22 +00:00
|
|
|
MON_COLOR @ $30 ;lo-res graphics color
|
2019-09-16 23:58:32 +00:00
|
|
|
MON_INVFLAG @ $32 ;text mask (255=normal, 127=flash, 63=inv)
|
2021-11-14 16:24:55 +00:00
|
|
|
MON_PROMPT @ $33 ;prompt character, used by GETLN
|
2019-09-16 23:58:32 +00:00
|
|
|
MON_CSWL @ $36 ;character output hook (lo)
|
|
|
|
MON_CSWH @ $37 ;character output hook (hi)
|
|
|
|
MON_KSWL @ $38 ;character input hook (lo)
|
|
|
|
MON_KSWH @ $39 ;character input hook (hi)
|
|
|
|
MON_PCL @ $3A ;program counter save
|
|
|
|
MON_PCH @ $3B ;program counter save
|
|
|
|
MON_A1L @ $3C ;general purpose
|
|
|
|
MON_A1H @ $3D ;general purpose
|
|
|
|
MON_A2L @ $3E ;general purpose
|
|
|
|
MON_A2H @ $3F ;general purpose
|
2019-10-27 00:32:22 +00:00
|
|
|
MON_A3L @ $40 ;general purpose
|
|
|
|
MON_A3H @ $41 ;general purpose
|
|
|
|
MON_A4L @ $42 ;general purpose
|
|
|
|
MON_A4H @ $43 ;general purpose
|
|
|
|
MON_A5L @ $44 ;general purpose
|
|
|
|
MON_A5H @ $45 ;general purpose
|
2019-09-21 02:04:10 +00:00
|
|
|
MON_RNDL @ $4E ;low byte of KEYIN "random" value
|
|
|
|
MON_RNDH @ $4F ;high byte of KEYIN "random" value
|
2018-09-28 17:05:11 +00:00
|
|
|
|
2020-08-13 03:40:56 +00:00
|
|
|
; page 3 vectors
|
Allow explicit widths in project/platform symbols, part 1
The ability to give explicit widths to local variables worked out
pretty well, so we're going to try adding the same thing to project
and platform symbols.
The first step is to allow widths to be specified in platform files,
and set with the project symbol editor. The DefSymbol editor is
also used for local variables, so a bit of dancing is required.
For platform/project symbols the width is optional, and is totally
ignored for constants. (For variables, constants are used for the
StackRel args, so the width is meaningful and required.)
We also now show the symbol's type (address or constant) and width
in the listing. This gets really distracting when overused, so we
only show it when the width is explicitly set. The default width
is 1, which most things will be, so users can make an aesthetic
choice there. (The place where widths make very little sense is when
the symbol represents a code entry point, rather than a data item.)
The maximum width of a local variable is now 256, but it's not
allowed to overlap with other variables or run of the end of the
direct page. The maximum width of a platform/project symbol is
65536, with bank-wrap behavior TBD.
The local variable table editor now refers to stack-relative
constants as such, rather than simply "constant", to make it clear
that it's not just defining an 8-bit constant.
Widths have been added to a handful of Apple II platform defs.
2019-10-01 21:58:24 +00:00
|
|
|
MON_BRKV @ $03F0 2 ;address of BRK handler
|
|
|
|
MON_SOFTEVEC @ $03F2 2 ;address of RESET handler
|
2019-09-16 23:58:32 +00:00
|
|
|
MON_PWREDUP @ $03F4 ;power-up RESET checksum
|
Allow explicit widths in project/platform symbols, part 1
The ability to give explicit widths to local variables worked out
pretty well, so we're going to try adding the same thing to project
and platform symbols.
The first step is to allow widths to be specified in platform files,
and set with the project symbol editor. The DefSymbol editor is
also used for local variables, so a bit of dancing is required.
For platform/project symbols the width is optional, and is totally
ignored for constants. (For variables, constants are used for the
StackRel args, so the width is meaningful and required.)
We also now show the symbol's type (address or constant) and width
in the listing. This gets really distracting when overused, so we
only show it when the width is explicitly set. The default width
is 1, which most things will be, so users can make an aesthetic
choice there. (The place where widths make very little sense is when
the symbol represents a code entry point, rather than a data item.)
The maximum width of a local variable is now 256, but it's not
allowed to overlap with other variables or run of the end of the
direct page. The maximum width of a platform/project symbol is
65536, with bank-wrap behavior TBD.
The local variable table editor now refers to stack-relative
constants as such, rather than simply "constant", to make it clear
that it's not just defining an 8-bit constant.
Widths have been added to a handful of Apple II platform defs.
2019-10-01 21:58:24 +00:00
|
|
|
MON_USRADDR @ $03F8 3 ;jump to function that handles monitor Ctrl-Y
|
|
|
|
MON_NMIVEC @ $03FB 3 ;jump to function that handles NMI
|
|
|
|
MON_IRQADDR @ $03FE 2 ;address of IRQ handler
|
2018-09-28 17:05:11 +00:00
|
|
|
|
2020-08-13 03:40:56 +00:00
|
|
|
; monitor entry points
|
2019-09-16 23:58:32 +00:00
|
|
|
MON_PLOT @ $F800 ;lo-res plot at X=Y-reg, Y=Acc
|
|
|
|
MON_PLOT1 @ $F80E ;lo-res plot at X=Y-reg, Y per GBASL/H
|
|
|
|
MON_HLINE @ $F819 ;lo-res horiz line at Y=Acc with X from $2c
|
|
|
|
MON_VLINE @ $F828 ;lo-res vert line at X=Y-reg and Y from Acc to $2b
|
|
|
|
MON_CLRSCR @ $F832 ;clear lo-res screen to black
|
|
|
|
MON_CLRTOP @ $F836 ;clear top part of lo-res screen to black
|
|
|
|
MON_GBASCALC @ $F847 ;compute gfx base addr for line in Acc
|
|
|
|
MON_NXTCOL @ $F85F ;change lo-res color to (color)+3
|
|
|
|
MON_SETCOL @ $F864 ;set lo-res color to Acc
|
|
|
|
MON_SCRN @ $F871 ;load Acc with lo-res value at Y=Acc, X=X-reg
|
|
|
|
MON_INSDS1_2 @ $F88C
|
|
|
|
MON_INSDS2 @ $F88E
|
|
|
|
MON_GET816LEN @ $F890
|
|
|
|
MON_INSTDSP @ $F8D0 ;monitor/mini-asm display
|
|
|
|
MON_PRNTYX @ $F940 ;print Y-reg/X-reg as 4 hex digits
|
|
|
|
MON_PRNTAX @ $F941 ;print Acc/X-reg as 4 hex digits
|
|
|
|
MON_PRNTX @ $F944 ;print X-reg as 2 hex digits
|
|
|
|
MON_PRBLNK @ $F948 ;print 3 spaces
|
2019-10-07 00:07:07 +00:00
|
|
|
MON_PRBL2 @ $F94A ;print multiple spaces, count in X-reg
|
2019-09-16 23:58:32 +00:00
|
|
|
MON_PCADJ @ $F953 ;monitor/mini-asm PC adjust
|
|
|
|
MON_TEXT2COPY @ $F962
|
|
|
|
MON_OLDIRQ @ $FA40 ;autostart ROM IRQ handler
|
|
|
|
MON_BREAK @ $FA4C
|
|
|
|
MON_OLDBRK @ $FA59
|
2021-11-14 16:24:55 +00:00
|
|
|
MON_RESET @ $FA62 ;autostart ROM RESET handler
|
2019-09-16 23:58:32 +00:00
|
|
|
MON_PWRUP @ $FAA6
|
|
|
|
MON_SLOOP @ $FABA
|
|
|
|
MON_REGDSP @ $FAD7 ;display register contents
|
|
|
|
MON_RTBL @ $FB19
|
|
|
|
MON_PREAD @ $FB1E ;read paddle specifed by X-reg, return in Y-reg
|
|
|
|
MON_PREAD4 @ $FB21
|
|
|
|
MON_INIT @ $FB2F ;screen initialization
|
|
|
|
MON_SETTXT @ $FB39 ;set screen to text mode
|
|
|
|
MON_SETGR @ $FB40 ;set screen to graphics mode
|
|
|
|
MON_SETWND @ $FB4B ;set normal low-res graphics window
|
|
|
|
MON_SETWND2 @ $FB51
|
2021-11-14 16:24:55 +00:00
|
|
|
MON_TABV @ $FB5B ;place cursor at line (A-reg) and column (CH)
|
2019-09-16 23:58:32 +00:00
|
|
|
MON_APPLEII @ $FB60 ;clear screen and put "Apple II" into first line
|
|
|
|
MON_SETPWRC @ $FB6F
|
2021-11-14 16:24:55 +00:00
|
|
|
MON_VIDWAIT @ $FB78 ;autostart: handle Ctrl+S after CR
|
2019-09-16 23:58:32 +00:00
|
|
|
MON_KBDWAIT @ $FB88
|
2021-11-14 16:24:55 +00:00
|
|
|
MON_VERSION @ $FBB3 ;used to detect system version
|
|
|
|
MON_ZIDBYTE2 @ $FBBF ;used to detect system version
|
|
|
|
MON_ZIDBYTE @ $FBC0 ;used to detect system version
|
2019-09-16 23:58:32 +00:00
|
|
|
MON_BASCALC @ $FBC1 ;calculate text base address
|
|
|
|
MON_BELL1 @ $FBDD ;sound bell regardless of output device
|
|
|
|
MON_BELL1_2 @ $FBE2
|
|
|
|
MON_BELL2 @ $FBE4 ;sound bell
|
|
|
|
MON_STORADV @ $FBF0
|
|
|
|
MON_ADVANCE @ $FBF4 ;move cursor right
|
|
|
|
MON_VIDOUT @ $FBFD ;output Acc as text
|
|
|
|
MON_BS @ $FC10 ;move cursor left
|
|
|
|
MON_UP @ $FC1A ;move cursor up
|
2021-11-14 16:24:55 +00:00
|
|
|
MON_VTAB @ $FC22 ;tab to row specified in CV
|
|
|
|
MON_VTABZ @ $FC24 ;tab to row specified in Acc
|
2019-09-16 23:58:32 +00:00
|
|
|
MON_CLREOP @ $FC42 ;clear screen from cursor to end of page
|
|
|
|
MON_HOME @ $FC58 ;clear screen and reset text output to top-left
|
|
|
|
MON_CR @ $FC62 ;perform a carriage return
|
|
|
|
MON_LF @ $FC66 ;perform a line feed
|
Allow explicit widths in project/platform symbols, part 1
The ability to give explicit widths to local variables worked out
pretty well, so we're going to try adding the same thing to project
and platform symbols.
The first step is to allow widths to be specified in platform files,
and set with the project symbol editor. The DefSymbol editor is
also used for local variables, so a bit of dancing is required.
For platform/project symbols the width is optional, and is totally
ignored for constants. (For variables, constants are used for the
StackRel args, so the width is meaningful and required.)
We also now show the symbol's type (address or constant) and width
in the listing. This gets really distracting when overused, so we
only show it when the width is explicitly set. The default width
is 1, which most things will be, so users can make an aesthetic
choice there. (The place where widths make very little sense is when
the symbol represents a code entry point, rather than a data item.)
The maximum width of a local variable is now 256, but it's not
allowed to overlap with other variables or run of the end of the
direct page. The maximum width of a platform/project symbol is
65536, with bank-wrap behavior TBD.
The local variable table editor now refers to stack-relative
constants as such, rather than simply "constant", to make it clear
that it's not just defining an 8-bit constant.
Widths have been added to a handful of Apple II platform defs.
2019-10-01 21:58:24 +00:00
|
|
|
MON_SCROLL @ $FC70 ;scroll up one line
|
2019-09-16 23:58:32 +00:00
|
|
|
MON_CLREOL @ $FC9C ;clear to end of line
|
2021-11-14 16:24:55 +00:00
|
|
|
MON_CLREOLZ @ $FC9E ;clear from pos in Y-reg to end of line
|
2019-09-16 23:58:32 +00:00
|
|
|
MON_WAIT @ $FCA8 ;delay for (26 + 27*Acc + 5*(Acc*Acc))/2 cycles
|
2019-10-27 00:32:22 +00:00
|
|
|
MON_NXTA4 @ $FCB4 ;increment A4, fall through into NXTA1
|
|
|
|
MON_NXTA1 @ $FCBA ;increment A1; set carry if A1 >= A2 before inc
|
2019-09-16 23:58:32 +00:00
|
|
|
MON_HEADR @ $FCC9 ;write cassette sync
|
|
|
|
MON_WRTAPE @ $FCE5 ;casssette write
|
2019-09-21 02:04:10 +00:00
|
|
|
MON_RD2BIT @ $FCFA ;cassette read
|
2020-08-13 03:40:56 +00:00
|
|
|
MON_RDKEY @ $FD0C ;read key from input device via $38-39
|
2019-09-16 23:58:32 +00:00
|
|
|
MON_FD10 @ $FD10
|
|
|
|
MON_RDKEY1 @ $FD18
|
|
|
|
MON_KEYIN @ $FD1B ;get next key input from keyboard hardware
|
|
|
|
MON_RDCHAR @ $FD35 ;calls RDKEY to get next char
|
|
|
|
MON_GETLNZ @ $FD67 ;get a line of input
|
|
|
|
MON_GETLN @ $FD6A ;get a line of input
|
2021-11-14 16:24:55 +00:00
|
|
|
MON_GETLN0 @ $FD6C ;GETLN with prompt char in A-reg
|
|
|
|
MON_GETLN1 @ $FD6F ;GETLN with no prompt char
|
|
|
|
MON_CROUT1 @ $FD8B ;clear to EOL and print a carriage return
|
2019-09-16 23:58:32 +00:00
|
|
|
MON_CROUT @ $FD8E ;print a carriage return
|
|
|
|
MON_PRA1 @ $FD92 ;print CR, then hex of A1H/A1L, then minus sign
|
|
|
|
MON_PRBYTE @ $FDDA ;print Acc as two-digit hex number
|
|
|
|
MON_PRHEX @ $FDE3 ;print right nibble of Acc as single hex digit
|
2020-08-13 03:40:56 +00:00
|
|
|
MON_COUT @ $FDED ;print Acc to output device via $36-37
|
|
|
|
MON_COUT1 @ $FDF0 ;print Acc to screen
|
2019-09-16 23:58:32 +00:00
|
|
|
MON_COUTZ @ $FDF6
|
2021-11-14 16:24:55 +00:00
|
|
|
MON_IDROUTINE @ $FE1F ;RTS on 8-bit, ID routine on IIgs
|
2019-10-27 00:32:22 +00:00
|
|
|
MON_MOVE @ $FE2C ;move bytes from A1 to A4 until A1=A2
|
2019-09-16 23:58:32 +00:00
|
|
|
MON_LIST @ $FE5E ;disassemble 20 instructions (not on GS)
|
|
|
|
MON_SETINV @ $FE80 ;set video mode to inverse
|
|
|
|
MON_SETNORM @ $FE84 ;set video mode to normal
|
|
|
|
MON_SETKBD @ $FE89 ;reset char input handler to ROM
|
2021-11-14 16:24:55 +00:00
|
|
|
MON_INPORT @ $FE8B ;set char input handler to slot in A-reg
|
2019-09-16 23:58:32 +00:00
|
|
|
MON_SETVID @ $FE93 ;reset char output handler to ROM
|
2021-11-14 16:24:55 +00:00
|
|
|
MON_OUTPORT @ $FE95 ;set char output handler to slot in A-reg
|
2019-09-16 23:58:32 +00:00
|
|
|
MON_GO @ $FEB6
|
|
|
|
MON_WRITE @ $FECD ;write data to cassette
|
|
|
|
MON_READ @ $FEFD ;read data from cassette
|
2019-09-21 02:04:10 +00:00
|
|
|
MON_READ2 @ $FF02 ;read data from cassette
|
2019-09-16 23:58:32 +00:00
|
|
|
MON_PRERR @ $FF2D ;print "ERR" and sound bell
|
|
|
|
MON_BELL @ $FF3A ;sound bell
|
|
|
|
MON_RESTORE @ $FF3F ;restore 6502 registers from $45-48
|
|
|
|
MON_SAVE @ $FF4A ;save 6502 registers to $45-49
|
|
|
|
MON_IORTS @ $FF58 ;JSR here to find out where one is
|
|
|
|
MON_OLDRST @ $FF59 ;RESET entry point
|
|
|
|
MON_MON @ $FF65 ;normal entry to monitor
|
|
|
|
MON_MONZ @ $FF69 ;reset and enter monitor
|
|
|
|
MON_MONZ2 @ $FF6C
|
|
|
|
MON_MONZ4 @ $FF70
|
|
|
|
MON_DIG @ $FF8A
|
|
|
|
MON_GETNUM @ $FFA7
|
|
|
|
MON_NXTCHR @ $FFAD ;part of GETLN input loop
|
|
|
|
MON_TOSUB @ $FFBE
|
|
|
|
MON_ZMODE @ $FFC7
|
2020-08-13 03:40:56 +00:00
|
|
|
|
|
|
|
; locations defined by the 6502
|
2020-08-18 22:10:10 +00:00
|
|
|
MON_6502_NMI @ $FFFA 2 ;6502 NMI vector
|
|
|
|
MON_6502_RESET @ $FFFC 2 ;6502 reset vector
|
|
|
|
MON_6502_IRQ @ $FFFE 2 ;6502 IRQ vector
|