Home » Personal collection » Acorn ADFS disks » Electron_User_Group » EUG_51.ADF » V/+SERROM
V/+SERROM
This website contains an archive of files for the Acorn Electron, BBC Micro, Acorn Archimedes, Commodore 16 and Commodore 64 computers, which Dominic Ford has rescued from his private collection of floppy disks and cassettes.
Some of these files were originally commercial releases in the 1980s and 1990s, but they are now widely available online. I assume that copyright over them is no longer being asserted. If you own the copyright and would like files to be removed, please contact me.
Tape/disk: | Home » Personal collection » Acorn ADFS disks » Electron_User_Group » EUG_51.ADF |
Filename: | V/+SERROM |
Read OK: | ✔ |
File size: | 1AD7 bytes |
Load address: | 2B204556 |
Exec address: | 52524553 |
Duplicates
There are 2 duplicate copies of this file in the archive:
- AEW website » eug » eug_3_5_discs_Eug-51_A-EUG51.adf » V/+SERROM
- AEW website » eug » eug_5_25_discs_Eug-51_D-EUG51.dsd » V.+SERROM
- Personal collection » Acorn ADFS disks » Electron_User_Group » EUG_51.ADF » V/+SERROM
File contents
EXAMPLE SERVICE ROM HEADER THIS piece of source code is ONLY for advanced 6502 programmers or users wishing to create their own Paged ROMs. The explanation following is quite technical so if you require further information then contact EUG and any queries will be passed on. This source code demonstrates a simple way of making a robust Paged ROM that can either be loaded into Sideways RAM or blown onto an EPROM. The code has been designed not for compactness or optimisation, but to allow easy implantation of extra commands and readability. (When I first started writing ROMs, I used to write custom headers, which always made updates difficult to implement and error-prone.) Some coders will look at this code and frown at the use of what seems like unnecessary JMP instructions. However, it is specifically written in such a way that each code section is totally independent of each other and thus code and data can be implanted anywhere without any relatives moving out of range. (Goodbyte BYTE errors!) Advanced ROM coders should not that this header example does NOT support Autoboot, Private Workspace Claims or Claims of the NMI Work- space or zero-page locations. If you require these service calls, you should implant/intercept them in the Service Entry part of the source code. (Not forgetting to add release claims also!!!) The first part of the code consists of a standard ROM header, as used by all Paged ROMs. (Please note that I have removed the bug in the header that the Acorn Electron Advanced User Guide contains!!) The ROM title in this header is the text that is used to compare against and printer when a *HELP command is received. However, altering this so that another text string is used, is very easy and only requires changing one EQUW statement. A portion of this text is also printed by the operating system when a *ROMS command is issued. The Command Data is, as its name suggests, the commands that are accepted by the Service ROM. All of this text between the labels .cdt and .cde is printed by the RON when a *HELP command is received with an argument of the ROM title. *HELP with no arguments just yields the ROM titles and version number. Each ROM command in this data block should have its own label and be terminated with carriage return (&0D) for readability's sake when echoed to the screen. Please be aware that lowercase to uppercase character conversion is used in the comparing of issued commands (unrecognised commands that are offered to the Paged ROMs) so please do not used weird characters or numbers in your command names. Should you desperately require numbers in command names, you will need to reqrite the Command Interpreter (and possibly the Help Inter- preter also). The Service Entry is the piece of code called when the ROM is entered and there is nothing complex about this code. It simply stores the ROM entry registers and restores them on exit. The code only supports un- recognised commands issued to the Paged ROMs and *HELP commands. As I said earlier, if you ROM requires workspace or an NMI handler, you'll need to add code here. I am actually open to debate on whether I should use zero-page locations (&70-&8F) as given to the user by BASIC. In actuality, your ROM should probably reserve workspace, but I actually think that reser- ving an entire page for just a few locations is very wasteful! I did think of grabbing the NMI and using its allocation of zero-page, but another ROM could request the NMI workspace whilst this ROM was active. The ROM would then be forced into relinquishing the NMI workspace and you would again need some zero-page workspace!! The most important part of the source code is the Command Structure. It is this data that defines what text is printed and checked for when *HELP is issued and also how many and what commands the ROM actually has. The first entry in this table is the .hcs entry, which consists of a byte that specifies how long the *HELP ROM title is, minus one. Following this is a 16 bit (word) pointer to the ROM title itself. It is this text that will be used for comparison when a *HELP command is received with an argument of the ROM name. The .cms entry is where the command pointers are located. The first byte is the number of ROM commands minus one. Each command entry con- sists of five bytes. Therefore, if your ROM has four commands, your total .cms length would be (5 x 4) + 1. A command entry has a very sim ple structure: A byte specifying the command length minus one, a word pointer to the command name itself and a final word which is the JMP address in the Jump Table. Please be aware that a register is used to step through this Command Structure and therefore the number of possible commands is limited to a maximum of 85. With careful reprogramming using indirect addressing, it would be possible to increase this, but I would have though that 85 was sufficient!! The Jump Array comes next. This might be considered by some program- mers to be superfluous when the command structure could achieve the same results. Well, I thought about this and since everything in this header is very modular, a jump table was a much neater way of achieving order. The Help Interpreter is the code called when a *HELP command is issued. It first scans the CLI looking for arguments and if none are found simply reports the ROM name and version number. However, if the supplied argument matches the text pointed to by the .hcs pointer, then the ROM command list is echoed to the screen. Character conversion is performed on the input stream so that character case is equal. Please be aware of this if you are planning on using any strange characters. The Command Interpreter is roughly the same as the Help Interpreter. Character case conversion is done on the input stream so special char- acters may cause commands to not be recognised. It scans the Command Structure for as many commands as indicated and, when one is recognised, it clears location (&70) which is the Accumulator of the ROM exit value. If you are writing a large ROM with many commands, please take care that the Command Structure does not exceed a Page in length! As warned earlier, the Command Structure is stepped through using a register and is therefore limited to 256 bytes. There are some points to note about this code. Firsty, no dodgy self- modifying code is used at all. Secondly, it should work on any machine, from all BBCs to the Acorn Electron with whatever expansions they may have. Thirdly, when writing your ROM code, DO NOT use locations &70, &71 or &72 for storage. The other BASIC user locations (&73-&8F) may be used as you see fit. Chris Warburton welder@majesty.net
00000000 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00000010 20 20 20 20 20 45 58 41 4d 50 4c 45 20 53 45 52 | EXAMPLE SER| 00000020 56 49 43 45 20 52 4f 4d 20 48 45 41 44 45 52 0d |VICE ROM HEADER.| 00000030 0d 54 48 49 53 20 70 69 65 63 65 20 6f 66 20 73 |.THIS piece of s| 00000040 6f 75 72 63 65 20 63 6f 64 65 20 69 73 20 4f 4e |ource code is ON| 00000050 4c 59 20 66 6f 72 20 61 64 76 61 6e 63 65 64 20 |LY for advanced | 00000060 36 35 30 32 20 70 72 6f 67 72 61 6d 6d 65 72 73 |6502 programmers| 00000070 20 6f 72 20 75 73 65 72 73 0d 77 69 73 68 69 6e | or users.wishin| 00000080 67 20 74 6f 20 63 72 65 61 74 65 20 74 68 65 69 |g to create thei| 00000090 72 20 6f 77 6e 20 50 61 67 65 64 20 52 4f 4d 73 |r own Paged ROMs| 000000a0 2e 20 54 68 65 20 65 78 70 6c 61 6e 61 74 69 6f |. The explanatio| 000000b0 6e 20 66 6f 6c 6c 6f 77 69 6e 67 20 69 73 0d 71 |n following is.q| 000000c0 75 69 74 65 20 74 65 63 68 6e 69 63 61 6c 20 73 |uite technical s| 000000d0 6f 20 69 66 20 79 6f 75 20 72 65 71 75 69 72 65 |o if you require| 000000e0 20 66 75 72 74 68 65 72 20 69 6e 66 6f 72 6d 61 | further informa| 000000f0 74 69 6f 6e 20 74 68 65 6e 20 63 6f 6e 74 61 63 |tion then contac| 00000100 74 20 45 55 47 0d 61 6e 64 20 61 6e 79 20 71 75 |t EUG.and any qu| 00000110 65 72 69 65 73 20 77 69 6c 6c 20 62 65 20 70 61 |eries will be pa| 00000120 73 73 65 64 20 6f 6e 2e 0d 20 20 20 54 68 69 73 |ssed on.. This| 00000130 20 73 6f 75 72 63 65 20 63 6f 64 65 20 64 65 6d | source code dem| 00000140 6f 6e 73 74 72 61 74 65 73 20 61 20 73 69 6d 70 |onstrates a simp| 00000150 6c 65 20 77 61 79 20 6f 66 20 6d 61 6b 69 6e 67 |le way of making| 00000160 20 61 20 72 6f 62 75 73 74 20 50 61 67 65 64 0d | a robust Paged.| 00000170 52 4f 4d 20 74 68 61 74 20 63 61 6e 20 65 69 74 |ROM that can eit| 00000180 68 65 72 20 62 65 20 6c 6f 61 64 65 64 20 69 6e |her be loaded in| 00000190 74 6f 20 53 69 64 65 77 61 79 73 20 52 41 4d 20 |to Sideways RAM | 000001a0 6f 72 20 62 6c 6f 77 6e 20 6f 6e 74 6f 20 61 6e |or blown onto an| 000001b0 20 45 50 52 4f 4d 2e 0d 54 68 65 20 63 6f 64 65 | EPROM..The code| 000001c0 20 68 61 73 20 62 65 65 6e 20 64 65 73 69 67 6e | has been design| 000001d0 65 64 20 6e 6f 74 20 66 6f 72 20 63 6f 6d 70 61 |ed not for compa| 000001e0 63 74 6e 65 73 73 20 6f 72 20 6f 70 74 69 6d 69 |ctness or optimi| 000001f0 73 61 74 69 6f 6e 2c 20 62 75 74 20 74 6f 0d 61 |sation, but to.a| 00000200 6c 6c 6f 77 20 65 61 73 79 20 69 6d 70 6c 61 6e |llow easy implan| 00000210 74 61 74 69 6f 6e 20 6f 66 20 65 78 74 72 61 20 |tation of extra | 00000220 63 6f 6d 6d 61 6e 64 73 20 61 6e 64 20 72 65 61 |commands and rea| 00000230 64 61 62 69 6c 69 74 79 2e 20 28 57 68 65 6e 20 |dability. (When | 00000240 49 20 66 69 72 73 74 0d 73 74 61 72 74 65 64 20 |I first.started | 00000250 77 72 69 74 69 6e 67 20 52 4f 4d 73 2c 20 49 20 |writing ROMs, I | 00000260 75 73 65 64 20 74 6f 20 77 72 69 74 65 20 63 75 |used to write cu| 00000270 73 74 6f 6d 20 68 65 61 64 65 72 73 2c 20 77 68 |stom headers, wh| 00000280 69 63 68 20 61 6c 77 61 79 73 20 6d 61 64 65 0d |ich always made.| 00000290 75 70 64 61 74 65 73 20 64 69 66 66 69 63 75 6c |updates difficul| 000002a0 74 20 74 6f 20 69 6d 70 6c 65 6d 65 6e 74 20 61 |t to implement a| 000002b0 6e 64 20 65 72 72 6f 72 2d 70 72 6f 6e 65 2e 29 |nd error-prone.)| 000002c0 20 53 6f 6d 65 20 63 6f 64 65 72 73 20 77 69 6c | Some coders wil| 000002d0 6c 20 6c 6f 6f 6b 20 0d 61 74 20 74 68 69 73 20 |l look .at this | 000002e0 63 6f 64 65 20 61 6e 64 20 66 72 6f 77 6e 20 61 |code and frown a| 000002f0 74 20 74 68 65 20 75 73 65 20 6f 66 20 77 68 61 |t the use of wha| 00000300 74 20 73 65 65 6d 73 20 6c 69 6b 65 20 75 6e 6e |t seems like unn| 00000310 65 63 65 73 73 61 72 79 20 4a 4d 50 20 0d 69 6e |ecessary JMP .in| 00000320 73 74 72 75 63 74 69 6f 6e 73 2e 20 48 6f 77 65 |structions. Howe| 00000330 76 65 72 2c 20 69 74 20 69 73 20 73 70 65 63 69 |ver, it is speci| 00000340 66 69 63 61 6c 6c 79 20 77 72 69 74 74 65 6e 20 |fically written | 00000350 69 6e 20 73 75 63 68 20 61 20 77 61 79 20 74 68 |in such a way th| 00000360 61 74 0d 65 61 63 68 20 63 6f 64 65 20 73 65 63 |at.each code sec| 00000370 74 69 6f 6e 20 69 73 20 74 6f 74 61 6c 6c 79 20 |tion is totally | 00000380 69 6e 64 65 70 65 6e 64 65 6e 74 20 6f 66 20 65 |independent of e| 00000390 61 63 68 20 6f 74 68 65 72 20 61 6e 64 20 74 68 |ach other and th| 000003a0 75 73 20 63 6f 64 65 20 61 6e 64 0d 64 61 74 61 |us code and.data| 000003b0 20 63 61 6e 20 62 65 20 69 6d 70 6c 61 6e 74 65 | can be implante| 000003c0 64 20 61 6e 79 77 68 65 72 65 20 77 69 74 68 6f |d anywhere witho| 000003d0 75 74 20 61 6e 79 20 72 65 6c 61 74 69 76 65 73 |ut any relatives| 000003e0 20 6d 6f 76 69 6e 67 20 6f 75 74 20 6f 66 20 0d | moving out of .| 000003f0 72 61 6e 67 65 2e 20 28 47 6f 6f 64 62 79 74 65 |range. (Goodbyte| 00000400 20 42 59 54 45 20 65 72 72 6f 72 73 21 29 0d 20 | BYTE errors!). | 00000410 20 20 41 64 76 61 6e 63 65 64 20 52 4f 4d 20 63 | Advanced ROM c| 00000420 6f 64 65 72 73 20 73 68 6f 75 6c 64 20 6e 6f 74 |oders should not| 00000430 20 74 68 61 74 20 74 68 69 73 20 68 65 61 64 65 | that this heade| 00000440 72 20 65 78 61 6d 70 6c 65 20 64 6f 65 73 20 4e |r example does N| 00000450 4f 54 20 0d 73 75 70 70 6f 72 74 20 41 75 74 6f |OT .support Auto| 00000460 62 6f 6f 74 2c 20 50 72 69 76 61 74 65 20 57 6f |boot, Private Wo| 00000470 72 6b 73 70 61 63 65 20 43 6c 61 69 6d 73 20 6f |rkspace Claims o| 00000480 72 20 43 6c 61 69 6d 73 20 6f 66 20 74 68 65 20 |r Claims of the | 00000490 4e 4d 49 20 57 6f 72 6b 2d 0d 73 70 61 63 65 20 |NMI Work-.space | 000004a0 6f 72 20 7a 65 72 6f 2d 70 61 67 65 20 6c 6f 63 |or zero-page loc| 000004b0 61 74 69 6f 6e 73 2e 20 49 66 20 79 6f 75 20 72 |ations. If you r| 000004c0 65 71 75 69 72 65 20 74 68 65 73 65 20 73 65 72 |equire these ser| 000004d0 76 69 63 65 20 63 61 6c 6c 73 2c 20 79 6f 75 0d |vice calls, you.| 000004e0 73 68 6f 75 6c 64 20 69 6d 70 6c 61 6e 74 2f 69 |should implant/i| 000004f0 6e 74 65 72 63 65 70 74 20 74 68 65 6d 20 69 6e |ntercept them in| 00000500 20 74 68 65 20 53 65 72 76 69 63 65 20 45 6e 74 | the Service Ent| 00000510 72 79 20 70 61 72 74 20 6f 66 20 74 68 65 20 73 |ry part of the s| 00000520 6f 75 72 63 65 0d 63 6f 64 65 2e 20 28 4e 6f 74 |ource.code. (Not| 00000530 20 66 6f 72 67 65 74 74 69 6e 67 20 74 6f 20 61 | forgetting to a| 00000540 64 64 20 72 65 6c 65 61 73 65 20 63 6c 61 69 6d |dd release claim| 00000550 73 20 61 6c 73 6f 21 21 21 29 0d 20 20 20 54 68 |s also!!!). Th| 00000560 65 20 66 69 72 73 74 20 70 61 72 74 20 6f 66 20 |e first part of | 00000570 74 68 65 20 63 6f 64 65 20 63 6f 6e 73 69 73 74 |the code consist| 00000580 73 20 6f 66 20 61 20 73 74 61 6e 64 61 72 64 20 |s of a standard | 00000590 52 4f 4d 20 68 65 61 64 65 72 2c 20 61 73 20 75 |ROM header, as u| 000005a0 73 65 64 0d 62 79 20 61 6c 6c 20 50 61 67 65 64 |sed.by all Paged| 000005b0 20 52 4f 4d 73 2e 20 28 50 6c 65 61 73 65 20 6e | ROMs. (Please n| 000005c0 6f 74 65 20 74 68 61 74 20 49 20 68 61 76 65 20 |ote that I have | 000005d0 72 65 6d 6f 76 65 64 20 74 68 65 20 62 75 67 20 |removed the bug | 000005e0 69 6e 20 74 68 65 20 0d 68 65 61 64 65 72 20 74 |in the .header t| 000005f0 68 61 74 20 74 68 65 20 41 63 6f 72 6e 20 45 6c |hat the Acorn El| 00000600 65 63 74 72 6f 6e 20 41 64 76 61 6e 63 65 64 20 |ectron Advanced | 00000610 55 73 65 72 20 47 75 69 64 65 20 63 6f 6e 74 61 |User Guide conta| 00000620 69 6e 73 21 21 29 20 54 68 65 20 52 4f 4d 0d 74 |ins!!) The ROM.t| 00000630 69 74 6c 65 20 69 6e 20 74 68 69 73 20 68 65 61 |itle in this hea| 00000640 64 65 72 20 69 73 20 74 68 65 20 74 65 78 74 20 |der is the text | 00000650 74 68 61 74 20 69 73 20 75 73 65 64 20 74 6f 20 |that is used to | 00000660 63 6f 6d 70 61 72 65 20 61 67 61 69 6e 73 74 20 |compare against | 00000670 61 6e 64 0d 70 72 69 6e 74 65 72 20 77 68 65 6e |and.printer when| 00000680 20 61 20 2a 48 45 4c 50 20 63 6f 6d 6d 61 6e 64 | a *HELP command| 00000690 20 69 73 20 72 65 63 65 69 76 65 64 2e 20 48 6f | is received. Ho| 000006a0 77 65 76 65 72 2c 20 61 6c 74 65 72 69 6e 67 20 |wever, altering | 000006b0 74 68 69 73 20 73 6f 20 74 68 61 74 0d 61 6e 6f |this so that.ano| 000006c0 74 68 65 72 20 74 65 78 74 20 73 74 72 69 6e 67 |ther text string| 000006d0 20 69 73 20 75 73 65 64 2c 20 69 73 20 76 65 72 | is used, is ver| 000006e0 79 20 65 61 73 79 20 61 6e 64 20 6f 6e 6c 79 20 |y easy and only | 000006f0 72 65 71 75 69 72 65 73 20 63 68 61 6e 67 69 6e |requires changin| 00000700 67 20 6f 6e 65 0d 45 51 55 57 20 73 74 61 74 65 |g one.EQUW state| 00000710 6d 65 6e 74 2e 20 41 20 70 6f 72 74 69 6f 6e 20 |ment. A portion | 00000720 6f 66 20 74 68 69 73 20 74 65 78 74 20 69 73 20 |of this text is | 00000730 61 6c 73 6f 20 70 72 69 6e 74 65 64 20 62 79 20 |also printed by | 00000740 74 68 65 20 6f 70 65 72 61 74 69 6e 67 0d 73 79 |the operating.sy| 00000750 73 74 65 6d 20 77 68 65 6e 20 61 20 2a 52 4f 4d |stem when a *ROM| 00000760 53 20 63 6f 6d 6d 61 6e 64 20 69 73 20 69 73 73 |S command is iss| 00000770 75 65 64 2e 0d 20 20 20 54 68 65 20 43 6f 6d 6d |ued.. The Comm| 00000780 61 6e 64 20 44 61 74 61 20 69 73 2c 20 61 73 20 |and Data is, as | 00000790 69 74 73 20 6e 61 6d 65 20 73 75 67 67 65 73 74 |its name suggest| 000007a0 73 2c 20 74 68 65 20 63 6f 6d 6d 61 6e 64 73 20 |s, the commands | 000007b0 74 68 61 74 20 61 72 65 0d 61 63 63 65 70 74 65 |that are.accepte| 000007c0 64 20 62 79 20 74 68 65 20 53 65 72 76 69 63 65 |d by the Service| 000007d0 20 52 4f 4d 2e 20 41 6c 6c 20 6f 66 20 74 68 69 | ROM. All of thi| 000007e0 73 20 74 65 78 74 20 62 65 74 77 65 65 6e 20 74 |s text between t| 000007f0 68 65 20 6c 61 62 65 6c 73 20 2e 63 64 74 20 0d |he labels .cdt .| 00000800 61 6e 64 20 2e 63 64 65 20 69 73 20 70 72 69 6e |and .cde is prin| 00000810 74 65 64 20 62 79 20 74 68 65 20 52 4f 4e 20 77 |ted by the RON w| 00000820 68 65 6e 20 61 20 2a 48 45 4c 50 20 63 6f 6d 6d |hen a *HELP comm| 00000830 61 6e 64 20 69 73 20 72 65 63 65 69 76 65 64 20 |and is received | 00000840 77 69 74 68 20 61 6e 0d 61 72 67 75 6d 65 6e 74 |with an.argument| 00000850 20 6f 66 20 74 68 65 20 52 4f 4d 20 74 69 74 6c | of the ROM titl| 00000860 65 2e 20 2a 48 45 4c 50 20 77 69 74 68 20 6e 6f |e. *HELP with no| 00000870 20 61 72 67 75 6d 65 6e 74 73 20 6a 75 73 74 20 | arguments just | 00000880 79 69 65 6c 64 73 20 74 68 65 20 52 4f 4d 0d 74 |yields the ROM.t| 00000890 69 74 6c 65 73 20 61 6e 64 20 76 65 72 73 69 6f |itles and versio| 000008a0 6e 20 6e 75 6d 62 65 72 2e 20 45 61 63 68 20 52 |n number. Each R| 000008b0 4f 4d 20 63 6f 6d 6d 61 6e 64 20 69 6e 20 74 68 |OM command in th| 000008c0 69 73 20 64 61 74 61 20 62 6c 6f 63 6b 20 73 68 |is data block sh| 000008d0 6f 75 6c 64 0d 68 61 76 65 20 69 74 73 20 6f 77 |ould.have its ow| 000008e0 6e 20 6c 61 62 65 6c 20 61 6e 64 20 62 65 20 74 |n label and be t| 000008f0 65 72 6d 69 6e 61 74 65 64 20 77 69 74 68 20 63 |erminated with c| 00000900 61 72 72 69 61 67 65 20 72 65 74 75 72 6e 20 28 |arriage return (| 00000910 26 30 44 29 20 66 6f 72 20 0d 72 65 61 64 61 62 |&0D) for .readab| 00000920 69 6c 69 74 79 27 73 20 73 61 6b 65 20 77 68 65 |ility's sake whe| 00000930 6e 20 65 63 68 6f 65 64 20 74 6f 20 74 68 65 20 |n echoed to the | 00000940 73 63 72 65 65 6e 2e 20 50 6c 65 61 73 65 20 62 |screen. Please b| 00000950 65 20 61 77 61 72 65 20 74 68 61 74 0d 6c 6f 77 |e aware that.low| 00000960 65 72 63 61 73 65 20 74 6f 20 75 70 70 65 72 63 |ercase to upperc| 00000970 61 73 65 20 63 68 61 72 61 63 74 65 72 20 63 6f |ase character co| 00000980 6e 76 65 72 73 69 6f 6e 20 69 73 20 75 73 65 64 |nversion is used| 00000990 20 69 6e 20 74 68 65 20 63 6f 6d 70 61 72 69 6e | in the comparin| 000009a0 67 20 6f 66 0d 69 73 73 75 65 64 20 63 6f 6d 6d |g of.issued comm| 000009b0 61 6e 64 73 20 28 75 6e 72 65 63 6f 67 6e 69 73 |ands (unrecognis| 000009c0 65 64 20 63 6f 6d 6d 61 6e 64 73 20 74 68 61 74 |ed commands that| 000009d0 20 61 72 65 20 6f 66 66 65 72 65 64 20 74 6f 20 | are offered to | 000009e0 74 68 65 20 50 61 67 65 64 0d 52 4f 4d 73 29 20 |the Paged.ROMs) | 000009f0 73 6f 20 70 6c 65 61 73 65 20 64 6f 20 6e 6f 74 |so please do not| 00000a00 20 75 73 65 64 20 77 65 69 72 64 20 63 68 61 72 | used weird char| 00000a10 61 63 74 65 72 73 20 6f 72 20 6e 75 6d 62 65 72 |acters or number| 00000a20 73 20 69 6e 20 79 6f 75 72 20 63 6f 6d 6d 61 6e |s in your comman| 00000a30 64 0d 6e 61 6d 65 73 2e 20 53 68 6f 75 6c 64 20 |d.names. Should | 00000a40 79 6f 75 20 64 65 73 70 65 72 61 74 65 6c 79 20 |you desperately | 00000a50 72 65 71 75 69 72 65 20 6e 75 6d 62 65 72 73 20 |require numbers | 00000a60 69 6e 20 63 6f 6d 6d 61 6e 64 20 6e 61 6d 65 73 |in command names| 00000a70 2c 20 79 6f 75 20 77 69 6c 6c 0d 6e 65 65 64 20 |, you will.need | 00000a80 74 6f 20 72 65 71 72 69 74 65 20 74 68 65 20 43 |to reqrite the C| 00000a90 6f 6d 6d 61 6e 64 20 49 6e 74 65 72 70 72 65 74 |ommand Interpret| 00000aa0 65 72 20 28 61 6e 64 20 70 6f 73 73 69 62 6c 79 |er (and possibly| 00000ab0 20 74 68 65 20 48 65 6c 70 20 49 6e 74 65 72 2d | the Help Inter-| 00000ac0 0d 70 72 65 74 65 72 20 61 6c 73 6f 29 2e 0d 20 |.preter also).. | 00000ad0 20 20 54 68 65 20 53 65 72 76 69 63 65 20 45 6e | The Service En| 00000ae0 74 72 79 20 69 73 20 74 68 65 20 70 69 65 63 65 |try is the piece| 00000af0 20 6f 66 20 63 6f 64 65 20 63 61 6c 6c 65 64 20 | of code called | 00000b00 77 68 65 6e 20 74 68 65 20 52 4f 4d 20 69 73 20 |when the ROM is | 00000b10 65 6e 74 65 72 65 64 0d 61 6e 64 20 74 68 65 72 |entered.and ther| 00000b20 65 20 69 73 20 6e 6f 74 68 69 6e 67 20 63 6f 6d |e is nothing com| 00000b30 70 6c 65 78 20 61 62 6f 75 74 20 74 68 69 73 20 |plex about this | 00000b40 63 6f 64 65 2e 20 49 74 20 73 69 6d 70 6c 79 20 |code. It simply | 00000b50 73 74 6f 72 65 73 20 74 68 65 20 52 4f 4d 0d 65 |stores the ROM.e| 00000b60 6e 74 72 79 20 72 65 67 69 73 74 65 72 73 20 61 |ntry registers a| 00000b70 6e 64 20 72 65 73 74 6f 72 65 73 20 74 68 65 6d |nd restores them| 00000b80 20 6f 6e 20 65 78 69 74 2e 20 54 68 65 20 63 6f | on exit. The co| 00000b90 64 65 20 6f 6e 6c 79 20 73 75 70 70 6f 72 74 73 |de only supports| 00000ba0 20 75 6e 2d 0d 72 65 63 6f 67 6e 69 73 65 64 20 | un-.recognised | 00000bb0 63 6f 6d 6d 61 6e 64 73 20 69 73 73 75 65 64 20 |commands issued | 00000bc0 74 6f 20 74 68 65 20 50 61 67 65 64 20 52 4f 4d |to the Paged ROM| 00000bd0 73 20 61 6e 64 20 2a 48 45 4c 50 20 63 6f 6d 6d |s and *HELP comm| 00000be0 61 6e 64 73 2e 20 41 73 20 49 0d 73 61 69 64 20 |ands. As I.said | 00000bf0 65 61 72 6c 69 65 72 2c 20 69 66 20 79 6f 75 20 |earlier, if you | 00000c00 52 4f 4d 20 72 65 71 75 69 72 65 73 20 77 6f 72 |ROM requires wor| 00000c10 6b 73 70 61 63 65 20 6f 72 20 61 6e 20 4e 4d 49 |kspace or an NMI| 00000c20 20 68 61 6e 64 6c 65 72 2c 20 79 6f 75 27 6c 6c | handler, you'll| 00000c30 0d 6e 65 65 64 20 74 6f 20 61 64 64 20 63 6f 64 |.need to add cod| 00000c40 65 20 68 65 72 65 2e 0d 20 20 20 49 20 61 6d 20 |e here.. I am | 00000c50 61 63 74 75 61 6c 6c 79 20 6f 70 65 6e 20 74 6f |actually open to| 00000c60 20 64 65 62 61 74 65 20 6f 6e 20 77 68 65 74 68 | debate on wheth| 00000c70 65 72 20 49 20 73 68 6f 75 6c 64 20 75 73 65 20 |er I should use | 00000c80 7a 65 72 6f 2d 70 61 67 65 20 0d 6c 6f 63 61 74 |zero-page .locat| 00000c90 69 6f 6e 73 20 28 26 37 30 2d 26 38 46 29 20 61 |ions (&70-&8F) a| 00000ca0 73 20 67 69 76 65 6e 20 74 6f 20 74 68 65 20 75 |s given to the u| 00000cb0 73 65 72 20 62 79 20 42 41 53 49 43 2e 20 49 6e |ser by BASIC. In| 00000cc0 20 61 63 74 75 61 6c 69 74 79 2c 20 79 6f 75 72 | actuality, your| 00000cd0 0d 52 4f 4d 20 73 68 6f 75 6c 64 20 70 72 6f 62 |.ROM should prob| 00000ce0 61 62 6c 79 20 72 65 73 65 72 76 65 20 77 6f 72 |ably reserve wor| 00000cf0 6b 73 70 61 63 65 2c 20 62 75 74 20 49 20 61 63 |kspace, but I ac| 00000d00 74 75 61 6c 6c 79 20 74 68 69 6e 6b 20 74 68 61 |tually think tha| 00000d10 74 20 72 65 73 65 72 2d 0d 76 69 6e 67 20 61 6e |t reser-.ving an| 00000d20 20 65 6e 74 69 72 65 20 70 61 67 65 20 66 6f 72 | entire page for| 00000d30 20 6a 75 73 74 20 61 20 66 65 77 20 6c 6f 63 61 | just a few loca| 00000d40 74 69 6f 6e 73 20 69 73 20 76 65 72 79 20 77 61 |tions is very wa| 00000d50 73 74 65 66 75 6c 21 20 49 20 64 69 64 20 0d 74 |steful! I did .t| 00000d60 68 69 6e 6b 20 6f 66 20 67 72 61 62 62 69 6e 67 |hink of grabbing| 00000d70 20 74 68 65 20 4e 4d 49 20 61 6e 64 20 75 73 69 | the NMI and usi| 00000d80 6e 67 20 69 74 73 20 61 6c 6c 6f 63 61 74 69 6f |ng its allocatio| 00000d90 6e 20 6f 66 20 7a 65 72 6f 2d 70 61 67 65 2c 20 |n of zero-page, | 00000da0 62 75 74 0d 61 6e 6f 74 68 65 72 20 52 4f 4d 20 |but.another ROM | 00000db0 63 6f 75 6c 64 20 72 65 71 75 65 73 74 20 74 68 |could request th| 00000dc0 65 20 4e 4d 49 20 77 6f 72 6b 73 70 61 63 65 20 |e NMI workspace | 00000dd0 77 68 69 6c 73 74 20 74 68 69 73 20 52 4f 4d 20 |whilst this ROM | 00000de0 77 61 73 20 61 63 74 69 76 65 2e 0d 54 68 65 20 |was active..The | 00000df0 52 4f 4d 20 77 6f 75 6c 64 20 74 68 65 6e 20 62 |ROM would then b| 00000e00 65 20 66 6f 72 63 65 64 20 69 6e 74 6f 20 72 65 |e forced into re| 00000e10 6c 69 6e 71 75 69 73 68 69 6e 67 20 74 68 65 20 |linquishing the | 00000e20 4e 4d 49 20 77 6f 72 6b 73 70 61 63 65 20 61 6e |NMI workspace an| 00000e30 64 0d 79 6f 75 20 77 6f 75 6c 64 20 61 67 61 69 |d.you would agai| 00000e40 6e 20 6e 65 65 64 20 73 6f 6d 65 20 7a 65 72 6f |n need some zero| 00000e50 2d 70 61 67 65 20 77 6f 72 6b 73 70 61 63 65 21 |-page workspace!| 00000e60 21 0d 20 20 20 54 68 65 20 6d 6f 73 74 20 69 6d |!. The most im| 00000e70 70 6f 72 74 61 6e 74 20 70 61 72 74 20 6f 66 20 |portant part of | 00000e80 74 68 65 20 73 6f 75 72 63 65 20 63 6f 64 65 20 |the source code | 00000e90 69 73 20 74 68 65 20 43 6f 6d 6d 61 6e 64 20 53 |is the Command S| 00000ea0 74 72 75 63 74 75 72 65 2e 0d 49 74 20 69 73 20 |tructure..It is | 00000eb0 74 68 69 73 20 64 61 74 61 20 74 68 61 74 20 64 |this data that d| 00000ec0 65 66 69 6e 65 73 20 77 68 61 74 20 74 65 78 74 |efines what text| 00000ed0 20 69 73 20 70 72 69 6e 74 65 64 20 61 6e 64 20 | is printed and | 00000ee0 63 68 65 63 6b 65 64 20 66 6f 72 20 77 68 65 6e |checked for when| 00000ef0 0d 2a 48 45 4c 50 20 69 73 20 69 73 73 75 65 64 |.*HELP is issued| 00000f00 20 61 6e 64 20 61 6c 73 6f 20 68 6f 77 20 6d 61 | and also how ma| 00000f10 6e 79 20 61 6e 64 20 77 68 61 74 20 63 6f 6d 6d |ny and what comm| 00000f20 61 6e 64 73 20 74 68 65 20 52 4f 4d 20 61 63 74 |ands the ROM act| 00000f30 75 61 6c 6c 79 20 0d 68 61 73 2e 20 54 68 65 20 |ually .has. The | 00000f40 66 69 72 73 74 20 65 6e 74 72 79 20 69 6e 20 74 |first entry in t| 00000f50 68 69 73 20 74 61 62 6c 65 20 69 73 20 74 68 65 |his table is the| 00000f60 20 2e 68 63 73 20 65 6e 74 72 79 2c 20 77 68 69 | .hcs entry, whi| 00000f70 63 68 20 63 6f 6e 73 69 73 74 73 20 6f 66 0d 61 |ch consists of.a| 00000f80 20 62 79 74 65 20 74 68 61 74 20 73 70 65 63 69 | byte that speci| 00000f90 66 69 65 73 20 68 6f 77 20 6c 6f 6e 67 20 74 68 |fies how long th| 00000fa0 65 20 2a 48 45 4c 50 20 52 4f 4d 20 74 69 74 6c |e *HELP ROM titl| 00000fb0 65 20 69 73 2c 20 6d 69 6e 75 73 20 6f 6e 65 2e |e is, minus one.| 00000fc0 20 0d 46 6f 6c 6c 6f 77 69 6e 67 20 74 68 69 73 | .Following this| 00000fd0 20 69 73 20 61 20 31 36 20 62 69 74 20 28 77 6f | is a 16 bit (wo| 00000fe0 72 64 29 20 70 6f 69 6e 74 65 72 20 74 6f 20 74 |rd) pointer to t| 00000ff0 68 65 20 52 4f 4d 20 74 69 74 6c 65 20 69 74 73 |he ROM title its| 00001000 65 6c 66 2e 20 49 74 20 69 73 0d 74 68 69 73 20 |elf. It is.this | 00001010 74 65 78 74 20 74 68 61 74 20 77 69 6c 6c 20 62 |text that will b| 00001020 65 20 75 73 65 64 20 66 6f 72 20 63 6f 6d 70 61 |e used for compa| 00001030 72 69 73 6f 6e 20 77 68 65 6e 20 61 20 2a 48 45 |rison when a *HE| 00001040 4c 50 20 63 6f 6d 6d 61 6e 64 20 69 73 20 0d 72 |LP command is .r| 00001050 65 63 65 69 76 65 64 20 77 69 74 68 20 61 6e 20 |eceived with an | 00001060 61 72 67 75 6d 65 6e 74 20 6f 66 20 74 68 65 20 |argument of the | 00001070 52 4f 4d 20 6e 61 6d 65 2e 0d 20 20 20 54 68 65 |ROM name.. The| 00001080 20 2e 63 6d 73 20 65 6e 74 72 79 20 69 73 20 77 | .cms entry is w| 00001090 68 65 72 65 20 74 68 65 20 63 6f 6d 6d 61 6e 64 |here the command| 000010a0 20 70 6f 69 6e 74 65 72 73 20 61 72 65 20 6c 6f | pointers are lo| 000010b0 63 61 74 65 64 2e 20 54 68 65 20 66 69 72 73 74 |cated. The first| 000010c0 0d 62 79 74 65 20 69 73 20 74 68 65 20 6e 75 6d |.byte is the num| 000010d0 62 65 72 20 6f 66 20 52 4f 4d 20 63 6f 6d 6d 61 |ber of ROM comma| 000010e0 6e 64 73 20 6d 69 6e 75 73 20 6f 6e 65 2e 20 45 |nds minus one. E| 000010f0 61 63 68 20 63 6f 6d 6d 61 6e 64 20 65 6e 74 72 |ach command entr| 00001100 79 20 63 6f 6e 2d 0d 73 69 73 74 73 20 6f 66 20 |y con-.sists of | 00001110 66 69 76 65 20 62 79 74 65 73 2e 20 54 68 65 72 |five bytes. Ther| 00001120 65 66 6f 72 65 2c 20 69 66 20 79 6f 75 72 20 52 |efore, if your R| 00001130 4f 4d 20 68 61 73 20 66 6f 75 72 20 63 6f 6d 6d |OM has four comm| 00001140 61 6e 64 73 2c 20 79 6f 75 72 20 0d 74 6f 74 61 |ands, your .tota| 00001150 6c 20 2e 63 6d 73 20 6c 65 6e 67 74 68 20 77 6f |l .cms length wo| 00001160 75 6c 64 20 62 65 20 28 35 20 78 20 34 29 20 2b |uld be (5 x 4) +| 00001170 20 31 2e 20 41 20 63 6f 6d 6d 61 6e 64 20 65 6e | 1. A command en| 00001180 74 72 79 20 68 61 73 20 61 20 76 65 72 79 20 73 |try has a very s| 00001190 69 6d 0d 70 6c 65 20 73 74 72 75 63 74 75 72 65 |im.ple structure| 000011a0 3a 20 41 20 62 79 74 65 20 73 70 65 63 69 66 79 |: A byte specify| 000011b0 69 6e 67 20 74 68 65 20 63 6f 6d 6d 61 6e 64 20 |ing the command | 000011c0 6c 65 6e 67 74 68 20 6d 69 6e 75 73 20 6f 6e 65 |length minus one| 000011d0 2c 20 61 20 77 6f 72 64 0d 70 6f 69 6e 74 65 72 |, a word.pointer| 000011e0 20 74 6f 20 74 68 65 20 63 6f 6d 6d 61 6e 64 20 | to the command | 000011f0 6e 61 6d 65 20 69 74 73 65 6c 66 20 61 6e 64 20 |name itself and | 00001200 61 20 66 69 6e 61 6c 20 77 6f 72 64 20 77 68 69 |a final word whi| 00001210 63 68 20 69 73 20 74 68 65 20 4a 4d 50 20 0d 61 |ch is the JMP .a| 00001220 64 64 72 65 73 73 20 69 6e 20 74 68 65 20 4a 75 |ddress in the Ju| 00001230 6d 70 20 54 61 62 6c 65 2e 20 50 6c 65 61 73 65 |mp Table. Please| 00001240 20 62 65 20 61 77 61 72 65 20 74 68 61 74 20 61 | be aware that a| 00001250 20 72 65 67 69 73 74 65 72 20 69 73 20 75 73 65 | register is use| 00001260 64 20 74 6f 20 0d 73 74 65 70 20 74 68 72 6f 75 |d to .step throu| 00001270 67 68 20 74 68 69 73 20 43 6f 6d 6d 61 6e 64 20 |gh this Command | 00001280 53 74 72 75 63 74 75 72 65 20 61 6e 64 20 74 68 |Structure and th| 00001290 65 72 65 66 6f 72 65 20 74 68 65 20 6e 75 6d 62 |erefore the numb| 000012a0 65 72 20 6f 66 20 70 6f 73 73 69 62 6c 65 0d 63 |er of possible.c| 000012b0 6f 6d 6d 61 6e 64 73 20 69 73 20 6c 69 6d 69 74 |ommands is limit| 000012c0 65 64 20 74 6f 20 61 20 6d 61 78 69 6d 75 6d 20 |ed to a maximum | 000012d0 6f 66 20 38 35 2e 20 57 69 74 68 20 63 61 72 65 |of 85. With care| 000012e0 66 75 6c 20 72 65 70 72 6f 67 72 61 6d 6d 69 6e |ful reprogrammin| 000012f0 67 20 75 73 69 6e 67 0d 69 6e 64 69 72 65 63 74 |g using.indirect| 00001300 20 61 64 64 72 65 73 73 69 6e 67 2c 20 69 74 20 | addressing, it | 00001310 77 6f 75 6c 64 20 62 65 20 70 6f 73 73 69 62 6c |would be possibl| 00001320 65 20 74 6f 20 69 6e 63 72 65 61 73 65 20 74 68 |e to increase th| 00001330 69 73 2c 20 62 75 74 20 49 20 77 6f 75 6c 64 0d |is, but I would.| 00001340 68 61 76 65 20 74 68 6f 75 67 68 20 74 68 61 74 |have though that| 00001350 20 38 35 20 77 61 73 20 73 75 66 66 69 63 69 65 | 85 was sufficie| 00001360 6e 74 21 21 0d 20 20 20 54 68 65 20 4a 75 6d 70 |nt!!. The Jump| 00001370 20 41 72 72 61 79 20 63 6f 6d 65 73 20 6e 65 78 | Array comes nex| 00001380 74 2e 20 54 68 69 73 20 6d 69 67 68 74 20 62 65 |t. This might be| 00001390 20 63 6f 6e 73 69 64 65 72 65 64 20 62 79 20 73 | considered by s| 000013a0 6f 6d 65 20 70 72 6f 67 72 61 6d 2d 0d 6d 65 72 |ome program-.mer| 000013b0 73 20 74 6f 20 62 65 20 73 75 70 65 72 66 6c 75 |s to be superflu| 000013c0 6f 75 73 20 77 68 65 6e 20 74 68 65 20 63 6f 6d |ous when the com| 000013d0 6d 61 6e 64 20 73 74 72 75 63 74 75 72 65 20 63 |mand structure c| 000013e0 6f 75 6c 64 20 61 63 68 69 65 76 65 20 74 68 65 |ould achieve the| 000013f0 20 73 61 6d 65 0d 72 65 73 75 6c 74 73 2e 20 57 | same.results. W| 00001400 65 6c 6c 2c 20 49 20 74 68 6f 75 67 68 74 20 61 |ell, I thought a| 00001410 62 6f 75 74 20 74 68 69 73 20 61 6e 64 20 73 69 |bout this and si| 00001420 6e 63 65 20 65 76 65 72 79 74 68 69 6e 67 20 69 |nce everything i| 00001430 6e 20 74 68 69 73 20 68 65 61 64 65 72 0d 69 73 |n this header.is| 00001440 20 76 65 72 79 20 6d 6f 64 75 6c 61 72 2c 20 61 | very modular, a| 00001450 20 6a 75 6d 70 20 74 61 62 6c 65 20 77 61 73 20 | jump table was | 00001460 61 20 6d 75 63 68 20 6e 65 61 74 65 72 20 77 61 |a much neater wa| 00001470 79 20 6f 66 20 61 63 68 69 65 76 69 6e 67 20 6f |y of achieving o| 00001480 72 64 65 72 2e 0d 20 20 20 54 68 65 20 48 65 6c |rder.. The Hel| 00001490 70 20 49 6e 74 65 72 70 72 65 74 65 72 20 69 73 |p Interpreter is| 000014a0 20 74 68 65 20 63 6f 64 65 20 63 61 6c 6c 65 64 | the code called| 000014b0 20 77 68 65 6e 20 61 20 2a 48 45 4c 50 20 63 6f | when a *HELP co| 000014c0 6d 6d 61 6e 64 20 69 73 0d 69 73 73 75 65 64 2e |mmand is.issued.| 000014d0 20 49 74 20 66 69 72 73 74 20 73 63 61 6e 73 20 | It first scans | 000014e0 74 68 65 20 43 4c 49 20 6c 6f 6f 6b 69 6e 67 20 |the CLI looking | 000014f0 66 6f 72 20 61 72 67 75 6d 65 6e 74 73 20 61 6e |for arguments an| 00001500 64 20 69 66 20 6e 6f 6e 65 20 61 72 65 20 0d 66 |d if none are .f| 00001510 6f 75 6e 64 20 73 69 6d 70 6c 79 20 72 65 70 6f |ound simply repo| 00001520 72 74 73 20 74 68 65 20 52 4f 4d 20 6e 61 6d 65 |rts the ROM name| 00001530 20 61 6e 64 20 76 65 72 73 69 6f 6e 20 6e 75 6d | and version num| 00001540 62 65 72 2e 20 48 6f 77 65 76 65 72 2c 20 69 66 |ber. However, if| 00001550 20 74 68 65 0d 73 75 70 70 6c 69 65 64 20 61 72 | the.supplied ar| 00001560 67 75 6d 65 6e 74 20 6d 61 74 63 68 65 73 20 74 |gument matches t| 00001570 68 65 20 74 65 78 74 20 70 6f 69 6e 74 65 64 20 |he text pointed | 00001580 74 6f 20 62 79 20 74 68 65 20 2e 68 63 73 20 70 |to by the .hcs p| 00001590 6f 69 6e 74 65 72 2c 20 74 68 65 6e 0d 74 68 65 |ointer, then.the| 000015a0 20 52 4f 4d 20 63 6f 6d 6d 61 6e 64 20 6c 69 73 | ROM command lis| 000015b0 74 20 69 73 20 65 63 68 6f 65 64 20 74 6f 20 74 |t is echoed to t| 000015c0 68 65 20 73 63 72 65 65 6e 2e 20 43 68 61 72 61 |he screen. Chara| 000015d0 63 74 65 72 20 63 6f 6e 76 65 72 73 69 6f 6e 20 |cter conversion | 000015e0 69 73 0d 70 65 72 66 6f 72 6d 65 64 20 6f 6e 20 |is.performed on | 000015f0 74 68 65 20 69 6e 70 75 74 20 73 74 72 65 61 6d |the input stream| 00001600 20 73 6f 20 74 68 61 74 20 63 68 61 72 61 63 74 | so that charact| 00001610 65 72 20 63 61 73 65 20 69 73 20 65 71 75 61 6c |er case is equal| 00001620 2e 20 50 6c 65 61 73 65 20 62 65 0d 61 77 61 72 |. Please be.awar| 00001630 65 20 6f 66 20 74 68 69 73 20 69 66 20 79 6f 75 |e of this if you| 00001640 20 61 72 65 20 70 6c 61 6e 6e 69 6e 67 20 6f 6e | are planning on| 00001650 20 75 73 69 6e 67 20 61 6e 79 20 73 74 72 61 6e | using any stran| 00001660 67 65 20 63 68 61 72 61 63 74 65 72 73 2e 0d 20 |ge characters.. | 00001670 20 20 54 68 65 20 43 6f 6d 6d 61 6e 64 20 49 6e | The Command In| 00001680 74 65 72 70 72 65 74 65 72 20 69 73 20 72 6f 75 |terpreter is rou| 00001690 67 68 6c 79 20 74 68 65 20 73 61 6d 65 20 61 73 |ghly the same as| 000016a0 20 74 68 65 20 48 65 6c 70 20 49 6e 74 65 72 70 | the Help Interp| 000016b0 72 65 74 65 72 2e 0d 43 68 61 72 61 63 74 65 72 |reter..Character| 000016c0 20 63 61 73 65 20 63 6f 6e 76 65 72 73 69 6f 6e | case conversion| 000016d0 20 69 73 20 64 6f 6e 65 20 6f 6e 20 74 68 65 20 | is done on the | 000016e0 69 6e 70 75 74 20 73 74 72 65 61 6d 20 73 6f 20 |input stream so | 000016f0 73 70 65 63 69 61 6c 20 63 68 61 72 2d 0d 61 63 |special char-.ac| 00001700 74 65 72 73 20 6d 61 79 20 63 61 75 73 65 20 63 |ters may cause c| 00001710 6f 6d 6d 61 6e 64 73 20 74 6f 20 6e 6f 74 20 62 |ommands to not b| 00001720 65 20 72 65 63 6f 67 6e 69 73 65 64 2e 20 49 74 |e recognised. It| 00001730 20 73 63 61 6e 73 20 74 68 65 20 43 6f 6d 6d 61 | scans the Comma| 00001740 6e 64 0d 53 74 72 75 63 74 75 72 65 20 66 6f 72 |nd.Structure for| 00001750 20 61 73 20 6d 61 6e 79 20 63 6f 6d 6d 61 6e 64 | as many command| 00001760 73 20 61 73 20 69 6e 64 69 63 61 74 65 64 20 61 |s as indicated a| 00001770 6e 64 2c 20 77 68 65 6e 20 6f 6e 65 20 69 73 20 |nd, when one is | 00001780 72 65 63 6f 67 6e 69 73 65 64 2c 0d 69 74 20 63 |recognised,.it c| 00001790 6c 65 61 72 73 20 6c 6f 63 61 74 69 6f 6e 20 28 |lears location (| 000017a0 26 37 30 29 20 77 68 69 63 68 20 69 73 20 74 68 |&70) which is th| 000017b0 65 20 41 63 63 75 6d 75 6c 61 74 6f 72 20 6f 66 |e Accumulator of| 000017c0 20 74 68 65 20 52 4f 4d 20 65 78 69 74 20 76 61 | the ROM exit va| 000017d0 6c 75 65 2e 0d 49 66 20 79 6f 75 20 61 72 65 20 |lue..If you are | 000017e0 77 72 69 74 69 6e 67 20 61 20 6c 61 72 67 65 20 |writing a large | 000017f0 52 4f 4d 20 77 69 74 68 20 6d 61 6e 79 20 63 6f |ROM with many co| 00001800 6d 6d 61 6e 64 73 2c 20 70 6c 65 61 73 65 20 74 |mmands, please t| 00001810 61 6b 65 20 63 61 72 65 20 74 68 61 74 0d 74 68 |ake care that.th| 00001820 65 20 43 6f 6d 6d 61 6e 64 20 53 74 72 75 63 74 |e Command Struct| 00001830 75 72 65 20 64 6f 65 73 20 6e 6f 74 20 65 78 63 |ure does not exc| 00001840 65 65 64 20 61 20 50 61 67 65 20 69 6e 20 6c 65 |eed a Page in le| 00001850 6e 67 74 68 21 20 41 73 20 77 61 72 6e 65 64 20 |ngth! As warned | 00001860 20 0d 65 61 72 6c 69 65 72 2c 20 74 68 65 20 43 | .earlier, the C| 00001870 6f 6d 6d 61 6e 64 20 53 74 72 75 63 74 75 72 65 |ommand Structure| 00001880 20 69 73 20 73 74 65 70 70 65 64 20 74 68 72 6f | is stepped thro| 00001890 75 67 68 20 75 73 69 6e 67 20 61 20 72 65 67 69 |ugh using a regi| 000018a0 73 74 65 72 20 61 6e 64 0d 69 73 20 74 68 65 72 |ster and.is ther| 000018b0 65 66 6f 72 65 20 6c 69 6d 69 74 65 64 20 74 6f |efore limited to| 000018c0 20 32 35 36 20 62 79 74 65 73 2e 0d 20 20 20 54 | 256 bytes.. T| 000018d0 68 65 72 65 20 61 72 65 20 73 6f 6d 65 20 70 6f |here are some po| 000018e0 69 6e 74 73 20 74 6f 20 6e 6f 74 65 20 61 62 6f |ints to note abo| 000018f0 75 74 20 74 68 69 73 20 63 6f 64 65 2e 20 46 69 |ut this code. Fi| 00001900 72 73 74 79 2c 20 6e 6f 20 64 6f 64 67 79 20 73 |rsty, no dodgy s| 00001910 65 6c 66 2d 0d 6d 6f 64 69 66 79 69 6e 67 20 63 |elf-.modifying c| 00001920 6f 64 65 20 69 73 20 75 73 65 64 20 61 74 20 61 |ode is used at a| 00001930 6c 6c 2e 20 53 65 63 6f 6e 64 6c 79 2c 20 69 74 |ll. Secondly, it| 00001940 20 73 68 6f 75 6c 64 20 77 6f 72 6b 20 6f 6e 20 | should work on | 00001950 61 6e 79 20 6d 61 63 68 69 6e 65 2c 0d 66 72 6f |any machine,.fro| 00001960 6d 20 61 6c 6c 20 42 42 43 73 20 74 6f 20 74 68 |m all BBCs to th| 00001970 65 20 41 63 6f 72 6e 20 45 6c 65 63 74 72 6f 6e |e Acorn Electron| 00001980 20 77 69 74 68 20 77 68 61 74 65 76 65 72 20 65 | with whatever e| 00001990 78 70 61 6e 73 69 6f 6e 73 20 74 68 65 79 20 6d |xpansions they m| 000019a0 61 79 0d 68 61 76 65 2e 20 54 68 69 72 64 6c 79 |ay.have. Thirdly| 000019b0 2c 20 77 68 65 6e 20 77 72 69 74 69 6e 67 20 79 |, when writing y| 000019c0 6f 75 72 20 52 4f 4d 20 63 6f 64 65 2c 20 44 4f |our ROM code, DO| 000019d0 20 4e 4f 54 20 75 73 65 20 6c 6f 63 61 74 69 6f | NOT use locatio| 000019e0 6e 73 20 26 37 30 2c 20 26 37 31 0d 6f 72 20 26 |ns &70, &71.or &| 000019f0 37 32 20 66 6f 72 20 73 74 6f 72 61 67 65 2e 20 |72 for storage. | 00001a00 54 68 65 20 6f 74 68 65 72 20 42 41 53 49 43 20 |The other BASIC | 00001a10 75 73 65 72 20 6c 6f 63 61 74 69 6f 6e 73 20 28 |user locations (| 00001a20 26 37 33 2d 26 38 46 29 20 6d 61 79 20 62 65 20 |&73-&8F) may be | 00001a30 75 73 65 64 0d 61 73 20 79 6f 75 20 73 65 65 20 |used.as you see | 00001a40 66 69 74 2e 0d 20 20 20 20 20 20 20 20 20 20 20 |fit.. | 00001a50 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | * 00001a70 20 20 20 20 20 20 20 20 20 20 20 20 20 20 43 68 | Ch| 00001a80 72 69 73 20 57 61 72 62 75 72 74 6f 6e 0d 20 20 |ris Warburton. | 00001a90 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | * 00001ac0 20 20 20 20 77 65 6c 64 65 72 40 6d 61 6a 65 73 | welder@majes| 00001ad0 74 79 2e 6e 65 74 0d |ty.net.| 00001ad7