mirror of
https://github.com/markpmlim/EdAsm.git
synced 2024-06-01 03:41:33 +00:00
Added files for viewing purposes
This commit is contained in:
parent
f6a1b75e84
commit
159996a13d
2176
EDASM.SRC/ASM/ASM1.S
Normal file
2176
EDASM.SRC/ASM/ASM1.S
Normal file
File diff suppressed because it is too large
Load Diff
3389
EDASM.SRC/ASM/ASM2.S
Normal file
3389
EDASM.SRC/ASM/ASM2.S
Normal file
File diff suppressed because it is too large
Load Diff
3667
EDASM.SRC/ASM/ASM3.S
Normal file
3667
EDASM.SRC/ASM/ASM3.S
Normal file
File diff suppressed because it is too large
Load Diff
210
EDASM.SRC/ASM/EQUATES.S
Normal file
210
EDASM.SRC/ASM/EQUATES.S
Normal file
|
@ -0,0 +1,210 @@
|
||||||
|
Name : EQUATES.S
|
||||||
|
End of file : 7,281
|
||||||
|
This file was generated using the DiskBrowser utility with minimal editing.
|
||||||
|
It is meant for viewing purposes only.
|
||||||
|
|
||||||
|
**************************************************
|
||||||
|
* Symbol names ending with
|
||||||
|
* B - buffer
|
||||||
|
* F - flag
|
||||||
|
* P - pointer
|
||||||
|
* S - string (can be p,c or otherwise)
|
||||||
|
* T - table
|
||||||
|
*
|
||||||
|
* This would allow us to give more meaningful abbrv
|
||||||
|
* to symbol names
|
||||||
|
*
|
||||||
|
*=================================================
|
||||||
|
*
|
||||||
|
* Indices to access file control tables (FCT)
|
||||||
|
*
|
||||||
|
ObjFile EQU 0
|
||||||
|
ChnFile EQU 2
|
||||||
|
InclFile EQU 4
|
||||||
|
MacFile EQU 6
|
||||||
|
LstFile EQU 8
|
||||||
|
*
|
||||||
|
* There are flags which describes the
|
||||||
|
* characteristics of a symbol - ref pg 231
|
||||||
|
*
|
||||||
|
undefined equ $80
|
||||||
|
unrefd equ $40
|
||||||
|
relative equ $20
|
||||||
|
external equ $10
|
||||||
|
entry equ $08
|
||||||
|
macro equ $04
|
||||||
|
nosuchlabel equ $02
|
||||||
|
fwdrefd equ $01
|
||||||
|
*
|
||||||
|
* zero page usage
|
||||||
|
* NB. The contents of $60-$F1 are saved & will be
|
||||||
|
* restored by the Assembler on exit.
|
||||||
|
* Some of these locations are re-cycled i.e. they have a
|
||||||
|
* different meaning when use in another part of the code
|
||||||
|
*
|
||||||
|
Z60 EQU $60
|
||||||
|
BCDNbr EQU $60 ;src file line #s in BCD
|
||||||
|
StrtSymT EQU $63 ;start of symtable
|
||||||
|
EndSymT EQU $65 ;curr end of symtable
|
||||||
|
PassNbr EQU $67 ;pass 1=0, pass 2=1 pass 3=2
|
||||||
|
ListingF EQU $68 ;$80-LST ON
|
||||||
|
SubTtlF EQU $69 ;=$00,$40=SBTL, $FF=SBTL str
|
||||||
|
LineCnt EQU $6A ;# of printed lines
|
||||||
|
PageNbr EQU $6B
|
||||||
|
FileNbr EQU $6D
|
||||||
|
LogPL EQU $6E ;logical page len
|
||||||
|
PhyPL EQU $6F ;physical page len
|
||||||
|
SavIndX EQU $70 ;Temp location to save (X)
|
||||||
|
ByteCnt EQU $70 ;# of generated bytes so far
|
||||||
|
PrtCol EQU $71 ;Printing col
|
||||||
|
EIStack EQU $72 ;EdAsm Interpreter's stack ptr
|
||||||
|
CancelF EQU $73
|
||||||
|
NbrErrs EQU $74 ;# of errors
|
||||||
|
PrSlot EQU $76
|
||||||
|
AbortF EQU $77
|
||||||
|
SavIndY EQU $78 ;Temp location to save (Y)
|
||||||
|
SrcP EQU $79 ;Set to point to somewhere within src line
|
||||||
|
UnsortedP EQU $79 ;Ptr to a record of the unsorted aux work array
|
||||||
|
Src2P EQU $7B ;Copy of src ptr used during code listing
|
||||||
|
PC EQU $7D ;position/program counter
|
||||||
|
SortedP EQU $7D ;Ptr to a record of the sorted aux array
|
||||||
|
ObjPC EQU $7F ;PC for OBJ code store in mem
|
||||||
|
SymFBP EQU $7F ;Ptr to a symbol's flag byte field (use during pass1)
|
||||||
|
CodeLen EQU $7F ;curr len of code image of REL files (stored @ BOF)
|
||||||
|
AuxAryE EQU $7F ;Ptr to last end of sorted array
|
||||||
|
FileLen EQU $81 ;curr len of BIN/REL file
|
||||||
|
CurrORG EQU $83 ;curr origin addr
|
||||||
|
SymP EQU $85 ;Ptr to symbol
|
||||||
|
MnemP EQU $85 ;Ptr to mnenmonic table entry
|
||||||
|
Delimitr EQU $85 ;Double as delimiter
|
||||||
|
DTEndCol EQU $85 ;end index of DateTime str
|
||||||
|
StrType EQU $86 ;0=DCI -1=ASC
|
||||||
|
DTCurIdx EQU $86 ;curr index into DateTime str
|
||||||
|
MemTop EQU $87
|
||||||
|
TotLines EQU $89 ;3 bytes
|
||||||
|
VidSlot EQU $8C
|
||||||
|
SaveA EQU $8D
|
||||||
|
SaveY EQU $8E
|
||||||
|
SaveX EQU $8F
|
||||||
|
DskListF EQU $90 ;$00,$40,$80-list to txt file
|
||||||
|
LstDBIdx EQU $91 ;LST Data buf index, double as # of chars to write
|
||||||
|
WinLeft EQU $92 ;left & right edges
|
||||||
|
WinRight EQU $93 ;of 40-col window
|
||||||
|
X6502F EQU $94
|
||||||
|
HighMem EQU $95 ;HiMem of generated obj code
|
||||||
|
ExprAccF EQU $97 ;expression's accumulated flag bits
|
||||||
|
ColCnt EQU $97 ;curr print col
|
||||||
|
SortF EQU $98
|
||||||
|
NxtToken EQU $98 ;Flag to indicate nature of next char
|
||||||
|
LstCodeF EQU $99 ;Bits to control listing of machine code
|
||||||
|
SymRefCh EQU $99 ;Preceding char printed b4 symbol's addr
|
||||||
|
GMC EQU $9A ;$9A-$9D Generated Machine Code buf
|
||||||
|
IsFwdRef EQU $9A ;Forward ref bit was set
|
||||||
|
NumCols EQU $9B ;=2,4,6 # of print cols
|
||||||
|
SymIdx EQU $9C ;Save index into symbol record
|
||||||
|
ERfield EQU $9D ;Expr Result field
|
||||||
|
SymAddr EQU $9D ;Addr associated w/symbolicname
|
||||||
|
ValExpr EQU $9F ;value of expression
|
||||||
|
RLDEntP EQU $9F ;Ptr to RLD entry
|
||||||
|
WrkP EQU $A1 ;Work ptr to symbol table entry
|
||||||
|
JJJ EQU $9F ;Running vars used
|
||||||
|
III EQU $A1 ; during sorting
|
||||||
|
Length EQU $A3 ;len of inst => 1-1 byte, 2-2 bytes etc
|
||||||
|
ModWrdL EQU $A4 ;Permitted modes of a 65C02
|
||||||
|
ModWrdH EQU $A5 ; mnemonic/SW16 pseudo opcode
|
||||||
|
StrtIdx EQU $A3 ;Starting index of FOR loop
|
||||||
|
EndIdx EQU $A5 ;Ending Index of FOR loop
|
||||||
|
LenTIdx EQU $A6 ;Index into inst len table
|
||||||
|
Filler EQU $A7 ;byte used to fill reserved storage
|
||||||
|
SavLstF EQU $A7 ;Used to save List flags temporarily
|
||||||
|
GMCIdx EQU $A7 ;Used to index GMC buf during code generation
|
||||||
|
RadixCh EQU $A7 ;Char used to check radix during str2bin conversion
|
||||||
|
Jump EQU $A7 ;Gap btwn 2 elements
|
||||||
|
SavFByt EQU $A7 ;Save symbol's flag byte temporarily
|
||||||
|
BitsDig EQU $A8 ;# of bits/digit-use into bin/octal/hex conversion
|
||||||
|
LabelF EQU $A9 ;Instruction has a label field
|
||||||
|
RecCnt EQU $A9 ;Use to count the # of recs in aux array
|
||||||
|
NumRecs EQU $A9 ;Renamed above label
|
||||||
|
SubTIdx EQU $AA ;offset into a sub-table of opcode table
|
||||||
|
ZAB EQU $AB
|
||||||
|
ErrorF EQU $AC ;curr line is flagged as incorrect
|
||||||
|
ErrTIdx EQU $AC ;Used to index ErrInfo Table
|
||||||
|
msbF EQU $AD
|
||||||
|
J.TH EQU $AB ;offset/ptr to the j-th/i-th
|
||||||
|
I.TH EQU $AD ; elements of the aux array
|
||||||
|
EndianF EQU $AE ;little/big endian flag
|
||||||
|
Accum EQU $AF ;Main accumulator ($AF-$B0)
|
||||||
|
NewPC EQU $AF ;Used temporarily by DS directive
|
||||||
|
SymPJ EQU $AF
|
||||||
|
Ret816F EQU $B1 ;-1=16-bits,0-low 8-bits,1-high 8-bits
|
||||||
|
SymPI EQU $B1
|
||||||
|
RepChar EQU $B2 ;char used by REP directive
|
||||||
|
SymNbr EQU $B3 ;# of idfers declared as EXTRN/ENTRY (DEF/RE)
|
||||||
|
SymLen EQU $B3 ;len of symbolic name
|
||||||
|
SavSTS EQU $B3 ;Save start of symbol table
|
||||||
|
GblAbsF EQU $B4 ;Global Abs addr flag $00-ZDEF/ZREF; $01-DEF/REF
|
||||||
|
DummyF EQU $B5 ;dummy section flag
|
||||||
|
SavPC EQU $B6
|
||||||
|
SavObjPC EQU $B8
|
||||||
|
CodeImgLen EQU $B8
|
||||||
|
CondAsmF EQU $BA ;Conditional Assembly Flag $00,$40,$80
|
||||||
|
TabTIdx EQU $BB ;Index into Editor's tab table
|
||||||
|
SymFByte EQU $BC ;Symbol's curr flag byte
|
||||||
|
RelCodeF EQU $BD
|
||||||
|
DskSrcF EQU $BE ;-1=Disk src file, 0-mem src file
|
||||||
|
GenF EQU $BF ;N=1-suppress code gen,V=1-disk,V=0-mem
|
||||||
|
ObjDBIdx EQU $C0 ;Gen obj code buf index, double as # of bytes to write
|
||||||
|
IDskSrcF EQU $C1 ;msb=on - stmts fr INCLUDE file
|
||||||
|
MacroF EQU $C2 ;0=not using macros,$40,$06,$04,$80-macro file opened
|
||||||
|
MParmCnt EQU $C3
|
||||||
|
MacArg EQU $C4 ;macro argument 0-9
|
||||||
|
ZC5 EQU $C5 ;not used
|
||||||
|
FCTIndex EQU $C6 ;0,2,4,6,8 - Index of File Control tables (FCT)
|
||||||
|
PathP EQU $C7 ;Pathname ptr
|
||||||
|
SrcPathP EQU $C9 ;Curr src filename ptr
|
||||||
|
RelExprF EQU $CB ;If non-zero, rel addr expr/sub-expr
|
||||||
|
SavSTE EQU $CC ;temp save for hibyte of EO symbol table
|
||||||
|
SavSEF EQU $CC ;prev subexpr's RelExprF
|
||||||
|
NewF EQU $CD ;$80-new file is being assembled
|
||||||
|
Msg2P EQU $CE ;message ptr
|
||||||
|
Lower8 EQU $CE ;Low 8 bits of 16-bit val
|
||||||
|
ParmBIdx EQU $CE ;Index into parm string passed by EI
|
||||||
|
OnOffSW EQU $CE ;$80=ON,$00=FF
|
||||||
|
SrcP3 EQU $CE ;Ptr to partial src line-1
|
||||||
|
ZCE EQU $CE
|
||||||
|
ZCF EQU $CF
|
||||||
|
SymNodeP EQU $CE ;Use in printing of symbol table
|
||||||
|
TotCnt EQU $CF ;total # of bytes generated
|
||||||
|
RLDEnd EQU $D0 ;Points to end of Rel dict table (build downwards)
|
||||||
|
ZD2 EQU $D2 ;Not used
|
||||||
|
SavGenF EQU $D4 ;Save GenF when DSECT is declared
|
||||||
|
SBufP EQU $D5 ;ptr to SBuf/IBuf data buf
|
||||||
|
MsgP EQU $D5 ;Message ptr
|
||||||
|
HashIdx EQU $D7
|
||||||
|
PrvSymP EQU $D8 ;Ptr to previous symbol's node
|
||||||
|
NxtSymP EQU $DA ;Ptr to next symbol's node
|
||||||
|
NumCycles EQU $DD ;instruction's # of cycles
|
||||||
|
NbrWarns EQU $DE ;2 bytes used
|
||||||
|
*
|
||||||
|
* These flags are for the LST directive
|
||||||
|
* $00-OFF, non-zero=ON
|
||||||
|
*
|
||||||
|
LstFlags EQU $E0
|
||||||
|
LstCyc EQU $E0 ;cycle times (OFF)
|
||||||
|
LstUnAsm EQU $E1 ;unassembled source (ON)
|
||||||
|
LstExpMac EQU $E2 ;expansion of macro lines (ON)
|
||||||
|
LstWarns EQU $E3 ;warnings (ON)
|
||||||
|
LstGCode EQU $E4 ;generate obj code (OFF)
|
||||||
|
LstASym EQU $E5 ;Alphabetic symbol (ON)
|
||||||
|
LstVSym EQU $E6 ;Value-ordered Symbol (OFF)
|
||||||
|
Lst6Cols EQU $E7 ;6-col symbol dump (OFF)
|
||||||
|
ZE8 EQU $E8 ;Was init but not used
|
||||||
|
SW16F EQU $E9
|
||||||
|
ZPSaveY EQU $EA
|
||||||
|
RndF EQU $EC ;$80-use random data, $00-use filler byte
|
||||||
|
ErrNbr4 EQU $EB ;Err # x 4=index
|
||||||
|
*
|
||||||
|
DecimalS EQU $ED ;'0000' 4-byte ASCII str ($ED-$F0)
|
||||||
|
ZPRetAdr EQU $EF
|
||||||
|
MacPNLen EQU $F1 ;Len byte of Maclib prefix/Macro file PathName
|
||||||
|
*=================================================
|
24
EDASM.SRC/ASM/EXTERNALS.S
Normal file
24
EDASM.SRC/ASM/EXTERNALS.S
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
Name : EXTERNALS.S
|
||||||
|
End of file : 884
|
||||||
|
This file was generated using the DiskBrowser utility with minimal editing.
|
||||||
|
It is meant for viewing purposes only.
|
||||||
|
|
||||||
|
**************************************************
|
||||||
|
* EXTERN labels used by Assembler
|
||||||
|
* The 1024-byte buffers are used by ProDOS8 for I/O
|
||||||
|
*
|
||||||
|
X0800 EQU $0800
|
||||||
|
X6E00 EQU $6E00 ;1024-byte buf for MACRO defn file if List to File
|
||||||
|
MacExpBuf EQU $7200 ;$7200-$727F Use to expand macro lines
|
||||||
|
MacStrBuf EQU $7280 ;$7280-$72FF Use to store string parms passed
|
||||||
|
OLDataB EQU $7300 ;Online data buf
|
||||||
|
LstDBuf EQU $7300 ;256-bytes circular data buf for LST file
|
||||||
|
X7400 EQU $7400 ;1024-bytes buf for LST/MACRO file
|
||||||
|
ObjDataB EQU $BD00 ;128-byte data buf for obj code
|
||||||
|
AsmParmB EQU $BD80 ;128-byte buf use to pass by editor to pass parm to asmbler
|
||||||
|
XA100 EQU $A100 ;1024-bytes buf for OBJ file
|
||||||
|
XA500 EQU $A500 ;1024-bytes buf for SRC file
|
||||||
|
*XA900 EQU $A900 ;1024-bytes buf for INCLUDE file
|
||||||
|
*
|
||||||
|
HeaderT EQU $BC00 ;Table of ptrs to 1st node of singly linked lists
|
||||||
|
*=================================================
|
782
EDASM.SRC/BUGBYTER/BB1.S
Normal file
782
EDASM.SRC/BUGBYTER/BB1.S
Normal file
|
@ -0,0 +1,782 @@
|
||||||
|
Name : BB1.S
|
||||||
|
End of file : 14,078
|
||||||
|
This file was generated using the DiskBrowser utility with minimal editing.
|
||||||
|
It is meant for viewing purposes only.
|
||||||
|
|
||||||
|
ORG $0800
|
||||||
|
MSB ON
|
||||||
|
; BB (ProDOS version) was assembled @ $0800
|
||||||
|
; but may be run from any location starting
|
||||||
|
; from $0800 as long as there is enough memory
|
||||||
|
;
|
||||||
|
BBSTART EQU *
|
||||||
|
SEC
|
||||||
|
BCS SkipSWA
|
||||||
|
;
|
||||||
|
XUNDSW DB $80 ;Allow BB to call ProDOS
|
||||||
|
Btn0SW DB $00 ;Use Paddle button 0 for trace/suspend (ON=$80)
|
||||||
|
PDL0SW DB $80 ;Use Paddle 0 for trace rate
|
||||||
|
KBDPOLL DB $00 ;Tr/SS keyboard polling (msb on=OFF)
|
||||||
|
SNDSW DB $80 ;$80-ON
|
||||||
|
CYCLEC DW $0000 ;Cycle Counter
|
||||||
|
BARTC DW $FFFF ;Beginning & Ending Addresses
|
||||||
|
EARTC DW $FFFF ; of Real Time Code
|
||||||
|
;
|
||||||
|
IBuff EQU * ;$080E-$088D (128 chars)
|
||||||
|
SkipSWA LDA #iRTS
|
||||||
|
STA Z2F
|
||||||
|
JSR Z2F
|
||||||
|
RetHere EQU *
|
||||||
|
TSX
|
||||||
|
LDY STACK,X ;Hi
|
||||||
|
DEX
|
||||||
|
LDA STACK,X
|
||||||
|
SBC #>RetHere-1
|
||||||
|
STA Z44
|
||||||
|
BCS L0824
|
||||||
|
DEY
|
||||||
|
L0824 STY Z44+1 ;($44,$45)=load addr
|
||||||
|
;
|
||||||
|
CLC
|
||||||
|
ADC #>L08CF
|
||||||
|
STA MONPC ;bugbyter's main entry point
|
||||||
|
BCC L082E
|
||||||
|
INY
|
||||||
|
L082E STY MONPC+1
|
||||||
|
;
|
||||||
|
CLC
|
||||||
|
ADC #>BBDATA-L08CF ;#$46
|
||||||
|
STA Z46 ;Point to end of bugbyter's program code
|
||||||
|
TYA
|
||||||
|
ADC #<BBDATA-L08CF ;#$17
|
||||||
|
STA Z46+1
|
||||||
|
;
|
||||||
|
; This part of the code modifies the instruction @
|
||||||
|
; the load address to a JMP to BugByter's main entry point
|
||||||
|
;
|
||||||
|
LDY #0
|
||||||
|
LDA #iJMP
|
||||||
|
L083E STA (Z44),Y
|
||||||
|
LDA MONPC,Y ;Get load address
|
||||||
|
INY
|
||||||
|
CPY #3
|
||||||
|
BCC L083E
|
||||||
|
;
|
||||||
|
LDA Z44+1 ;Only need to modify the Hi byte because BB is
|
||||||
|
SBC #<BBSTART ; assembled @ $0800 which is the lowest mem page
|
||||||
|
STA Z44+1 ;($44,45)=offset to be added to abs addrs
|
||||||
|
L084E BCC L084E ;BB will hang if run addr below $800
|
||||||
|
;
|
||||||
|
; On fall thru, (MONPC) is pointing @ BugByter's main entry
|
||||||
|
; point. Basically, we will be looking for $X9,$XC,$XD,$XE
|
||||||
|
; $XF are assummed to be abs opcodes
|
||||||
|
; $29,$49,$69 etc are 2-byte immediate opcodes
|
||||||
|
;
|
||||||
|
L0850 LDY #0
|
||||||
|
LDA (MONPC),Y ;Get instruction's opcode
|
||||||
|
TAX ;save it temporarily
|
||||||
|
AND #%00011111 ;xxxx xxxx -> 000x xxxx
|
||||||
|
CMP #%00011001 ;Checking for opcodes $19,$39,$59 etc
|
||||||
|
BEQ L0874
|
||||||
|
AND #$0F ;0000 xxxx
|
||||||
|
CMP #%00001100 ;This should cover ($XC,$XD,$XE)
|
||||||
|
BCS L0874
|
||||||
|
AND #%00001101 ;0000 xx0x
|
||||||
|
CMP #%00001000 ;$X8 opcodes (1-byte)
|
||||||
|
BEQ L0890 ;NB: (Y)=0
|
||||||
|
TXA ;Restore opcode
|
||||||
|
BEQ L0890 ;BRK instruction
|
||||||
|
CMP #iJSR
|
||||||
|
BEQ L0874
|
||||||
|
AND #%10011111 ;x00x xxxx (Y)=0
|
||||||
|
BNE L088F ;Assume all are 2-byte instructions
|
||||||
|
BEQ L0890 ;($40,$60) always
|
||||||
|
;
|
||||||
|
; Handle 3-byte 65C02 instructions
|
||||||
|
; We only need to consider references to memory
|
||||||
|
; locations btwn BBSTART-BBDATA ($0800-$2150)
|
||||||
|
;
|
||||||
|
L0874 INY ;Skip opcode & low byte of abs addr
|
||||||
|
INY
|
||||||
|
LDA (MONPC),Y ;Abs addr's hi byte
|
||||||
|
CMP #<BBSTART ;Modify abs addrs btwn $0800-$2400
|
||||||
|
BCC L0890
|
||||||
|
CMP #BBEND+$100/256
|
||||||
|
BCS L0890
|
||||||
|
;
|
||||||
|
DEY
|
||||||
|
LDA (MONPC),Y ;Get abs addr's lobyte
|
||||||
|
ADC Z44 ;Add offset to get
|
||||||
|
STA (MONPC),Y ; relocated addr
|
||||||
|
INY
|
||||||
|
LDA (MONPC),Y
|
||||||
|
ADC Z44+1
|
||||||
|
STA (MONPC),Y
|
||||||
|
DEY ;Indexing lobyte
|
||||||
|
;
|
||||||
|
; The code in this area will be overwritten by BB.
|
||||||
|
; Saved area (67 bytes) for instructions and their format bytes
|
||||||
|
; when real BP addrs are set
|
||||||
|
;
|
||||||
|
L088F EQU *
|
||||||
|
INY
|
||||||
|
L0890 SEC ;Advance our PC
|
||||||
|
TYA
|
||||||
|
ADC MONPC
|
||||||
|
STA MONPC
|
||||||
|
BCC L089A
|
||||||
|
INC MONPC+1
|
||||||
|
;
|
||||||
|
L089A CMP Z46 ;Are we done with modifying
|
||||||
|
LDA MONPC+1
|
||||||
|
SBC Z46+1 ; all the abs addrs?
|
||||||
|
BCC L0850 ;nope
|
||||||
|
;
|
||||||
|
; Now, modify all JMP addrs of BB's cmd table
|
||||||
|
;
|
||||||
|
LDA Z44 ;NB:C set on fall thru
|
||||||
|
ADC #>CMDTBL-1
|
||||||
|
STA MONPC
|
||||||
|
LDA Z44+1
|
||||||
|
ADC #<CMDTBL
|
||||||
|
STA MONPC+1
|
||||||
|
;
|
||||||
|
LDY #0
|
||||||
|
L08B0 LDA (MONPC),Y ;Add offset to
|
||||||
|
ADC Z44
|
||||||
|
STA (MONPC),Y
|
||||||
|
INY
|
||||||
|
LDA (MONPC),Y
|
||||||
|
ADC Z44+1
|
||||||
|
STA (MONPC),Y ; the JMP addrs
|
||||||
|
INY
|
||||||
|
CPY #NumJmps
|
||||||
|
BCC L08B0
|
||||||
|
;
|
||||||
|
NOP
|
||||||
|
NOP
|
||||||
|
NOP
|
||||||
|
NOP
|
||||||
|
NOP
|
||||||
|
NOP
|
||||||
|
NOP
|
||||||
|
NOP
|
||||||
|
NOP
|
||||||
|
NOP
|
||||||
|
NOP
|
||||||
|
NOP
|
||||||
|
NOP
|
||||||
|
;=================================================
|
||||||
|
; MAIN ENTRY POINT
|
||||||
|
;
|
||||||
|
L08CF LDA OURCTLYV ;Ctrl-Y vector
|
||||||
|
STA USRADR+1
|
||||||
|
LDA OURCTLYV+1
|
||||||
|
STA USRADR+2
|
||||||
|
;
|
||||||
|
LDA BRKV ;Save curr BREAK vector
|
||||||
|
STA SVBRKV
|
||||||
|
LDA BRKV+1
|
||||||
|
STA SVBRKV+1
|
||||||
|
LDA OURBRKV ; & use BB's
|
||||||
|
STA BRKV
|
||||||
|
LDA OURBRKV+1
|
||||||
|
STA BRKV+1
|
||||||
|
;
|
||||||
|
LDA #>MONZ ;RESET vector
|
||||||
|
STA SOFTEV
|
||||||
|
LDA #<MONZ
|
||||||
|
STA SOFTEV+1
|
||||||
|
LDA #$5A
|
||||||
|
STA PWREDUP
|
||||||
|
LDX #>BBStack ;BB's stack usage ($100-$11F)
|
||||||
|
TXS
|
||||||
|
JSR SwapZP
|
||||||
|
JSR DRegHdr ;Show registers
|
||||||
|
JSR L0ADD ;Show all SDs
|
||||||
|
;
|
||||||
|
; Display copyright notice
|
||||||
|
;
|
||||||
|
DCPYRCMD LDX #$26
|
||||||
|
L0910 LDA COPYRK,X
|
||||||
|
STA SLIN23+1,X
|
||||||
|
DEX
|
||||||
|
BPL L0910
|
||||||
|
JMP BBGetLn
|
||||||
|
;=================================================
|
||||||
|
; BB's ctrl-Y Handler
|
||||||
|
;
|
||||||
|
WrmStrt JSR SwapZP
|
||||||
|
L091F JSR DRegHdr
|
||||||
|
L0922 JSR L0ADD ;Show all SDs
|
||||||
|
XDelLin JMP DelLin
|
||||||
|
;=================================================
|
||||||
|
; Execute cmd
|
||||||
|
;
|
||||||
|
XCmd LDX INPUTLEN ;null entry?
|
||||||
|
BEQ XDelLin
|
||||||
|
BIT MemPgDSW ;Mem Page being displayed?
|
||||||
|
BMI ParseCmd ;Yes
|
||||||
|
JSR HndlCmd
|
||||||
|
BEQ ParseCmd ;No hit
|
||||||
|
;
|
||||||
|
STX Z40 ;Entry #
|
||||||
|
TXA
|
||||||
|
ASL
|
||||||
|
TAX
|
||||||
|
LDA CMDTBL+1,X
|
||||||
|
PHA
|
||||||
|
LDA CMDTBL,X
|
||||||
|
PHA
|
||||||
|
RTS
|
||||||
|
;
|
||||||
|
EqSign INY
|
||||||
|
INY
|
||||||
|
JSR Bin2Dec
|
||||||
|
JMP L0982
|
||||||
|
;
|
||||||
|
; Convert dec rep to hex rep
|
||||||
|
;
|
||||||
|
PlusDecS LDA #$00
|
||||||
|
BEQ L0953 ;always
|
||||||
|
NegDecS LDA #$80
|
||||||
|
L0953 STA Z40
|
||||||
|
INY
|
||||||
|
JSR Dec2Bin ;First convert dec str to its binary value
|
||||||
|
LDA IBuff,Y
|
||||||
|
CMP #'='
|
||||||
|
BNE L09D8 ;Input err
|
||||||
|
INY
|
||||||
|
INY
|
||||||
|
LDA #'$'
|
||||||
|
STA (ScrLoc),Y
|
||||||
|
INY
|
||||||
|
BIT Z40
|
||||||
|
BPL DspHexS ;+ve dec->hex
|
||||||
|
;
|
||||||
|
SEC
|
||||||
|
LDA #0 ;-ve dec->hex
|
||||||
|
SBC Z3E
|
||||||
|
STA Z3E
|
||||||
|
LDA #0
|
||||||
|
SBC Z3E+1
|
||||||
|
STA Z3E+1
|
||||||
|
;
|
||||||
|
DspHexS LDA Z3E+1 ;Now convert binary value
|
||||||
|
JSR PUTHEX ; to its hex rep &
|
||||||
|
LDA Z3E
|
||||||
|
JSR PUTHEX ; show on cmdln SD
|
||||||
|
;
|
||||||
|
L0982 JSR CPY2IB ;Copy scrn ln to input buffer
|
||||||
|
JMP BOCL
|
||||||
|
;
|
||||||
|
ParseCmd LDA #>SLIN23
|
||||||
|
STA ScrLoc
|
||||||
|
LDA #<SLIN23
|
||||||
|
STA ScrLoc+1
|
||||||
|
;
|
||||||
|
LDY #0 ;Get 1st char of
|
||||||
|
LDA IBuff,Y ; user's input
|
||||||
|
CMP #'+'
|
||||||
|
BEQ PlusDecS
|
||||||
|
CMP #'-'
|
||||||
|
BEQ NegDecS ;DecS -> Bin value -> HexS
|
||||||
|
CMP #'$'
|
||||||
|
BNE L09A2
|
||||||
|
INY ;Skip over $
|
||||||
|
;
|
||||||
|
L09A2 JSR Hex2Bin ;Do we have a hexdec str?
|
||||||
|
BCS InputErr ;No
|
||||||
|
LDA IBuff,Y
|
||||||
|
CMP #'='
|
||||||
|
BEQ EqSign ;HexS -> DecS
|
||||||
|
;
|
||||||
|
CMP #':' ;Addr:
|
||||||
|
BEQ L0A16 ;Mem Page Display or assignment
|
||||||
|
;
|
||||||
|
BIT MemPgDSW
|
||||||
|
BMI InputErr
|
||||||
|
JSR ToUpper
|
||||||
|
;
|
||||||
|
; Debugging modes viz TRACE, SINGLE STEP, EXECUTE
|
||||||
|
; AddrT, AddrS, AddrG, AddrJ
|
||||||
|
;
|
||||||
|
CMP #'T'
|
||||||
|
BNE L09C1
|
||||||
|
JMP TKEY1
|
||||||
|
;
|
||||||
|
L09C1 CMP #'S'
|
||||||
|
BNE L09C8
|
||||||
|
JMP SKEY1
|
||||||
|
;
|
||||||
|
L09C8 CMP #'G'
|
||||||
|
BNE L09CF
|
||||||
|
JMP GKEY1
|
||||||
|
;
|
||||||
|
L09CF CMP #'J'
|
||||||
|
BNE L09D6
|
||||||
|
JMP JKEY1
|
||||||
|
; AddrL
|
||||||
|
L09D6 CMP #'L' ;DisAssembly
|
||||||
|
L09D8 BNE InputErr
|
||||||
|
JMP LKEY1
|
||||||
|
;
|
||||||
|
InputErr JSR BELL2
|
||||||
|
JMP BOCL
|
||||||
|
;=================================================
|
||||||
|
; Parse the cmd line for keywords
|
||||||
|
; Ret Z=1 no hit, Z=0 hit
|
||||||
|
;
|
||||||
|
HndlCmd LDX #$00
|
||||||
|
LDA CMDTBLP
|
||||||
|
STA Z40PTR ;points @ table of COMMAND keywords
|
||||||
|
LDA CMDTBLP+1
|
||||||
|
STA Z40PTR+1
|
||||||
|
;
|
||||||
|
L09EF LDY #0
|
||||||
|
LDA (Z40PTR),Y ;Get entry len
|
||||||
|
BEQ L0A15 ;end of table
|
||||||
|
STA Z42
|
||||||
|
L09F7 INY
|
||||||
|
CPY Z42
|
||||||
|
BEQ L0A14 ;got a hit
|
||||||
|
LDA IBuff-1,Y
|
||||||
|
JSR ToUpper
|
||||||
|
CMP (Z40PTR),Y
|
||||||
|
BEQ L09F7 ;keep searching
|
||||||
|
;
|
||||||
|
INX ;cmd # (to be used later as an index)
|
||||||
|
CLC
|
||||||
|
LDA Z40 ;bump to next entry
|
||||||
|
ADC Z42
|
||||||
|
STA Z40
|
||||||
|
BCC L09EF
|
||||||
|
INC Z41
|
||||||
|
BCS L09EF ;always
|
||||||
|
L0A14 DEY ;Z=0 to flag a hit
|
||||||
|
L0A15 RTS
|
||||||
|
;
|
||||||
|
; An assignment or memory page display
|
||||||
|
;
|
||||||
|
L0A16 INY
|
||||||
|
STY ALTYSV
|
||||||
|
CPY INPUTLEN
|
||||||
|
BEQ L0A8F ;-> display mem page
|
||||||
|
;
|
||||||
|
; Altering mem contents
|
||||||
|
;
|
||||||
|
JSR SVMONPC
|
||||||
|
LDA Z3E
|
||||||
|
STA MONPC
|
||||||
|
STA IMM1+1
|
||||||
|
LDA Z3E+1
|
||||||
|
STA MONPC+1
|
||||||
|
STA IMM1+2
|
||||||
|
;
|
||||||
|
JSR DoAsm ;Try to assemble inst
|
||||||
|
JSR RSTMONPC
|
||||||
|
LDY ALTYSV
|
||||||
|
DEY
|
||||||
|
L0A3A INY
|
||||||
|
L0A3B CPY INPUTLEN ;End of input?
|
||||||
|
BEQ L0AB8 ;Yes, chk if a mem page display is needed
|
||||||
|
;
|
||||||
|
LDA IBuff,Y
|
||||||
|
CMP #SPACE
|
||||||
|
BEQ L0A3A ;Skip blanks
|
||||||
|
;
|
||||||
|
; Memory cell assignment. Altering the contents of mem
|
||||||
|
; Including 6502 instr & operands
|
||||||
|
;
|
||||||
|
CMP #'"'
|
||||||
|
BEQ L0A5C
|
||||||
|
CMP #'''
|
||||||
|
BEQ L0A60 ;-> string assignment
|
||||||
|
;
|
||||||
|
JSR Hex2Bin
|
||||||
|
BCS InputErr
|
||||||
|
LDA Z3E
|
||||||
|
JSR L0AC3 ;Assign to mem
|
||||||
|
JMP L0A3B ;Loop back for more
|
||||||
|
;
|
||||||
|
; String assignment
|
||||||
|
;
|
||||||
|
L0A5C LDA #$00
|
||||||
|
BEQ L0A62 ;always
|
||||||
|
L0A60 LDA #$80
|
||||||
|
L0A62 STA HIGHB ;string type
|
||||||
|
L0A65 INY
|
||||||
|
CPY INPUTLEN
|
||||||
|
BEQ L0AB8
|
||||||
|
LDA IBuff,Y
|
||||||
|
CMP #'/' ;Accepts next char verbatim
|
||||||
|
BNE L0A7E
|
||||||
|
INY
|
||||||
|
CPY INPUTLEN
|
||||||
|
BEQ L0AB8
|
||||||
|
LDA IBuff,Y ;Get ASCII char
|
||||||
|
JMP L0A86
|
||||||
|
;
|
||||||
|
L0A7E CMP #'"' ;Check for closing quotes
|
||||||
|
BEQ L0A3A
|
||||||
|
CMP #'''
|
||||||
|
BEQ L0A3A
|
||||||
|
;
|
||||||
|
L0A86 EOR HIGHB
|
||||||
|
JSR L0AC3 ;Assign to mem
|
||||||
|
JMP L0A65 ;Next char
|
||||||
|
;
|
||||||
|
; Do a mem page display
|
||||||
|
;
|
||||||
|
L0A8F LDA Z3E ;Starting addr
|
||||||
|
STA MBStrtAdr
|
||||||
|
LDA Z3E+1
|
||||||
|
STA MBStrtAdr+1
|
||||||
|
BIT MemPgDSW
|
||||||
|
BMI L0AA1
|
||||||
|
JSR ClrScrn ;Blank entire scrn if necessary
|
||||||
|
;
|
||||||
|
L0AA1 JSR L1D23 ;Display mem page
|
||||||
|
LDA #$80
|
||||||
|
STA MemPgDSW
|
||||||
|
LDA IMM9+1
|
||||||
|
STA IMM1+1
|
||||||
|
LDA IMM9+2
|
||||||
|
STA IMM1+2
|
||||||
|
JMP L0922
|
||||||
|
;
|
||||||
|
L0AB8 BIT MemPgDSW
|
||||||
|
BPL L0AC0
|
||||||
|
JSR L1D23
|
||||||
|
;
|
||||||
|
L0AC0 JMP L0922
|
||||||
|
;=================================================
|
||||||
|
; Change contents of mem cell
|
||||||
|
;
|
||||||
|
L0AC3 PHA
|
||||||
|
STY ALTYSV
|
||||||
|
JSR SwapZP
|
||||||
|
PLA
|
||||||
|
IMM1 STA $FFFF ;curr Mem loc
|
||||||
|
JSR SwapZP
|
||||||
|
LDY ALTYSV
|
||||||
|
INC IMM1+1
|
||||||
|
BNE L0ADC
|
||||||
|
INC IMM1+2
|
||||||
|
L0ADC RTS
|
||||||
|
;=================================================
|
||||||
|
; Update BB SDs
|
||||||
|
;
|
||||||
|
L0ADD BIT MasDSW
|
||||||
|
BPL L0ADC
|
||||||
|
BIT MemPgDSW
|
||||||
|
BMI L0ADC
|
||||||
|
;
|
||||||
|
JSR DBBREGS ;Show (regs)
|
||||||
|
JSR DMONPC ;Show PC
|
||||||
|
JSR DREGS
|
||||||
|
JSR L14C3 ;Show Stack SD
|
||||||
|
JSR L151A ;Show MC SD
|
||||||
|
JMP L1719 ;Show BP SD
|
||||||
|
;=================================================
|
||||||
|
; ($0AF9) BB Command Level
|
||||||
|
;
|
||||||
|
BBGetLn JSR CLRIB
|
||||||
|
LDY #1
|
||||||
|
STY Z40
|
||||||
|
LDX #$00
|
||||||
|
STX Z41
|
||||||
|
STX Z42
|
||||||
|
STX INSFLAG
|
||||||
|
BEQ L0B36 ;always
|
||||||
|
;
|
||||||
|
; This rtn allows user to type up to 128 chars using the
|
||||||
|
; 39-char CmdLn SD. We may think of this SD as a 39-char
|
||||||
|
; wide window into the IBuff which can store up to 128 chars
|
||||||
|
;
|
||||||
|
; (Z40) - cursor posn within cmdln SD (1-39)
|
||||||
|
; (Z41) - IBuff index of char at cursor posn
|
||||||
|
; (Z42) - IBuff index of char at posn 1 of cmdln SD
|
||||||
|
; Posn 0 of SD is the colon prompt
|
||||||
|
;
|
||||||
|
DelLin JSR CLRIB
|
||||||
|
BOCL LDX #0
|
||||||
|
STX Z42
|
||||||
|
LDY #1
|
||||||
|
CMDCLP CLC
|
||||||
|
InsChar ROR INSFLAG ;bit7=0 => overwrite mode
|
||||||
|
L0B18 STY Z40 ;cursor posn
|
||||||
|
STX Z41 ;index of char under cursor
|
||||||
|
;
|
||||||
|
LDY #1 ;Skip past colon
|
||||||
|
LDX Z42 ;Start refresh of cmdln SD fr here
|
||||||
|
L0B20 LDA IBuff,X
|
||||||
|
CMP #SPACE
|
||||||
|
BCS L0B29
|
||||||
|
AND #$3F ;Convert to inverse char (00-3F)
|
||||||
|
L0B29 STA SLIN23,Y
|
||||||
|
INX
|
||||||
|
INY
|
||||||
|
CPY #40 ;Only 1-39 chars are displayed
|
||||||
|
BNE L0B20 ;next char
|
||||||
|
;
|
||||||
|
LDY Z40 ;curr cursor posn
|
||||||
|
LDX Z41 ;index into IBuff
|
||||||
|
L0B36 LDA SLIN23,Y
|
||||||
|
AND #$3F ;$00-$3F
|
||||||
|
ORA #$40 ;$40-$7F
|
||||||
|
STA SLIN23,Y ;Flash the char
|
||||||
|
LDA #':' ;Put a colon in front
|
||||||
|
STA SLIN23 ; of cmdln SD
|
||||||
|
;
|
||||||
|
WAITK1 LDA KBD
|
||||||
|
BPL WAITK1
|
||||||
|
;
|
||||||
|
STA KBDSTROBE
|
||||||
|
CMP #CTRLX
|
||||||
|
BEQ DelLin ;Clear every thing and re-start input
|
||||||
|
CMP #CTRLB
|
||||||
|
BEQ BOCL
|
||||||
|
CMP #TAB
|
||||||
|
BEQ InsChar ;Proceed to set INSERT flag (NB. C=1)
|
||||||
|
CMP #ESC
|
||||||
|
BNE L0B6C
|
||||||
|
CPX #0 ;Was it the 1st char?
|
||||||
|
BNE BOCL ;No, move cursor to BO input line
|
||||||
|
;
|
||||||
|
LSR MemPgDSW ;msb=0
|
||||||
|
BIT MemPgDSW ;Was MEM PAGE SD displayed?
|
||||||
|
BVC L0B36 ;No, get 1st char (Y=1, X=0)
|
||||||
|
JMP L091F
|
||||||
|
;
|
||||||
|
L0B6C CMP #SPACE ;Was space bar pressed?
|
||||||
|
BNE L0B77
|
||||||
|
CPX #0 ;Was 1st char a space?
|
||||||
|
BNE L0B77 ;char is a space but it's not 1st char
|
||||||
|
JMP DNxtMem ;Yes
|
||||||
|
;
|
||||||
|
L0B77 CMP #CURSL ;BS key
|
||||||
|
BEQ ML1CH
|
||||||
|
CMP #DELCH ;Delete key
|
||||||
|
BEQ ML1CH
|
||||||
|
;
|
||||||
|
CMP #CURSR ;FS
|
||||||
|
BEQ MR1CH
|
||||||
|
CMP #CTRLD
|
||||||
|
BEQ DELCHR
|
||||||
|
CMP #CTRLC
|
||||||
|
BEQ ASISST
|
||||||
|
CMP #CTRLN
|
||||||
|
BEQ EOCL
|
||||||
|
CMP #CR
|
||||||
|
BEQ L0BFA ;Accept input
|
||||||
|
;
|
||||||
|
CMP #SPACE ;If ctrl-char,
|
||||||
|
BCC L0B36 ; ignore input char
|
||||||
|
BIT INSFLAG ;Insert mode?
|
||||||
|
BPL Add2IB ;No, Overwrite mode
|
||||||
|
JSR MVCHARS ;Move chars forward
|
||||||
|
;
|
||||||
|
Add2IB STA IBuff,X ;Replace old char w/new one
|
||||||
|
L0BA2 CPX #127 ;maxlen?
|
||||||
|
BNE L0BAC
|
||||||
|
JSR BELL2 ;Too many chars
|
||||||
|
JMP CMDCLP
|
||||||
|
;
|
||||||
|
L0BAC INX
|
||||||
|
CPY #39 ;Is it at the edge of SD?
|
||||||
|
BNE L0BB4 ;No, proceed to incr (Y)
|
||||||
|
INC Z42
|
||||||
|
DB $24 ;Y=39 on fall thru
|
||||||
|
L0BB4 INY
|
||||||
|
JMP L0B18
|
||||||
|
;
|
||||||
|
MR1CH CLC
|
||||||
|
ROR INSFLAG ;Set overwrite mode
|
||||||
|
BPL L0BA2 ;always
|
||||||
|
;
|
||||||
|
ML1CH DEX
|
||||||
|
BPL L0BC4
|
||||||
|
JMP BOCL ;(X) was 0
|
||||||
|
L0BC4 CPY #1 ;Is cursor @ BO SD?
|
||||||
|
BNE L0BCB ;No, just decr (Y)
|
||||||
|
DEC Z42 ;Yes
|
||||||
|
DB $24 ;NB. On fall thru (Y) = 1
|
||||||
|
L0BCB DEY
|
||||||
|
JMP CMDCLP
|
||||||
|
;
|
||||||
|
; Enter next key verbatim
|
||||||
|
;
|
||||||
|
ASISST LDA #$20 ;ASCII space
|
||||||
|
STA SLIN23,Y
|
||||||
|
WAITK2 LDA KBD
|
||||||
|
BPL WAITK2
|
||||||
|
STA KBDSTROBE ;Clear key latch
|
||||||
|
STA IBuff,X ;Store key as it is
|
||||||
|
BMI MR1CH ;always
|
||||||
|
;
|
||||||
|
DELCHR STX Z40 ;Save temporarily
|
||||||
|
L0BE3 CPX #127 ;maxlen
|
||||||
|
BEQ L0BF0
|
||||||
|
LDA IBuff+1,X ;Shift chars left
|
||||||
|
STA IBuff,X ; within input buffer
|
||||||
|
INX
|
||||||
|
BNE L0BE3 ;Always since (X) < 128
|
||||||
|
L0BF0 LDA #SPACE ;Replace with space
|
||||||
|
STA IBuff,X
|
||||||
|
LDX Z40 ;Restore
|
||||||
|
JMP CMDCLP
|
||||||
|
;
|
||||||
|
; CR - Accept user input
|
||||||
|
;
|
||||||
|
L0BFA LDA #SPACE
|
||||||
|
STX INPUTLEN
|
||||||
|
L0BFF STA SLIN23,Y ;Clear rest of scrn line
|
||||||
|
INY
|
||||||
|
CPY #40
|
||||||
|
BNE L0BFF
|
||||||
|
;
|
||||||
|
JSR ClrIBZ ;Clear rest of buffer
|
||||||
|
JMP XCmd
|
||||||
|
;
|
||||||
|
EOCL LDX #127
|
||||||
|
L0C0F LDA IBuff,X ;Trailing spaces
|
||||||
|
CMP #SPACE
|
||||||
|
BNE L0C19
|
||||||
|
DEX
|
||||||
|
BPL L0C0F
|
||||||
|
L0C19 INX
|
||||||
|
BPL L0C1D
|
||||||
|
DEX ;(X) was 128, so set to 127
|
||||||
|
;
|
||||||
|
L0C1D TXA
|
||||||
|
TAY ;(Y)=(X)
|
||||||
|
LDA #0
|
||||||
|
CPX #39
|
||||||
|
BCC L0C2A
|
||||||
|
;
|
||||||
|
TXA
|
||||||
|
LDY #38 ;Y becomes 39 on looping back
|
||||||
|
SBC #38
|
||||||
|
;
|
||||||
|
L0C2A STA Z42 ;index of char @ posn 1 of SD
|
||||||
|
INY
|
||||||
|
JMP CMDCLP
|
||||||
|
;=================================================
|
||||||
|
; ($0C30) Fill the input buffer with 128 blanks
|
||||||
|
;
|
||||||
|
CLRIB LDX #0
|
||||||
|
LDA #SPACE
|
||||||
|
ClrIBZ STA IBuff,X
|
||||||
|
INX
|
||||||
|
BPL ClrIBZ
|
||||||
|
RTS
|
||||||
|
;=================================================
|
||||||
|
; Move chars forward in IBuff to make space
|
||||||
|
; for char to be inserted
|
||||||
|
;
|
||||||
|
MVCHARS PHA ;save char to be inserted
|
||||||
|
STX Z40 ;curr index
|
||||||
|
LDX #127
|
||||||
|
L0C40 CPX Z40 ;finish?
|
||||||
|
BEQ L0C4D ;done
|
||||||
|
LDA IBuff-1,X
|
||||||
|
STA IBuff,X
|
||||||
|
DEX
|
||||||
|
BPL L0C40
|
||||||
|
L0C4D PLA
|
||||||
|
LDX Z40
|
||||||
|
RTS
|
||||||
|
;=================================================
|
||||||
|
; ($0C51) Display next mem location on cmdln SD
|
||||||
|
;
|
||||||
|
DNxtMem LDA #>SLIN23
|
||||||
|
STA STOSCR+1
|
||||||
|
LDA #<SLIN23
|
||||||
|
STA STOSCR+2
|
||||||
|
LDA IMM1+2
|
||||||
|
JSR STOHEX
|
||||||
|
LDA IMM1+1
|
||||||
|
JSR STOHEX
|
||||||
|
;
|
||||||
|
LDA #':'
|
||||||
|
STA SLIN23,Y
|
||||||
|
JSR CPY2IB
|
||||||
|
LDY #6 ;scrn offset into cmdln SD
|
||||||
|
LDX #5 ;Index into IBuff
|
||||||
|
JMP L0B36
|
||||||
|
;=================================================
|
||||||
|
; ($0C76) Convert a hex str into its binary value
|
||||||
|
; Return result in ($3E,$3F)
|
||||||
|
;
|
||||||
|
Hex2Bin LDA #$00
|
||||||
|
STA Z3E ;result
|
||||||
|
STA Z3E+1
|
||||||
|
STY Z43
|
||||||
|
L0C7E LDA IBuff,Y
|
||||||
|
JSR Add2Bin
|
||||||
|
BCS L0C8C ;char is not a hex digit
|
||||||
|
INY
|
||||||
|
CPY INPUTLEN
|
||||||
|
BNE L0C7E ;convert next char
|
||||||
|
L0C8C CPY Z43
|
||||||
|
BNE L0CB1 ;--> C=0
|
||||||
|
RTS
|
||||||
|
;=================================================
|
||||||
|
; ($0C91) Convert a ASCII hex digit into its binary
|
||||||
|
; value & combine it into with the partial result
|
||||||
|
; ($3E,$3F) - partial result
|
||||||
|
; C=1 - (A) is not an ASC hex char
|
||||||
|
; (A) & (X) - changed
|
||||||
|
;
|
||||||
|
Add2Bin EOR #'0' ;Change numeric char into its binary value
|
||||||
|
CMP #10
|
||||||
|
BCC L0C9F ;Was ASCII '0'-'9';now $00-$09
|
||||||
|
ADC #$88 ;Adjust
|
||||||
|
ORA #$20
|
||||||
|
CMP #$FA ;$FA-$FF (ASCII 'A'-'F')
|
||||||
|
BCC L0CB3 ;On fall thru (A)=$0A-$0F
|
||||||
|
;
|
||||||
|
L0C9F AND #$0F ;Mask off upper nybble
|
||||||
|
STA Z44 ;$00-$0F
|
||||||
|
LDX #4
|
||||||
|
LDA Z3E ;Shift to accommodate
|
||||||
|
L0CA7 ASL ; the incoming value
|
||||||
|
ROL Z3E+1
|
||||||
|
DEX
|
||||||
|
BNE L0CA7
|
||||||
|
ORA Z44 ;Combine it
|
||||||
|
STA Z3E
|
||||||
|
L0CB1 CLC
|
||||||
|
DB $24
|
||||||
|
L0CB3 SEC ;Invalid numeral
|
||||||
|
RTS
|
||||||
|
;=================================================
|
||||||
|
; ($0CB5) Display the topmost line of column
|
||||||
|
; and the break point headers
|
||||||
|
;
|
||||||
|
DRegHdr BIT MasDSW
|
||||||
|
BPL L0CE8
|
||||||
|
JSR ClrScrn ;Clear entire screen if necessary
|
||||||
|
LDX #'C' ;cycle
|
||||||
|
STX SLIN00
|
||||||
|
DEX
|
||||||
|
STX SLIN00+8 ;"B" - break point reg
|
||||||
|
LDA #'R' ;rate
|
||||||
|
STA SLIN00+5
|
||||||
|
;
|
||||||
|
L0CCB LDX L2105 ;Set (ScrLoc)
|
||||||
|
JSR VTABX
|
||||||
|
;
|
||||||
|
LDY #39
|
||||||
|
L0CD3 LDA REGSK-11,Y
|
||||||
|
STA SLIN00,Y
|
||||||
|
LDA BPHDR-11,Y ;BP header
|
||||||
|
STA (ScrLoc),Y
|
||||||
|
DEY
|
||||||
|
CPY #10
|
||||||
|
BNE L0CD3
|
||||||
|
;
|
||||||
|
LDA #$00
|
||||||
|
STA MemPgDSW
|
||||||
|
L0CE8 RTS
|
1590
EDASM.SRC/BUGBYTER/BB2.S
Normal file
1590
EDASM.SRC/BUGBYTER/BB2.S
Normal file
File diff suppressed because it is too large
Load Diff
1903
EDASM.SRC/BUGBYTER/BB3.S
Normal file
1903
EDASM.SRC/BUGBYTER/BB3.S
Normal file
File diff suppressed because it is too large
Load Diff
146
EDASM.SRC/BUGBYTER/EQUATES.S
Normal file
146
EDASM.SRC/BUGBYTER/EQUATES.S
Normal file
|
@ -0,0 +1,146 @@
|
||||||
|
Name : EQUATES.S
|
||||||
|
End of file : 2,654
|
||||||
|
This file was generated using the DiskBrowser utility with minimal editing.
|
||||||
|
It is meant for viewing purposes only.
|
||||||
|
|
||||||
|
;---------------------------------------------------------;
|
||||||
|
; Disassembled with The Flaming Bird Disassembler ;
|
||||||
|
; (c) Phoenix corp. 1992,93 - All rights reserved ;
|
||||||
|
; References: ;
|
||||||
|
; Neil Parker's 6502 instruction set ;
|
||||||
|
; Apple II Monitor ;
|
||||||
|
; Appendix C pg 203 of WorkBench Manual ;
|
||||||
|
;---------------------------------------------------------;
|
||||||
|
WNDLFT EQU $20
|
||||||
|
WNDWDTH EQU $21
|
||||||
|
WNDTOP EQU $22
|
||||||
|
WNDBTM EQU $23
|
||||||
|
CH EQU $24
|
||||||
|
CV EQU $25
|
||||||
|
BASL EQU $28
|
||||||
|
BASH EQU $29
|
||||||
|
CSWL EQU $36
|
||||||
|
Z2F EQU $2F
|
||||||
|
;
|
||||||
|
DSECT
|
||||||
|
ORG $3A
|
||||||
|
MONPC EQU *
|
||||||
|
PZWS EQU *
|
||||||
|
Z3APTR DS 2
|
||||||
|
ScrLoc DS 2
|
||||||
|
Z3E DS 2
|
||||||
|
Z40 DS 1
|
||||||
|
Z41 DS 1
|
||||||
|
Z40PTR EQU Z40
|
||||||
|
Z42 DS 1
|
||||||
|
Z43 DS 1
|
||||||
|
Z44 DS 1
|
||||||
|
Z43PTR EQU Z43
|
||||||
|
CPURegs EQU *
|
||||||
|
HACCUM DS 1 ;$45-$49
|
||||||
|
HXREG DS 1
|
||||||
|
HYREG DS 1
|
||||||
|
HFLAGS DS 1
|
||||||
|
HSTAKP DS 1
|
||||||
|
Z46 EQU HXREG
|
||||||
|
DEND
|
||||||
|
;
|
||||||
|
; Apple keycodes
|
||||||
|
;
|
||||||
|
CTRLB EQU $82
|
||||||
|
CTRLC EQU $83
|
||||||
|
CTRLD EQU $84
|
||||||
|
BEL EQU $87
|
||||||
|
CURSL EQU $88 ;ctrl-H
|
||||||
|
TAB EQU $89
|
||||||
|
CR EQU $8D
|
||||||
|
CTRLN EQU $8E
|
||||||
|
CURSR EQU $95 ;ctrlU
|
||||||
|
CTRLX EQU $98
|
||||||
|
ESC EQU $9B
|
||||||
|
SPACE EQU $A0
|
||||||
|
DELCH EQU $FF
|
||||||
|
;
|
||||||
|
STACK EQU $0100
|
||||||
|
BBStack EQU $011F
|
||||||
|
INBUF EQU $200 ;input buffer for BI
|
||||||
|
DOSWrm EQU $03D0 ;ProDOS warm start vector
|
||||||
|
BRKV EQU $03F0 ;BREAK vector
|
||||||
|
SOFTEV EQU $03F2 ;reset vector
|
||||||
|
PWREDUP EQU $03F4
|
||||||
|
USRADR EQU $03F8 ;ctl-y handler
|
||||||
|
;
|
||||||
|
DSECT
|
||||||
|
ORG $400
|
||||||
|
SLIN00 DS 40 ; $0400
|
||||||
|
SLIN08 DS 40 ; $0428
|
||||||
|
SLIN16 DS 40 ; $0450
|
||||||
|
SHOLA0 DS 8 ; $0478..$047F
|
||||||
|
SLIN01 DS 40 ; $0480
|
||||||
|
SLIN09 DS 40 ; $04A8
|
||||||
|
SLIN17 DS 40 ; $04D0
|
||||||
|
SHOLA1 DS 8 ; $04F8..$04FF
|
||||||
|
SLIN02 DS 40 ; $0500
|
||||||
|
SLIN10 DS 40 ; $0528
|
||||||
|
SLIN18 DS 40 ; $0550
|
||||||
|
SHOLA2 DS 8 ; $0578..$057F
|
||||||
|
SLIN03 DS 40 ; $0580
|
||||||
|
SLIN11 DS 40 ; $05A8
|
||||||
|
SLIN19 DS 40 ; $05D0
|
||||||
|
SHOLA3 DS 8 ; $05F8..$05FF
|
||||||
|
SLIN04 DS 40 ; $0600
|
||||||
|
SLIN12 DS 40 ; $0628
|
||||||
|
SLIN20 DS 40 ; $0650
|
||||||
|
SHOLA4 DS 8 ; $0678..$067F
|
||||||
|
SLIN05 DS 40 ; $0680
|
||||||
|
SLIN13 DS 40 ; $06A8
|
||||||
|
SLIN21 DS 40 ; $06D0
|
||||||
|
SHOLA5 DS 8 ; $06F8..$06FF
|
||||||
|
SLIN06 DS 40 ; $0700
|
||||||
|
SLIN14 DS 40 ; $0728
|
||||||
|
SLIN22 DS 40 ; $0750
|
||||||
|
SHOLA6 DS 8 ; $0778..$077F
|
||||||
|
SLIN07 DS 40 ; $0780
|
||||||
|
SLIN15 DS 40 ; $07A8
|
||||||
|
SLIN23 DS 40 ; $07D0
|
||||||
|
SHOLA7 DS 8 ; $07F8..$07FF
|
||||||
|
DEND
|
||||||
|
;
|
||||||
|
iJSR EQU $20
|
||||||
|
iRTI EQU $40
|
||||||
|
iJMP EQU $4C
|
||||||
|
iRTS EQU $60
|
||||||
|
iNOP EQU $EA
|
||||||
|
;
|
||||||
|
; BI & ProDOS
|
||||||
|
;
|
||||||
|
DOSCMD EQU $BE03
|
||||||
|
PRINTERR EQU $BE0C
|
||||||
|
PRODOS8 EQU $BF00
|
||||||
|
;
|
||||||
|
; I/O Switches
|
||||||
|
;
|
||||||
|
KBD EQU $C000
|
||||||
|
KBDSTROBE EQU $C010
|
||||||
|
SPKR EQU $C030
|
||||||
|
TXTCLR EQU $C050
|
||||||
|
TXTSET EQU $C051
|
||||||
|
MIXCLR EQU $C052
|
||||||
|
MIXSET EQU $C053
|
||||||
|
TXTPAGE1 EQU $C054
|
||||||
|
TXTPAGE2 EQU $C055
|
||||||
|
LORES EQU $C056
|
||||||
|
HIRES EQU $C057
|
||||||
|
BUTN0 EQU $C061 ;OA key (Paddle Button 0)
|
||||||
|
PADDL0 EQU $C064
|
||||||
|
PTRIG EQU $C070
|
||||||
|
;
|
||||||
|
; Monitor
|
||||||
|
;
|
||||||
|
MONZ EQU $FF69
|
||||||
|
;
|
||||||
|
; BB uses 32 bytes of stack space ($100-$11F)
|
||||||
|
; It is assembled @ $0800 but may be relocated
|
||||||
|
; to anywhere in memory ($0800-$95FF) as long there
|
||||||
|
; sufficient mem
|
||||||
|
;
|
247
EDASM.SRC/COMMONEQUS.S
Normal file
247
EDASM.SRC/COMMONEQUS.S
Normal file
|
@ -0,0 +1,247 @@
|
||||||
|
Name : COMMONEQUS.S
|
||||||
|
End of file : 6,161
|
||||||
|
This file was generated using the DiskBrowser utility with minimal editing.
|
||||||
|
It is meant for viewing purposes only.
|
||||||
|
|
||||||
|
CHR ";"
|
||||||
|
;=================================================
|
||||||
|
; Equates used by EdAsm's modules
|
||||||
|
;
|
||||||
|
; ASCII keycodes
|
||||||
|
;
|
||||||
|
CTRLA EQU $01
|
||||||
|
CTRLB EQU $02
|
||||||
|
CTRLC EQU $03
|
||||||
|
CTRLD EQU $04
|
||||||
|
CTRLE EQU $05
|
||||||
|
CTRLF EQU $06
|
||||||
|
BEL EQU $07
|
||||||
|
BS EQU $08
|
||||||
|
TAB EQU $09
|
||||||
|
FF EQU $0C
|
||||||
|
CR EQU $0D
|
||||||
|
CTRLN EQU $0E
|
||||||
|
CTRLO EQU $0F
|
||||||
|
CTRLQ EQU $11
|
||||||
|
CTRLR EQU $12
|
||||||
|
CTRLS EQU $13
|
||||||
|
CTRLT EQU $14
|
||||||
|
CTRLU EQU $15
|
||||||
|
CTRLV EQU $16
|
||||||
|
CTRLW EQU $17
|
||||||
|
CTRLX EQU $18 ;cancel
|
||||||
|
ESCAPE EQU $1B
|
||||||
|
SPACE EQU $20
|
||||||
|
UNDERSCORE EQU $5F
|
||||||
|
DEL EQU $7F
|
||||||
|
;=================================================
|
||||||
|
; filetypes
|
||||||
|
;
|
||||||
|
TXTtype EQU $04
|
||||||
|
BINtype EQU $06
|
||||||
|
DIRtype EQU $0D
|
||||||
|
RELtype EQU $FE
|
||||||
|
SYStype EQU $FF
|
||||||
|
;=================================================
|
||||||
|
; Apple ][ Standard Zero page
|
||||||
|
;
|
||||||
|
WNDWDTH EQU $21
|
||||||
|
CH EQU $24
|
||||||
|
CV EQU $25
|
||||||
|
BASL EQU $28
|
||||||
|
InvFlg EQU $32
|
||||||
|
Prompt EQU $33
|
||||||
|
CSWL EQU $36 ;Output hook
|
||||||
|
KSWL EQU $38 ;Input hook
|
||||||
|
A1 EQU $3C
|
||||||
|
A2 EQU $3E
|
||||||
|
A4 EQU $42
|
||||||
|
;=================================================
|
||||||
|
; These zpage locations are referenced by 2 or
|
||||||
|
; more of EdAsm's modules
|
||||||
|
;
|
||||||
|
LoMem EQU $0A ;=$0801
|
||||||
|
TxtBgn EQU $0A ;Reg5
|
||||||
|
TxtEnd EQU $0E ;Reg7
|
||||||
|
HiMem EQU $0C ;=$9900 Not used by EDASM.ASM
|
||||||
|
StackP EQU $49 ;Save area for H/W stack ptr
|
||||||
|
VideoSlt EQU $50 ;=$Cs where s=1-3 (if 80-col video card present)
|
||||||
|
FileType EQU $51 ;filetype
|
||||||
|
ExecMode EQU $53 ;Exec mode
|
||||||
|
PtrMode EQU $54 ;=$80,$00 - Printer ON/OFF
|
||||||
|
TabChar EQU $5F ;Set by Editor
|
||||||
|
PrColumn EQU $61 ;curr print col
|
||||||
|
UserTabT EQU $68 ;$68-$71 User defined Table table
|
||||||
|
PrintF EQU $73 ;-1=Print Cmd 0=List Cmd
|
||||||
|
StackP2 EQU $73 ;Save area for H/W stack ptr on fatal err
|
||||||
|
SwapMode EQU $74 ;Split-buf mode 0-normal,1=buf1,2=buf2
|
||||||
|
CaseMode EQU $75 ;ucase/lcase
|
||||||
|
CmdDelim EQU $78 ;Cmd Delimiter/Separator
|
||||||
|
TruncF EQU $79 ;=$FF-truncate comments
|
||||||
|
;=================================================
|
||||||
|
X2000 EQU $2000 ;Load & Exec addr of SYS Files
|
||||||
|
LoadAdrEd EQU $8900 ;Load Addr of Editor Module
|
||||||
|
;=================================================
|
||||||
|
; 1024-byte I/O buffers for ProDOS8
|
||||||
|
;
|
||||||
|
XA900 EQU $A900
|
||||||
|
XAD00 EQU $AD00
|
||||||
|
;=================================================
|
||||||
|
; Edasm Global Page
|
||||||
|
; Used to pass parameters btwn EdAsm's
|
||||||
|
; modules viz Editor, Assembly & Linker
|
||||||
|
; The EI must be resident all the times
|
||||||
|
; EdAsm Interpreter's Global Page
|
||||||
|
; Used to pass parameters btwn EdAsm's
|
||||||
|
; modules viz Editor, Assembly & Linker
|
||||||
|
; The EI must be resident all the times
|
||||||
|
;
|
||||||
|
XBD00 EQU $BD00 ;General Purpose 128-byte buffers
|
||||||
|
XBD80 EQU $BD80 ; used by Edasm's modules
|
||||||
|
XBE00 EQU $BE00 ;$BE00-$BE3F (curr Pathname)
|
||||||
|
DevCtlS EQU $BE40 ;($BE40-$BE61) Init to $C3 if 80-col card present
|
||||||
|
TabTable EQU $BE60 ;$BE60-$BE62
|
||||||
|
DateTime EQU $BE64 ;$BE64-$73
|
||||||
|
EdAsmDir EQU $BE79 ;Where EDASM lives
|
||||||
|
PrtError EQU $BEFC ;EdAsm Interpreter error message rtn
|
||||||
|
;=================================================
|
||||||
|
; Apple ][
|
||||||
|
;
|
||||||
|
Stack EQU $0100
|
||||||
|
InBuf EQU $0200
|
||||||
|
TxBuf2 EQU $0280
|
||||||
|
SOFTEV EQU $03F2 ;RESET vector
|
||||||
|
PWREDUP EQU $03F4
|
||||||
|
USRADR EQU $03F8 ;ctrl-Y vector
|
||||||
|
;=================================================
|
||||||
|
; ProDOS 8 Global Page
|
||||||
|
;
|
||||||
|
PRODOS8 EQU $BF00
|
||||||
|
LASTDEV EQU $BF30
|
||||||
|
BitMap EQU $BF58
|
||||||
|
P8DATE EQU $BF90
|
||||||
|
P8TIME EQU $BF92
|
||||||
|
MACHID EQU $BF98
|
||||||
|
SLTBYT EQU $BF99 ;Slot ROM map
|
||||||
|
CMDADR EQU $BF9C ;last MLI call return address
|
||||||
|
MINIVERS EQU $BFFC ;minimum interpreter version
|
||||||
|
IVERSION EQU $BFFD ;interpreter version
|
||||||
|
;=================================================
|
||||||
|
; Soft Switches
|
||||||
|
;
|
||||||
|
KBD EQU $C000
|
||||||
|
CLR80VID EQU $C00C
|
||||||
|
KBDSTROBE EQU $C010
|
||||||
|
BUTN3 EQU $C060
|
||||||
|
BUTN2 EQU $C063
|
||||||
|
RDBANK2 EQU $C080 ;Read only RAM bank 2; no write
|
||||||
|
ROMIN2 EQU $C081 ;Read ROM/Write RAM bank 2 (RR)
|
||||||
|
RDROM2 EQU $C082 ;Read ROM; no write
|
||||||
|
LCBANK2 EQU $C083 ;Read/Write RAM bank 2 (RR)
|
||||||
|
BASICINT EQU $C300
|
||||||
|
XC30B EQU $C30B ;card identification
|
||||||
|
XC30C EQU $C30C
|
||||||
|
;
|
||||||
|
XD000 EQU $D000 ;LC Bank2 - SW16 or Asm's Print Symbol Table
|
||||||
|
BASCLD EQU $E000 ;AppleSoft ColdStart
|
||||||
|
;=================================================
|
||||||
|
; Apple ][ Monitor Entry Points
|
||||||
|
;
|
||||||
|
SWEET16 EQU $F689 ;Original IntegerBASIC ROM entry point
|
||||||
|
PRNTAX EQU $F941
|
||||||
|
PRBLNK EQU $F948
|
||||||
|
INIT EQU $FB2F
|
||||||
|
BELL1 EQU $FBDD
|
||||||
|
VTABZ EQU $FC24
|
||||||
|
HOME EQU $FC58
|
||||||
|
CLREOL EQU $FC9C
|
||||||
|
WAIT EQU $FCA8
|
||||||
|
RDKEY EQU $FD0C
|
||||||
|
RDCHAR EQU $FD35
|
||||||
|
GETLN EQU $FD6A ;input line w/prompt
|
||||||
|
CROUT EQU $FD8E ;issue carriage return
|
||||||
|
COUT EQU $FDED ;output char via user's I/O
|
||||||
|
COUT1 EQU $FDF0 ;output via video screen
|
||||||
|
MOVE EQU $FE2C
|
||||||
|
SETNORM EQU $FE84
|
||||||
|
SETKBD EQU $FE89
|
||||||
|
SETVID EQU $FE93
|
||||||
|
PRERR EQU $FF2D
|
||||||
|
MON EQU $FF65
|
||||||
|
MONZ EQU $FF69
|
||||||
|
IRQV EQU $FFFE
|
||||||
|
;=================================================
|
||||||
|
;
|
||||||
|
; SW16 registers when using 6502 instructions
|
||||||
|
;
|
||||||
|
Reg0 EQU $00 ;Doubles as the Accumulator
|
||||||
|
Reg1 EQU $02
|
||||||
|
Reg2 EQU $04
|
||||||
|
Reg3 EQU $06
|
||||||
|
Reg4 EQU $08
|
||||||
|
Reg5 EQU $0A ;Points @ 1st char of curr edited file
|
||||||
|
Reg6 EQU $0C ;HiMem
|
||||||
|
Reg7 EQU $0E ;Points @ last char of curr edited file
|
||||||
|
Reg8 EQU $10
|
||||||
|
Reg9 EQU $12
|
||||||
|
Reg10 EQU $14
|
||||||
|
Reg11 EQU $16
|
||||||
|
Reg12 EQU $18 ;Subroutine return stack pointer
|
||||||
|
Reg13 EQU $1A ;Result of a comparison instruction
|
||||||
|
Reg14 EQU $1C ;Status Register
|
||||||
|
Reg15 EQU $1E ;Program Counter
|
||||||
|
;=================================================
|
||||||
|
; Sweet16 registers
|
||||||
|
; These labels are for the EdAsm assembler
|
||||||
|
; For Merlin8, Rn are pre-defined and
|
||||||
|
; do not need to be declared.
|
||||||
|
;
|
||||||
|
R0 EQU 0
|
||||||
|
R1 EQU 1
|
||||||
|
R2 EQU 2
|
||||||
|
R3 EQU 3
|
||||||
|
R4 EQU 4
|
||||||
|
R5 EQU 5
|
||||||
|
R6 EQU 6
|
||||||
|
R7 EQU 7
|
||||||
|
R8 EQU 8
|
||||||
|
R9 EQU 9
|
||||||
|
R10 EQU 10
|
||||||
|
R11 EQU 11
|
||||||
|
R12 EQU 12 ;Subroutine return stack pointer
|
||||||
|
R13 EQU 13 ;Result of a comparison instruction
|
||||||
|
R14 EQU 14 ;Status Register
|
||||||
|
R15 EQU 15 ;Program Counter
|
||||||
|
;=================================================
|
||||||
|
; Lifted from ProDOS v1.7
|
||||||
|
; xdos parameters:
|
||||||
|
;
|
||||||
|
c.pCnt EQU $0 ; (count)
|
||||||
|
c.devNum EQU $1 ; (value)
|
||||||
|
c.refNum EQU $1 ; (value)
|
||||||
|
c.intNum EQU $1 ; (value)
|
||||||
|
c.path EQU $1 ;&2 (pointer)
|
||||||
|
c.isNewl EQU $2 ; (mask)
|
||||||
|
c.dataBuf EQU $2 ;&3 (value)
|
||||||
|
c.bufAdr EQU $2 ;&3 (address)
|
||||||
|
c.intAdr EQU $2 ;&3 (address)
|
||||||
|
c.mark EQU $2 ;->4 (value)
|
||||||
|
c.eof EQU $2 ;->4 (value)
|
||||||
|
c.attr EQU $3 ; (flags)
|
||||||
|
c.newl EQU $3 ; (character)
|
||||||
|
c.bufPtr EQU $3 ;&4 (pointer)
|
||||||
|
c.newPath EQU $3 ;&4 (pointer)
|
||||||
|
c.fileId EQU $4 ; (value)
|
||||||
|
c.reqCnt EQU $4 ;&5 (value)
|
||||||
|
c.blkNum EQU $4 ;&5 (address)
|
||||||
|
c.outRef EQU $5
|
||||||
|
c.auxId EQU $5 ;&6 (value)
|
||||||
|
c.transCnt EQU $6 ;&7 (value)
|
||||||
|
c.fKind EQU $7 ; (value)
|
||||||
|
c.date EQU $8 ;&9 (value)
|
||||||
|
c.outBlk EQU $8 ;&9 (count)
|
||||||
|
c.time EQU $a ;&b (value)
|
||||||
|
c.modDate EQU $a ;&b (value)
|
||||||
|
c.modTime EQU $c ;&d (value)
|
||||||
|
c.creDate EQU $e ;&f (value)
|
||||||
|
c.creTime EQU $10 ;&11 (value)
|
1800
EDASM.SRC/EDITOR/EDITOR1.S
Normal file
1800
EDASM.SRC/EDITOR/EDITOR1.S
Normal file
File diff suppressed because it is too large
Load Diff
478
EDASM.SRC/EDITOR/EDITOR2.S
Normal file
478
EDASM.SRC/EDITOR/EDITOR2.S
Normal file
|
@ -0,0 +1,478 @@
|
||||||
|
Name : EDITOR2.S
|
||||||
|
End of file : 7,116
|
||||||
|
This file was generated using the DiskBrowser utility with minimal editing.
|
||||||
|
It is meant for viewing purposes only.
|
||||||
|
|
||||||
|
;=================================================
|
||||||
|
; EXIT cmd
|
||||||
|
; Default to BASIC.SYSTEM
|
||||||
|
; The command interpreter's OpenNRd rtn expects
|
||||||
|
; a ptr to pathname to be stored at Reg4
|
||||||
|
;
|
||||||
|
LDCC8 SET R4,XBD80 ;Set ptr to PN
|
||||||
|
SET R10,XBD80
|
||||||
|
LDI R10 ;Did user type a pathname?
|
||||||
|
BNZ LDCD4 ;Yes
|
||||||
|
SET R4,XBB1A ;No, default to BI's name
|
||||||
|
LDCD4 RTN
|
||||||
|
;
|
||||||
|
LDA #>X2000
|
||||||
|
STA XBA8A ;Data buf/Load addr
|
||||||
|
LDA #<X2000
|
||||||
|
STA XBA8A+1
|
||||||
|
LDA #$00
|
||||||
|
STA XBA8C
|
||||||
|
LDA #$98 ;LEN
|
||||||
|
STA XBA8C+1
|
||||||
|
LDA #SYStype
|
||||||
|
JSR XB937 ;Open and read file into mem
|
||||||
|
BCS LDD09 ;Error
|
||||||
|
JSR LA7AB ;Init video card, setup I/O hooks
|
||||||
|
LDA #$00
|
||||||
|
STA BITMAP+$13
|
||||||
|
STA BITMAP+$15
|
||||||
|
STA BITMAP+$14
|
||||||
|
STA BITMAP+$16
|
||||||
|
LDA #$01
|
||||||
|
STA BITMAP+$17
|
||||||
|
JMP XB92E ;Go execute and don't come back
|
||||||
|
;
|
||||||
|
LDD09 PHA ;Errcode
|
||||||
|
JSR LA788 ;Reset I/O hooks
|
||||||
|
PLA
|
||||||
|
JMP XB602 ;Report err
|
||||||
|
;=================================================
|
||||||
|
; Checks keyboard for a ctrl-S, ctrl-C and spacebar
|
||||||
|
; keypress
|
||||||
|
; Z=1,C=0 -> ctrl-S
|
||||||
|
; Z=1,C=1 -> ctrl-C
|
||||||
|
; Z=0,C=0 -> any other key
|
||||||
|
;
|
||||||
|
KeyPress LDA KBD
|
||||||
|
BPL LDD2C
|
||||||
|
CMP #CTRLS+$80
|
||||||
|
BEQ LDD2C ;Z=1
|
||||||
|
BIT KBDSTROBE
|
||||||
|
CMP #CTRLC+$80
|
||||||
|
BNE LDD23
|
||||||
|
SEC
|
||||||
|
RTS
|
||||||
|
;
|
||||||
|
LDD23 CMP #SPACE+$80 ;Single-step?
|
||||||
|
BNE LDD2C
|
||||||
|
LDD27 LDA KBD ;Wait for another
|
||||||
|
BPL LDD27 ; key press
|
||||||
|
LDD2C CLC
|
||||||
|
RTS
|
||||||
|
;=================================================
|
||||||
|
; Chk for a ctrl-C
|
||||||
|
;
|
||||||
|
LDD2E JSR KeyPress
|
||||||
|
BCS LDD34 ;ctrl-C
|
||||||
|
RTS
|
||||||
|
LDD34 JMP LDCA9
|
||||||
|
;=================================================
|
||||||
|
LDD37 JSR LA614 ;Get char fr user's input key rtn
|
||||||
|
CMP #$60
|
||||||
|
BCC LDD40
|
||||||
|
AND #$5F ;To ucase
|
||||||
|
LDD40 RTS
|
||||||
|
;=================================================
|
||||||
|
; Init tab table
|
||||||
|
;
|
||||||
|
LDD41 EQU * ;ENTRY
|
||||||
|
LDA #$00
|
||||||
|
STA SwapMode
|
||||||
|
STA XBE00 ;Curr PN
|
||||||
|
LDY #10
|
||||||
|
LDD4A LDA DefTabsT,Y ;Only 3 are set
|
||||||
|
CPY #3
|
||||||
|
BCC LDD53
|
||||||
|
LDA #0 ;Zero the rest
|
||||||
|
LDD53 STA UserTabT,Y
|
||||||
|
DEY
|
||||||
|
BPL LDD4A
|
||||||
|
;
|
||||||
|
LDA #SPACE
|
||||||
|
STA TabChar
|
||||||
|
RTS
|
||||||
|
;=================================================
|
||||||
|
; PR# cmd
|
||||||
|
; Parsed parms are in $BD00 buf
|
||||||
|
;
|
||||||
|
LDD5E RTN
|
||||||
|
LDY #1
|
||||||
|
LDX XBD00 ;Get Slot #
|
||||||
|
STX Z59
|
||||||
|
BEQ LDD8C ;slot 0
|
||||||
|
CPX #8
|
||||||
|
BCS LDD99 ;slot > 7
|
||||||
|
;
|
||||||
|
LDA #%00000010
|
||||||
|
LDD6E DEX
|
||||||
|
BEQ LDD74
|
||||||
|
ASL
|
||||||
|
BNE LDD6E
|
||||||
|
LDD74 BIT SLTBYT
|
||||||
|
BEQ LDD99 ;Invalid
|
||||||
|
;
|
||||||
|
LDA XBD00,Y
|
||||||
|
STA DevCtlS,Y
|
||||||
|
LDD7F INY
|
||||||
|
CPY #33
|
||||||
|
BEQ LDD8C
|
||||||
|
LDA XBD00,Y
|
||||||
|
STA DevCtlS,Y
|
||||||
|
BNE LDD7F
|
||||||
|
;
|
||||||
|
LDD8C LDA #0 ;Set delimiter
|
||||||
|
STA DevCtlS,Y ; to mark EOS
|
||||||
|
LDX Z59
|
||||||
|
STX DevCtlS
|
||||||
|
JMP XB1CB
|
||||||
|
LDD99 JMP LD53E
|
||||||
|
;=================================================
|
||||||
|
; Tabs cmd
|
||||||
|
; Input
|
||||||
|
; Reg12-ptr to $BD00 buf
|
||||||
|
;
|
||||||
|
LDD9C SET R9,UserTabT
|
||||||
|
LD R9
|
||||||
|
ST R2
|
||||||
|
SET R8,10 ;Up to 10 tab cols
|
||||||
|
LD R8
|
||||||
|
ST R10
|
||||||
|
SUB R0 ;zero ACC
|
||||||
|
;
|
||||||
|
LDDA7 STI R9 ;Zero the table first
|
||||||
|
DCR R8
|
||||||
|
BNZ LDDA7
|
||||||
|
;
|
||||||
|
LDDAB LDD R12 ;Get tab posn (stored as a 16-bit val)
|
||||||
|
BM LDDB3 ;If $FFFF, EO list
|
||||||
|
STI R2 ;Save to UserTabT
|
||||||
|
LDI R12
|
||||||
|
DCR R10
|
||||||
|
BNZ LDDAB
|
||||||
|
LDDB3 RTN
|
||||||
|
;
|
||||||
|
LDA XBD80 ;Is a tab char passed?
|
||||||
|
BEQ LDDBB ;No
|
||||||
|
STA TabChar
|
||||||
|
LDDBB JMP XB1CB
|
||||||
|
;
|
||||||
|
DefTabsT DB $10 ;16,22,36
|
||||||
|
DB $16
|
||||||
|
DB $24
|
||||||
|
;=================================================
|
||||||
|
; TYPE cmd
|
||||||
|
; The command interpreter's ChkAttrF ($B883)
|
||||||
|
; rtn expects a ptr to pathname to be stored
|
||||||
|
; at Reg4
|
||||||
|
;
|
||||||
|
LDDC1 SET R4,XBD80 ;Set ptr to PN
|
||||||
|
RTN
|
||||||
|
LDA #TXTtype
|
||||||
|
JSR XB883 ;Chk file's properties
|
||||||
|
BCC LDDCF
|
||||||
|
LDDCC JMP XB602 ;Not found, show errmsg
|
||||||
|
;
|
||||||
|
LDDCF BNE LDDCC ;Wrong filetype -> err
|
||||||
|
;
|
||||||
|
LDX #>XA900 ;1024-byte I/O buf
|
||||||
|
LDY #<XA900
|
||||||
|
JSR XB8CE ;Open the TEXT file
|
||||||
|
LDA XBA87 ;Open Ref #
|
||||||
|
STA XBAA1 ;NL ref #
|
||||||
|
JSR L9F34 ;Set NewLine mode
|
||||||
|
BNE LDDCC
|
||||||
|
LDA XBA87
|
||||||
|
STA L9F43 ;read ref #
|
||||||
|
LDDE9 JSR L9F3B ;Read a line into $BD00 buf
|
||||||
|
BNE LDE05 ;Err
|
||||||
|
JSR KeyPress ;Abort listing?
|
||||||
|
BCS LDE03 ;ctrl-C -> yes
|
||||||
|
;
|
||||||
|
LDY #0
|
||||||
|
LDDF5 LDA XBD00,Y ;Get a char fr buf
|
||||||
|
JSR XB343 ;Show it
|
||||||
|
INY
|
||||||
|
CPY L9F48
|
||||||
|
BCC LDDF5
|
||||||
|
LDE01 BCS LDDE9 ;always
|
||||||
|
;
|
||||||
|
LDE03 LDA #$4C ;EOF err
|
||||||
|
LDE05 LDX L9F43
|
||||||
|
STX XBAF7 ;Close Ref #
|
||||||
|
JSR XB8FE ;Close file
|
||||||
|
CMP #$4C
|
||||||
|
BEQ LDE15
|
||||||
|
JMP XB602 ;Report err
|
||||||
|
LDE15 JMP XB1AB ;Back to EI Main loop
|
||||||
|
;=================================================
|
||||||
|
; Editor's Cmd table - used by $B20F
|
||||||
|
;
|
||||||
|
MSB ON
|
||||||
|
LDE18 EQU * ;ENTRY
|
||||||
|
DB $00
|
||||||
|
ASC "ASM"
|
||||||
|
DB $0A ;Index into $9D21 table
|
||||||
|
ASC "," ;comma
|
||||||
|
DB $0C ;->$9D21
|
||||||
|
DB $00 ;->$9D21 (Chk for a CR)
|
||||||
|
DB $00 ;Not used to index $DFA2
|
||||||
|
ASC "APPEND"
|
||||||
|
DB $10
|
||||||
|
DB $0A
|
||||||
|
DB $00
|
||||||
|
DB $30 ;->$DFA2
|
||||||
|
ASC "Add"
|
||||||
|
DB $10 ;->$9D21
|
||||||
|
DB $00 ;->$9D21
|
||||||
|
DB $02 ;->$DFA2 table
|
||||||
|
ASC "BLOAD"
|
||||||
|
DB $0A ;->$9D21 table
|
||||||
|
ASC ","
|
||||||
|
DB $22 ;->$9D21 table
|
||||||
|
DB $00
|
||||||
|
DB $24 ;->$DFA2 table
|
||||||
|
ASC "BSAVE"
|
||||||
|
DB $0A
|
||||||
|
ASC ","
|
||||||
|
DB $22
|
||||||
|
ASC ","
|
||||||
|
DB $24
|
||||||
|
DB $00
|
||||||
|
DB $4E
|
||||||
|
ASC "CATALOG"
|
||||||
|
DB $12
|
||||||
|
DB $00
|
||||||
|
DB $50
|
||||||
|
ASC "CAT"
|
||||||
|
DB $12
|
||||||
|
DB $00
|
||||||
|
DB $0E
|
||||||
|
ASC "COLumn"
|
||||||
|
DB $16
|
||||||
|
DB $00
|
||||||
|
DB $44
|
||||||
|
ASC "COpy"
|
||||||
|
DB $02
|
||||||
|
ASC "-"
|
||||||
|
DB $10
|
||||||
|
ASC "TO"
|
||||||
|
DB $02
|
||||||
|
DB $00
|
||||||
|
DB $22
|
||||||
|
ASC "CREATE"
|
||||||
|
DB $0A
|
||||||
|
DB $00
|
||||||
|
DB $5A
|
||||||
|
ASC "Change"
|
||||||
|
DB $04
|
||||||
|
DB $08
|
||||||
|
DB $00
|
||||||
|
DB $28
|
||||||
|
ASC "DELETE"
|
||||||
|
DB $0A
|
||||||
|
DB $00
|
||||||
|
DB $08
|
||||||
|
ASC "Del"
|
||||||
|
DB $04
|
||||||
|
DB $00
|
||||||
|
DB $16
|
||||||
|
ASC "END"
|
||||||
|
DB $00
|
||||||
|
DB $5C
|
||||||
|
ASC "EXIT"
|
||||||
|
DB $12
|
||||||
|
DB $00
|
||||||
|
DB $4C
|
||||||
|
ASC "EXEC"
|
||||||
|
DB $0A
|
||||||
|
DB $00
|
||||||
|
DB $52
|
||||||
|
ASC "Edit"
|
||||||
|
DB $04
|
||||||
|
DB $06
|
||||||
|
DB $00
|
||||||
|
DB $2E
|
||||||
|
ASC "FILE"
|
||||||
|
DB $00
|
||||||
|
DB $34
|
||||||
|
ASC "Find"
|
||||||
|
DB $04
|
||||||
|
DB $06
|
||||||
|
DB $00
|
||||||
|
DB $2A
|
||||||
|
ASC "Insert"
|
||||||
|
DB $02
|
||||||
|
DB $00
|
||||||
|
DB $14
|
||||||
|
ASC "KILL2"
|
||||||
|
DB $00
|
||||||
|
DB $1A
|
||||||
|
ASC "LOaD"
|
||||||
|
DB $0A
|
||||||
|
DB $00
|
||||||
|
DB $10
|
||||||
|
ASC "LOCK"
|
||||||
|
DB $0A
|
||||||
|
DB $00
|
||||||
|
DB $0A
|
||||||
|
ASC "List"
|
||||||
|
DB $04 ;->$9D21
|
||||||
|
DB $00
|
||||||
|
DB $26 ;->$DFA2
|
||||||
|
ASC "MON"
|
||||||
|
DB $00
|
||||||
|
DB $04
|
||||||
|
ASC "NEW"
|
||||||
|
DB $00
|
||||||
|
DB $1C
|
||||||
|
ASC "Online"
|
||||||
|
DB $00 ;Chk for CR
|
||||||
|
DB $4A ;->$DFA2
|
||||||
|
ASC "PR#"
|
||||||
|
DB $16
|
||||||
|
ASC ","
|
||||||
|
DB $0E
|
||||||
|
DB $00
|
||||||
|
DB $36
|
||||||
|
ASC "PreFiX"
|
||||||
|
DB $12
|
||||||
|
DB $00
|
||||||
|
DB $06
|
||||||
|
ASC "PTRON"
|
||||||
|
DB $00
|
||||||
|
DB $46
|
||||||
|
ASC "PTROFF"
|
||||||
|
DB $00
|
||||||
|
DB $48
|
||||||
|
ASC "Print"
|
||||||
|
DB $04
|
||||||
|
DB $00
|
||||||
|
DB $2C
|
||||||
|
ASC "RENAME"
|
||||||
|
DB $1A ;->$9D21
|
||||||
|
ASC ","
|
||||||
|
DB $1C ;->$9D21
|
||||||
|
DB $00
|
||||||
|
DB $20 ;->$DFA2
|
||||||
|
ASC "Replace"
|
||||||
|
DB $04
|
||||||
|
DB $00
|
||||||
|
DB $32
|
||||||
|
ASC "SETDelim"
|
||||||
|
DB $18
|
||||||
|
DB $00
|
||||||
|
DB $38
|
||||||
|
ASC "SETLcase"
|
||||||
|
DB $00
|
||||||
|
DB $3A
|
||||||
|
ASC "SETUcase"
|
||||||
|
DB $00
|
||||||
|
DB $3C
|
||||||
|
ASC "SWAP"
|
||||||
|
DB $00
|
||||||
|
DB $18
|
||||||
|
ASC "SaVE"
|
||||||
|
DB $04
|
||||||
|
DB $12
|
||||||
|
DB $00
|
||||||
|
DB $12
|
||||||
|
ASC "TYPE"
|
||||||
|
DB $0A
|
||||||
|
DB $00
|
||||||
|
DB $58
|
||||||
|
ASC "TRuncOFf"
|
||||||
|
DB $00
|
||||||
|
DB $3E
|
||||||
|
ASC "TRuncON"
|
||||||
|
DB $00
|
||||||
|
DB $40
|
||||||
|
ASC "Tabs"
|
||||||
|
DB $04
|
||||||
|
DB $06
|
||||||
|
DB $00
|
||||||
|
DB $1E
|
||||||
|
ASC "UNLOCK"
|
||||||
|
DB $0A
|
||||||
|
DB $00
|
||||||
|
DB $0C
|
||||||
|
ASC "Where"
|
||||||
|
DB $02
|
||||||
|
DB $00
|
||||||
|
DB $42
|
||||||
|
ASC "XLOAD"
|
||||||
|
DB $0A
|
||||||
|
ASC ","
|
||||||
|
DB $26
|
||||||
|
DB $00
|
||||||
|
DB $54
|
||||||
|
ASC "XSAVE"
|
||||||
|
DB $0A
|
||||||
|
ASC ","
|
||||||
|
DB $1E ;->$9D21(A$)
|
||||||
|
ASC ","
|
||||||
|
DB $20 ;->$9D21 (L$)
|
||||||
|
DB $00
|
||||||
|
DB $56 ;->$DFA2
|
||||||
|
DB $28 ;What's this
|
||||||
|
MSB OFF
|
||||||
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
; These are the entry points for the various
|
||||||
|
; SW16 routines utilised by the EI ($B659-B6A3)
|
||||||
|
; The "JMP" takes place at $B6A3 where the
|
||||||
|
; SW16 PC is set with the contents of R2 register
|
||||||
|
; R2 was previously set by EI code at $B680-$B68C
|
||||||
|
;
|
||||||
|
LDFA2 EQU *
|
||||||
|
DW LD33C-1 ;0
|
||||||
|
DW LD410-1 ;2
|
||||||
|
DW LD56D-1 ;4
|
||||||
|
DW LA29E-1 ;6
|
||||||
|
DW LD2C4-1 ;8
|
||||||
|
DW LD287-1 ;A
|
||||||
|
DW LD282-1 ;C
|
||||||
|
DW LA077-1 ;E
|
||||||
|
DW LD9B1-1 ;10
|
||||||
|
DW LDA06-1 ;12
|
||||||
|
DW LD656-1 ;14
|
||||||
|
DW LD6BB-1 ;16
|
||||||
|
DW LD76B-1 ;18
|
||||||
|
DW LD504-1 ;1A
|
||||||
|
DW LD521-1 ;1C
|
||||||
|
DW LDD9C-1 ;1E
|
||||||
|
DW LD308-1 ;20
|
||||||
|
DW LD819-1 ;22
|
||||||
|
DW L9BD6-1 ;24
|
||||||
|
DW LD631-1 ;26
|
||||||
|
DW LD8C6-1 ;28
|
||||||
|
DW LD865-1 ;2A
|
||||||
|
DW LD533-1 ;2C
|
||||||
|
DW LDB54-1 ;2E
|
||||||
|
DW LD9A6-1 ;30 - Append
|
||||||
|
DW LD6D6-1 ;32
|
||||||
|
DW LD6EC-1 ;34
|
||||||
|
DW LDD5E-1 ;36
|
||||||
|
DW LD5AD-1 ;38
|
||||||
|
DW LD5CB-1 ;3A
|
||||||
|
DW LD5C2-1 ;3C
|
||||||
|
DW LD582-1 ;3E
|
||||||
|
DW LD58A-1 ;40
|
||||||
|
DW LD58F-1 ;42
|
||||||
|
DW LD547-1 ;44
|
||||||
|
DW LA024-1 ;46
|
||||||
|
DW LA049-1 ;48
|
||||||
|
DW LA309-1 ;4A - Online
|
||||||
|
DW LDCC8-1 ;4C
|
||||||
|
DW L9BF9-1 ;4E
|
||||||
|
DW LA072-1 ;50
|
||||||
|
DW XB9B0-1 ;52
|
||||||
|
DW L9B19-1 ;54
|
||||||
|
DW L9B6E-1 ;56
|
||||||
|
DW LDDC1-1 ;58
|
||||||
|
DW L9F4A-1 ;5A
|
||||||
|
DW $C8D3 ;5C - NOT USED?
|
||||||
|
;
|
2080
EDASM.SRC/EDITOR/EDITOR3.S
Normal file
2080
EDASM.SRC/EDITOR/EDITOR3.S
Normal file
File diff suppressed because it is too large
Load Diff
30
EDASM.SRC/EDITOR/EQUATES.S
Normal file
30
EDASM.SRC/EDITOR/EQUATES.S
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
Name : EQUATES.S
|
||||||
|
End of file : 448
|
||||||
|
This file was generated using the DiskBrowser utility with minimal editing.
|
||||||
|
It is meant for viewing purposes only.
|
||||||
|
|
||||||
|
;=================================================
|
||||||
|
; Zero page usage
|
||||||
|
;
|
||||||
|
Z10 EQU $10 ;cntr
|
||||||
|
Z12 EQU $12 ;Char
|
||||||
|
Z4E EQU $4E
|
||||||
|
Z58 EQU $58
|
||||||
|
Z59 EQU $59 ;slot #
|
||||||
|
Z5A EQU $5A
|
||||||
|
Z5B EQU $5B
|
||||||
|
Z5C EQU $5C
|
||||||
|
Z5E EQU $5E ;Char being printed
|
||||||
|
Z60 EQU $60 ;Tab expansion flag
|
||||||
|
Z62 EQU $62
|
||||||
|
Z63 EQU $63
|
||||||
|
Z64 EQU $64
|
||||||
|
Z65 EQU $65
|
||||||
|
Z66 EQU $66
|
||||||
|
Z67 EQU $67
|
||||||
|
Z7A EQU $7A
|
||||||
|
Z7B EQU $7B
|
||||||
|
Z7D EQU $7D
|
||||||
|
Z7E EQU $7E ;These 6 locations are used
|
||||||
|
Z80 EQU $80 ; to move txt within mem
|
||||||
|
Z82 EQU $82
|
111
EDASM.SRC/EDITOR/EXTERNALS.S
Normal file
111
EDASM.SRC/EDITOR/EXTERNALS.S
Normal file
|
@ -0,0 +1,111 @@
|
||||||
|
Name : EXTERNALS.S
|
||||||
|
End of file : 3,020
|
||||||
|
This file was generated using the DiskBrowser utility with minimal editing.
|
||||||
|
It is meant for viewing purposes only.
|
||||||
|
|
||||||
|
;
|
||||||
|
; These externals labels are EDASM.SYSTEM's entry points
|
||||||
|
;
|
||||||
|
XB198 EQU $B198 ;warm start
|
||||||
|
XB1AB EQU $B1AB ;EI main loop
|
||||||
|
XB1CB EQU $B1CB ;reset I/O hooks
|
||||||
|
XB211 EQU $B211 ;command parser
|
||||||
|
XB274 EQU $B274 ;get non-blank char
|
||||||
|
XB286 EQU $B286 ;cmd table ptr
|
||||||
|
XB289 EQU $B289 ;do an RTS
|
||||||
|
XB28E EQU $B28E ;print cmd syntax err
|
||||||
|
XB290 EQU $B290 ;prt err msg
|
||||||
|
XB339 EQU $B339 ;output CR
|
||||||
|
XB33D EQU $B33D ;beep
|
||||||
|
XB343 EQU $B343 ;output (A)
|
||||||
|
XB36B EQU $B36B ;call monitor's VTAB
|
||||||
|
XB375 EQU $B375 ;call monitor's BELL1
|
||||||
|
XB37F EQU $B37F ;call monitor's PRBLNK
|
||||||
|
XB389 EQU $B389 ;call monitor's PRNTAX
|
||||||
|
XB393 EQU $B393 ;call monitor's SETKBD & SETVID
|
||||||
|
XB3D9 EQU $B3D9 ;Output (A) thru EI's CSW
|
||||||
|
XB5F8 EQU $B5F8 ;Fatal Error
|
||||||
|
XB5FF EQU $B5FF ;Close file and fall thru
|
||||||
|
XB602 EQU $B602 ; to print err msg
|
||||||
|
XB620 EQU $B620 ;Print "ER:" and beep
|
||||||
|
XB659 EQU $B659 ;Print err msg and err code
|
||||||
|
XB6EA EQU $B6EA ;Multi-buffer err msg
|
||||||
|
XB7AB EQU $B7AB ;Load EDASM.ED
|
||||||
|
XB836 EQU $B836 ;Set prefix to EDASM's boot dir
|
||||||
|
XB844 EQU $B844 ;Load EDASM.ED or EDASM.ASM
|
||||||
|
XB86F EQU $B86F ;Print invalid pathname
|
||||||
|
XB883 EQU $B883 ;check file's attributes
|
||||||
|
XB8B2 EQU $B8B2 ;copy file's name to 2 buffers
|
||||||
|
XB8CE EQU $B8CE ;open a file for reading
|
||||||
|
XB8EF EQU $B8EF ;close file and proceed to err handler
|
||||||
|
XB8FE EQU $B8FE ;close file and return to caller
|
||||||
|
XB904 EQU $B904 ;set file info
|
||||||
|
XB90B EQU $B90B ;kill file
|
||||||
|
XB912 EQU $B912 ;rename
|
||||||
|
XB919 EQU $B919 ;create
|
||||||
|
XB920 EQU $B920 ;write
|
||||||
|
XB927 EQU $B927 ;set EOF
|
||||||
|
XB92E EQU $B92E ;xfer control to another .SYSTEM program
|
||||||
|
XB937 EQU $B937 ;open and read an EDASM module
|
||||||
|
XB966 EQU $B966 ;check a file's size
|
||||||
|
XB99B EQU $B99B ;convert (A) to printable HEX code
|
||||||
|
XB9B0 EQU $B9B0 ;EXEC command handler
|
||||||
|
;=================================================
|
||||||
|
;
|
||||||
|
; These externals labels are EDASM.SYSTEM's DATA AREAS
|
||||||
|
;
|
||||||
|
XB40A EQU $B40A ;text of err messages
|
||||||
|
XB420 EQU $B420 ;are in $B40A-$B5BE
|
||||||
|
XB427 EQU $B427
|
||||||
|
XB432 EQU $B432
|
||||||
|
XB43E EQU $B43E
|
||||||
|
XB448 EQU $B448
|
||||||
|
XB45B EQU $B45B
|
||||||
|
XB50D EQU $B50D
|
||||||
|
XB521 EQU $B521
|
||||||
|
;
|
||||||
|
XB9EE EQU $B9EE ;used by SWAP command
|
||||||
|
XBA33 EQU $BA33 ; - ditto -
|
||||||
|
XBA78 EQU $BA78 ;used by SW16
|
||||||
|
XBA80 EQU $BA80 ;ptr to free mem
|
||||||
|
XBA87 EQU $BA87 ;open ref #
|
||||||
|
XBA8A EQU $BA8A ;read ref #
|
||||||
|
XBA8C EQU $BA8C ;read request len
|
||||||
|
XBA8E EQU $BA8E ;actual read len
|
||||||
|
XBA91 EQU $BA91 ;write ref #
|
||||||
|
XBA92 EQU $BA92 ;write data buffer
|
||||||
|
XBA94 EQU $BA94 ;write len
|
||||||
|
XBAA0 EQU $BAA0 ;New line parm block
|
||||||
|
XBAA1 EQU $BAA1 ;NL ref #
|
||||||
|
XBAA4 EQU $BAA4 ;Read park block used by CAT/CATALOG cmd
|
||||||
|
XBAA5 EQU $BAA5 ;read ref #
|
||||||
|
XBAA8 EQU $BAA8 ;read len
|
||||||
|
XBAAC EQU $BAAC ;use to read dir block
|
||||||
|
XBAAD EQU $BAAD ;read ref #
|
||||||
|
XBAB5 EQU $BAB5 ;Set EOF ref #
|
||||||
|
XBAB6 EQU $BAB6 ;new EOF (3 bytes)
|
||||||
|
XBABC EQU $BABC
|
||||||
|
XBAC8 EQU $BAC8
|
||||||
|
XBACA EQU $BACA
|
||||||
|
XBACB EQU $BACB
|
||||||
|
XBACC EQU $BACC
|
||||||
|
XBACE EQU $BACE
|
||||||
|
XBACF EQU $BACF
|
||||||
|
XBAD1 EQU $BAD1
|
||||||
|
XBADA EQU $BADA
|
||||||
|
XBADC EQU $BADC
|
||||||
|
XBADD EQU $BADD
|
||||||
|
XBADE EQU $BADE
|
||||||
|
XBAE3 EQU $BAE3
|
||||||
|
XBAE8 EQU $BAE8
|
||||||
|
XBAEA EQU $BAEA
|
||||||
|
XBAEB EQU $BAEB
|
||||||
|
XBAEC EQU $BAEC
|
||||||
|
XBAEE EQU $BAEE
|
||||||
|
XBAF4 EQU $BAF4
|
||||||
|
XBAF7 EQU $BAF7
|
||||||
|
XBAFB EQU $BAFB
|
||||||
|
XBAFD EQU $BAFD
|
||||||
|
XBAFE EQU $BAFE
|
||||||
|
XBB1A EQU $BB1A
|
||||||
|
XBB80 EQU $BB80
|
692
EDASM.SRC/EDITOR/SWEET16.S
Normal file
692
EDASM.SRC/EDITOR/SWEET16.S
Normal file
|
@ -0,0 +1,692 @@
|
||||||
|
Name : SWEET16.S
|
||||||
|
End of file : 16,627
|
||||||
|
This file was generated using the DiskBrowser utility with minimal editing.
|
||||||
|
It is meant for viewing purposes only.
|
||||||
|
;---------------------------------------------------------;
|
||||||
|
; Initial source was disassembled with The Flaming Bird ;
|
||||||
|
; Disassembler. The Sweet16 code was disassembled with ;
|
||||||
|
; the Merlin8 disassembler. Final re-assembly must be ;
|
||||||
|
; done with the EdAsm assembler to produce a binary ;
|
||||||
|
; image which will be compared against the original ;
|
||||||
|
; (c) Phoenix corp. 1992,93 - All rights reserved ;
|
||||||
|
;---------------------------------------------------------;
|
||||||
|
ORG $D000
|
||||||
|
;=================================================
|
||||||
|
; SWEET16 code is executed as if it were running on a
|
||||||
|
; 16-bit processor with sixteen, internal 16-bit
|
||||||
|
; little-endian registers, R0 through R15. Some registers
|
||||||
|
; have well-defined functions:
|
||||||
|
; R0 is the accumulator.
|
||||||
|
; R12 subroutine return address stack
|
||||||
|
; R13 stores the result of all comparison operations for
|
||||||
|
; branch testing.
|
||||||
|
; R14 is the status register.
|
||||||
|
; R15 is the program counter.
|
||||||
|
; The 16 virtual registers, 32 bytes in total, are located
|
||||||
|
; in the zero page of the Apple II's real, physical memory
|
||||||
|
; map (at $00-$1F)
|
||||||
|
;
|
||||||
|
; The carry bit is in the lsb of R14H
|
||||||
|
; Negative and Zero "flags" are the given by the contents
|
||||||
|
; of the "prior" result register (indexed with X)
|
||||||
|
;
|
||||||
|
NEWSW16 EQU * ;ENTRY
|
||||||
|
STA Z58 ;Preserve the regs
|
||||||
|
STX Z59
|
||||||
|
STY Z5A
|
||||||
|
PHP
|
||||||
|
PLA
|
||||||
|
STA Z5B
|
||||||
|
CLD
|
||||||
|
PLA
|
||||||
|
STA Reg15 ;Init the SW16 program counter
|
||||||
|
PLA ; using the Return Addr
|
||||||
|
STA Reg15+1
|
||||||
|
LD011 INC Reg15 ;Increment SW16 PC for fetch
|
||||||
|
BNE LD017
|
||||||
|
INC Reg15+1
|
||||||
|
;
|
||||||
|
LD017 LDY #0
|
||||||
|
SW16BK EQU *-1
|
||||||
|
LDA (Reg15),Y ;Fetch the instruction
|
||||||
|
AND #$0F ;Mask register specification
|
||||||
|
ASL ;Double for 2-byte registers
|
||||||
|
TAX ;(X) is used to index the register Rn
|
||||||
|
LSR
|
||||||
|
EOR (Reg15),Y ;Now we have the opcode ($x0) where x=1-F
|
||||||
|
BEQ ToBR ;If zero, then non-reg op or CPIM
|
||||||
|
;
|
||||||
|
STX Reg14+1 ;Indicate "prior" result register
|
||||||
|
LSR ;opcodex2 to LSB's
|
||||||
|
LSR
|
||||||
|
LSR
|
||||||
|
TAY ;To Y-reg for indexing
|
||||||
|
LDA LD07F-2,Y
|
||||||
|
STA Z5C+1
|
||||||
|
LDA LD05F-2,Y
|
||||||
|
STA Z5C
|
||||||
|
JMP (Z5C) ;Go SW16 REG op rtns
|
||||||
|
;
|
||||||
|
; Non-register ops are handled here. They include
|
||||||
|
; the new ops CPIM, BRL and BSL
|
||||||
|
; NB. On entry, Y=0
|
||||||
|
;
|
||||||
|
ToBR INC Reg15 ;Increment SW16 PC
|
||||||
|
BNE ToBR2
|
||||||
|
INC Reg15+1
|
||||||
|
ToBR2 LDA LD080,X
|
||||||
|
STA Z5C+1
|
||||||
|
LDA LD060,X
|
||||||
|
STA Z5C
|
||||||
|
LDA Reg14+1 ;"Prior" result register
|
||||||
|
LSR ;Prepare 6502 C-bit for BC, BNC
|
||||||
|
LDA Reg14+1
|
||||||
|
; AND #%0001_1110
|
||||||
|
AND #%00011110
|
||||||
|
TAX ;(X)=Index to the "prior" result register
|
||||||
|
JMP (Z5C) ;Go non-reg op rtn
|
||||||
|
;
|
||||||
|
; Control is returned to the 6502 and program execution
|
||||||
|
; continues at the location immediately following the RTN
|
||||||
|
; instruction. The 6502 registers and status conditions are
|
||||||
|
; restored to their original contents (prior to entering
|
||||||
|
; SWEET 16 mode).
|
||||||
|
;
|
||||||
|
SW16RTN LDA Z5B ;Restore the contents of the 6502 regs
|
||||||
|
PHA
|
||||||
|
LDA Z58
|
||||||
|
LDX Z59
|
||||||
|
LDY Z5A
|
||||||
|
PLP
|
||||||
|
LD05C JMP (Reg15) ;Return to 6502 code via SW16 PC
|
||||||
|
;
|
||||||
|
LD05F DB >SW16SET ;1X
|
||||||
|
LD060 DB >SW16RTN ;0
|
||||||
|
DB >SW16LD ;2X
|
||||||
|
DB >SW16BR ;1
|
||||||
|
DB >SW16ST ;3X
|
||||||
|
DB >SW16BNC ;2
|
||||||
|
DB >SW16LDat ;4X
|
||||||
|
DB >SW16BC ;3
|
||||||
|
DB >SW16STat ;5X
|
||||||
|
DB >SW16BP ;4
|
||||||
|
DB >SW16LDDat ;6X
|
||||||
|
DB >SW16BM ;5
|
||||||
|
DB >SW16STDat ;7X
|
||||||
|
DB >SW16BZ ;6
|
||||||
|
DB >SW16POP ;8X
|
||||||
|
DB >SW16BNZ ;7
|
||||||
|
DB >SW16STPat ;9X
|
||||||
|
DB >SW16BM1 ;8
|
||||||
|
DB >SW16ADD ;AX
|
||||||
|
DB >SW16BNM1 ;9
|
||||||
|
DB >SW16SUB ;BX
|
||||||
|
DB >SW16BK ;A
|
||||||
|
DB >SW16POPD ;CX
|
||||||
|
DB >SW16RS ;B
|
||||||
|
DB >SW16CPR ;DX
|
||||||
|
DB >SW16BS ;C
|
||||||
|
DB >SW16INR ;EX
|
||||||
|
DB >SW16CPIM ;D
|
||||||
|
DB >SW16DCR ;FX
|
||||||
|
DB >SW16BRL ;E
|
||||||
|
DB >LD011 ;Unused
|
||||||
|
DB >SW16BSL ;F
|
||||||
|
;
|
||||||
|
LD07F DB <SW16SET ;1X
|
||||||
|
LD080 DB <SW16RTN ;0
|
||||||
|
DB <SW16LD ;2X
|
||||||
|
DB <SW16BR ;1
|
||||||
|
DB <SW16ST ;3X
|
||||||
|
DB <SW16BNC ;2
|
||||||
|
DB <SW16LDat ;4X
|
||||||
|
DB <SW16BC ;3
|
||||||
|
DB <SW16STat ;5X
|
||||||
|
DB <SW16BP ;4
|
||||||
|
DB <SW16LDDat ;6X
|
||||||
|
DB <SW16BM ;5
|
||||||
|
DB <SW16STDat ;7X
|
||||||
|
DB <SW16BZ ;6
|
||||||
|
DB <SW16POP ;8X
|
||||||
|
DB <SW16BNZ ;7
|
||||||
|
DB <SW16STPat ;9X
|
||||||
|
DB <SW16BM1 ;8
|
||||||
|
DB <SW16ADD ;AX
|
||||||
|
DB <SW16BNM1 ;9
|
||||||
|
DB <SW16SUB ;BX
|
||||||
|
DB <SW16BK ;A
|
||||||
|
DB <SW16POPD ;CX
|
||||||
|
DB <SW16RS ;B
|
||||||
|
DB <SW16CPR ;DX
|
||||||
|
DB <SW16BS ;C
|
||||||
|
DB <SW16INR ;EX
|
||||||
|
DB <SW16CPIM ;D
|
||||||
|
DB <SW16DCR ;FX
|
||||||
|
DB <SW16BRL ;E
|
||||||
|
DB <LD011 ;Unused
|
||||||
|
DB <SW16BSL ;F
|
||||||
|
;
|
||||||
|
; The SW16 accumulator is loaded from Rn and branch
|
||||||
|
; conditions set according to the data transferred. The
|
||||||
|
; Carry is cleared and the contents of Rn are not changed.
|
||||||
|
; Input
|
||||||
|
; Rn
|
||||||
|
; Output
|
||||||
|
; R0 - both bytes
|
||||||
|
;
|
||||||
|
SW16LD LDA Reg0,X ;Move Rx to R0 (Acc)
|
||||||
|
STA Reg0
|
||||||
|
LDA Reg0+1,X
|
||||||
|
STA Reg0+1
|
||||||
|
JMP LD011
|
||||||
|
;
|
||||||
|
; The SW16 ACC is stored into Rn and branch
|
||||||
|
; conditions set according to the data transferred.
|
||||||
|
; The carry is cleared and the contents of the ACC
|
||||||
|
; are unchanged
|
||||||
|
; Input
|
||||||
|
; R0
|
||||||
|
; Output
|
||||||
|
; Rn - both bytes
|
||||||
|
;
|
||||||
|
SW16ST LDA Reg0 ;Move R0 (Acc) to Rx
|
||||||
|
STA Reg0,X
|
||||||
|
LDA Reg0+1
|
||||||
|
STA Reg0+1,X
|
||||||
|
JMP LD011
|
||||||
|
;
|
||||||
|
; The low byte of ACC is stored into the memory location
|
||||||
|
; whose ADDRESS resides in Rn. Branch conditions reflect
|
||||||
|
; the 2-byte ACC contents. After the transfer, Rn is
|
||||||
|
; incremented by 1.
|
||||||
|
; Input
|
||||||
|
; Rn - ptr to mem location
|
||||||
|
; R0 - lobyte
|
||||||
|
; Output
|
||||||
|
; Rn = Rn+1
|
||||||
|
; R14H = 0 - carry cleared
|
||||||
|
;
|
||||||
|
SW16STat LDA Reg0
|
||||||
|
STA (Reg0,X) ;Store byte indirect
|
||||||
|
LDY #0
|
||||||
|
STY Reg14+1 ;Indicate R0 is result -ve
|
||||||
|
;
|
||||||
|
; The contents of Rn are incremented by 1. The carry is
|
||||||
|
; cleared and other branch conditions reflect the
|
||||||
|
; incremented value.
|
||||||
|
;
|
||||||
|
SW16INR INC Reg0,X ;Increment Rx
|
||||||
|
BNE LD0C3
|
||||||
|
INC Reg0+1,X
|
||||||
|
LD0C3 JMP LD011
|
||||||
|
;
|
||||||
|
; The lobyte of the SW16 ACC is loaded from the memory
|
||||||
|
; location whose ADDRESS resides in Rn and ACC hi-byte
|
||||||
|
; is zeroed. Branch conditions reflect the final contents
|
||||||
|
; of the ACC which will always be positive and never
|
||||||
|
; minus 1. The Carry is cleared and after the transfer,
|
||||||
|
; Rn is incremented by 1.
|
||||||
|
; Input
|
||||||
|
; Rn - ptr to mem location
|
||||||
|
; Output
|
||||||
|
; R0 - lobyte
|
||||||
|
; Rn = Rn+1
|
||||||
|
; R14H = 0 - carry cleared
|
||||||
|
;
|
||||||
|
SW16LDat LDA (Reg0,X)
|
||||||
|
STA Reg0
|
||||||
|
LDY #0 ;Zero the ACC's hi-byte
|
||||||
|
STY Reg0+1
|
||||||
|
STY Reg14+1 ;Indicate R0 is +ve
|
||||||
|
INC Reg0,X
|
||||||
|
BNE LD0D6
|
||||||
|
INC Reg0+1,X
|
||||||
|
LD0D6 JMP LD011
|
||||||
|
;
|
||||||
|
; Rn is decremented by 1 and the hibyte of ACC is loaded
|
||||||
|
; from the memory location whose address now resides in Rn.
|
||||||
|
; Rn is again decremented by 1 and the lobyte of ACC is
|
||||||
|
; loaded from the corresponding memory location. Branch
|
||||||
|
; conditions reflect the final ACC contents. The carry
|
||||||
|
; is cleared. Because Rn is decremented prior to loading
|
||||||
|
; each of the ACC halves, double-byte stacks may be
|
||||||
|
; implemented with the STD Rn and POPD Rn ops where Rn
|
||||||
|
; is the stack pointer.
|
||||||
|
;
|
||||||
|
; Input
|
||||||
|
; Rn - ptr to mem location
|
||||||
|
; Output
|
||||||
|
; R0 - both bytes
|
||||||
|
; Rn = Rn+2
|
||||||
|
; R14H = 0 - carry cleared
|
||||||
|
;
|
||||||
|
SW16POPD LDA Reg0,X
|
||||||
|
BNE LD0DF
|
||||||
|
DEC Reg0+1,X
|
||||||
|
LD0DF DEC Reg0,X
|
||||||
|
LDA (Reg0,X)
|
||||||
|
TAY
|
||||||
|
LDA Reg0,X
|
||||||
|
BNE LD0EA
|
||||||
|
DEC Reg0+1,X
|
||||||
|
LD0EA DEC Reg0,X
|
||||||
|
LDA (Reg0,X)
|
||||||
|
STA Reg0
|
||||||
|
STY Reg0+1
|
||||||
|
LDY #0
|
||||||
|
STY Reg14+1
|
||||||
|
JMP LD011
|
||||||
|
;
|
||||||
|
; The lobyte of the ACC is loaded from the memory location
|
||||||
|
; whose address resides in Rn AFTER Rn is decremented by 1,
|
||||||
|
; and the hibyte is cleared. Branch conditions reflect
|
||||||
|
; the final 2-byte ACC contents which will always be
|
||||||
|
; positive and never minus one. The carry is cleared.
|
||||||
|
; Because Rn is decremented prior to loading the ACC,
|
||||||
|
; single byte stacks may be implemented with the
|
||||||
|
; STI Rn and POP Rn ops where Rn is the stack pointer.
|
||||||
|
; Input
|
||||||
|
; Rn - ptr to mem location
|
||||||
|
; Output
|
||||||
|
; R0L - changed
|
||||||
|
; R0H = 0
|
||||||
|
; Rn = Rn+1
|
||||||
|
; R14H = 0 - carry cleared
|
||||||
|
;
|
||||||
|
SW16POP LDY #0
|
||||||
|
LDA Reg0,X
|
||||||
|
JMP LD106
|
||||||
|
;=================================================
|
||||||
|
LD100 EQU * ;ENTRY?
|
||||||
|
LDA ROMIN2
|
||||||
|
JMP $E000 ;AppleSoft
|
||||||
|
;=================================================
|
||||||
|
LD106 BNE LD10A
|
||||||
|
DEC Reg0+1,X
|
||||||
|
LD10A DEC Reg0,X
|
||||||
|
LDA (Reg0,X)
|
||||||
|
STA Reg0
|
||||||
|
STY Reg0+1 ;zero hi-byte
|
||||||
|
LDY #0
|
||||||
|
STY Reg14+1
|
||||||
|
JMP LD011
|
||||||
|
;
|
||||||
|
; The lobyte of the ACC is loaded from memory location
|
||||||
|
; whose address resides in Rn, and Rn is then incremented
|
||||||
|
; by 1. Its hibyte is loaded from the memory location whose
|
||||||
|
; address resides in the incremented Rn, and Rn is again
|
||||||
|
; incremented by 1. Branch conditions reflect the contents
|
||||||
|
; of final ACC. The carry is cleared.
|
||||||
|
; Input
|
||||||
|
; Rn - ptr to mem location
|
||||||
|
; Output
|
||||||
|
; R0 - both bytes changed
|
||||||
|
; Rn = Rn+2
|
||||||
|
; R14H = 0 - carry cleared
|
||||||
|
;
|
||||||
|
SW16LDDat LDA (Reg0,X)
|
||||||
|
STA Reg0
|
||||||
|
INC Reg0,X
|
||||||
|
BNE LD123
|
||||||
|
INC Reg0+1,X
|
||||||
|
LD123 LDA (Reg0,X)
|
||||||
|
STA Reg0+1
|
||||||
|
LDY #0
|
||||||
|
STY Reg14+1
|
||||||
|
INC Reg0,X
|
||||||
|
BNE LD131
|
||||||
|
INC Reg0+1,X
|
||||||
|
LD131 JMP LD011
|
||||||
|
;
|
||||||
|
; The lobyte of ACC is stored into memory location
|
||||||
|
; whose address resides in Rn, and Rn is the incremented
|
||||||
|
; by 1. The hibyte of ACC is stored into the memory
|
||||||
|
; location whose address resides in the incremented
|
||||||
|
; Rn, and Rn is again incremented by 1. Branch conditions
|
||||||
|
; reflect the contents of ACC which are unchanged.
|
||||||
|
; The carry is cleared.
|
||||||
|
; Input
|
||||||
|
; Rn - ptr to mem location
|
||||||
|
; R0 - both bytes used
|
||||||
|
; Output
|
||||||
|
; Rn = Rn+2
|
||||||
|
; R14H = 0 - carry cleared
|
||||||
|
;
|
||||||
|
SW16STDat LDA Reg0
|
||||||
|
STA (Reg0,X)
|
||||||
|
LDY #0
|
||||||
|
STY Reg14+1
|
||||||
|
INC Reg0,X
|
||||||
|
BNE LD142
|
||||||
|
INC Reg0+1,X
|
||||||
|
LD142 LDA Reg0+1
|
||||||
|
STA (Reg0,X)
|
||||||
|
INC Reg0,X
|
||||||
|
BNE LD14C
|
||||||
|
INC Reg0+1,X
|
||||||
|
LD14C JMP LD011
|
||||||
|
;
|
||||||
|
; The lobyte of ACC is stored into the memory location
|
||||||
|
; whose address resides in Rn after Rn is decremented by 1.
|
||||||
|
; Branch conditions will reflect the 2-byte ACC contents
|
||||||
|
; which are not modified. STP Rn and POP Rn are used
|
||||||
|
; together to move data blocks beginning at the greatest
|
||||||
|
; address and working down. Additionally, single-byte
|
||||||
|
; stacks may be implemented with the STP Rn ops.
|
||||||
|
; Input
|
||||||
|
; R0 - lobyte used
|
||||||
|
; Rn - ptr to mem location
|
||||||
|
; Output
|
||||||
|
; Rn = Rn+1
|
||||||
|
; R14H = 0 - carry cleared
|
||||||
|
;
|
||||||
|
SW16STPat LDA Reg0,X
|
||||||
|
BNE LD155
|
||||||
|
DEC Reg0+1,X
|
||||||
|
LD155 DEC Reg0,X
|
||||||
|
LDA Reg0
|
||||||
|
STA (Reg0,X)
|
||||||
|
LDY #0
|
||||||
|
STY Reg14+1
|
||||||
|
JMP LD011
|
||||||
|
;
|
||||||
|
; The contents of Rn are decremented by 1. The carry is
|
||||||
|
; cleared and other branch conditions reflect the
|
||||||
|
; decremented value.
|
||||||
|
; Input
|
||||||
|
; Rn
|
||||||
|
; Output
|
||||||
|
; Rn = Rn-1
|
||||||
|
; R14H = set on entry into SW16
|
||||||
|
;
|
||||||
|
SW16DCR LDA Reg0,X
|
||||||
|
BNE LD168
|
||||||
|
DEC Reg0+1,X
|
||||||
|
LD168 DEC Reg0,X
|
||||||
|
JMP LD011
|
||||||
|
;
|
||||||
|
; The low order 16 bits of the subtraction are restored in
|
||||||
|
; the ACC, the 17-th bit becomes the carry and other branch
|
||||||
|
; conditions reflect the final ACC contents. If the 16-bit
|
||||||
|
; unsigned ACC contents are greater than or equal to the
|
||||||
|
; 16-bit unsigned Rn contents, then the carry is set,
|
||||||
|
; otherwise it is cleared. Rn is not disturbed.
|
||||||
|
; For SUB instruction, register specification would be
|
||||||
|
; changed to indicate R0 (the SW16 ACC)
|
||||||
|
;
|
||||||
|
; Output
|
||||||
|
; R0
|
||||||
|
; R14H = lsb indicate carry condition (0/1)
|
||||||
|
;
|
||||||
|
SW16SUB LDY #0
|
||||||
|
;
|
||||||
|
; The ACC (R0) contents are compared to Rn by performing
|
||||||
|
; the 16 bit binary subtraction ACC-Rn and storing the low
|
||||||
|
; order 16 difference bits in R13 for subsequent branch
|
||||||
|
; tests. If the 16 bit unsigned ACC contents are greater
|
||||||
|
; than or equal to the 16 bit unsigned Rn contents, then
|
||||||
|
; the carry is set, otherwise it is cleared. No other
|
||||||
|
; registers, including ACC and Rn, are disturbed.
|
||||||
|
; Input
|
||||||
|
; Rn - both bytes used; unchanged
|
||||||
|
; R0 - both bytes used; unchanged
|
||||||
|
; Output
|
||||||
|
; R13 = 0 if ACC == Rn
|
||||||
|
; R14H = lsb indicate carry condition (26/27)
|
||||||
|
;
|
||||||
|
SW16CPR SEC ;(Y)=13;2 for CPR instr
|
||||||
|
LDA Reg0
|
||||||
|
SBC Reg0,X
|
||||||
|
; STA |Reg0,Y
|
||||||
|
DB $99,$00,$00
|
||||||
|
LDA Reg0+1
|
||||||
|
SBC Reg0+1,X
|
||||||
|
; STA |Reg0+1,Y
|
||||||
|
DB $99,$01,$00
|
||||||
|
TYA
|
||||||
|
ADC #0 ;Propagate the carry as well as indicate
|
||||||
|
STA Reg14+1 ; the "prior" result reg is R0/R13
|
||||||
|
JMP LD011
|
||||||
|
;
|
||||||
|
; The contents of Rn are added to the contents of ACC,
|
||||||
|
; and the low-order 16 bits of the sum restored in ACC.
|
||||||
|
; The 17-th bit becomes the carry and the other branch
|
||||||
|
; conditions reflect the final ACC contents.
|
||||||
|
; For ADD instruction, register specification would be
|
||||||
|
; changed to indicate R0 (the SW16 ACC)
|
||||||
|
; Input
|
||||||
|
;
|
||||||
|
; Rn - both bytes used
|
||||||
|
; R0 - both bytes used
|
||||||
|
; Output
|
||||||
|
; R0 - changed
|
||||||
|
; R14H = lsb indicate carry condition (0/1)
|
||||||
|
;
|
||||||
|
SW16ADD LDA Reg0
|
||||||
|
ADC Reg0,X
|
||||||
|
STA Reg0
|
||||||
|
LDA Reg0+1
|
||||||
|
ADC Reg0+1,X
|
||||||
|
LDY #0
|
||||||
|
; STA |Reg0+1,Y
|
||||||
|
DB $99,$01,$00
|
||||||
|
TYA ;(A)=0
|
||||||
|
ADC #0 ;Propagate the C-bit as well as
|
||||||
|
STA Reg14+1 ; indicate the "prior" result reg is ACC
|
||||||
|
JMP LD011
|
||||||
|
;
|
||||||
|
; A branch to the effective address (PC + 2 + d) is taken
|
||||||
|
; and execution is resumed in SWEET 16 mode. The current
|
||||||
|
; PC is pushed onto a SWEET 16 subroutine return address
|
||||||
|
; stack whose pointer is R12, and R12 is incremented by 2.
|
||||||
|
; The carry is cleared and branch conditions set to
|
||||||
|
; indicate the current ACC contents.
|
||||||
|
; Input
|
||||||
|
; R15
|
||||||
|
; Output
|
||||||
|
; R12 = R12+2
|
||||||
|
; (R12) = Mem location pointed to
|
||||||
|
;
|
||||||
|
SW16BS LDX #Reg12 ;12;2 (SW16 stack register)
|
||||||
|
LDA Reg15 ;PC
|
||||||
|
STA (Reg0,X)
|
||||||
|
INC Reg12
|
||||||
|
BNE LD1A9
|
||||||
|
INC Reg12+1
|
||||||
|
LD1A9 LDA Reg15+1
|
||||||
|
STA (Reg0,X)
|
||||||
|
INC Reg12
|
||||||
|
BNE SW16BR
|
||||||
|
INC Reg12
|
||||||
|
;
|
||||||
|
; An effective address (ea) is calculated by adding the
|
||||||
|
; signed displacement byte (d) to the PC. The PC contains
|
||||||
|
; the address of the instruction immediately following the
|
||||||
|
; BR, or the address of the BR op plus 2. The displacement
|
||||||
|
; is a signed two's complement value from -128 to +127.
|
||||||
|
; Branch conditions are not changed.
|
||||||
|
;
|
||||||
|
; NOTE: The effective address calculation is identical to
|
||||||
|
; that for 6502 relative branches. The Hex add & Subtract
|
||||||
|
; features of the APPLE ][ monitor may be used to
|
||||||
|
; calculate displacements.
|
||||||
|
;
|
||||||
|
SW16BR CLC
|
||||||
|
LDA (Reg15),Y ;Get displacement byte
|
||||||
|
BPL LD1B9
|
||||||
|
DEY ;=$FF (-1)
|
||||||
|
LD1B9 ADC Reg15 ;Add to SW16 PC
|
||||||
|
STA Reg15
|
||||||
|
TYA
|
||||||
|
ADC Reg15+1
|
||||||
|
STA Reg15+1
|
||||||
|
JMP LD011
|
||||||
|
;
|
||||||
|
; A branch is effected only if the carry is set. Branch
|
||||||
|
; conditions are not changed.
|
||||||
|
;
|
||||||
|
SW16BC BCS SW16BR
|
||||||
|
JMP LD011
|
||||||
|
;
|
||||||
|
; A branch to the effective address is taken only is the
|
||||||
|
; carry is clear, otherwise execution resumes as normal
|
||||||
|
; with the next instruction. Branch conditions are
|
||||||
|
; not changed.
|
||||||
|
;
|
||||||
|
SW16BNC BCC SW16BR
|
||||||
|
JMP LD011
|
||||||
|
;
|
||||||
|
; A branch is effected only if the prior 'result' (or most
|
||||||
|
; recently transferred data) was positive. Branch
|
||||||
|
; conditions are not changed
|
||||||
|
;
|
||||||
|
SW16BP LDA Reg0+1,X ;Need to chk hi-byte only
|
||||||
|
BPL SW16BR
|
||||||
|
JMP LD011
|
||||||
|
;
|
||||||
|
; A branch is effected only if prior 'result' was minus.
|
||||||
|
; Branch conditions are not changed.
|
||||||
|
;
|
||||||
|
SW16BM LDA Reg0+1,X ;Need to chk hi-byte only
|
||||||
|
BMI SW16BR
|
||||||
|
JMP LD011
|
||||||
|
;
|
||||||
|
; A Branch is effected only if the prior 'result' was zero.
|
||||||
|
; Branch conditions are not changed.
|
||||||
|
;
|
||||||
|
SW16BZ LDA Reg0,X
|
||||||
|
ORA Reg0+1,X
|
||||||
|
BEQ SW16BR
|
||||||
|
JMP LD011
|
||||||
|
;
|
||||||
|
; A branch is effected only if the prior 'result' was
|
||||||
|
; non-zero. Branch conditions are not changed.
|
||||||
|
;
|
||||||
|
SW16BNZ LDA Reg0,X
|
||||||
|
ORA Reg0+1,X
|
||||||
|
BNE SW16BR
|
||||||
|
JMP LD011
|
||||||
|
;
|
||||||
|
; A branch is effected only if the prior 'result' was -1
|
||||||
|
; ($FFFF Hex). Branch conditions are not changed.
|
||||||
|
;
|
||||||
|
SW16BM1 LDA Reg0,X ;Get 'prior result' register
|
||||||
|
AND Reg0+1,X
|
||||||
|
EOR #-1
|
||||||
|
BEQ SW16BR
|
||||||
|
JMP LD011
|
||||||
|
;
|
||||||
|
; A branch effected only if the prior 'result' was NOT
|
||||||
|
; -1 ($FFFF). Branch conditions are not changed.
|
||||||
|
;
|
||||||
|
SW16BNM1 LDA Reg0,X
|
||||||
|
AND Reg0+1,X
|
||||||
|
EOR #-1
|
||||||
|
BNE SW16BR
|
||||||
|
JMP LD011
|
||||||
|
;
|
||||||
|
; RS terminates execution of a SWEET16 subroutine and
|
||||||
|
; returns to the SWEET 16 calling program which resumes
|
||||||
|
; execution (in SWEET 16 mode). R12, which is the SWEET16
|
||||||
|
; subroutine return stack pointer, is decremented twice.
|
||||||
|
; Branch conditions are not changed.
|
||||||
|
;
|
||||||
|
SW16RS LDX #Reg12 ;12;2 for R12 as stack pointer
|
||||||
|
LDA Reg12
|
||||||
|
BNE LD20D
|
||||||
|
DEC Reg12+1
|
||||||
|
LD20D DEC Reg12
|
||||||
|
LDA (Reg0,X) ;Get byte from SW16 stack
|
||||||
|
STA Reg15+1 ;Modify the PC
|
||||||
|
LDA Reg12
|
||||||
|
BNE LD219
|
||||||
|
DEC Reg12+1
|
||||||
|
LD219 DEC Reg12
|
||||||
|
LDA (Reg0,X)
|
||||||
|
STA Reg15
|
||||||
|
JMP LD011
|
||||||
|
;
|
||||||
|
; $D222 The 2-byte constant is loaded into Rn (n=0-F) and
|
||||||
|
; branch conditions set accordingly. Carry is cleared.
|
||||||
|
; Output
|
||||||
|
; Rn
|
||||||
|
;
|
||||||
|
SW16SET LDA (Reg15),Y ;Get hi-byte of constant
|
||||||
|
STA Reg0+1,X
|
||||||
|
DEY
|
||||||
|
LDA (Reg15),Y ;Lo-byte of constant
|
||||||
|
STA Reg0,X
|
||||||
|
TYA ;Y=1
|
||||||
|
SEC ;Add 2 to SW16 PC
|
||||||
|
ADC Reg15
|
||||||
|
STA Reg15
|
||||||
|
BCC LD235
|
||||||
|
INC Reg15+1
|
||||||
|
LD235 JMP LD011
|
||||||
|
;
|
||||||
|
; Usage: CPIM constant
|
||||||
|
; The contents of the ACC is compared against the
|
||||||
|
; 2-byte constant by performing the 16-bit binary
|
||||||
|
; subtraction ACC-CONSTANT and storing the low order 16
|
||||||
|
; difference bits in R13 for subsequent branch tests.
|
||||||
|
; If the 16-bit unsigned ACC contents are greater
|
||||||
|
; than or equal to the 16-bit unsigned CONSTANT,
|
||||||
|
; then the carry is set, otherwise it is cleared.
|
||||||
|
; No other registers, are disturbed.
|
||||||
|
;
|
||||||
|
SW16CPIM SEC ;(Y)=0
|
||||||
|
LDX #Reg13 ;13;2
|
||||||
|
LDA Reg0
|
||||||
|
SBC (Reg15),Y
|
||||||
|
STA Reg0,X
|
||||||
|
INC Reg15
|
||||||
|
BNE LD247
|
||||||
|
INC Reg15+1
|
||||||
|
LD247 LDA Reg0+1
|
||||||
|
SBC (Reg15),Y
|
||||||
|
STA Reg0+1,X
|
||||||
|
TXA ;=26
|
||||||
|
ADC #0
|
||||||
|
STA Reg14+1 ;=27 if there's a C
|
||||||
|
JMP LD011
|
||||||
|
;
|
||||||
|
; A branch to the effective address (PC + 3 + d) is taken
|
||||||
|
; and execution is resumed in SWEET 16 mode. The current PC
|
||||||
|
; is pushed onto a SWEET 16 subroutine return address
|
||||||
|
; stack whose pointer is R12, and R12 is incremented by 2.
|
||||||
|
; The carry is cleared and branch conditions set to
|
||||||
|
; indicate the current ACC contents.
|
||||||
|
;
|
||||||
|
SW16BSL LDX #Reg12 ;12;2 (SW16 stack register)
|
||||||
|
LDA Reg15 ;PC
|
||||||
|
STA (Reg0,X)
|
||||||
|
INC Reg12
|
||||||
|
BNE LD261
|
||||||
|
INC Reg12+1
|
||||||
|
LD261 LDA Reg15+1
|
||||||
|
STA (Reg0,X)
|
||||||
|
INC Reg12
|
||||||
|
BNE SW16BRL
|
||||||
|
INC Reg12+1
|
||||||
|
;
|
||||||
|
; An effective address (ea) is calculated by adding the
|
||||||
|
; signed displacement word (d) to the PC. The PC contains
|
||||||
|
; the address of the instruction immediately following the
|
||||||
|
; BRL, or the address of the BRL op plus 3. The
|
||||||
|
; displacement is a signed two's complement value from
|
||||||
|
; -32768 ($8000) to +32767 ($7FFF).
|
||||||
|
; Branch conditions are not changed.
|
||||||
|
;
|
||||||
|
SW16BRL CLC
|
||||||
|
LDA (Reg15),Y
|
||||||
|
INC Reg15
|
||||||
|
BNE LD274
|
||||||
|
INC Reg15+1
|
||||||
|
LD274 ADC Reg15
|
||||||
|
TAX
|
||||||
|
LDA (Reg15),Y
|
||||||
|
ADC Reg15+1
|
||||||
|
STA Reg15+1
|
||||||
|
STX Reg15
|
||||||
|
JMP LD011
|
||||||
|
;=================================================
|
1537
EDASM.SRC/EI/EDASMINT.S
Normal file
1537
EDASM.SRC/EI/EDASMINT.S
Normal file
File diff suppressed because it is too large
Load Diff
17
EDASM.SRC/EI/EQUATES.S
Normal file
17
EDASM.SRC/EI/EQUATES.S
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
Name : EQUATES.S
|
||||||
|
End of file : 391
|
||||||
|
This file was generated using the DiskBrowser utility with minimal editing.
|
||||||
|
It is meant for viewing purposes only.
|
||||||
|
|
||||||
|
;=================================================
|
||||||
|
; zero page usage by EdAsm Interpreter
|
||||||
|
; Since SW16 is used, the first 32 zero page
|
||||||
|
; locations must be treated with care
|
||||||
|
;
|
||||||
|
Z00 EQU $00 ;Reg0
|
||||||
|
Z04 EQU $04 ;Reg2
|
||||||
|
Z12 EQU $12 ;Reg9-Ptr to Msg/Save Char
|
||||||
|
ErrCode EQU $72 ;error code
|
||||||
|
BufIndex EQU $76 ;Index into InBuf
|
||||||
|
MulCmdF EQU $77 ;multiple cmds if msb on
|
||||||
|
HelpF EQU $7C ;Display Help Menu-$80
|
33
EDASM.SRC/EI/EXTERNALS.S
Normal file
33
EDASM.SRC/EI/EXTERNALS.S
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
Name : EXTERNALS.S
|
||||||
|
End of file : 979
|
||||||
|
This file was generated using the DiskBrowser utility with minimal editing.
|
||||||
|
It is meant for viewing purposes only.
|
||||||
|
|
||||||
|
*=================================================
|
||||||
|
* EDASM Command Interpreter
|
||||||
|
* This module references of a number
|
||||||
|
* of routines and tables of EdAsm.Ed
|
||||||
|
*
|
||||||
|
X9AA5 EQU $9AA5 ;set R12 to $BD00
|
||||||
|
X9C98 EQU $9C98 ;output err msg
|
||||||
|
X9D11 EQU $9D11 ;Default TAB table
|
||||||
|
X9D14 EQU $9D14 ;Edasm.AutoSt
|
||||||
|
X9D21 EQU $9D21 ;JMP table
|
||||||
|
X9E55 EQU $9E55 ;convert date/time to ASCII
|
||||||
|
X9F83 EQU $9F83 ;copy right
|
||||||
|
XA70B EQU $A70B ;cmd line input
|
||||||
|
XA75B EQU $A75B ;chk for presence of 80-col card
|
||||||
|
XA788 EQU $A788 ;reset I/O hooks
|
||||||
|
XA78A EQU $A78A ;alternate entry point of $A788
|
||||||
|
DoHelp EQU $A7F1
|
||||||
|
XA872 EQU $A872 ;Load EDASM.SWAP
|
||||||
|
XA8D1 EQU $A8D1 ;vol/sub-dir header entry
|
||||||
|
NEWSW16 EQU $D000 ;Modified version of Sweet16 lives here
|
||||||
|
XD610 EQU $D610 ;printer init
|
||||||
|
XDD41 EQU $DD41 ;init TAB tabke
|
||||||
|
XDE18 EQU $DE18 ;Table of cmds (ASM,NEW,ONLINE etc)
|
||||||
|
XDFA2 EQU $DFA2 ;Cmd SW16 jmp table
|
||||||
|
*
|
||||||
|
LoadAdrAsm EQU $6800
|
||||||
|
X7800 EQU $7800 ;EdAsm.Asm's sub-module load/exec Addr
|
||||||
|
X9900 EQU $9900 ;EdAsm.Ed's sub-module load/exec addr
|
493
EDASM.SRC/EI/RELOCATOR.S
Normal file
493
EDASM.SRC/EI/RELOCATOR.S
Normal file
|
@ -0,0 +1,493 @@
|
||||||
|
Name : RELOCATOR.S
|
||||||
|
End of file : 7,244
|
||||||
|
This file was generated using the DiskBrowser utility with minimal editing.
|
||||||
|
It is meant for viewing purposes only.
|
||||||
|
|
||||||
|
;---------------------------------------------------------;
|
||||||
|
; EDASM.SYSTEM - loaded into mem at $2000-$2FFE (len $FFF)
|
||||||
|
; The 1st part of the code is the relocator ($2000-$23FF)
|
||||||
|
; The 2nd part of the code is the EdAsm Interpreter
|
||||||
|
; ($2400-2FFE) which is relocated to $B100-$BCFE (len $0BFF).
|
||||||
|
; The EI is always in memory whether in assembly/edit mode
|
||||||
|
;---------------------------------------------------------;
|
||||||
|
SYS
|
||||||
|
;
|
||||||
|
ORG $2000
|
||||||
|
;
|
||||||
|
L2000 LDX #$F0
|
||||||
|
TXS
|
||||||
|
LDX #255
|
||||||
|
LDA #0
|
||||||
|
L2007 STA Stack,X ;Zero entire stack
|
||||||
|
DEX
|
||||||
|
BNE L2007
|
||||||
|
;
|
||||||
|
LDY #19
|
||||||
|
LDA #$00 ;Mark pages $20-$BF
|
||||||
|
L2011 STA BitMap+4,Y ; as free
|
||||||
|
DEY
|
||||||
|
BPL L2011
|
||||||
|
;
|
||||||
|
LDA #<$2000 ;Starting fr $2000
|
||||||
|
STA TxtBgn+1 ; downto $0800
|
||||||
|
LDY #3
|
||||||
|
L201D LDX #8
|
||||||
|
L201F LDA BitMap,Y ; scan for the
|
||||||
|
L2022 LSR
|
||||||
|
BCS L202D ; first non-free page
|
||||||
|
DEC TxtBgn+1
|
||||||
|
DEX
|
||||||
|
BNE L2022
|
||||||
|
DEY
|
||||||
|
BNE L201D
|
||||||
|
;
|
||||||
|
L202D LDA #$01
|
||||||
|
STA TxtBgn ;=$0801 (normally)
|
||||||
|
;
|
||||||
|
JSR PRODOS8
|
||||||
|
DB $82 ;Get the date/time
|
||||||
|
L2035 DW L2035 ;No parms needed
|
||||||
|
;
|
||||||
|
LDA ROMIN2 ;Read ROM
|
||||||
|
LDA ROMIN2 ;Write-enabled RAM LC Bank2
|
||||||
|
LDA P8DATE
|
||||||
|
ORA P8DATE+1
|
||||||
|
PHP ;save Z-bit
|
||||||
|
L2044 STA CLR80VID ;Disable 80-col display mode
|
||||||
|
JSR SETNORM
|
||||||
|
L204A JSR INIT
|
||||||
|
JSR SETVID
|
||||||
|
JSR SETKBD
|
||||||
|
JSR HOME
|
||||||
|
PLP
|
||||||
|
BNE L20B6
|
||||||
|
;
|
||||||
|
; No clock card
|
||||||
|
;
|
||||||
|
LDY #$00
|
||||||
|
JSR SendBanr
|
||||||
|
LDA #0
|
||||||
|
STA CH
|
||||||
|
JSR L21DE ;enter DD
|
||||||
|
L2065 LDA #3
|
||||||
|
STA CH
|
||||||
|
JSR L22C1 ;enter MMM
|
||||||
|
BCC L2074
|
||||||
|
L206E JSR L21FB
|
||||||
|
JMP L2065
|
||||||
|
;
|
||||||
|
; Year
|
||||||
|
;
|
||||||
|
L2074 LDA #7
|
||||||
|
STA CH
|
||||||
|
JSR L2238 ;enter year digit 1
|
||||||
|
BCC L2084
|
||||||
|
L207D JSR L22AF
|
||||||
|
BCC L2074
|
||||||
|
BCS L206E
|
||||||
|
;
|
||||||
|
L2084 JSR RDKEY
|
||||||
|
CMP #BS+$80
|
||||||
|
BNE L2092
|
||||||
|
JSR L2259
|
||||||
|
BCC L2084
|
||||||
|
BCS L207D
|
||||||
|
L2092 CMP #CR+$80
|
||||||
|
BEQ L209E
|
||||||
|
LDA #BEL+$80
|
||||||
|
JSR COUT
|
||||||
|
JMP L2084
|
||||||
|
;
|
||||||
|
L209E LDA L21CF
|
||||||
|
LDX L21CE
|
||||||
|
CPX #$08
|
||||||
|
ROL
|
||||||
|
STA P8DATE+1
|
||||||
|
TXA
|
||||||
|
ASL
|
||||||
|
ASL
|
||||||
|
ASL
|
||||||
|
ASL
|
||||||
|
ASL
|
||||||
|
ORA Day
|
||||||
|
STA P8DATE
|
||||||
|
;
|
||||||
|
L20B6 JSR PRODOS8 ;Get prefix
|
||||||
|
DB $C7
|
||||||
|
DW CurrPfxP
|
||||||
|
LDA CurrPfxB
|
||||||
|
BNE L20E1
|
||||||
|
;
|
||||||
|
; No current prefix
|
||||||
|
;
|
||||||
|
LDA LASTDEV
|
||||||
|
STA OLUnit
|
||||||
|
JSR PRODOS8
|
||||||
|
DB $C5
|
||||||
|
DW OnLineP
|
||||||
|
;
|
||||||
|
LDA CurrPfxB+1
|
||||||
|
AND #$0F ;Get len byte of volname
|
||||||
|
CLC
|
||||||
|
ADC #2
|
||||||
|
STA CurrPfxB
|
||||||
|
TAY
|
||||||
|
LDA #'/' ;Prepend and append volname
|
||||||
|
STA CurrPfxB+1 ; with a slash
|
||||||
|
STA CurrPfxB,Y
|
||||||
|
;
|
||||||
|
; The code below assumes the TxBuf2 area has been
|
||||||
|
; setup properly by ProDOS8
|
||||||
|
;
|
||||||
|
L20E1 LDX TxBuf2 ;Do we have a trailing /?
|
||||||
|
INX
|
||||||
|
L20E5 DEX
|
||||||
|
BEQ L20FC ;No trailing /
|
||||||
|
LDA #'/'
|
||||||
|
EOR TxBuf2,X
|
||||||
|
ASL
|
||||||
|
BNE L20E5 ;No, keep looking
|
||||||
|
;
|
||||||
|
DEX ;Got a trailing /, so remove
|
||||||
|
STX TxBuf2 ; it by just adjusting len byte
|
||||||
|
;
|
||||||
|
JSR PRODOS8 ;Make this the default prefix
|
||||||
|
DB $C6
|
||||||
|
DW SDefPfxP
|
||||||
|
BNE ShowErr
|
||||||
|
;
|
||||||
|
; Get the prefix to Edasm's directory
|
||||||
|
;
|
||||||
|
L20FC JSR PRODOS8 ;Get prefix
|
||||||
|
DB $C7
|
||||||
|
DW PFX3P
|
||||||
|
BNE ShowErr
|
||||||
|
JSR L2342 ;Backup ProDOS Quit code
|
||||||
|
;
|
||||||
|
; Setup to relocate the EdAsm Interpreter
|
||||||
|
; to its final location @ $B100
|
||||||
|
;
|
||||||
|
LDA #>L2400 ;EI's load addr
|
||||||
|
STA A1 ;start=$2400
|
||||||
|
LDA #<L2400
|
||||||
|
STA A1+1
|
||||||
|
LDA #$27
|
||||||
|
STA A2 ;end=$2E27
|
||||||
|
LDA #$2E
|
||||||
|
STA A2+1
|
||||||
|
LDA #>EIStart
|
||||||
|
STA A4 ;dest
|
||||||
|
LDA #<EIStart
|
||||||
|
STA A4+1
|
||||||
|
LDA #<EIStart-1 ;Jump to $B100 after MOVE completed
|
||||||
|
PHA
|
||||||
|
LDA #>EIStart-1
|
||||||
|
PHA
|
||||||
|
LDY #0
|
||||||
|
LDA ROMIN2 ;read ROM
|
||||||
|
LDA ROMIN2 ;write-enabled LC Bank2 RAM
|
||||||
|
JMP MOVE
|
||||||
|
;=================================================
|
||||||
|
; Use this to set the default prefix
|
||||||
|
;
|
||||||
|
SDefPfxP DB $01
|
||||||
|
DW TxBuf2
|
||||||
|
;
|
||||||
|
; Use this parameter block to get the current prefix
|
||||||
|
;
|
||||||
|
CurrPfxP DB $01
|
||||||
|
DW CurrPfxB
|
||||||
|
;
|
||||||
|
; EdAsm's Dir is where the 3 files EdAsm.Ed,
|
||||||
|
; Edasm.Asm and Edasm.System resides
|
||||||
|
;
|
||||||
|
PFX3P DB $01
|
||||||
|
DW EdAsmDir
|
||||||
|
;
|
||||||
|
OnLineP DB $02
|
||||||
|
OLUnit DB $60
|
||||||
|
DW CurrPfxB+1
|
||||||
|
;=================================================
|
||||||
|
ShowErr STA ErrCode
|
||||||
|
TSX
|
||||||
|
STX StackP2
|
||||||
|
LDX #$80
|
||||||
|
L2144 TXS
|
||||||
|
L2145 STA CLR80VID
|
||||||
|
JSR SETNORM
|
||||||
|
JSR INIT
|
||||||
|
LDA RDROM2 ;read ROM, write-protect RAM LC Bank2
|
||||||
|
JSR SETKBD
|
||||||
|
JSR SETVID
|
||||||
|
JSR HOME
|
||||||
|
JSR PRERR ;PRINT "ERR=XX"
|
||||||
|
LDA ErrCode
|
||||||
|
JSR $FDD3 ;unsupported mon entry point
|
||||||
|
JMP MON
|
||||||
|
;
|
||||||
|
SendBanr LDA Banner,Y
|
||||||
|
BPL L2171
|
||||||
|
JSR COUT
|
||||||
|
INY
|
||||||
|
JMP SendBanr
|
||||||
|
L2171 RTS
|
||||||
|
;
|
||||||
|
MSB ON
|
||||||
|
Banner DB $8D,$8D,$8D
|
||||||
|
ASC " PRODOS EDITOR-ASSEMBLER //"
|
||||||
|
DB $8D,$8D,$8D,$8D,$8D,$8D
|
||||||
|
ASC "ENTER THE DATE AND PRESS RETURN"
|
||||||
|
DB $8D,$8D
|
||||||
|
ASC "DD-MMM-YY"
|
||||||
|
DB 0
|
||||||
|
MSB OFF
|
||||||
|
TensT DB 00,10,20,30,40,50,60,70,80,90
|
||||||
|
Day DB $00
|
||||||
|
L21CE DB $00
|
||||||
|
L21CF DB $00
|
||||||
|
L21D0 DB $00
|
||||||
|
L21D1 DB $00
|
||||||
|
MMM DS 3,0
|
||||||
|
;
|
||||||
|
L21D5 LDA #BEL+$80
|
||||||
|
JSR COUT
|
||||||
|
L21DA LDA #$00
|
||||||
|
STA CH
|
||||||
|
L21DE JSR RDKEY
|
||||||
|
CMP #'0'+$80
|
||||||
|
BCC L21D5
|
||||||
|
CMP #'3'+1+$80
|
||||||
|
BCS L21D5
|
||||||
|
JSR COUT
|
||||||
|
AND #$0F
|
||||||
|
TAX
|
||||||
|
LDA TensT,X
|
||||||
|
STA Day
|
||||||
|
STA L21D0
|
||||||
|
JMP L220D
|
||||||
|
;
|
||||||
|
L21FB LDA L21D0
|
||||||
|
STA Day
|
||||||
|
LDA #1
|
||||||
|
STA CH
|
||||||
|
JMP L220D ;enter 2nd digit for DD
|
||||||
|
;
|
||||||
|
L2208 LDA #BEL+$80
|
||||||
|
JSR COUT
|
||||||
|
L220D JSR RDKEY
|
||||||
|
CMP #BS+$80
|
||||||
|
BEQ L21DA
|
||||||
|
CMP #'0'+$80
|
||||||
|
BCC L2208
|
||||||
|
CMP #'9'+1+$80
|
||||||
|
BCS L2208
|
||||||
|
JSR COUT
|
||||||
|
AND #$0F
|
||||||
|
CLC
|
||||||
|
ADC Day
|
||||||
|
STA Day
|
||||||
|
BEQ L21D5
|
||||||
|
CMP #31+1 ;at most 31
|
||||||
|
BCS L21D5 ;err
|
||||||
|
RTS
|
||||||
|
; Year
|
||||||
|
L222F LDA #BEL+$80
|
||||||
|
JSR COUT
|
||||||
|
L2234 LDA #7
|
||||||
|
STA CH
|
||||||
|
L2238 JSR RDKEY
|
||||||
|
CMP #BS+$80
|
||||||
|
BEQ L2289
|
||||||
|
CMP #'0'+$80
|
||||||
|
BCC L222F
|
||||||
|
CMP #'9'+1+$80
|
||||||
|
BCS L222F
|
||||||
|
JSR COUT
|
||||||
|
AND #$0F
|
||||||
|
TAX
|
||||||
|
LDA TensT,X
|
||||||
|
STA L21CF
|
||||||
|
STA L21D1
|
||||||
|
JMP L226B
|
||||||
|
;
|
||||||
|
L2259 LDA L21D1
|
||||||
|
STA L21CF
|
||||||
|
LDA #$08
|
||||||
|
STA CH
|
||||||
|
JMP L226B
|
||||||
|
;
|
||||||
|
L2266 LDA #BEL+$80
|
||||||
|
JSR COUT
|
||||||
|
L226B JSR RDKEY
|
||||||
|
CMP #BS+$80
|
||||||
|
BEQ L2234
|
||||||
|
CMP #'0'+$80
|
||||||
|
BCC L2266
|
||||||
|
CMP #'9+1+$80
|
||||||
|
BCS L2266
|
||||||
|
JSR COUT
|
||||||
|
AND #$0F
|
||||||
|
CLC
|
||||||
|
ADC L21CF
|
||||||
|
STA L21CF
|
||||||
|
BEQ L222F
|
||||||
|
CLC
|
||||||
|
L2289 RTS
|
||||||
|
;
|
||||||
|
L228A DB $A0
|
||||||
|
MSB ON
|
||||||
|
Months ASC "JANFEBMARAPRMAYJUNJULAUGSEPOCTNOVDEC"
|
||||||
|
MSB OFF
|
||||||
|
;
|
||||||
|
L22AF LDA #5 ;3rd letter of MMM
|
||||||
|
STA CH
|
||||||
|
JMP L22DF
|
||||||
|
;
|
||||||
|
L22B6 SEC
|
||||||
|
RTS
|
||||||
|
;
|
||||||
|
; Month entry
|
||||||
|
;
|
||||||
|
L22B8 LDA #BEL+$80
|
||||||
|
JSR COUT
|
||||||
|
L22BD LDA #3 ;1st letter of MMM
|
||||||
|
STA CH
|
||||||
|
L22C1 JSR ToUCase
|
||||||
|
CMP #BS+$80
|
||||||
|
BEQ L22B6
|
||||||
|
JSR PRUCase
|
||||||
|
BCS L22C1
|
||||||
|
STA MMM
|
||||||
|
L22D0 JSR ToUCase
|
||||||
|
CMP #BS+$80
|
||||||
|
BEQ L22BD
|
||||||
|
JSR PRUCase
|
||||||
|
BCS L22D0
|
||||||
|
STA MMM+1
|
||||||
|
L22DF JSR ToUCase
|
||||||
|
CMP #BS+$80
|
||||||
|
BNE L22EC
|
||||||
|
JSR COUT
|
||||||
|
JMP L22D0
|
||||||
|
;
|
||||||
|
L22EC JSR PRUCase
|
||||||
|
BCS L22DF
|
||||||
|
STA MMM+2
|
||||||
|
;
|
||||||
|
LDX #$00
|
||||||
|
STX L21CE
|
||||||
|
L22F9 LDY #$00
|
||||||
|
INC L21CE
|
||||||
|
STX L228A
|
||||||
|
L2301 LDA MMM,Y
|
||||||
|
CMP Months,X
|
||||||
|
BNE L2311
|
||||||
|
INX
|
||||||
|
INY
|
||||||
|
CPY #$03
|
||||||
|
BCC L2301
|
||||||
|
BEQ L2322 ;match
|
||||||
|
L2311 LDX L228A
|
||||||
|
INX
|
||||||
|
INX
|
||||||
|
INX
|
||||||
|
CPX #48 ;bug? (should be 36)
|
||||||
|
BCC L22F9
|
||||||
|
;
|
||||||
|
LDA #3
|
||||||
|
STA CH
|
||||||
|
JMP L22B8 ;re-enter
|
||||||
|
L2322 CLC
|
||||||
|
RTS
|
||||||
|
;
|
||||||
|
; Display char (in A) as uppercase letter
|
||||||
|
;
|
||||||
|
PRUCase CMP #'A'+$80
|
||||||
|
BCC BELL
|
||||||
|
CMP #'Z'+1+$80
|
||||||
|
BCS BELL
|
||||||
|
JSR COUT
|
||||||
|
CLC
|
||||||
|
RTS
|
||||||
|
BELL LDA #BEL+$80
|
||||||
|
JSR COUT
|
||||||
|
SEC
|
||||||
|
RTS
|
||||||
|
;
|
||||||
|
ToUCase JSR RDKEY
|
||||||
|
CMP #$E0 ;should be "a" ($E1)
|
||||||
|
BCC L2341
|
||||||
|
AND #$DF
|
||||||
|
L2341 RTS
|
||||||
|
;=================================================
|
||||||
|
; Move ProDOS Quit code fr LCBank2 to main 48K mem
|
||||||
|
; first. Save code as EdAsm.Swap
|
||||||
|
;
|
||||||
|
L2342 LDA RDBANK2 ;read and write-protect RAM LC Bank2
|
||||||
|
LDA RDBANK2
|
||||||
|
LDA #>XD000
|
||||||
|
STA A1 ;start=$D000
|
||||||
|
LDA #<XD000
|
||||||
|
STA A1+1
|
||||||
|
LDA #>X3000
|
||||||
|
STA A2 ;dest=$3000
|
||||||
|
LDA #<X3000
|
||||||
|
STA A2+1
|
||||||
|
;
|
||||||
|
LDY #0
|
||||||
|
L235A LDA (A1),Y
|
||||||
|
STA (A2),Y
|
||||||
|
INY
|
||||||
|
BNE L235A
|
||||||
|
INC A1+1
|
||||||
|
INC A2+1
|
||||||
|
LDA A1+1
|
||||||
|
CMP #<XD000+$1000 ;$D000-$DFFF
|
||||||
|
BCC L235A ;Next mem page
|
||||||
|
;
|
||||||
|
LDA ROMIN2 ;read ROM
|
||||||
|
LDA ROMIN2 ;write enable LC Bank2 RAM
|
||||||
|
JSR PRODOS8
|
||||||
|
DB $C8
|
||||||
|
DW OpenSwapP
|
||||||
|
BEQ L237A
|
||||||
|
RTS
|
||||||
|
;
|
||||||
|
L237A LDA SwapRN
|
||||||
|
STA WrSwapRN
|
||||||
|
STA ClsSwapRN
|
||||||
|
JSR PRODOS8
|
||||||
|
DB $CB
|
||||||
|
DW WrSwapP
|
||||||
|
JSR PRODOS8
|
||||||
|
DB $CC
|
||||||
|
DW ClsSwapP
|
||||||
|
RTS
|
||||||
|
;=================================================
|
||||||
|
; These ProDOS parameter blocks are used for EDASM.SWAP
|
||||||
|
;
|
||||||
|
X3000 EQU $3000
|
||||||
|
X4000 EQU $4000 ;addr of 1024-byte file buffer
|
||||||
|
;
|
||||||
|
OpenSwapP DB $03
|
||||||
|
DW SwapFileS
|
||||||
|
DW X4000
|
||||||
|
SwapRN DB $00
|
||||||
|
;
|
||||||
|
SwapFileS STR 'EDASM.SWAP'
|
||||||
|
;
|
||||||
|
WrSwapP DB $04
|
||||||
|
WrSwapRN DB $B0
|
||||||
|
DW X3000 ;Data buffer
|
||||||
|
DW $1000 ;# of bytes to write
|
||||||
|
DW $0000
|
||||||
|
;
|
||||||
|
ClsSwapP DB $01
|
||||||
|
ClsSwapRN DB $C2
|
||||||
|
;=================================================
|
||||||
|
STR ' (c) COPYRIGHT 1983 BY'
|
||||||
|
STR ' JOHN O. ARKLEY'
|
||||||
|
STR ' ALL RIGHTS RESERVED'
|
||||||
|
;DS \,$EA
|
||||||
|
DS $2400-*,$EA
|
||||||
|
L2400 EQU *
|
60
EDASM.SRC/LINKER/EQUATES.S
Normal file
60
EDASM.SRC/LINKER/EQUATES.S
Normal file
|
@ -0,0 +1,60 @@
|
||||||
|
Name : EQUATES.S
|
||||||
|
End of file : 1,580
|
||||||
|
This file was generated using the DiskBrowser utility with minimal editing.
|
||||||
|
It is meant for viewing purposes only.
|
||||||
|
|
||||||
|
SYS
|
||||||
|
ORG $2000
|
||||||
|
;=================================================
|
||||||
|
; Zero page usage by Linker
|
||||||
|
;
|
||||||
|
Z80 EQU $80
|
||||||
|
Z82 EQU $82
|
||||||
|
SrcP EQU $84 ;ptr into src file data buf
|
||||||
|
Z86 EQU $86 ;ptr into tempESD buf ($9100)
|
||||||
|
Z88 EQU $88 ;GP rec ptr
|
||||||
|
EntRecP EQU $8A ;ptr into DEF/ENTRY table 24-byte records
|
||||||
|
XtnRecP EQU $8C ;ptr into REF/EXTRN table 8-byte records
|
||||||
|
SymP EQU $8E ;ptr into $9200-$A8DF 16-byte records (SymbolicName table)
|
||||||
|
Z8E EQU $8E ;re-cycled
|
||||||
|
;
|
||||||
|
cp EQU $90 ;ptr into cmd line buf
|
||||||
|
MsgP EQU $92
|
||||||
|
CurrORG EQU $94 ;Starting PC of curr src file
|
||||||
|
Z96 EQU $96 ;Curr EOF of REL OBJ file
|
||||||
|
LwrBound EQU $98 ;old offset into curr code image
|
||||||
|
UprBound EQU $9A ;curr offset into curr code (why is $9B not used?)
|
||||||
|
Z9C EQU $9C ; image in memory
|
||||||
|
Z9E EQU $9E ;Flag if a src PN is preceded by an ;
|
||||||
|
XtnNbr EQU $9F ;# of EXTRNs in REL OBJ file's ESD
|
||||||
|
FTypeF EQU $A0 ;filetype of target obj file BIN=$01,REL=$80,SYS=$02
|
||||||
|
;
|
||||||
|
OptionsF EQU $A1 ;TRUE when the OPTION cmd is encountered
|
||||||
|
OptFlagT EQU $A2
|
||||||
|
MapFileF EQU $A2 ;default ON
|
||||||
|
ERefF EQU $A3 ;default ON
|
||||||
|
SortLMF EQU $A4 ;default ON
|
||||||
|
XRefF EQU $A5 ;default ON
|
||||||
|
NumSortF EQU $A6 ;default OFF
|
||||||
|
OptDF EQU $A7 ;default OFF
|
||||||
|
PageF EQU $A8 ;default OFF
|
||||||
|
;
|
||||||
|
; Use to help set flags $A2-$A8
|
||||||
|
; as well as return as a 16-bit value
|
||||||
|
;
|
||||||
|
Switch EQU $AB ;ON/OFF ($80/$00)
|
||||||
|
Value16 EQU $AB ;Value of arithmetic/numeric expression
|
||||||
|
;
|
||||||
|
LineCnt EQU $AD
|
||||||
|
PageCnt EQU $AE
|
||||||
|
JJJ EQU $AF
|
||||||
|
III EQU $B1
|
||||||
|
StrtIdx EQU $B3
|
||||||
|
EndIdx EQU $B5
|
||||||
|
Jump EQU $B7
|
||||||
|
NumRecs EQU $B9 ;Total # of records in ENTRY table
|
||||||
|
J.TH EQU $BB
|
||||||
|
I.TH EQU $BD
|
||||||
|
EntRPJ EQU $BF
|
||||||
|
EntRPI EQU $C1
|
||||||
|
;=================================================
|
20
EDASM.SRC/LINKER/EXTERNALS.S
Normal file
20
EDASM.SRC/LINKER/EXTERNALS.S
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
Name : EXTERNALS.S
|
||||||
|
End of file : 826
|
||||||
|
This file was generated using the DiskBrowser utility with minimal editing.
|
||||||
|
It is meant for viewing purposes only.
|
||||||
|
|
||||||
|
;=================================================
|
||||||
|
; Memory usage by Linker
|
||||||
|
;
|
||||||
|
SrcIOAdr EQU $0800 ;1024-byte buf for REL src file(s) ($0800-$BFFF)
|
||||||
|
SrcDBuf EQU $0C00 ;R/W data buf for file(s) ($0C00-$1FFF)
|
||||||
|
X3F00 EQU $3F00 ;1024-byte buf for OBJ/tempESD files ($3F00-$42FF)
|
||||||
|
X4300 EQU $4300 ;1024-byte buf for LinkMap/tempRLD file ($4300-$46FF)
|
||||||
|
EntTbl EQU $4700 ;DEFine table (24-byte records) ($4700-$70FF)
|
||||||
|
XtnTbl EQU $7100 ;REFerence table (8-byte records) ($7100-$90FF)
|
||||||
|
X9100 EQU $9100 ;databuf-tempESD/REL Obj file ($9100-$91FF)
|
||||||
|
X9200 EQU $9200 ;1 mem page data buf for code image read
|
||||||
|
SymTbl EQU $9200 ;SymbolicName table (16-byte records) ($9200-$A8DF?)
|
||||||
|
XA8E0 EQU $A8E0 ;Upper limit of symbolicname table
|
||||||
|
;=================================================
|
||||||
|
CurrPfxB EQU $BB80 ;Curr Prefix set by user in Editor's environment
|
4543
EDASM.SRC/LINKER/LINK.S
Normal file
4543
EDASM.SRC/LINKER/LINK.S
Normal file
File diff suppressed because it is too large
Load Diff
BIN
EDASM_SRC.2mg
BIN
EDASM_SRC.2mg
Binary file not shown.
|
@ -1,7 +1,7 @@
|
||||||
The disassembled source code of the programs of the PRODOS ASSEMBLER TOOLS RELEASE 1.1 are
|
The disassembled source code of the programs of the PRODOS ASSEMBLER TOOLS RELEASE 1.1 are
|
||||||
distributed in the form of an 800K Universal disk image (.2mg).
|
distributed in the form of an 800K Universal disk image (.2mg). The relevant source files are in the EDASM.SRC folder and are meant for viewing purposes only.
|
||||||
|
|
||||||
This disassembled source codes are arranged in 5 folders.
|
The disassembled source codes are arranged in 5 folders.
|
||||||
|
|
||||||
If you wish to assemble any of the 5 programs,
|
If you wish to assemble any of the 5 programs,
|
||||||
1) you should have a copy of the PRODOS Assembler Tools,
|
1) you should have a copy of the PRODOS Assembler Tools,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user