├── .DS_Store
├── D64-Disc
└── FORUM64 SMON.d64
├── LICENSE
├── History.txt
├── README.md
└── code
└── SMON_RSC.asm
/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LeshanDaFo/SMON-RelocatableSourceCode/HEAD/.DS_Store
--------------------------------------------------------------------------------
/D64-Disc/FORUM64 SMON.d64:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LeshanDaFo/SMON-RelocatableSourceCode/HEAD/D64-Disc/FORUM64 SMON.d64
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2022 Claus Schlereth
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/History.txt:
--------------------------------------------------------------------------------
1 | ; History:
2 |
3 | ; 2023.04.21 V1.2.7.10 = error correction, after removing the RAM-version, the Z-command was not working any more
4 | ; 2023-02.24 V1.2.6.10 = with this version, the RAM under ROM functions are removed, the RAM under ROM version get an own repository now.
5 | ; the repository can be found at: https://github.com/LeshanDaFo/SMON-RAM-VERSION
6 | ; 2023.02.02 V1.1.6.009 = rearanged code in exclude bounding lines function, correct a problem in RAM disassembling, the opcodes were not displayed, added comments
7 | ; 2023.01.31 V1.1.5.008 = error correction in the RAM version, the W-command was not working
8 | ; 2023.01.30 V1.1.4.008 = add comments to the B-command
9 |
10 | ; 2023.01.14 V1.1.4.007 = work on ram under rom function ;error correction, rearange code and commands, add floppy commands, add more comments
11 |
12 | In the RAM under ROM function was a problem, it was not possible any more, to save the ROM content from $A000 to $FFFF.
13 | With the new updated, this is corrected.
14 |
15 | The SMON-RAM-PLUS-version now get back the "Y" command to move the SMON to different memory location.
16 |
17 | The command to change the memory location $01 is now available with the P-command. Examble: P 33 will write the value $33 into the memory location $01. The original P-command to change the printer address is removed.
18 |
19 | Additional disc-cammands are added to both RAM version:
20 | - P@ shows the error channel from the floppy
21 | - P$ shows the directory
22 | - P"cmd" sends a floppy command
23 |
24 | The idea for this additional commands are based on a SMON-version provided to me by rh70,
25 | which is also a member from FORUM64.
26 | https://www.forum64.de/wcf/index.php?user/20464-rh70/
27 |
28 | : 2022.09.10 V1.1.3.006 = change a missspelled label from brdline to bndline
29 | ; 2022.09.09 V1.1.3.005 = add a switch to hide the bounding line after 'brk','rts' and 'jmp', add some comments, re arrange the code
30 | ; 2022.09.08 V1.1.3.004 = error correction in the SAVE command in the RAM version
31 | ; 2022.09.04 V1.1.2.004 = error correction in "comma" function in RAM version
32 | ; 2022.09.03 V1.1.1.004 = add the show ram under rom function, add more comments, re arrange code
33 |
34 | I have added a new function to the source code,
35 | with this function it is possible to show the RAM under the ROM in the area from $A000 to $FFFF
36 |
37 | To compile it you should uncomment the RAM or RAM1 in the source code.
38 |
39 | RAM is the PLUS version with the extended function.
40 | RAM1 is the ILOC version with the extended function.
41 |
42 | The Trace commands are not implemented now, and therefore removed.
43 | The Y-command to move SMON is removed.
44 | To change the address $01 you can use the Y-command
45 | For example: Y37 switch to normal status, Y34 switch to RAM
46 |
47 | ; 2022.09.01 V1.0.0.003 = re arrange some lables , add more comments
48 | ; 2022.08.29 V1 = Initial release
49 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | ### Latest Version : 2023.04.21 V1.2.7.10
2 |
3 | Update information and changlogs are in History.txt
4 |
5 | ## SMON relocatable source code
6 | #### With the help of this source code you can build your own personal SMON-version
7 | - The created versions can be used in different address area of the C64-memory.
8 | - You can change or remove commands.
9 | - You can add own commands to your SMON version
10 |
11 | ## About SMON for C64
12 |
13 | SMON was published in 1984-1985 as a basic listing in the German computer magazin 64'er.
14 | It is still a good and often used tool for C64 users until today in 2022.
15 |
16 | ### Available version of SMON
17 | Mainly there are 3 different version on several D64 disc images available, which have some common main function, and different aditional functions.
18 | The versions so far are:
19 |
20 | - #### SMONFx000 (FMON-version)
21 | This is the initial version of SMON, it contains the basic main commands including the trace commands and the main disc commands.
22 | This version was presented the first time as a basic listing in 5 parts in the German computer magazin 64'er from 1984/11 to 1985/04.
23 | The initial version was written by Norfried Mann und Dietrich Weineck
24 |
25 | - #### SMONPx000 (PLUS-version)
26 | This version has some extended memory commands, and a command to copy SMON to different memory location. To provide this extended functions, the disc functions were removed.
27 | This extension was provided as a basic listing in the German computer magazin 64'er 1985/10.
28 | This version was written by Mark Richters
29 | - #### SMONIx000 (ILOC-version)
30 | This version is an extension to show the so called 'illegal opcodes' of the 6510 Microcontroller. To provide this extended functions, the disc functions were removed.
31 | This extension was provided as a basic listing in the German computer magazin 64'er 1985/12.
32 | It was written by Dietrich Weineck
33 |
34 | Except these 3 version, there is one more extension available, which provides more disc memory commands for the FMON-version, it will replace the trace commands. This extension was also provided as a basic listing in the German computer magazin 64'er 1985/12.
35 | This was also written by Dietrich Weineck
36 | Here I will call it FCOM-version (extended FloppyCommands)
37 |
38 | You can find more details about the SMON at the [C64-Wiki](https://www.c64-wiki.de/wiki/SMON)
39 |
40 |
41 | ## The reason, to work on the source code
42 |
43 | I was looking for a SMON version, which can run in the memory area from $8000 to $9000, and has the extended disc function included.
44 | But it seems, that this version is not available. A version, which has the extended disc commands included, cannot freely moved into the address area of $8000, and a version which includes the SMON copy command, is missing the disc commands.
45 | During my search in the web for a SMON source code, i have found at [https://www.forum64.de](https://www.forum64.de/index.php?thread/56085-smon-source-code/&postID=1347932#post1347932) a link to the [GitHub repository](https://github.com/cbmuser/smon-reassembly) from 'cbmuser', which is marked as Public Domain.
46 | I had a first look on it, and seems it is a good start for my own project.
47 | So I decided to use this as a base for my work, to create different version of SMON.
48 |
49 | ## The work on the existing SMON source code, step by step
50 |
51 | ### 1. Checking the existing source code.
52 | The source code is the so called EXT, or PLUS version of SMON, and is allmost perfect.
53 |
54 | So far I found 2 problems in the source code.
55 |
56 | #### 1.1 a wrong placed branch label.
57 | The label was placed in the source code at the wrong position ($CE89), The label should be placed at ($CEA2), this is corrected now.
58 |
59 |
. . .
60 |
61 | #### 1.2 a missing byte at the end of the source code.
62 | The last byte "0E" was missing in the source code, this byte belongs to the adjustment table for the Y-command
63 |
64 |
65 |
66 | The byte at address xE04 was not adjusted by the Y-command. This was fixed by adding the byte $0E at the end of the source code.
67 |
68 | (Btw, some of the existing PLUS-version on the disc images are missing this byte at the end too)
69 | ### 2. Making SMON freely relocatable
70 |
71 | updated all link addresses, and all offsets to relocatable ones, now the SMON can be compiled for different memory address areas.
72 |
73 | ### 3. Extending the existing source code (SMONPx000)
74 |
75 | #### added code to the source code as following:
76 |
77 | - added source code from FMON-version (disc commands),
78 |
79 | - added source code from FCOM-version (extended floppy commands) and
80 |
81 | - added source code from ILOC-version (illegal opcodes).
82 |
83 | #### with this extensions it is possible to compile any version of SMON
84 |
85 | ### 4. Comments
86 |
87 | added some comments (if i can find the time, i will maybe continue to work on this)
88 | ### 5. Try-out, and bug fixing
89 |
90 | during try out off the different compiled version, I found a bug which is inside SMON from the beginning. The B-command for creating basic data-lines is only working in the version which is compiled for the address range $C000. Even in the copy (Y) command of the PRO version, this error is existing.
91 | To fix this error the address LC08D must be defined as relocatable address, and must be aded to the table of the (Y) command.
92 | This is done in the next step.
93 |
94 | ### 6. Analyzing and improve the (Y) command
95 |
96 | I have analyzed and partly rebuild the move (Y) command. The command now also includes the missing address of the B-command.
97 | The SMON-PLUS can now be coppied with the Y-command to different memory location as fully working version.
98 | The B-command to create basic data-lines is fixed and fully working now in the copied version.
99 |
100 | ### 7. Error correction
101 |
102 | Based on the instructions given in the German magazine 64'er 12/85 some errors are corrected in different places of the source code.
103 |
104 | ## How to use the SMON relocatable multi source code
105 | The source code which is provided here in this repository is now a multi function source code, which can build all different version for different memory adresses.
106 |
107 | ### How to select the version
108 | The version can be easy selected by uncommenting the relevant part in the sourc code.
109 | in the following example, the "FCOM" part is selected for the build
110 |
111 | ; -----------------------------------------------------------
112 | ; ---------------------- SMON VERSION -----------------------
113 | ; -----------------------------------------------------------
114 | ; - DEFINE ONLY ONE VERSION BY UNCOMMENTING IT -
115 | ; if nothing is selected here, SMON will be compiled without any extension
116 |
117 | ;FMON = 1 ; this is the FMON version, also named SMONFx000, this seems to be the 'normal' or initial one, including the base disc commands
118 | ;PLUS = 1 ; this is the PLUS version, also named SMONPx000, for the new function the FMON monitor is removed
119 | ;ILOC = 1 ; this is the ILOC version, also named SMONIx000, this provides the function to show the illegal opcodes, the FMON is removed
120 | FCOM = 1 ; this is the FCOM version, can named as SMONDx000, this has the extended Floppy cpmmands, the "Trace" function is removed
121 |
122 | Only one version can be used, otherwise SMON will not work correctly.
123 |
124 | ### How to define the start address
125 | the start address can be defind with the common command like like "*=$C000"
126 | The start address should be an even 4k address, like: $1000, $4000, aso.
127 | it is possible to use an address like $6500,
128 | but with this kind of address, the Y-command in the PLUS-version cannot work correct.
129 |
130 | ### T-command on different CIA version
131 |
132 | On different C64 can be installed different CIA chips. The trace command is using the timer function of the CIA. If the command is not working on your C64, this can be adjusted by selecting the right CIA timing version in the source.
133 |
134 | ; -----------------------------------------------------------
135 | ; ----------------------- CIA VERSION -----------------------
136 | ; -----------------------------------------------------------
137 | ; the new CIA is defined as standard
138 | ; commenting CIA_N will activate the old version
139 | ; changing the CIA timing is necessary if the trace-command is not working well
140 | ; it can also defined manually by changing the value at address $CD8E
141 | CIA_N = 1 ; change here
142 | ; -----------------------------------------------------------
143 |
144 | ## REMARK:
145 | Used Software:
146 | Visual Studio Code, Version: 1.63.2 (Universal)
147 | Acme Cross-Assembler for VS Code (c64) v0.0.18
148 |
149 | Used Hardware:
150 | Apple iMac (24-inch, M1, 2021)
151 | macOS Ventura, version 13.0 Beta (22A5331f)
152 |
153 |
154 | The source code can be compiled by using the Acme Cross Compiler (C64)
155 |
156 | Please use this source code on your own risk ;)
157 |
--------------------------------------------------------------------------------
/code/SMON_RSC.asm:
--------------------------------------------------------------------------------
1 | ; ###############################################################
2 | ; # #
3 | ; # SMON RELOCATABLE SOURCE CODE #
4 | ; # Version 1.2.7.10 (2023.04.21) #
5 | ; # Copyright (c) 2022, 2023 Claus Schlereth #
6 | ; # #
7 | ; # Based on the source code from: cbmuser #
8 | ; # https://github.com/cbmuser/smon-reassembly #
9 | ; # #
10 | ; # This source is available at: #
11 | ; # https://github.com/LeshanDaFo/SMON-RelocatableSourceCode #
12 | ; # #
13 | ; # SMON was written by: #
14 | ; # Norfried Mann und Dietrich Weineck #
15 | ; # #
16 | ; # The PLUS-extension was written by: #
17 | ; # Mark Richters #
18 | ; # #
19 | ; # This version of the source code is under MIT License #
20 | ; ###############################################################
21 |
22 | ; History:
23 | ; V1 = Initial release
24 | ; V1.0.0.001 = add more comments, not released
25 | ; V1.0.0.002 = add more comments, not released
26 | ; V1.0.0.003 = re arranged some lables , added more comments
27 | ; V1.1.0.003 = start to add the show ram under rom function, not released
28 | ; V1.1.1.004 = added the show ram under rom function, added more comments, re arranged code
29 | ; V1.1.2.004 = error correction in "comma" function in RAM version
30 | ; V1.1.3.004 = error correction in the SAVE command in the RAM version
31 | ; V1.1.3.005 = added a switch to hide the bounding line after 'brk','rts' and 'jmp', added some comments, re arrangeed the code
32 | ; V1.1.3.006 = changeed a missspelled label from "brdline" to "bndline"
33 | ; V1.1.4.007 = worked on ram under rom function ; error correction, rearanged code and commands, add floppy commands, added more comments
34 | ; V1.1.4.008 = added comments to the B-command
35 | ; V1.1.5.008 = error correction in the RAM version, the W-command was not working
36 | ; V1.1.6.009 = rearanged code in exclude bounding lines function, correct a problem in RAM disassembling, the opcodes were not displayed, added comments
37 | ; ---------------------------------------------------------------
38 | ; V1.2.6.10 = with this version, the RAM under ROM functions are removed, the RAM under ROM version get an own repository now.
39 | ; the RAM under ROM function can be found at: https://github.com/LeshanDaFo/SMON-RAM-VERSION
40 | ; V1.2.7.10 = error correction, after removing the RAM-version, the Z-command was not working any more
41 |
42 | TASTBUF = $0277
43 | COLOR = $0286 ; charcolor
44 | PCHSAVE = $02A8 ; PC hi
45 | PCLSAVE = $02A9 ; PC lo
46 | SRSAVE = $02AA ; SR
47 | AKSAVE = $02AB ; A
48 | XRSAVE = $02AC ; XR
49 | YRSAVE = $02AD ; YR
50 | SPSAVE = $02AE ; SP
51 | PRNNO = $02AF ; Printer number
52 | IONO = $02B0 ; Device-Number
53 | MEM = $02B1 ; Buffer bis $02BA
54 | TRACEBUF = $02B8 ; Buffer für Trace-Modus bis $02BF
55 |
56 | IRQ_LO = $0314 ; Vector: Hardware IRQ Interrupt Address Lo
57 | IRQ_HI = $0315 ; Vector: Hardware IRQ Interrupt Address Hi
58 | BRK_LO = $0316 ; Vector: BRK Lo
59 | BRK_HI = $0317 ; Vector: BRK Hi
60 | LOADVECT = $0330 ; Vector: Kernal LOAD
61 | SAVEVECT = $0332 ; Vector: Kernal SAVE
62 |
63 | ;READY
64 | WARMSTART = $A474 ; Restart BASIC
65 | FLOATC = $BC49 ; FLOAT UNSIGNED VALUE IN FAC+1,2
66 | INTOUT = $BDCD ; Output Positive Integer in A/X
67 | INTOUT1 = $BDD1 ; Output Positive Integer in A/X
68 | FLPSTR = $BDDD ; Convert FAC#1 to ASCII String
69 | VIC_CTRL1 = $D011 ; VIC Control Register 1
70 | BORDER = $D020 ; Border Color
71 | BKGRND = $D021 ; Background Clor
72 | TIMERA_LO = $DC04 ; Timer A Low-Byte (Kernal-IRQ, Tape)
73 | TIMERA_HI = $DC05 ; Timer A High-Byte (Kernal-IRQ, Tape)
74 | CONTROL_REGA = $DC0E ; Control Register A CIA#1
75 | EN_TIMER = $FDDD ; Enable Timer
76 | SECND = $FF93 ; send SA after LISTEN
77 | TKSA = $FF96 ; Set secondary address
78 | IECIN = $FFA5 ; Read byte from IEC bus
79 | CIOUT = $FFA8 ; handshake IEEE byte out
80 | UNTALK = $FFAB ; send UNTALK out IEEE
81 | UNLSN = $FFAE ; send UNLISTEN out IEEE
82 | LISTN = $FFB1 ; send LISTEN out IEEE
83 | TALK = $FFB4 ; send TALK out IEEE
84 | SETLFS = $FFBA ; set length and FN adr
85 | SETNAM = $FFBD ; Set file name
86 | OPEN = $FFC0 ; OPEN Vector
87 | CLOSE = $FFC3 ; CLOSE Vector
88 | CHKIN = $FFC6 ; Set input file
89 | CHKOUT = $FFC9 ; Set Output
90 | CLRCHN = $FFCC ; Restore I/O Vector
91 | CHRIN = $FFCF ; Input Vector
92 | CHROUT = $FFD2 ; Output Vector
93 | STOP = $FFE1 ; Test STOP Vector
94 | GETIN = $FFE4 ; Vector: Kernal GETIN Routine
95 |
96 | ; addresses used from disk monitor:
97 |
98 | SAVEX = $02C1 ; Temp storage for X- und Y-Register
99 | TMPTRCK = $02C2
100 | TMPSECTO = $02C3 ; Temp storage for track and sector
101 | DCMDST = $02D0 ; Disc command string
102 | TRACK = $02D8
103 | SECTO = $02DB ; Track and sector number
104 | BUF1 = $033C ; Buffer for assembly command, until $03FC
105 | BUF2 = $036C
106 | BUF3 = $039C
107 | BUF4 = $03CC
108 |
109 | ; used zero page addresses
110 | _01BUFF = $41 ; Buffer for $01 zero page value used in ram under rom version
111 | FLAG = $AA ; Universal flag
112 | ADRCODE = $AB ; Addressing code for Assembler/Disassembler
113 | COMMAND = $AC ; SMON-command code
114 | BEFCODE = $AD ; Command code Ass./Disass.
115 | LOPER = $AE ; Low-Operand for Ass./Disass.
116 | HOPER = $AF ; High-Operand for Ass./Disass.
117 | BEFLEN = $B6 ; Command length Ass./Disass.
118 | PCL = $FB ; SMON-programmcounter Low-Byte
119 | PCH = $FC ; SMON-programmcounter High-Byte
120 |
121 | ; hidden commands
122 | HCK = $27 ; "'"
123 | HCM = $3a ; ":"
124 | HCR = $3b ; ";"
125 | HCD = $2C ; ","
126 | ; hidden cmds in PLUS
127 | HCH = $28 ; '('
128 | HCZ = $29 ; ")"
129 | HCN = $21 ; "!"
130 |
131 | ; -----------------------------------------------------------
132 | ; ---------------------- SMON VERSION -----------------------
133 | ; -----------------------------------------------------------
134 | ; - SELECT ONLY ONE VERSION BY UNCOMMENTING IT -
135 | ; if nothing is selected here, SMON will be compiled without any extension
136 |
137 | FMON = 1 ; this is the FMON version, also named SMONFx000, this seems to be the 'normal' or initial one, including the base disc commands
138 | ;PLUS = 1 ; this is the PLUS version, also named SMONPx000, for the new function the FMON monitor is removed
139 | ;ILOC = 1 ; this is the ILOC version, also named SMONIx000, this provides the function to show the illegal opcodes, the FMON is removed
140 |
141 | ;FCOM = 1 ; this is the FCOM version, can named as SMONDx000, this has the extended Floppy cpmmands, the "Trace" function is removed
142 |
143 | ; -----------------------------------------------------------
144 | ; -------------------END SMON VERSION -----------------------
145 | ; -----------------------------------------------------------
146 |
147 | ; -----------------------------------------------------------
148 | ; --------- define here the start address in memory ---------
149 | *= $8000
150 | ; -----------------------------------------------------------
151 |
152 | ; -----------------------------------------------------------
153 | ; ----------------------- CIA VERSION -----------------------
154 | ; -----------------------------------------------------------
155 | ; the new CIA is defined as standard
156 | ; commenting CIA_N will activate the old version
157 | ; changing the CIA timing is necessary if the trace-command is not working well
158 | ; it can also defined manually at address $CD8E
159 | CIA_N = 1 ; change here
160 | ; -----------------------------------------------------------
161 |
162 | ; -----------------------------------------------------------
163 | ; feature to hide the bounding line after 'brk','rts' and 'jmp'
164 | ; -----------------------------------------------------------
165 | ; with this switch it is possible to hide the bounding lines
166 | ; which is normally displayed after some commands during disassemble
167 | ; commenting bndline will hide the lines
168 | bndline = 1 ; change here
169 | ; -----------------------------------------------------------
170 |
171 | !ifdef FMON {
172 | !to"build/SMONFx000.prg",cbm
173 | } else {
174 | !ifdef PLUS {
175 | !to"build/SMONPx000.prg",cbm
176 | } else {
177 | !ifdef ILOC {
178 | !to"build/SMONIx000.prg",cbm
179 | } else {
180 | !ifdef FCOM {
181 | !to"build/SMONDx000.prg",cbm
182 | } else {
183 | !to"build/SMONBx000.prg",cbm
184 | }
185 | }
186 | }
187 | }
188 |
189 | ; -----------------------------------------------------------
190 | ; ------ THIS IS FOR COMPILING THE VERSIONS CORRECTLY -------
191 | ; ------------ NORMALLY NOTHING TO CHANGE HERE! -------------
192 | ; -----------------------------------------------------------
193 | !ifdef FCOM {
194 | FMON = 1
195 | }
196 | ; -----------------------------------------------------------
197 | ; ------------------ start of the program -------------------
198 | ; -----------------------------------------------------------
199 |
200 | SETBRK: lda #BREAK
203 | sta BRK_HI
204 | brk
205 | ; ------------------ here are the general commands ----------
206 | CMDTBL: !by $27,$23,$24,$25,$2C,$3A,$3B,$3D ;"'#$%,:;="
207 | !by $3F,$41,$42,$43,$44,$46,$47,$49 ;"?ABCDFGI"
208 | !by $4B,$4C,$4D,$4F,$50,$52,$53 ;"KLMOPRS"
209 |
210 | ; depending of the selection, different commands are defined
211 | !ifdef FCOM {
212 | !by $00 ; deactivate the trace command if FCOM is selected
213 | } else {
214 | !by $54 ; "T"
215 | }
216 | !by $56,$57,$58 ; "VWX"
217 | !ifdef FMON {
218 | !by $5A ; "Z" activate the Z command
219 | } else {
220 | !by $00 ; "." deactivate
221 | }
222 | !by $00,$00 ;".."
223 | !by $00,$00
224 | ; the command addresses
225 | CMDS: !by TICK-1
227 | !by BEFDEC-1
229 | !by BEFHEX-1
231 | !by BEFBIN-1
233 | !by COMMA-1
235 | !by COLON-1
237 | !by SEMIS-1
239 | !by COMP-1
241 | !by ADDSUB-1
243 | !by ASSEMBLER-1
245 | !by BASICDATA-1
247 | !by CONVERT-1
249 | !by DISASS-1
251 | !by FIND-1
253 | !by GO-1
255 | !by IOSET-1
257 | !by KONTROLLE-1
259 | !by LOADSAVE-1
261 | !by MEMDUMP-1
263 | !by OCCUPY-1
265 | ; depending on the selected version, different command addresses are defined
266 | !by SETPRINTER-1
268 | !by REGISTER-1
270 | !by LOADSAVE-1
272 | !ifdef FCOM { ; trace command removed
273 | !by $00 ; . 19
274 | !by $00
275 | } else {
276 | ; the trace command is used in PLUS and FMON version
277 | !by TRACE-1
279 | }
280 | !by VERSCHIEB-1
282 | !by WRITE-1
284 | !by EXIT-1
286 |
287 | !ifdef PLUS {
288 | HCMDTAB: !by HCK,HCM,HCR,HCD,HCH,HCZ,HCN ; "':;,()!"
289 |
290 | } else {
291 |
292 | !ifdef FMON { ; activate the FMON commands
293 | !by DMON-1
295 | !by $00,$00
296 | }
297 | !ifdef ILOC { ; activate the Illegal opcodes
298 | !by ILLEGAL-1
300 | !by $00,$00
301 | }
302 | !by $00,$00,$00
303 | }
304 | !by $00,$00,$00
305 |
306 | OFFSET: !by $FF,$FF,$01,$00
307 |
308 | ; find commands
309 | FINDTAB: !by $41,$5A,$49,$52,$54 ; "AZIRT"
310 | FINDFLG: !by $80,$20,$40,$10,$00
311 | FINDFLG1: !by $02,$01,$01,$02,$00
312 |
313 | ; code for generating basic lines
314 | SYS172: !by $91,$91,$0D
315 | !by $53,$D9,$31,$37,$32,$0D ; "sY172."
316 | DATATAB: !by $00,$7D ; basic line number 32000
317 | !by $4C ; jmp DATALOOP
318 | !by DATALOOP
320 |
321 | ; the register header
322 | REGHEAD: !by $0D,$0D,$20,$2D,$50,$43,$2D,$20 ; ".. -PC- "
323 | !by $53,$52,$20,$41,$43,$20,$58,$52 ; "SR AC XR"
324 | !by $20,$59,$52,$20,$53,$50,$20,$20 ; " YR SP "
325 | !by $4E,$56,$2D,$42,$44,$49,$5A,$43 ; "NV-BDIZC"
326 |
327 | LC0AC: !by $00,$02,$04
328 | LC0AF: !by $01,$2C,$00
329 | LC0B2: !by $2C,$59,$29
330 | LC0B5: !by $58,$9D,$1F,$FF,$1C,$1C,$1F,$1F
331 | !by $1F,$1C,$DF,$1C,$1F,$DF,$FF,$FF
332 | !by $03
333 | LC0C6: !by $1F,$80,$09,$20,$0C,$04,$10,$01
334 | !by $11,$14,$96,$1C,$19,$94,$BE,$6C
335 | !by $03,$13
336 | LC0D8: !by $01,$02,$02,$03,$03,$02,$02,$02
337 | !by $02,$02,$02,$03,$03,$02,$03,$03
338 | !by $03,$02
339 | LC0EA: !by $00,$40,$40,$80,$80,$20,$10,$25
340 | !by $26,$21,$22,$81,$82,$21,$82,$84
341 | !by $08
342 | LC0FB: !by $08,$E7,$E7,$E7,$E7,$E3,$E3,$E3
343 | !by $E3,$E3,$E3,$E3,$E3,$E3,$E3,$E7
344 | !by $A7,$E7,$E7,$F3,$F3,$F7
345 | LC111: !by $DF
346 |
347 | ; --------- 6510 COMMANDS -----------------------------------
348 | LC112: !by $26,$46,$06,$66,$41,$81,$E1,$01 ;ROL,LSR,ASL,....
349 | !by $A0,$A2,$A1,$C1,$21,$61,$84,$86
350 | !by $E6,$C6,$E0,$C0,$24,$4C,$20,$90
351 | !by $B0,$F0,$30,$D0,$10,$50,$70,$78
352 | !by $00,$18,$D8,$58,$B8,$CA,$88,$E8
353 | LC13A: !by $C8,$EA,$48,$08,$68,$28,$40,$60
354 | !by $AA,$A8,$BA,$8A,$9A,$98,$38,$F8
355 |
356 | LC14A: !by $89,$9C,$9E
357 | LC14D: !by $B2,$2A,$4A,$0A,$6A,$4F,$23,$93
358 | !by $B3,$F3,$33,$D3,$13,$53,$73
359 |
360 | ; --------- 6510 COMMANDS CHAR ------------------------------
361 | LC15C: !by $52,$4C,$41,$52,$45,$53,$53,$4F ; "R L A R E S S O" ;R
362 | !by $4C,$4C,$4C,$43,$41,$41,$53,$53 ; "L L L C A A S S"
363 | !by $49,$44,$43,$43,$42,$4A,$4A,$42 ; "I D C C B J J B"
364 | !by $42,$42,$42,$42,$42,$42,$42,$53 ; "B B B B B B B S"
365 | !by $42,$43,$43,$43,$43,$44,$44,$49 ; "B C C C C D D I"
366 | !by $49,$4E,$50,$50,$50,$50,$52,$52 ; "I N P P P P R R"
367 | !by $54,$54,$54,$54,$54,$54,$53,$53 ; "T T T T T T S S"
368 |
369 | LC194: !by $4F,$53,$53,$4F,$4F,$54,$42,$52 ; "O S S O O T B R" ;O
370 | !by $44,$44,$44,$4D,$4E,$44,$54,$54 ; "D D D M N D T T"
371 | !by $4E,$45,$50,$50,$49,$4D,$53,$43 ; "N E P P I M S C"
372 | !by $43,$45,$4D,$4E,$50,$56,$56,$45 ; "C E M N P V V E"
373 | !by $52,$4C,$4C,$4C,$4C,$45,$45,$4E ; "R L L L L E E N"
374 | !by $4E,$4F,$48,$48,$4C,$4C,$54,$54 ; "N O H H L L T T"
375 | !by $41,$41,$53,$58,$58,$59,$45,$45 ; "A A S X X Y E E"
376 |
377 | LC1CC: !by $4C,$52,$4C,$52,$52,$41,$43,$41 ; "L R L R R A C A" ;L
378 | !by $59,$58,$41,$50,$44,$43,$59,$58 ; "Y X A P D C Y X"
379 | !by $43,$43,$58,$59,$54,$50,$52,$43 ; "C C X Y T P R C"
380 | !by $53,$51,$49,$45,$4C,$43,$53,$49 ; "S Q I E L S C I"
381 | !by $4B,$43,$44,$49,$56,$58,$59,$58 ; "K C D I V X Y X"
382 | !by $59,$50,$41,$50,$41,$50,$49,$53 ; "Y P A P A P I S"
383 | !by $58,$59,$58,$41,$53,$41,$43,$44 ; "X Y X A S A C D"
384 |
385 | LC204: !by $08,$84,$81,$22,$21,$26,$20,$80
386 | LC20C: !by $03,$20,$1C,$14,$14,$10,$04,$0C
387 |
388 | ; --------- SMON START --------------------------------------
389 | BREAK: cld
390 | lda #$08
391 | sta IONO ; set drive #8
392 | lda #$04
393 | sta PRNNO ; set printer #4
394 | lda #$06
395 | sta BORDER ; border and
396 | sta BKGRND ; screen color
397 | lda #$03
398 | sta COLOR ; charcolor
399 | ldx #$05
400 | BREAK2: pla
401 | sta PCHSAVE,x ; save stack
402 | dex
403 | bpl BREAK2
404 | lda PCLSAVE
405 | bne BREAK3
406 | dec PCHSAVE ; PC high
407 | BREAK3: dec PCLSAVE ; PC low
408 | tsx
409 | stx SPSAVE
410 | lda #$52 ; "R"-command
411 | jmp CMDSTORE ; execute R-command
412 | ;
413 | GETSTART: jsr GETRET ; check for return
414 | beq GETSTRTS
415 | GETSTART1: jsr GETADR1
416 | sta PCLSAVE
417 | lda PCH
418 | sta PCHSAVE
419 | GETSTRTS: rts
420 | ;
421 | GET3ADR: ldx #$A4
422 | jsr GETADR
423 | jsr GETADR
424 | bne GETADR
425 | ;
426 | GET12ADR: jsr GETADR1
427 | lda #$FE
428 | sta $FD
429 | lda #$FF
430 | sta $FE
431 | jsr GETRET ; check for return
432 | bne GETADR
433 | sta TASTBUF
434 | inc $C6
435 | rts
436 | ;
437 | GET2ADR: jsr GETADR1
438 | !by $2C
439 | GETADR1: ldx #$FB
440 | ;
441 | GETADR: jsr GETBYT
442 | sta $01,x
443 | jsr GETBYT1
444 | sta $00,x
445 | inx
446 | inx
447 | rts
448 | ;
449 | GETBYT: jsr GETCHRERR
450 | _GETBYT: cmp #$20
451 | beq GETBYT
452 | cmp #$2C
453 | beq GETBYT
454 | bne ASCHEX
455 | ;
456 | GETBYT1: jsr GETCHRERR
457 | ASCHEX: jsr ASCHEX1
458 | asl
459 | asl
460 | asl
461 | asl
462 | sta $B4
463 | jsr GETCHRERR
464 | jsr ASCHEX1
465 | ora $B4
466 | rts
467 | ASCHEX1: cmp #$3A
468 | bcc ASCHEX2
469 | adc #$08
470 | ASCHEX2: and #$0F
471 | rts
472 | ;
473 | SKIPSPACE: jsr GETCHRERR
474 | cmp #$20
475 | beq SKIPSPACE
476 | dec $D3
477 | rts
478 | ;
479 | GETRET:
480 | jsr CHRIN
481 | dec $D3 ;
482 | cmp #$0D ; await RETURN
483 | GETBRTS: rts
484 | ; --------- GET INPUT AND AWAIT RETURN ----------------------
485 | GETCHRERR:
486 | jsr CHRIN
487 | cmp #$0D ; await RETURN
488 | bne GETBRTS ; not CR
489 | ; --------- Faulty Userinput --------------------------------
490 | ERROR: lda #$3F ; "?"
491 | jsr CHROUT
492 | EXECUTE: ldx SPSAVE
493 | txs
494 | ldx #$00
495 | stx $C6
496 | jsr RETURN ; next line
497 | lda ($D1,x)
498 |
499 | !ifdef PLUS {
500 | ldx #$06 ; amount of commands
501 | CHKHCMD: cmp HCMDTAB,x ; check for hidden command
502 | beq EXEC1 ; if found, execute
503 | dex ;
504 | bpl CHKHCMD ; check for next command
505 | lda #$2E ; "."
506 | jsr CHROUT
507 | EXEC1: jsr GETCHRERR ; await next input
508 | cmp #$2E ; "."
509 | beq EXEC1 ; ignore dot
510 | jmp LINSTORE ; prepare buffer for J-command, and then jmp to CMDSTORE
511 | NEXT: jmp MORECMD
512 | } else {
513 | cmp #$27 ; "'"
514 | beq EXEC1
515 | cmp #$3A ; ':'
516 | beq EXEC1
517 | cmp #$3B ; ";"
518 | beq EXEC1
519 | cmp #$2C ; ","
520 | beq EXEC1
521 | lda #$2E ; "."
522 | jsr CHROUT
523 | EXEC1: jsr GETCHRERR
524 | cmp #$2E ; "."
525 | beq EXEC1
526 | }
527 | CMDSTORE: sta COMMAND ; store command
528 | and #$7F ; delete bit 7
529 | ldx #$20 ; amount of commands
530 | ; --------- Check User Input --------------------------------
531 | CMDSEARCH: cmp CMDTBL-1,x ; compare users char
532 | beq CMDFOUND ; matched
533 | dex
534 | bne CMDSEARCH ; repaet compare
535 | !ifdef PLUS {
536 | beq NEXT ; check for additonal plus commands
537 | } else {
538 | beq ERROR ; command unknown
539 | }
540 | CMDFOUND: jsr CMDEXEC ; fetch routine offset
541 | jmp EXECUTE ; go back, wait for next input
542 |
543 | ; --------- get address according command char and execute --
544 | CMDEXEC: txa
545 | asl
546 | tax
547 | inx
548 | lda CMDS-2,x ; low address
549 | pha ; on stack
550 | dex
551 | lda CMDS-2,x ; high address
552 | pha ; on stack
553 | rts ; jump to execute command
554 | ; --------- output PC as 4 digit hex -----------------------
555 | HEXOUT: lda PCH ; load PC high byte
556 | jsr HEXOUT1 ; output 2 digit hex address
557 | lda PCL ; load PC low byte
558 | ; --------- output value as 2 digit hex -----------------------
559 | HEXOUT1: pha ; save byte
560 | lsr ; shift 4 times to get low nibble
561 | lsr
562 | lsr
563 | lsr
564 | jsr HEXOUT2 ; output one nibble
565 | pla ; get back saved value
566 | and #$0F ; mask low nibble
567 | HEXOUT2: cmp #$0A ; compare
568 | bcc HEXOUT3 ; output as number
569 | adc #$06 ; add 6 for letter
570 | HEXOUT3: adc #$30 ; add $30
571 | jmp CHROUT
572 | ; --------- output a char with leading CR ---------------------
573 | CHARRET: lda #$0D ; next line
574 | CHARR1:
575 | jsr CHROUT
576 | txa ; get value from x
577 | jmp CHROUT
578 | ; --------- output 2 x space ----------------------------------
579 | SPACE2: jsr SPACE
580 | ; --------- output space --------------------------------------
581 | SPACE: lda #$20 ; space
582 | jmp CHROUT
583 | ; --------- output CR -----------------------------------------
584 | RETURN: lda #$0D ; next line
585 | jmp CHROUT
586 | ; --------- print string from address in a,y ------------------
587 | PRINT: sta $BB ; pointer to address low byte
588 | sty $BC ; pointer to address high byte
589 | ldy #$00 ; counter
590 | PRINT1: lda ($BB),y ; get byte from address
591 | beq PRINT2 ; if 0 then end
592 | jsr CHROUT
593 | iny ; increase counter
594 | bne PRINT1 ; more to print
595 | PRINT2: rts
596 | ; --------- increase PC -------------------------------------
597 | PCINC: inc PCL ; increase low byte
598 | bne PCRTS ; not 0, then finish
599 | inc PCH ; otherwise increase also the high byte
600 | PCRTS: rts
601 | ; --------- EXIT (X) ----------------------------------------
602 | EXIT:
603 | lda #$0E ; restore
604 | sta COLOR ; system
605 | sta BORDER ; colors
606 | lda #$06
607 | sta BKGRND
608 | lda #$37 ; default rom-config
609 | sta $01
610 | ldx SPSAVE ; restore stack
611 | txs
612 | jmp WARMSTART ; basic warmstart
613 | ; --------- REGISTER (R) ------------------------------------
614 | REGISTER: ldy #>REGHEAD
615 | lda #FLOPPY-MONITOR>"
1702 | beq PRNRET ; last char, print return
1703 | jsr CHROUT ; print
1704 | inx ;
1705 | bne PRNTXT ; next char
1706 | PRNRET: jsr RETURN ; next line
1707 | FCMDLOOP: ldx #$3e ; ">"
1708 | FCMDLOOP2: jsr CHARRET ; output to screen
1709 | GETFCMD: jsr CHRIN ; get Input
1710 | cmp #$3e ; cmp ">"
1711 | beq GETFCMD ; ignore
1712 | cmp #$20 ; space?
1713 | beq GETFCMD ; ignore
1714 | ldx #$05 ; load x with 5 possible commands
1715 | CHKTBL: cmp FCMDTBL,x ; check according table
1716 | beq FCMDFND ; it is a command
1717 | dex ; decrement x
1718 | bne CHKTBL ; check more
1719 | jsr RETURN ; unknown command, next line
1720 | jmp FCMDLOOP ; go output '>' CR and wait for command
1721 | FCMDFND: txa
1722 | asl
1723 | tax
1724 | inx
1725 | lda FADDTBL-2,x
1726 | pha
1727 | dex
1728 | lda FADDTBL-2,x
1729 | pha
1730 | rts
1731 | LCC33: jsr GETRET ; check for return
1732 | bne LCC42
1733 | lda #$00
1734 | sta LCDC3
1735 | sta LCDC4
1736 | beq LCC5C
1737 | LCC42: jsr GETBYT
1738 | sta LCDC4
1739 | jsr GETRET ; check for return
1740 | bne LCC54
1741 | lda #$00
1742 | sta LCDC3
1743 | beq LCC5C
1744 | LCC54: jsr GETBYT
1745 | and #$f8
1746 | sta LCDC3
1747 | LCC5C: jsr LCD77
1748 | ldx #$0f
1749 | jsr CHKOUT
1750 | ldx #$00
1751 | LCC66: lda MRTXT,x
1752 | jsr CHROUT
1753 | inx
1754 | cpx #$06
1755 | bcc LCC66
1756 | jsr CLRCHN
1757 | ldx #$0f
1758 | jsr CHKIN
1759 | ldy #$00
1760 | LCC7B: jsr CHRIN
1761 | sta $bf00,y
1762 | iny
1763 | bne LCC7B
1764 | jsr CLRCHN
1765 | LCC87: jmp LCFBC
1766 | LCC8A: lda #$bf
1767 | sta PCH
1768 | lda #$00
1769 | sta PCL
1770 | rts
1771 | ; --------- MEMDUMP (M) -------------------------------------
1772 | MEMDP: jsr LCC33
1773 | jsr LCC8A
1774 | LCC99: ldx #$3a
1775 | jsr CHARRET
1776 | lda LCDC4
1777 | jsr HEXOUT1 ; output 2 digit hex address
1778 | lda LCDC3
1779 | jsr HEXOUT1 ; output 2 digit hex address
1780 | ldy #$20
1781 | ldx #$00
1782 | jsr SPACE ; output space
1783 | LCCB1: jsr SPACE ; output space
1784 | lda (PCL,x)
1785 | jsr HEXOUT1 ; output 2 digit hex address
1786 | lda (PCL,x)
1787 | jsr ASCII
1788 | bne LCCB1
1789 | lda #$08
1790 | clc
1791 | adc LCDC3
1792 | sta LCDC3
1793 | php
1794 | cmp #$f8
1795 | bne LCCD4
1796 | jsr LCC5C
1797 | jsr LCC8A
1798 | LCCD4: plp
1799 | bcc LCCE0
1800 | inc LCDC4
1801 | jsr LCC5C
1802 | jsr LCC8A
1803 | LCCE0: jsr LCD87
1804 | jsr STOP
1805 | bne LCC99
1806 | jmp PRNRET ; print return
1807 | ; --------- HIDDEN CMD COLON (:) ----------------------------
1808 | H_COL: jsr GETADR1
1809 | lda PCL
1810 | sta LCDCC
1811 | lda PCH
1812 | sta LCDCD
1813 | jsr LCD19
1814 | ldy #$20
1815 | ldx #$00
1816 | jsr GETCHRERR
1817 | LCD02: jsr GETCHRERR
1818 | jsr GETBYT1
1819 | jsr CHROUT
1820 | jsr ASCII
1821 | bne LCD02
1822 | jsr CLRCHN
1823 | jsr LCFBC
1824 | jmp FCMDLOOP2
1825 | LCD19: jsr LCD77
1826 | ldx #$0f
1827 | jsr CHKOUT
1828 | ldx #$00
1829 | LCD23: lda MWTXT,x
1830 | jsr CHROUT
1831 | inx
1832 | cpx #$06
1833 | bcc LCD23
1834 | rts
1835 | ; --------- MEMORYCOPY (V) ----------------------------------
1836 | MEMCP: jsr GETADR1
1837 | ldx #$fd
1838 | jsr GETADR
1839 | lda $fd
1840 | sta LCDCC
1841 | lda $fe
1842 | sta LCDCD
1843 | lda #$20
1844 | sta FCMDTBL
1845 | LCD46: jsr LCD19
1846 | ldy #$00
1847 | LCD4B: lda (PCL),y
1848 | jsr CHROUT
1849 | iny
1850 | cpy #$20
1851 | bcc LCD4B
1852 | clc
1853 | lda #$20
1854 | adc LCDCC
1855 | bcs LCD69
1856 | sta LCDCC
1857 | lda #$20
1858 | adc PCL
1859 | sta PCL
1860 | jmp LCD46
1861 | LCD69: jsr CLRCHN
1862 | jsr LCFBC
1863 | lda #$08
1864 | sta FCMDTBL
1865 | jmp PRNRET ; print return
1866 | LCD77: lda #$0f
1867 | tay
1868 | ldx #$08
1869 | jsr SETLFS ; set length and FN adr
1870 | lda #$00
1871 | jsr SETNAM
1872 | jmp OPEN
1873 | LCD87: jsr GETIN
1874 | beq LCD87
1875 | rts
1876 | ; --------- READ ERR-CH (@) ---------------------------------
1877 | ERRCH: jsr GETRET ; check for return
1878 | bne LCD95
1879 | jmp DCF86
1880 | LCD95: lda #$08 ; device no.
1881 | jsr LISTN ; listen
1882 | lda #$6f ; secondary address
1883 | jsr SECND ; send SA after LISTEN
1884 | LCD9F: jsr CHRIN ; get cmd char
1885 | jsr CIOUT ; handshake IEEE byte out
1886 | cmp #$0d ; cmp with return
1887 | bne LCD9F ; branch if not
1888 | jsr UNLSN ; send UNLISTEN out IEEE
1889 | jmp PRNRET ; print return
1890 | ; --------- f-EXIT (X) --------------------------------------
1891 | FEXIT: jmp DMON
1892 |
1893 | FTEXT: !by $0d,$3E,$46,$4C,$4F,$50,$50,$59 ; ".>FLOPPY"
1894 | !by $2D,$4D,$4F,$4E,$49,$54,$4f,$52 ; "-MONITOR"
1895 | !by $00
1896 | MRTXT: !by $4D,$2D,$52 ; "M-R"
1897 | LCDC3: !by $00
1898 | LCDC4 !by $00
1899 | !by $ff
1900 | MWTXT: !by $4d,$2d,$57 ; "M-W"
1901 | LCDCC: !by $00
1902 | LCDCD: !by $00
1903 | FCMDTBL: !by $08,$3A,$4d,$56,$40,$58 ; ".:MV@X"
1904 |
1905 | FADDTBL: !by H_COL-1
1907 | !by MEMDP-1
1909 | !by MEMCP-1
1911 | !by ERRCH-1
1913 | !by FEXIT-1
1915 | ; this is free memory, only placeholder
1916 | !by $EA,$EA
1917 | !by $EA,$EA,$EA,$EA,$EA,$EA,$EA,$EA
1918 | !by $EA,$EA,$EA,$EA,$EA,$EA,$EA,$EA
1919 | !by $EA,$EA,$EA,$EA,$EA,$EA,$EA,$EA
1920 | !by $EA,$EA,$EA,$EA,$EA,$EA,$EA,$EA
1921 | !by $EA,$EA,$EA,$EA,$EA,$EA,$EA,$EA
1922 | !by $EA
1923 | ; placeholder end
1924 | }
1925 | ; -----------------------------------------------------------
1926 | ; --------- FCOM part end -----------------------------------
1927 | ; -----------------------------------------------------------
1928 |
1929 | ; -----------------------------------------------------------
1930 | ; --------- FMON OR PLUS part from LCBF1 to LCE08 -----------
1931 | ; -----------------------------------------------------------
1932 | !ifndef FCOM {
1933 |
1934 | ; --------- TRACE (T) ------- $CBF1 -------------------------
1935 | TRACE: pla
1936 | pla
1937 | jsr CHRIN
1938 | cmp #$57
1939 | bne LCBFD
1940 | jmp LCD56
1941 | LCBFD: cmp #$42
1942 | bne LCC04
1943 | jmp LCDD0
1944 | LCC04: cmp #$51
1945 | bne LCC0B
1946 | jmp LCD4F
1947 | LCC0B: cmp #$53
1948 | beq LCC12
1949 | jmp ERROR
1950 | LCC12: jsr GETBYT
1951 | pha
1952 | jsr GETBYT
1953 | pha
1954 | jsr GETSTART
1955 | ldy #$00
1956 | lda (PCL),y
1957 | sta $02BC
1958 | tya
1959 | sta (PCL),y
1960 | lda #LCC36
1963 | sta BRK_HI
1964 | ldx #$FC
1965 | jmp GO2
1966 | LCC36: ldx #$03
1967 | LCC38: pla
1968 | sta SRSAVE,x
1969 | dex
1970 | bpl LCC38
1971 | pla
1972 | pla
1973 | tsx
1974 | stx SPSAVE
1975 | lda PCHSAVE
1976 | sta PCH
1977 | lda PCLSAVE
1978 | sta PCL
1979 | lda $02BC
1980 | ldy #$00
1981 | sta (PCL),y
1982 | lda #BREAK
1985 | sta BRK_HI
1986 | lda #$52
1987 | jmp CMDSTORE ; store and compare command
1988 | LCC65: jsr RETURN ; next line
1989 | lda VIC_CTRL1
1990 | ora #$10
1991 | sta VIC_CTRL1
1992 | LCC70: rts
1993 | sta AKSAVE
1994 | php
1995 | pla
1996 | and #$EF
1997 | sta SRSAVE
1998 | stx XRSAVE
1999 | sty YRSAVE
2000 | pla
2001 | clc
2002 | adc #$01
2003 | sta PCLSAVE
2004 | pla
2005 | adc #$00
2006 | sta PCHSAVE
2007 | lda #$80
2008 | sta $02BC
2009 | bne LCCA5
2010 | LCC95: jsr LCDE5
2011 | jsr EN_TIMER
2012 | cld
2013 | ldx #$05
2014 | LCC9E: pla
2015 | sta PCHSAVE,x
2016 | dex
2017 | bpl LCC9E
2018 | LCCA5: lda IRQ_LO
2019 | sta $02BB
2020 | lda IRQ_HI
2021 | sta $02BA
2022 | tsx
2023 | stx SPSAVE
2024 | cli
2025 | lda SRSAVE
2026 | and #$10
2027 | beq LCCC5
2028 | LCCBD: jsr LCC65
2029 | lda #$52
2030 | jmp CMDSTORE ; store and compare command
2031 | LCCC5: bit $02BC
2032 | bvc LCCE9
2033 | sec
2034 | lda PCLSAVE
2035 | sbc $02BD
2036 | sta MEM
2037 | lda PCHSAVE
2038 | sbc $02BE
2039 | ora MEM
2040 | bne LCD46
2041 | lda $02BF
2042 | bne LCD43
2043 | lda #$80
2044 | sta $02BC
2045 | LCCE9: bmi LCCFD
2046 | lsr $02BC
2047 | bcc LCCBD
2048 | ldx SPSAVE
2049 | txs
2050 | LCCF4: lda #>LCC70
2051 | pha
2052 | lda #LCC95
2147 | sta $02BB
2148 | stx $02BA
2149 | LCDA9: ldx SPSAVE
2150 | txs
2151 | sei
2152 | lda $02BB
2153 | ldx $02BA
2154 | sta IRQ_LO
2155 | stx IRQ_HI
2156 | LCDBA: lda PCHSAVE
2157 | pha
2158 | lda PCLSAVE
2159 | pha
2160 | lda SRSAVE
2161 | pha
2162 | lda AKSAVE
2163 | ldx XRSAVE
2164 | ldy YRSAVE
2165 | rti
2166 | LCDD0: jsr GETBYT
2167 | sta $02BE
2168 | jsr GETBYT
2169 | sta $02BD
2170 | jsr GETBYT
2171 | sta $02BF
2172 | jmp EXECUTE ; go back, wait for next input
2173 | LCDE5: lda TRACEBUF
2174 | ldx $02B9
2175 | sta IRQ_LO
2176 | stx IRQ_HI
2177 | rts
2178 | LCDF2: lda IRQ_LO
2179 | ldx IRQ_HI
2180 | sta TRACEBUF
2181 | stx $02B9
2182 | lda #LCC95
2185 | sta BRK_HI
2186 | LCE08: rts
2187 | }
2188 | ; -----------------------------------------------------------
2189 | ; --------- END OF COMMON PLUS/FMON PART --------------------
2190 | ; -----------------------------------------------------------
2191 |
2192 | ; -----------------------------------------------------------
2193 | ; --------- PLUS PART ONLY FROM LCE09 to END-----------------
2194 | ; -----------------------------------------------------------
2195 | !ifdef PLUS {
2196 | ; --------- ZEICHENDATEN (Z) --------------------------------
2197 | ; LCE09
2198 | ZCMD: lda #$80 ; set Flag
2199 | !by $2c
2200 | ; --------- ZEICHENDATEN EXT (H) -----------------------------
2201 | HCMD: lda #$00
2202 | sta ADRCODE
2203 | jsr GET12ADR ; start/end-address
2204 | L1: bit ADRCODE
2205 | bpl W8
2206 | ldx #HCZ ; hidden command
2207 | !by $2C
2208 | W8: ldx #HCH
2209 | jsr CHARRET
2210 | jsr HEXOUT ; print PC as 4 digit hex
2211 | ldy #$06 ; column #6
2212 | L2: ldx #$00
2213 | lda (PCL,x)
2214 | L3: asl
2215 | pha ; store byte
2216 | bcs BITSET ; BIT=1, then *
2217 | lda #$2E ; BIT=0, then .
2218 | !by $2c ; print out
2219 | BITSET: lda #$2A ; "*"
2220 | sta ($D1),y
2221 | lda COLOR
2222 | sta ($F3),y
2223 | pla ; get byte back
2224 | iny ; push cursor
2225 | inx ; next byte
2226 | cpx #$08 ; 8 Bit
2227 | bne L3 ; further byte push
2228 | jsr PCINC ; increment counter
2229 | bit ADRCODE ; Flag for 1*8 BIT
2230 | bmi W9 ; line finish
2231 | cpy #$1E ; 3 Bytes
2232 | bcc L2
2233 | W9:
2234 | jsr CONTIN ; check key
2235 | bcc L1
2236 | rts
2237 | ;
2238 | ZCMDH: ldy #$08 ; 1 Byte
2239 | !by $2C
2240 | HCMDH:
2241 | ldy #$18 ; 3 Byte
2242 | jsr GETADR1
2243 | jsr SKIPSPACE ; ignore space
2244 | A1: ldx #$08
2245 | lda #$00
2246 | sta FLAG
2247 | ;
2248 | A2: jsr GETCHRERR
2249 | cmp #$2E ; . = BIT=0
2250 | beq BIT0
2251 | cmp #$2A ; * = BIT=1
2252 | beq BIT1
2253 | ERR1: jmp ERROR ; any other char
2254 | ;
2255 | BIT0: clc
2256 | BIT1: rol FLAG
2257 | dey
2258 | dex ; Byte
2259 | bne A2 ; not finished
2260 | lda FLAG
2261 | sta (PCL,x) ; write to
2262 | cmp (PCL,x) ; memory
2263 | bne ERR1
2264 | jsr PCINC
2265 | cpy #$00
2266 | bne A1 ; not finished
2267 | LCE85: rts
2268 | ; --------- NORMALDARSTELLUNG (N) ---------------------------
2269 | NCMD: lda #$80
2270 | LCE88: !by $2c
2271 | ; --------- UEBERSICHT (U) ----------------------------------
2272 | UCMD: lda #$00
2273 | sta ADRCODE
2274 | jsr GET12ADR
2275 | L5: jsr RETURN ; next line
2276 | bit ADRCODE
2277 | bpl U
2278 | lda #HCN ; hidden command
2279 | jsr CHROUT
2280 | jsr HEXOUT ; output as 4 digit hex
2281 | ldy #$08 ; column 8
2282 | !by $2c
2283 | U: ldy #$00
2284 | ldx #$00
2285 | L4: lda (PCL,x)
2286 | jsr ASCII4 ; as screen code
2287 | bne L4 ; print
2288 | jsr CONTIN
2289 | bcc L5 ; next line
2290 | rts
2291 | ;
2292 | NCMDH: jsr GETADR1
2293 | ldx #$00
2294 | ldy #$08 ; column 8
2295 | C1: lda ($D1),y
2296 | sta (PCL,x) ; write to
2297 | cmp (PCL,x) ; memory
2298 | bne ERR1
2299 | jsr ASCII5 ; increment PC
2300 | bcc C1
2301 | rts ; line finish
2302 |
2303 | ; --------- KOPIERT SMON (Y) --------------------------------
2304 | CPSMON: jsr GETBYT
2305 | and #$F0 ; get high-nibble
2306 | sta $FF ; store as new 4-k address
2307 | ; --------- W - COMMAND ------------------------
2308 | jsr SETPTR
2309 | jsr _write ; jump into W-command
2310 | ; --------- V - COMMAND ------------------------
2311 | jsr SETPTR ; prepare for V-command the start and end main address of new location
2312 | lda #NEWCMDS ; end address high byte
2315 | jsr and_or ; separate and ora with new address high-byte
2316 | sta $FE
2317 | lda #BREAK
2320 | jsr and_or ; separate and ora with new address high-byte
2321 | jsr _verschieb ; jump into V-command
2322 | ; --------- adjust main command table ----------
2323 | lda #CMDS ; high byte
2326 | jsr and_or ; separate and ora with new address high-byte
2327 | ldy #$35 ; amount of changes * 2
2328 | D3: jsr cp ; load, change and store the bytes for the new addresses
2329 | dey ; decrease counter
2330 | dey ; decrease counter
2331 | bpl D3
2332 | ; --------- adjust plus command table ----------
2333 | lda #NEWADR ; high byte
2336 | jsr and_or ; separate and ora with new address high-byte
2337 | ldy #$23 ; amount of changes
2338 | D2: jsr cp ; load, change and store the bytes for the new addresses
2339 | dey ; decrease counter
2340 | dey ; decrease counter
2341 | bpl D2
2342 | ; --------- adjust other addresses -------------
2343 | ldy #$00
2344 | ldx #$0F
2345 | D1: lda OFSTAB,x
2346 | jsr and_or ; separate and ora with new address high-byte
2347 | dex
2348 | lda OFSTAB,x
2349 | sta $FB
2350 | jsr cp ; load, change and store the bytes for the new addresses
2351 | dex
2352 | bpl D1
2353 | rts
2354 | ; prepare new address high byte
2355 | and_or: and #$0F ; separate high byte
2356 | ora $ff ; ora with high byte from new address
2357 | sta $fc ; store back as new high byte
2358 | rts
2359 | ; load, change and store the bytes for the new addresses
2360 | cp: lda ($fb),y ; load high byte from address
2361 | and #$0F ; separate high byte
2362 | ora $FF ; ora with high byte from new address
2363 | sta ($fb),y ; store back as new address high byte
2364 | rts
2365 | ;
2366 | SETPTR: lda $FF ; contains the high byte of the new address
2367 | sta $A9
2368 | jsr GETHI
2369 | GETHI: pla ; 2 times pla
2370 | pla ; the accu contains now the own address high byte
2371 | and #$F0 ; separate the high nibble
2372 | sta $A5 ; store it as start address high byte
2373 | clc
2374 | adc #$10 ; define end address high byte
2375 | sta $A7 ; store it
2376 | lda #$00 ; low byte
2377 | sta $A4 ; store as start address low byte
2378 | sta $A6 ; store as end adress low byte
2379 | sta $A8 ; store as new address low byte
2380 | LCF56: rts
2381 |
2382 | ; --------- ERASE (E) ---------------------------------------
2383 | ERASE: jsr GET2ADR
2384 | lda #$00 ; set defined value
2385 | jmp _occupy ; jump to O-ccupy
2386 |
2387 | ; --------- KOPIERE ZICHENSATZ (Q) --------------------------
2388 | CPCHR: jsr GETADR1
2389 | ldy #$00
2390 | lda #$D0 ; pointer to char rom
2391 | sty $FD
2392 | sta $FE
2393 | sei
2394 | lda #$03 ; char rom enable
2395 | sta $01
2396 | ldx #$10 ; 4-k counter
2397 | E1: lda ($FD),y
2398 | sta (PCL),y
2399 | iny
2400 | bne E1
2401 | inc PCH
2402 | inc $FE
2403 | dex
2404 | bne E1
2405 | lda #$27 ; normal state
2406 | sta $01
2407 | cli
2408 | rts
2409 | ; --------- print last command on screen (J) ----------------
2410 | LINSTORE: pha ; remember command
2411 | cmp #$4A ; "J"
2412 | bne STORE ; check other commands
2413 | ldy #$27 ; char amount
2414 | G1: lda $0200,y ; get char from buffer
2415 | sta ($D1),y ; print line on screen
2416 | dey ; next
2417 | bpl G1 ; not last
2418 | pla ; get last command back
2419 | dec $D6 ; Cursor up
2420 | jmp EXECUTE ; go back, wait for next input
2421 | ; --------- check for more PLUS commands --------------------
2422 | STORE: ldy #$06 ; amount of commands
2423 | G3: cmp OUTCMDS,y ; check for "()!EYQ"
2424 | bne W3
2425 | ldy #$27
2426 | G2: lda ($D1),y
2427 | sta $0200,y
2428 | dey
2429 | bpl G2
2430 | W3: dey
2431 | bpl G3
2432 | pla ; get command back
2433 | jmp CMDSTORE ; store and compare command
2434 | ; --------- execute PLUS COMMANDS ??? ------------------------
2435 | MORECMD: ldx #$0A
2436 | B1: cmp NEWCMDS-1,x
2437 | beq FOUND
2438 | dex
2439 | bne B1
2440 | jmp ERROR
2441 | FOUND: jsr CMDEXEC2
2442 | jmp EXECUTE ; go back, wait for next input
2443 | CMDEXEC2: txa
2444 | asl
2445 | tax
2446 | lda NEWADR-1,x
2447 | pha
2448 | lda NEWADR-2,x
2449 | pha
2450 | rts
2451 | ; --------- PLUS COMMANDS -----------------------------------
2452 | NEWCMDS: !by $28,$29,$21,$45,$59,$51 ; "()!EYQ"
2453 | OUTCMDS: !by $48,$5A,$4E,$55,$44,$4B,$4D ; "HZNUDKM"
2454 |
2455 | NEWADR: !by HCMDH-1
2457 | !by ZCMDH-1
2459 | !by NCMDH-1
2461 | !by ERASE-1
2463 | !by CPSMON-1
2465 | !by CPCHR-1
2467 | !by HCMD-1
2469 | !by ZCMD-1
2471 | !by NCMD-1
2473 | !by UCMD-1
2475 |
2476 | ; this belongs to the CPSMON (Y) Function
2477 | OFSTAB: !by <_brk_hb+1
2478 | !by >_brk_hb+1
2479 | !by REGISTER+1
2481 | ; this belongs to the "TRACE" command
2482 | !by LCC2C+1
2484 | !by LCC5B+1
2486 | !by LCCF4+1
2488 | !by LCDA1+1
2490 | !by LCE03+1
2492 |
2493 | ; this belongs to the "B" command
2494 | !by BASJMP
2496 | }
2497 | ; -----------------------------------------------------------
2498 | ; --------- END IFDEF PLUS ----------------------------------
2499 | ; -----------------------------------------------------------
2500 |
2501 | ; -----------------------------------------------------------
2502 | ; --------- FCOM/FMON PART ONLY FROM LCE09 to END -----------
2503 | ; -----------------------------------------------------------
2504 | !ifdef FMON {
2505 |
2506 | ; DMON (Z)
2507 | DMON: lda #$07
2508 | sta BORDER
2509 | lda #$36
2510 | sta $01
2511 | ldx #$00
2512 | LCE14: lda LCFE4,x
2513 | sta DCMDST,x
2514 | inx
2515 | cpx #$0D
2516 | bcc LCE14
2517 | LCE1F: ldx #$2A
2518 | jsr CHARRET
2519 | DCE24: jsr CHRIN
2520 | cmp #$2A
2521 | beq DCE24
2522 | ldx #$06
2523 | LCE2D: cmp LCFD2,x
2524 | bne LCE43
2525 | stx SAVEX
2526 | txa
2527 | asl
2528 | tax
2529 | inx
2530 | lda LCFD8,x
2531 | pha
2532 | dex
2533 | lda LCFD8,x
2534 | pha
2535 | rts
2536 | LCE43: dex
2537 | bpl LCE2D
2538 | jmp LCE1F
2539 | LCE49: lda #$00
2540 | sta PCL
2541 | lda #$BF
2542 | sta PCH
2543 | sta $FE
2544 | LCE53: lda PCL
2545 | adc #$04
2546 | sta $FD
2547 | jsr MEMDUMP1
2548 | LCE5C: jsr STOP
2549 | beq DCE70
2550 | lda $028D
2551 | beq LCE5C
2552 | lda #$00
2553 | sta $C6
2554 | lda PCH
2555 | cmp #$c0
2556 | bcc LCE53
2557 | DCE70: jmp LCE1F
2558 |
2559 | LCE73: jsr GETADR1
2560 | ldy #$20
2561 | ldx #$00
2562 | LCE7A: jsr GETCHRERR
2563 | jsr GETBYT1
2564 | sta (PCL,x)
2565 | jsr ASCII
2566 | bne LCE7A
2567 | jsr RETURN ; next line
2568 | jmp DCE24
2569 | LCE8D: jsr LCF55
2570 | lda SAVEX
2571 | cmp #$02
2572 | bne LCE9A
2573 | jmp LCEEB
2574 | LCE9A: ldx #$00
2575 | lda $BF00,x
2576 | sta TMPSECTO
2577 | inx
2578 | lda $BF00,x
2579 | sta $02C4
2580 | txa
2581 | jmp LCECB
2582 | LCEAD: jsr GETRET ; check for return
2583 | bne LCEB5
2584 | jmp LCE8D
2585 | LCEB5: jsr GETBYT
2586 | sta TMPSECTO
2587 | jsr GETBYT
2588 | sta $02C4
2589 | jsr LCF55
2590 | lda SAVEX
2591 | cmp #$02
2592 | beq LCEEB
2593 | LCECB: jsr LCF0D
2594 | ldx #$0d
2595 | jsr CHKIN
2596 | ldy #$00
2597 | LCED5: jsr CHRIN
2598 | nop
2599 | nop
2600 | nop
2601 | nop
2602 | sta $BF00,y
2603 | iny
2604 | bne LCED5
2605 | jsr CLRCHN
2606 | jsr LCFBC
2607 | jmp LCE49
2608 | LCEEB: jsr LCF40
2609 | ldx #$0d
2610 | jsr CHKOUT
2611 | ldy #$00
2612 | LCEF5: lda $BF00,y
2613 | jsr CHROUT
2614 | ldx $90
2615 | bne LCF02
2616 | iny
2617 | bne LCEF5
2618 | LCF02: jsr CLRCHN
2619 | lda #$32
2620 | jsr LCF0D
2621 | jmp LCFB6
2622 | LCF0D: sta $02D1
2623 | lda TMPSECTO
2624 | jsr LCF79
2625 | stx TRACK
2626 | sta $02D9
2627 | lda $02C4
2628 | jsr LCF79
2629 | stx SECTO
2630 | sta SECTO+1
2631 | ldx #$0f
2632 | jsr CHKOUT
2633 | ldx #$00
2634 | DCF2F: lda DCMDST,x
2635 | jsr CHROUT
2636 | inx
2637 | cpx #$0d
2638 | bcc DCF2F
2639 | jsr CLRCHN
2640 | jmp DCF8C
2641 | LCF40: ldx #$0f
2642 | jsr CHKOUT
2643 | ldx #$00
2644 | LCF47: lda DCFF2,x
2645 | jsr CHROUT
2646 | inx
2647 | cpx #$08
2648 | bcc LCF47
2649 | jmp CLRCHN
2650 | LCF55: lda #$0F
2651 | tay
2652 | ldx #$08
2653 | jsr SETLFS
2654 | lda #$00
2655 | jsr SETNAM
2656 | jsr OPEN
2657 | lda #$0d
2658 | tay
2659 | ldx #$08
2660 | jsr SETLFS
2661 | lda #$01
2662 | ldx #LCFF1
2664 | jsr SETNAM
2665 | jmp OPEN
2666 | LCF79: ldx #$30
2667 | sec
2668 | LCF7C: sbc #$0A
2669 | bcc LCF83
2670 | inx
2671 | bcs LCF7C
2672 | LCF83: adc #$3A
2673 | DCF85: rts
2674 | DCF86: jsr DCF8C
2675 | jmp LCFB6
2676 | DCF8C: lda #$00
2677 | sta $90
2678 | jsr RETURN ; next line
2679 | lda #$08
2680 | jsr TALK
2681 | lda #$6f
2682 | jsr TKSA
2683 | jsr IECIN
2684 | cmp #$30
2685 | bne LCFAA
2686 | jmp UNTALK
2687 | LCFA7: jsr IECIN
2688 | LCFAA: jsr CHROUT
2689 | cmp #$0D
2690 | bne LCFA7
2691 | jsr UNTALK
2692 | pla
2693 | pla
2694 | LCFB6: jsr LCFBC
2695 | jmp LCE1F
2696 | LCFBC: lda #$0D
2697 | jsr CLOSE
2698 | lda #$0F
2699 | jmp CLOSE
2700 | LCFC6: lda #$06
2701 | sta BORDER
2702 | lda #$37
2703 | sta $01
2704 | jmp EXECUTE ; go back, wait for next input
2705 |
2706 | LCFD2: !by $3A,$52,$57,$4d,$58 ; ":RWMX" , new floppy commands
2707 |
2708 | !ifdef FCOM {
2709 | DCFD7: !by $46 ; "F" , activates the new floppy commands
2710 | } else {
2711 | !by $40 ; "@" used in normal FMON mode
2712 | }
2713 |
2714 | LCFD8: !by LCE73-1
2716 | !by LCEAD-1
2718 | !by LCEAD-1
2720 | !by LCE49-1
2722 | !by LCFC6-1
2724 |
2725 | !ifdef FCOM {
2726 | LCFE2: !by LCBF1-1
2728 | } else {
2729 | !by DCF85
2731 | }
2732 |
2733 | LCFE4: !by $55,$31,$3A,$31,$33,$20,$30,$20 ; "U1:13 0 "
2734 | !by $31,$38,$20,$30,$30 ; "18 00"
2735 | LCFF1: !by $23 ; "#"
2736 | DCFF2: !by $42,$2d,$50,$20,$31,$33,$20,$30 ; "B-P 13 0"
2737 | }
2738 | ; -----------------------------------------------------------
2739 | ; --------- END FCOM/FMON PART ------------------------------
2740 | ; -----------------------------------------------------------
2741 |
2742 | ; -----------------------------------------------------------
2743 | ; --------- ILLEGAL OPCODES PART ----------------------------
2744 | ; -----------------------------------------------------------
2745 | !ifdef ILOC {
2746 | ILLEGAL:
2747 | ; 6510 ilops
2748 | LCE09: !by $2b,$4b,$6b,$8b,$9b,$ab,$bb,$cb
2749 | !by $eb,$89,$93,$9f,$0b,$9c,$9e
2750 |
2751 | ; ilops char
2752 | LCE18: !by $4e,$53,$52,$53,$52,$53,$4c,$44,$49,$43 ; N S R S R S L D I C ; N
2753 |
2754 | LCE22: !by $4f,$4c,$4c,$52,$52,$41,$41,$43,$53,$52 ; O L L R R A A C S R ; O
2755 |
2756 | LCE2C: !by $50,$4f,$41,$45,$41,$58,$58,$50,$43,$41 ; P O A E A X X P C A ; P
2757 |
2758 | LCE36: !by $25,$26,$20,$21,$82,$80,$81
2759 | !by $22,$21,$82
2760 | LCE40: !by $81,$03,$13,$07,$17,$1b,$0f,$1f
2761 | !by $97,$d7,$bf
2762 | LCE4B: !by $df,$02,$02,$02,$02,$03,$03,$03
2763 | !by $02,$02,$03,$03
2764 |
2765 | LCE57: ldx #$02
2766 | bne LCE83
2767 | _ILOCM: ldx BEFCODE
2768 | bne LCE8A
2769 | ldx #$01
2770 | lda (PCL),y
2771 | cmp #$9c
2772 | beq LCE9F
2773 | cmp #$80
2774 | beq LCE57
2775 | cmp #$89
2776 | beq LCE57
2777 | and #$0f
2778 | cmp #$02
2779 | beq LCE8B
2780 | cmp #$0a
2781 | beq LCE83
2782 | inx
2783 | cmp #$04
2784 | beq LCE83
2785 | inx
2786 | cmp #$0c
2787 | bne LCE9F
2788 | LCE83: stx BEFLEN
2789 | ldx #$01
2790 | stx $02c5
2791 | LCE8A: rts
2792 | LCE8B: lda (PCL),y
2793 | and #$90
2794 | eor #$80
2795 | bne LCE97
2796 | ldx #$02
2797 | bne LCE83
2798 | LCE97: stx BEFLEN
2799 | ldx #$0a
2800 | stx $02c5
2801 | rts
2802 | LCE9F: ldy #$02
2803 | sty BEFLEN
2804 | ldy #$00
2805 | sty $02c5
2806 | lda (PCL),y
2807 | ldx #$0f
2808 | LCEAC: cmp ILLEGAL,x
2809 | beq LCE8A
2810 | dex
2811 | bne LCEAC
2812 | and #$01
2813 | beq LCE8A
2814 | lda (PCL),y
2815 | lsr
2816 | lsr
2817 | lsr
2818 | lsr
2819 | lsr
2820 | clc
2821 | adc #$02
2822 | sta $02c5
2823 | ldx #$0b
2824 | ICEC7: lda (PCL),y
2825 | and LCE40,x
2826 | cmp LCE40,x
2827 | beq LCED4
2828 | dex
2829 | bne ICEC7
2830 | LCED4: lda LCE36-1,x
2831 | sta ADRCODE
2832 | lda LCE4B,x
2833 | sta BEFLEN
2834 | rts
2835 | _ILOCD: ldy #$00
2836 | ldx BEFCODE
2837 | beq ICEEB
2838 | jsr SPACE ; output space
2839 | jmp LC5DA
2840 | ICEEB: ldx $02c5
2841 | bne LCEF6
2842 | jsr SPACE ; output space
2843 | jmp LC5C9
2844 | LCEF6: lda #$2a
2845 | jsr CHROUT
2846 | lda LCE18-1,x
2847 | jsr CHROUT
2848 | lda LCE22-1,x
2849 | jsr CHROUT
2850 | lda LCE2C-1,x
2851 | jmp LC616
2852 |
2853 | }
2854 | ; -----------------------------------------------------------
2855 | ; --------- END ILLEGAL OPCODES PART ------------------------
2856 | ; -----------------------------------------------------------
--------------------------------------------------------------------------------