Home » CEEFAX disks » telesoftware17.adl » 25-08-89/HeadTEX
25-08-89/HeadTEX
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 » CEEFAX disks » telesoftware17.adl |
Filename: | 25-08-89/HeadTEX |
Read OK: | ✔ |
File size: | 1264 bytes |
Load address: | FFFFFD41 |
Exec address: | FFFFEB75 |
File contents
The two programs on this disc are intended to be used to generate a secure sideways ROM header. This is then added to a program held on disc and a new file is created with the header and program in an encoded form. The user must ensure that there is room on the disc for a new file to be created that may use one more sector than the original. The ROM image produced may be tested by loading into sideways RAM before blowing into an EPROM and is activated by using the ROM title as an OS (*) command. This follows the convention of permitting lower case entries and abbreviations down to two characters and a full stop. In the version for BASIC programs, the header routine decodes and downloads the original program to the CURRENT setting of PAGE then performs OLD and RUN. The version for machine code programs, decodes and downloads the code to the load address of the source programs then performs a JSR to the execution address. A return address and exit is provided to ensure that machine code with an RTS will be handled correctly. Both routines get all the information they require from the source program so that the user only needs to decide on a suitable ROM title and identify source and destination filenames. The ROM size is given as either 8k or 16k at the end of each run. The user is prevented form attempting to generate ROMs over this limit. Both routines will work with any version of BASIC and on the BBC B, B+, MASTER and TURBO. Either DFS or ADFS can be the resident filing system. Only ACORN approved OS calls have been used so the routines should also work on an ECONET system. Assembled ROMs will work on all machines but not with a second processor active, as the code is always downloaded into the I/O RAM area. Detailed notes for both programs are as below: 10 - 290 These lines are the initialising. Note that 'eor' is set to a random number at 100 so that there is no way of knowing the encoding value. 310 - 370 Prints the instructions from DATA 380 - 440 Gets the source filename from the user and opens the source file. If the file doesn't exist the error is reported. In the BASIC version, the first byte of the file is fetched and 430 checks to see that it is &0D (the start byte for all BASIC programs). In the machine code version, 430 finds the load and execution addresses. 450 - 480 Gets the ROM title from the user. The length is limited to slightly less than one line (40 column). 490 - 530 Gets the destination filename from the user and attempts to OPENUP the file. If successful then the file already exists and an error is forced. 540 - 800 These set up the esential characters for a sideways ROM as specified by ACORN. 810 - 1240 Identify that a ROM service call has been made. The service calls accepted by this ROM are: 3 - Initialise (Print title) 4 - Unknown command 9 - Help request 1250 - 1460 Compare the command line with the ROM title. 1470 - 1750 Download the program to user RAM. In the version for BASIC, a call is made to find out where PAGE is (1580). The machine code version simply downloads to the load address of the source program. 1760 - 2000 In the BASIC version, the input buffer is flushed (1760) and the characters representing OLD,RUN and VDU6 are put into the input buffer. At 1940 the ROM number containing BASIC is found. VDU21 is set at 1950 and a language entry call is made at 1990. In the machine code version, a call is made to the execution address at 1760. The remaining code is the return routine. The call is marked as acknowledged by setting A to zero at 1800. 2010 - 2100 Loads the source file to 'prog' then *SAVES the new file and prints the ROM size. Note that it is only necessary to enter PROCload on the first pass of the assembler, and the closing message is a forced error to return you to the instructions. PROCload Gets bytes from the source file, encodes them by exclusive-or with the value of E% then stores them in memory above the already generated header. E% is incremented after each byte is encoded. This makes the encoding less likely to show any detectable pattern. PROCerror A standard error handler. Print lines ending in '!' are directed here (error 26) along with any errors produced by the DFS. This ensures that all loose ends are taken care of and the user is always returned to the instructions. PROCclear Clears the area of memory to be used for the ROM. &FF is used as this is the most efficient value to have as blank code. Most EPROM programmers ignore this value, so programming faster. A simple piece of code is assembled and CALLed to do the clearing as this is faster than using a FOR NEXT loop in BASIC.
00000000 54 68 65 20 74 77 6f 20 70 72 6f 67 72 61 6d 73 |The two programs| 00000010 20 6f 6e 20 74 68 69 73 20 64 69 73 63 20 61 72 | on this disc ar| 00000020 65 20 69 6e 74 65 6e 64 65 64 20 74 6f 20 62 65 |e intended to be| 00000030 20 75 73 65 64 20 74 6f 20 67 65 6e 65 72 61 74 | used to generat| 00000040 65 20 61 20 20 73 65 63 75 72 65 20 73 69 64 65 |e a secure side| 00000050 77 61 79 73 20 52 4f 4d 20 68 65 61 64 65 72 2e |ways ROM header.| 00000060 20 20 54 68 69 73 20 69 73 20 74 68 65 6e 20 61 | This is then a| 00000070 64 64 65 64 20 74 6f 20 61 20 70 72 6f 67 72 61 |dded to a progra| 00000080 6d 20 68 65 6c 64 20 6f 6e 20 64 69 73 63 20 61 |m held on disc a| 00000090 6e 64 20 61 20 6e 65 77 20 66 69 6c 65 20 69 73 |nd a new file is| 000000a0 20 63 72 65 61 74 65 64 20 77 69 74 68 20 74 68 | created with th| 000000b0 65 20 68 65 61 64 65 72 20 61 6e 64 20 70 72 6f |e header and pro| 000000c0 67 72 61 6d 20 69 6e 20 61 6e 20 65 6e 63 6f 64 |gram in an encod| 000000d0 65 64 20 66 6f 72 6d 2e 20 20 54 68 65 20 75 73 |ed form. The us| 000000e0 65 72 20 6d 75 73 74 20 65 6e 73 75 72 65 20 74 |er must ensure t| 000000f0 68 61 74 20 74 68 65 72 65 20 69 73 20 72 6f 6f |hat there is roo| 00000100 6d 20 6f 6e 20 74 68 65 20 64 69 73 63 20 66 6f |m on the disc fo| 00000110 72 20 61 20 6e 65 77 20 66 69 6c 65 20 74 6f 20 |r a new file to | 00000120 62 65 20 63 72 65 61 74 65 64 20 74 68 61 74 20 |be created that | 00000130 6d 61 79 20 75 73 65 20 6f 6e 65 20 6d 6f 72 65 |may use one more| 00000140 20 73 65 63 74 6f 72 20 74 68 61 6e 20 74 68 65 | sector than the| 00000150 20 6f 72 69 67 69 6e 61 6c 2e 20 0d 0d 54 68 65 | original. ..The| 00000160 20 52 4f 4d 20 69 6d 61 67 65 20 70 72 6f 64 75 | ROM image produ| 00000170 63 65 64 20 6d 61 79 20 62 65 20 74 65 73 74 65 |ced may be teste| 00000180 64 20 62 79 20 6c 6f 61 64 69 6e 67 20 69 6e 74 |d by loading int| 00000190 6f 20 73 69 64 65 77 61 79 73 20 52 41 4d 20 62 |o sideways RAM b| 000001a0 65 66 6f 72 65 20 62 6c 6f 77 69 6e 67 20 69 6e |efore blowing in| 000001b0 74 6f 20 61 6e 20 45 50 52 4f 4d 20 61 6e 64 20 |to an EPROM and | 000001c0 69 73 20 61 63 74 69 76 61 74 65 64 20 62 79 20 |is activated by | 000001d0 75 73 69 6e 67 20 74 68 65 20 52 4f 4d 20 74 69 |using the ROM ti| 000001e0 74 6c 65 20 61 73 20 61 6e 20 4f 53 20 28 2a 29 |tle as an OS (*)| 000001f0 20 63 6f 6d 6d 61 6e 64 2e 20 20 54 68 69 73 20 | command. This | 00000200 66 6f 6c 6c 6f 77 73 20 74 68 65 20 63 6f 6e 76 |follows the conv| 00000210 65 6e 74 69 6f 6e 20 6f 66 20 70 65 72 6d 69 74 |ention of permit| 00000220 74 69 6e 67 20 6c 6f 77 65 72 20 63 61 73 65 20 |ting lower case | 00000230 65 6e 74 72 69 65 73 20 61 6e 64 20 61 62 62 72 |entries and abbr| 00000240 65 76 69 61 74 69 6f 6e 73 20 64 6f 77 6e 20 74 |eviations down t| 00000250 6f 20 74 77 6f 20 63 68 61 72 61 63 74 65 72 73 |o two characters| 00000260 20 61 6e 64 20 61 20 66 75 6c 6c 20 73 74 6f 70 | and a full stop| 00000270 2e 20 0d 0d 49 6e 20 74 68 65 20 76 65 72 73 69 |. ..In the versi| 00000280 6f 6e 20 66 6f 72 20 42 41 53 49 43 20 70 72 6f |on for BASIC pro| 00000290 67 72 61 6d 73 2c 20 74 68 65 20 68 65 61 64 65 |grams, the heade| 000002a0 72 20 72 6f 75 74 69 6e 65 20 64 65 63 6f 64 65 |r routine decode| 000002b0 73 20 61 6e 64 20 64 6f 77 6e 6c 6f 61 64 73 20 |s and downloads | 000002c0 74 68 65 20 6f 72 69 67 69 6e 61 6c 20 70 72 6f |the original pro| 000002d0 67 72 61 6d 20 74 6f 20 74 68 65 20 43 55 52 52 |gram to the CURR| 000002e0 45 4e 54 20 73 65 74 74 69 6e 67 20 6f 66 20 50 |ENT setting of P| 000002f0 41 47 45 20 74 68 65 6e 20 70 65 72 66 6f 72 6d |AGE then perform| 00000300 73 20 4f 4c 44 20 61 6e 64 20 52 55 4e 2e 0d 0d |s OLD and RUN...| 00000310 54 68 65 20 76 65 72 73 69 6f 6e 20 66 6f 72 20 |The version for | 00000320 6d 61 63 68 69 6e 65 20 63 6f 64 65 20 70 72 6f |machine code pro| 00000330 67 72 61 6d 73 2c 20 64 65 63 6f 64 65 73 20 61 |grams, decodes a| 00000340 6e 64 20 64 6f 77 6e 6c 6f 61 64 73 20 74 68 65 |nd downloads the| 00000350 20 63 6f 64 65 20 74 6f 20 74 68 65 20 6c 6f 61 | code to the loa| 00000360 64 20 61 64 64 72 65 73 73 20 6f 66 20 74 68 65 |d address of the| 00000370 20 73 6f 75 72 63 65 20 70 72 6f 67 72 61 6d 73 | source programs| 00000380 20 74 68 65 6e 20 70 65 72 66 6f 72 6d 73 20 61 | then performs a| 00000390 20 4a 53 52 20 74 6f 20 74 68 65 20 65 78 65 63 | JSR to the exec| 000003a0 75 74 69 6f 6e 20 61 64 64 72 65 73 73 2e 20 20 |ution address. | 000003b0 41 20 72 65 74 75 72 6e 20 61 64 64 72 65 73 73 |A return address| 000003c0 20 61 6e 64 20 65 78 69 74 20 69 73 20 70 72 6f | and exit is pro| 000003d0 76 69 64 65 64 20 74 6f 20 65 6e 73 75 72 65 20 |vided to ensure | 000003e0 74 68 61 74 20 6d 61 63 68 69 6e 65 20 63 6f 64 |that machine cod| 000003f0 65 20 77 69 74 68 20 61 6e 20 52 54 53 20 77 69 |e with an RTS wi| 00000400 6c 6c 20 62 65 20 68 61 6e 64 6c 65 64 20 63 6f |ll be handled co| 00000410 72 72 65 63 74 6c 79 2e 0d 0d 42 6f 74 68 20 72 |rrectly...Both r| 00000420 6f 75 74 69 6e 65 73 20 67 65 74 20 61 6c 6c 20 |outines get all | 00000430 74 68 65 20 69 6e 66 6f 72 6d 61 74 69 6f 6e 20 |the information | 00000440 74 68 65 79 20 72 65 71 75 69 72 65 20 66 72 6f |they require fro| 00000450 6d 20 74 68 65 20 73 6f 75 72 63 65 20 70 72 6f |m the source pro| 00000460 67 72 61 6d 20 73 6f 20 74 68 61 74 20 74 68 65 |gram so that the| 00000470 20 75 73 65 72 20 6f 6e 6c 79 20 6e 65 65 64 73 | user only needs| 00000480 20 74 6f 20 64 65 63 69 64 65 20 6f 6e 20 61 20 | to decide on a | 00000490 73 75 69 74 61 62 6c 65 20 52 4f 4d 20 74 69 74 |suitable ROM tit| 000004a0 6c 65 20 61 6e 64 20 69 64 65 6e 74 69 66 79 20 |le and identify | 000004b0 73 6f 75 72 63 65 20 61 6e 64 20 64 65 73 74 69 |source and desti| 000004c0 6e 61 74 69 6f 6e 20 66 69 6c 65 6e 61 6d 65 73 |nation filenames| 000004d0 2e 20 20 54 68 65 20 52 4f 4d 20 73 69 7a 65 20 |. The ROM size | 000004e0 69 73 20 67 69 76 65 6e 20 61 73 20 65 69 74 68 |is given as eith| 000004f0 65 72 20 38 6b 20 6f 72 20 31 36 6b 20 61 74 20 |er 8k or 16k at | 00000500 74 68 65 20 65 6e 64 20 6f 66 20 65 61 63 68 20 |the end of each | 00000510 72 75 6e 2e 20 20 54 68 65 20 75 73 65 72 20 69 |run. The user i| 00000520 73 20 70 72 65 76 65 6e 74 65 64 20 66 6f 72 6d |s prevented form| 00000530 20 61 74 74 65 6d 70 74 69 6e 67 20 74 6f 20 67 | attempting to g| 00000540 65 6e 65 72 61 74 65 20 52 4f 4d 73 20 6f 76 65 |enerate ROMs ove| 00000550 72 20 74 68 69 73 20 6c 69 6d 69 74 2e 0d 0d 42 |r this limit...B| 00000560 6f 74 68 20 72 6f 75 74 69 6e 65 73 20 77 69 6c |oth routines wil| 00000570 6c 20 77 6f 72 6b 20 77 69 74 68 20 61 6e 79 20 |l work with any | 00000580 76 65 72 73 69 6f 6e 20 6f 66 20 42 41 53 49 43 |version of BASIC| 00000590 20 61 6e 64 20 6f 6e 20 74 68 65 20 42 42 43 20 | and on the BBC | 000005a0 42 2c 20 42 2b 2c 20 4d 41 53 54 45 52 20 61 6e |B, B+, MASTER an| 000005b0 64 20 54 55 52 42 4f 2e 20 20 45 69 74 68 65 72 |d TURBO. Either| 000005c0 20 44 46 53 20 6f 72 20 41 44 46 53 20 63 61 6e | DFS or ADFS can| 000005d0 20 62 65 20 74 68 65 20 72 65 73 69 64 65 6e 74 | be the resident| 000005e0 20 66 69 6c 69 6e 67 20 73 79 73 74 65 6d 2e 20 | filing system. | 000005f0 20 4f 6e 6c 79 20 41 43 4f 52 4e 20 61 70 70 72 | Only ACORN appr| 00000600 6f 76 65 64 20 4f 53 20 63 61 6c 6c 73 20 68 61 |oved OS calls ha| 00000610 76 65 20 62 65 65 6e 20 75 73 65 64 20 73 6f 20 |ve been used so | 00000620 74 68 65 20 72 6f 75 74 69 6e 65 73 20 73 68 6f |the routines sho| 00000630 75 6c 64 20 61 6c 73 6f 20 77 6f 72 6b 20 6f 6e |uld also work on| 00000640 20 61 6e 20 45 43 4f 4e 45 54 20 73 79 73 74 65 | an ECONET syste| 00000650 6d 2e 0d 0d 41 73 73 65 6d 62 6c 65 64 20 52 4f |m...Assembled RO| 00000660 4d 73 20 77 69 6c 6c 20 77 6f 72 6b 20 6f 6e 20 |Ms will work on | 00000670 61 6c 6c 20 6d 61 63 68 69 6e 65 73 20 62 75 74 |all machines but| 00000680 20 6e 6f 74 20 77 69 74 68 20 61 20 73 65 63 6f | not with a seco| 00000690 6e 64 20 70 72 6f 63 65 73 73 6f 72 20 61 63 74 |nd processor act| 000006a0 69 76 65 2c 20 61 73 20 74 68 65 20 63 6f 64 65 |ive, as the code| 000006b0 20 69 73 20 61 6c 77 61 79 73 20 64 6f 77 6e 6c | is always downl| 000006c0 6f 61 64 65 64 20 69 6e 74 6f 20 74 68 65 20 49 |oaded into the I| 000006d0 2f 4f 20 52 41 4d 20 61 72 65 61 2e 0d 0d 0d 0d |/O RAM area.....| 000006e0 44 65 74 61 69 6c 65 64 20 6e 6f 74 65 73 20 66 |Detailed notes f| 000006f0 6f 72 20 62 6f 74 68 20 70 72 6f 67 72 61 6d 73 |or both programs| 00000700 20 61 72 65 20 61 73 20 62 65 6c 6f 77 3a 0d 0d | are as below:..| 00000710 0d 31 30 20 2d 20 32 39 30 0d 54 68 65 73 65 20 |.10 - 290.These | 00000720 6c 69 6e 65 73 20 61 72 65 20 74 68 65 20 69 6e |lines are the in| 00000730 69 74 69 61 6c 69 73 69 6e 67 2e 20 20 4e 6f 74 |itialising. Not| 00000740 65 20 74 68 61 74 20 27 65 6f 72 27 20 69 73 20 |e that 'eor' is | 00000750 73 65 74 20 74 6f 20 61 20 72 61 6e 64 6f 6d 20 |set to a random | 00000760 6e 75 6d 62 65 72 20 61 74 20 31 30 30 20 73 6f |number at 100 so| 00000770 20 74 68 61 74 20 74 68 65 72 65 20 69 73 20 6e | that there is n| 00000780 6f 20 77 61 79 20 6f 66 20 6b 6e 6f 77 69 6e 67 |o way of knowing| 00000790 20 74 68 65 20 65 6e 63 6f 64 69 6e 67 20 76 61 | the encoding va| 000007a0 6c 75 65 2e 0d 0d 0d 33 31 30 20 2d 20 33 37 30 |lue....310 - 370| 000007b0 0d 50 72 69 6e 74 73 20 74 68 65 20 69 6e 73 74 |.Prints the inst| 000007c0 72 75 63 74 69 6f 6e 73 20 66 72 6f 6d 20 44 41 |ructions from DA| 000007d0 54 41 0d 0d 0d 33 38 30 20 2d 20 34 34 30 0d 47 |TA...380 - 440.G| 000007e0 65 74 73 20 74 68 65 20 73 6f 75 72 63 65 20 66 |ets the source f| 000007f0 69 6c 65 6e 61 6d 65 20 66 72 6f 6d 20 74 68 65 |ilename from the| 00000800 20 75 73 65 72 20 61 6e 64 20 6f 70 65 6e 73 20 | user and opens | 00000810 74 68 65 20 73 6f 75 72 63 65 20 66 69 6c 65 2e |the source file.| 00000820 20 20 49 66 20 74 68 65 20 66 69 6c 65 20 64 6f | If the file do| 00000830 65 73 6e 27 74 20 65 78 69 73 74 20 74 68 65 20 |esn't exist the | 00000840 65 72 72 6f 72 20 69 73 20 72 65 70 6f 72 74 65 |error is reporte| 00000850 64 2e 0d 0d 49 6e 20 74 68 65 20 42 41 53 49 43 |d...In the BASIC| 00000860 20 76 65 72 73 69 6f 6e 2c 20 74 68 65 20 66 69 | version, the fi| 00000870 72 73 74 20 62 79 74 65 20 6f 66 20 74 68 65 20 |rst byte of the | 00000880 66 69 6c 65 20 69 73 20 66 65 74 63 68 65 64 20 |file is fetched | 00000890 61 6e 64 20 34 33 30 20 63 68 65 63 6b 73 20 74 |and 430 checks t| 000008a0 6f 20 73 65 65 20 74 68 61 74 20 69 74 20 69 73 |o see that it is| 000008b0 20 26 30 44 20 28 74 68 65 20 73 74 61 72 74 20 | &0D (the start | 000008c0 62 79 74 65 20 66 6f 72 20 61 6c 6c 20 42 41 53 |byte for all BAS| 000008d0 49 43 20 70 72 6f 67 72 61 6d 73 29 2e 0d 0d 49 |IC programs)...I| 000008e0 6e 20 74 68 65 20 6d 61 63 68 69 6e 65 20 63 6f |n the machine co| 000008f0 64 65 20 76 65 72 73 69 6f 6e 2c 20 34 33 30 20 |de version, 430 | 00000900 66 69 6e 64 73 20 74 68 65 20 6c 6f 61 64 20 61 |finds the load a| 00000910 6e 64 20 65 78 65 63 75 74 69 6f 6e 20 61 64 64 |nd execution add| 00000920 72 65 73 73 65 73 2e 20 0d 0d 0d 34 35 30 20 2d |resses. ...450 -| 00000930 20 34 38 30 0d 47 65 74 73 20 74 68 65 20 52 4f | 480.Gets the RO| 00000940 4d 20 74 69 74 6c 65 20 66 72 6f 6d 20 74 68 65 |M title from the| 00000950 20 75 73 65 72 2e 20 54 68 65 20 6c 65 6e 67 74 | user. The lengt| 00000960 68 20 69 73 20 6c 69 6d 69 74 65 64 20 74 6f 20 |h is limited to | 00000970 73 6c 69 67 68 74 6c 79 20 6c 65 73 73 20 74 68 |slightly less th| 00000980 61 6e 20 6f 6e 65 20 6c 69 6e 65 20 28 34 30 20 |an one line (40 | 00000990 63 6f 6c 75 6d 6e 29 2e 0d 0d 0d 34 39 30 20 2d |column)....490 -| 000009a0 20 35 33 30 0d 47 65 74 73 20 74 68 65 20 64 65 | 530.Gets the de| 000009b0 73 74 69 6e 61 74 69 6f 6e 20 66 69 6c 65 6e 61 |stination filena| 000009c0 6d 65 20 66 72 6f 6d 20 74 68 65 20 75 73 65 72 |me from the user| 000009d0 20 61 6e 64 20 61 74 74 65 6d 70 74 73 20 74 6f | and attempts to| 000009e0 20 4f 50 45 4e 55 50 20 74 68 65 20 66 69 6c 65 | OPENUP the file| 000009f0 2e 20 20 49 66 20 73 75 63 63 65 73 73 66 75 6c |. If successful| 00000a00 20 74 68 65 6e 20 74 68 65 20 66 69 6c 65 20 61 | then the file a| 00000a10 6c 72 65 61 64 79 20 65 78 69 73 74 73 20 61 6e |lready exists an| 00000a20 64 20 61 6e 20 65 72 72 6f 72 20 69 73 20 66 6f |d an error is fo| 00000a30 72 63 65 64 2e 0d 0d 0d 35 34 30 20 2d 20 38 30 |rced....540 - 80| 00000a40 30 0d 54 68 65 73 65 20 73 65 74 20 75 70 20 74 |0.These set up t| 00000a50 68 65 20 65 73 65 6e 74 69 61 6c 20 63 68 61 72 |he esential char| 00000a60 61 63 74 65 72 73 20 66 6f 72 20 61 20 73 69 64 |acters for a sid| 00000a70 65 77 61 79 73 20 52 4f 4d 20 61 73 20 73 70 65 |eways ROM as spe| 00000a80 63 69 66 69 65 64 20 62 79 20 41 43 4f 52 4e 2e |cified by ACORN.| 00000a90 0d 0d 0d 38 31 30 20 2d 20 31 32 34 30 0d 49 64 |...810 - 1240.Id| 00000aa0 65 6e 74 69 66 79 20 74 68 61 74 20 61 20 52 4f |entify that a RO| 00000ab0 4d 20 73 65 72 76 69 63 65 20 63 61 6c 6c 20 68 |M service call h| 00000ac0 61 73 20 62 65 65 6e 20 6d 61 64 65 2e 20 20 54 |as been made. T| 00000ad0 68 65 20 73 65 72 76 69 63 65 20 63 61 6c 6c 73 |he service calls| 00000ae0 20 61 63 63 65 70 74 65 64 20 62 79 20 74 68 69 | accepted by thi| 00000af0 73 20 52 4f 4d 20 61 72 65 3a 0d 0d 20 20 33 20 |s ROM are:.. 3 | 00000b00 2d 20 49 6e 69 74 69 61 6c 69 73 65 20 28 50 72 |- Initialise (Pr| 00000b10 69 6e 74 20 74 69 74 6c 65 29 0d 20 20 34 20 2d |int title). 4 -| 00000b20 20 55 6e 6b 6e 6f 77 6e 20 63 6f 6d 6d 61 6e 64 | Unknown command| 00000b30 0d 20 20 39 20 2d 20 48 65 6c 70 20 72 65 71 75 |. 9 - Help requ| 00000b40 65 73 74 20 20 0d 0d 0d 31 32 35 30 20 2d 20 31 |est ...1250 - 1| 00000b50 34 36 30 20 0d 43 6f 6d 70 61 72 65 20 74 68 65 |460 .Compare the| 00000b60 20 63 6f 6d 6d 61 6e 64 20 6c 69 6e 65 20 77 69 | command line wi| 00000b70 74 68 20 74 68 65 20 52 4f 4d 20 74 69 74 6c 65 |th the ROM title| 00000b80 2e 0d 0d 0d 31 34 37 30 20 2d 20 31 37 35 30 0d |....1470 - 1750.| 00000b90 44 6f 77 6e 6c 6f 61 64 20 74 68 65 20 70 72 6f |Download the pro| 00000ba0 67 72 61 6d 20 74 6f 20 75 73 65 72 20 52 41 4d |gram to user RAM| 00000bb0 2e 0d 0d 49 6e 20 74 68 65 20 76 65 72 73 69 6f |...In the versio| 00000bc0 6e 20 66 6f 72 20 42 41 53 49 43 2c 20 61 20 63 |n for BASIC, a c| 00000bd0 61 6c 6c 20 69 73 20 6d 61 64 65 20 74 6f 20 66 |all is made to f| 00000be0 69 6e 64 20 6f 75 74 20 77 68 65 72 65 20 50 41 |ind out where PA| 00000bf0 47 45 20 69 73 20 28 31 35 38 30 29 2e 0d 0d 54 |GE is (1580)...T| 00000c00 68 65 20 6d 61 63 68 69 6e 65 20 63 6f 64 65 20 |he machine code | 00000c10 76 65 72 73 69 6f 6e 20 73 69 6d 70 6c 79 20 64 |version simply d| 00000c20 6f 77 6e 6c 6f 61 64 73 20 74 6f 20 74 68 65 20 |ownloads to the | 00000c30 6c 6f 61 64 20 61 64 64 72 65 73 73 20 6f 66 20 |load address of | 00000c40 74 68 65 20 73 6f 75 72 63 65 20 70 72 6f 67 72 |the source progr| 00000c50 61 6d 2e 20 0d 0d 0d 31 37 36 30 20 2d 20 32 30 |am. ...1760 - 20| 00000c60 30 30 0d 49 6e 20 74 68 65 20 42 41 53 49 43 20 |00.In the BASIC | 00000c70 76 65 72 73 69 6f 6e 2c 20 74 68 65 20 69 6e 70 |version, the inp| 00000c80 75 74 20 62 75 66 66 65 72 20 69 73 20 66 6c 75 |ut buffer is flu| 00000c90 73 68 65 64 20 28 31 37 36 30 29 20 61 6e 64 20 |shed (1760) and | 00000ca0 74 68 65 20 63 68 61 72 61 63 74 65 72 73 20 72 |the characters r| 00000cb0 65 70 72 65 73 65 6e 74 69 6e 67 20 4f 4c 44 2c |epresenting OLD,| 00000cc0 52 55 4e 20 61 6e 64 20 56 44 55 36 20 61 72 65 |RUN and VDU6 are| 00000cd0 20 70 75 74 20 69 6e 74 6f 20 74 68 65 20 69 6e | put into the in| 00000ce0 70 75 74 20 62 75 66 66 65 72 2e 20 20 41 74 20 |put buffer. At | 00000cf0 31 39 34 30 20 74 68 65 20 52 4f 4d 20 6e 75 6d |1940 the ROM num| 00000d00 62 65 72 20 63 6f 6e 74 61 69 6e 69 6e 67 20 42 |ber containing B| 00000d10 41 53 49 43 20 69 73 20 66 6f 75 6e 64 2e 20 20 |ASIC is found. | 00000d20 56 44 55 32 31 20 69 73 20 73 65 74 20 61 74 20 |VDU21 is set at | 00000d30 31 39 35 30 20 61 6e 64 20 61 20 6c 61 6e 67 75 |1950 and a langu| 00000d40 61 67 65 20 65 6e 74 72 79 20 63 61 6c 6c 20 69 |age entry call i| 00000d50 73 20 6d 61 64 65 20 61 74 20 31 39 39 30 2e 0d |s made at 1990..| 00000d60 0d 49 6e 20 74 68 65 20 6d 61 63 68 69 6e 65 20 |.In the machine | 00000d70 63 6f 64 65 20 76 65 72 73 69 6f 6e 2c 20 61 20 |code version, a | 00000d80 63 61 6c 6c 20 69 73 20 6d 61 64 65 20 74 6f 20 |call is made to | 00000d90 74 68 65 20 65 78 65 63 75 74 69 6f 6e 20 61 64 |the execution ad| 00000da0 64 72 65 73 73 20 61 74 20 31 37 36 30 2e 20 20 |dress at 1760. | 00000db0 54 68 65 20 72 65 6d 61 69 6e 69 6e 67 20 63 6f |The remaining co| 00000dc0 64 65 20 69 73 20 74 68 65 20 72 65 74 75 72 6e |de is the return| 00000dd0 20 72 6f 75 74 69 6e 65 2e 20 20 54 68 65 20 63 | routine. The c| 00000de0 61 6c 6c 20 69 73 20 6d 61 72 6b 65 64 20 61 73 |all is marked as| 00000df0 20 61 63 6b 6e 6f 77 6c 65 64 67 65 64 20 62 79 | acknowledged by| 00000e00 20 73 65 74 74 69 6e 67 20 41 20 74 6f 20 7a 65 | setting A to ze| 00000e10 72 6f 20 61 74 20 31 38 30 30 2e 0d 0d 0d 32 30 |ro at 1800....20| 00000e20 31 30 20 2d 20 32 31 30 30 0d 4c 6f 61 64 73 20 |10 - 2100.Loads | 00000e30 74 68 65 20 73 6f 75 72 63 65 20 66 69 6c 65 20 |the source file | 00000e40 74 6f 20 27 70 72 6f 67 27 20 74 68 65 6e 20 2a |to 'prog' then *| 00000e50 53 41 56 45 53 20 74 68 65 20 6e 65 77 20 66 69 |SAVES the new fi| 00000e60 6c 65 20 61 6e 64 20 70 72 69 6e 74 73 20 74 68 |le and prints th| 00000e70 65 20 52 4f 4d 20 73 69 7a 65 2e 20 20 4e 6f 74 |e ROM size. Not| 00000e80 65 20 74 68 61 74 20 69 74 20 69 73 20 6f 6e 6c |e that it is onl| 00000e90 79 20 6e 65 63 65 73 73 61 72 79 20 74 6f 20 65 |y necessary to e| 00000ea0 6e 74 65 72 20 50 52 4f 43 6c 6f 61 64 20 6f 6e |nter PROCload on| 00000eb0 20 74 68 65 20 66 69 72 73 74 20 70 61 73 73 20 | the first pass | 00000ec0 6f 66 20 74 68 65 20 61 73 73 65 6d 62 6c 65 72 |of the assembler| 00000ed0 2c 20 61 6e 64 20 74 68 65 20 63 6c 6f 73 69 6e |, and the closin| 00000ee0 67 20 6d 65 73 73 61 67 65 20 69 73 20 61 20 66 |g message is a f| 00000ef0 6f 72 63 65 64 20 65 72 72 6f 72 20 74 6f 20 72 |orced error to r| 00000f00 65 74 75 72 6e 20 79 6f 75 20 74 6f 20 74 68 65 |eturn you to the| 00000f10 20 69 6e 73 74 72 75 63 74 69 6f 6e 73 2e 0d 0d | instructions...| 00000f20 0d 50 52 4f 43 6c 6f 61 64 0d 47 65 74 73 20 62 |.PROCload.Gets b| 00000f30 79 74 65 73 20 66 72 6f 6d 20 74 68 65 20 73 6f |ytes from the so| 00000f40 75 72 63 65 20 66 69 6c 65 2c 20 65 6e 63 6f 64 |urce file, encod| 00000f50 65 73 20 74 68 65 6d 20 62 79 20 65 78 63 6c 75 |es them by exclu| 00000f60 73 69 76 65 2d 6f 72 20 77 69 74 68 20 74 68 65 |sive-or with the| 00000f70 20 76 61 6c 75 65 20 6f 66 20 45 25 20 74 68 65 | value of E% the| 00000f80 6e 20 73 74 6f 72 65 73 20 74 68 65 6d 20 69 6e |n stores them in| 00000f90 20 6d 65 6d 6f 72 79 20 61 62 6f 76 65 20 74 68 | memory above th| 00000fa0 65 20 61 6c 72 65 61 64 79 20 67 65 6e 65 72 61 |e already genera| 00000fb0 74 65 64 20 68 65 61 64 65 72 2e 20 20 45 25 20 |ted header. E% | 00000fc0 69 73 20 69 6e 63 72 65 6d 65 6e 74 65 64 20 61 |is incremented a| 00000fd0 66 74 65 72 20 65 61 63 68 20 62 79 74 65 20 69 |fter each byte i| 00000fe0 73 20 65 6e 63 6f 64 65 64 2e 20 20 54 68 69 73 |s encoded. This| 00000ff0 20 6d 61 6b 65 73 20 74 68 65 20 65 6e 63 6f 64 | makes the encod| 00001000 69 6e 67 20 6c 65 73 73 20 6c 69 6b 65 6c 79 20 |ing less likely | 00001010 74 6f 20 73 68 6f 77 20 61 6e 79 20 64 65 74 65 |to show any dete| 00001020 63 74 61 62 6c 65 20 70 61 74 74 65 72 6e 2e 20 |ctable pattern. | 00001030 0d 0d 0d 50 52 4f 43 65 72 72 6f 72 0d 41 20 73 |...PROCerror.A s| 00001040 74 61 6e 64 61 72 64 20 65 72 72 6f 72 20 68 61 |tandard error ha| 00001050 6e 64 6c 65 72 2e 20 20 50 72 69 6e 74 20 6c 69 |ndler. Print li| 00001060 6e 65 73 20 65 6e 64 69 6e 67 20 69 6e 20 27 21 |nes ending in '!| 00001070 27 20 61 72 65 20 64 69 72 65 63 74 65 64 20 68 |' are directed h| 00001080 65 72 65 20 28 65 72 72 6f 72 20 32 36 29 20 61 |ere (error 26) a| 00001090 6c 6f 6e 67 20 77 69 74 68 20 61 6e 79 20 65 72 |long with any er| 000010a0 72 6f 72 73 20 70 72 6f 64 75 63 65 64 20 62 79 |rors produced by| 000010b0 20 74 68 65 20 44 46 53 2e 20 20 54 68 69 73 20 | the DFS. This | 000010c0 65 6e 73 75 72 65 73 20 74 68 61 74 20 61 6c 6c |ensures that all| 000010d0 20 6c 6f 6f 73 65 20 65 6e 64 73 20 61 72 65 20 | loose ends are | 000010e0 74 61 6b 65 6e 20 63 61 72 65 20 6f 66 20 61 6e |taken care of an| 000010f0 64 20 74 68 65 20 75 73 65 72 20 69 73 20 61 6c |d the user is al| 00001100 77 61 79 73 20 72 65 74 75 72 6e 65 64 20 74 6f |ways returned to| 00001110 20 74 68 65 20 69 6e 73 74 72 75 63 74 69 6f 6e | the instruction| 00001120 73 2e 0d 0d 0d 50 52 4f 43 63 6c 65 61 72 0d 43 |s....PROCclear.C| 00001130 6c 65 61 72 73 20 74 68 65 20 61 72 65 61 20 6f |lears the area o| 00001140 66 20 6d 65 6d 6f 72 79 20 74 6f 20 62 65 20 75 |f memory to be u| 00001150 73 65 64 20 66 6f 72 20 74 68 65 20 52 4f 4d 2e |sed for the ROM.| 00001160 20 20 26 46 46 20 69 73 20 75 73 65 64 20 61 73 | &FF is used as| 00001170 20 74 68 69 73 20 69 73 20 74 68 65 20 6d 6f 73 | this is the mos| 00001180 74 20 65 66 66 69 63 69 65 6e 74 20 76 61 6c 75 |t efficient valu| 00001190 65 20 74 6f 20 68 61 76 65 20 61 73 20 62 6c 61 |e to have as bla| 000011a0 6e 6b 20 63 6f 64 65 2e 20 20 4d 6f 73 74 20 45 |nk code. Most E| 000011b0 50 52 4f 4d 20 70 72 6f 67 72 61 6d 6d 65 72 73 |PROM programmers| 000011c0 20 69 67 6e 6f 72 65 20 74 68 69 73 20 76 61 6c | ignore this val| 000011d0 75 65 2c 20 73 6f 20 70 72 6f 67 72 61 6d 6d 69 |ue, so programmi| 000011e0 6e 67 20 66 61 73 74 65 72 2e 20 20 41 20 73 69 |ng faster. A si| 000011f0 6d 70 6c 65 20 70 69 65 63 65 20 6f 66 20 63 6f |mple piece of co| 00001200 64 65 20 69 73 20 61 73 73 65 6d 62 6c 65 64 20 |de is assembled | 00001210 61 6e 64 20 43 41 4c 4c 65 64 20 74 6f 20 64 6f |and CALLed to do| 00001220 20 74 68 65 20 63 6c 65 61 72 69 6e 67 20 61 73 | the clearing as| 00001230 20 74 68 69 73 20 69 73 20 66 61 73 74 65 72 20 | this is faster | 00001240 74 68 61 6e 20 75 73 69 6e 67 20 61 20 46 4f 52 |than using a FOR| 00001250 20 4e 45 58 54 20 6c 6f 6f 70 20 69 6e 20 42 41 | NEXT loop in BA| 00001260 53 49 43 2e |SIC.| 00001264