Home » Personal collection » Acorn ADFS disks » Electron_User_Group » EUG_37.ADF » P/+AB1
P/+AB1
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_37.ADF |
Filename: | P/+AB1 |
Read OK: | ✔ |
File size: | 1586 bytes |
Load address: | 2B204556 |
Exec address: | D314241 |
Duplicates
There is 1 duplicate copy of this file in the archive:
- Personal collection » Acorn ADFS disks » Electron_User_Group » EUG_37.ADF » P/+AB1
- Personal collection » Acorn hard disk » zipped_disks » elk03 » eug37/P/+AB1
File contents
************************************************************************* Mark Bellis, 118, The Lawns, Rolleston-on-Dove, Burton-on-Trent, Staffs, DE13 9DE. Second submission to EUG, March 1998 ************************************************************************* Greetings! I note with interest Ron Goad's request for a database for addresses and phone numbers. This database system, which I began last December, can handle international phone numbers, and 522 addreses on a Master 128! Unfortunately it's not finished yet, but with me having had very little time in the last two months, I thought I would submit what I'd done. Even using shadow RAM for the screen on a Master 128 or BBC B+, you can only usually use about 20K for strings by the time you have a program to manipulate them. This program uses main RAM, shadow RAM and all four banks of sideways RAM, allowing almost 96K for strings. For demo purposes I have divided the RAM into 522 strings of 188 characters in 6 banks of 87. The idea is that each string is a database record, and, for sorting purposes, the records could be sorted by a sequence of offsets within the string record. My address, including phone number, takes 104 bytes, so perhaps 188 bytes is enough for the longest address. I don't know how long your Christmas card list is, but I think 522 addresses should be adequate for anyone's address book. Two functions access the strings: FNputs(A$,I%) puts the 188-character string A$ into the string indexed by I%, a number from 0 to 521. To increase the integrity of the system, the machine code routine saves A$ into pigeon hole I%, but also reads it back, returning it as the result of the function. Therefore to verify a correct string storage: xyz IF FNputs(A$,I%) <> A$ THEN PROCerror("Bad string push") would report a storage error. FNgets(I%) returns the string in pigeon hole I%, and is called by: xyz A$ = FNgets(I%) Two other functions load and save the banks of strings as six files of 16K each. You may choose the filenames - I would suggest ABBANK0 to ABBANK5 for an address book. In order to use sideways RAM, I have not used *SRDATA 4,5,6, and 7, but rather loaded a 16-byte header into each of the 4 banks, so that they look "legal" to the MOS. The headers would still have been there if I had used *SRDATA, as explained by paragaph 2 on page G7-2 of the Master Reference Manual, so this removed any advantage of using *SRDATA. Other reasons for not using *SRDATA are as follows: I considered it easier and quicker to page in RAM banks by changing ?&FE30 (the ROM select register), rather than using *SRREAD and *SRWRITE, which have to page in the DFS ROM. Those two commands would also have used up more RAM with parameter blocks, and as it is, the PUTS and GETS routines use only one page of RAM at &900. Page &A is used as the string buffer. Also, the memory conveniently divides into 6 equal banks, with the same amount of memory (&3FF0 or 65472 bytes) used in each. This would have required multiplication of &3FEF in assembler every time a sideways RAM bank was accessed, in order to move to another abolutely-addressed bank. No multiplication is required if the banks are paged in and out, even though all bank accesses require the multiplication of 188 by (I% MOD 87) to calculate the address within the bank. For convenience, the banks are loaded and saved as 16K blocks (using &4000, rather than &3FEF as the length), because it is more convenient to keep the ROM header attached to the data, rather than explicitly writing it each time. HIMEM is set to &3C00, but in theory only two strings, A$ and B$, will be required by a database program, since that is all that is needed for sorting purposes. Even at 96K, you can still fit six sets of data on a large format ADFS disk. I have decided not to save just the amount of data in memory, because if the data expands, large gaps will be created on the disk when the data is next saved. Since the system uses absolute pigeon-holes, no string headers are stored, as all the length and address information is inherent to the program. The maximum length of a conventional string is 238 characters, according to the entry for INPUT on page N5-3 of the Master Reference Manual, so this will fit in page &A quite easily, if the data format were changed to use 238-character strings (408 of them, 68 per bank). The calculated absolute string address within the bank is stored at &70-71, and these are the only zero-page locations used. I% MOD 87 is stored at &A00-1, and the bank number (top bit set for PUTS, clear for GETS) is stored in &A02. $&A03 is the string buffer, terminated by CHR$13. With a 238 character string, this will leave 14 free bytes in page &A. Summary of the files: ABTEXT VIEW This file. Description of STRING program system. ?BLANK data Empty ROM header, with pun title to satisfy Gus' short filename request ;-). ABOOK1 BASIC IV Demo of string system. Loads ?BLANK into each of the four SRAM banks. Loads ?ABOOK into page &9. Saves up to 5 banks of 16K - user-defined filenames. ?ABOOK 6502 M/C Put, Get and absolute string address calculation. The sort routine will probably be in a page of machine code, and the printing routine in BASIC - eventually! Please feel free to suggest additional features etc...
00000000 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a |****************| * 00000040 2a 2a 2a 2a 2a 2a 2a 2a 2a 0d 4d 61 72 6b 20 42 |*********.Mark B| 00000050 65 6c 6c 69 73 2c 20 20 31 31 38 2c 20 54 68 65 |ellis, 118, The| 00000060 20 4c 61 77 6e 73 2c 20 20 52 6f 6c 6c 65 73 74 | Lawns, Rollest| 00000070 6f 6e 2d 6f 6e 2d 44 6f 76 65 2c 20 20 42 75 72 |on-on-Dove, Bur| 00000080 74 6f 6e 2d 6f 6e 2d 54 72 65 6e 74 2c 0d 53 74 |ton-on-Trent,.St| 00000090 61 66 66 73 2c 20 20 44 45 31 33 20 39 44 45 2e |affs, DE13 9DE.| 000000a0 0d 53 65 63 6f 6e 64 20 73 75 62 6d 69 73 73 69 |.Second submissi| 000000b0 6f 6e 20 74 6f 20 45 55 47 2c 20 4d 61 72 63 68 |on to EUG, March| 000000c0 20 31 39 39 38 0d 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a | 1998.**********| 000000d0 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a |****************| * 00000100 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 0d |***************.| 00000110 0d 47 72 65 65 74 69 6e 67 73 21 0d 0d 49 20 6e |.Greetings!..I n| 00000120 6f 74 65 20 77 69 74 68 20 69 6e 74 65 72 65 73 |ote with interes| 00000130 74 20 52 6f 6e 20 47 6f 61 64 27 73 20 72 65 71 |t Ron Goad's req| 00000140 75 65 73 74 20 66 6f 72 20 61 20 64 61 74 61 62 |uest for a datab| 00000150 61 73 65 20 66 6f 72 20 61 64 64 72 65 73 73 65 |ase for addresse| 00000160 73 20 61 6e 64 0d 70 68 6f 6e 65 20 6e 75 6d 62 |s and.phone numb| 00000170 65 72 73 2e 20 20 54 68 69 73 20 64 61 74 61 62 |ers. This datab| 00000180 61 73 65 20 73 79 73 74 65 6d 2c 20 77 68 69 63 |ase system, whic| 00000190 68 20 49 20 62 65 67 61 6e 20 6c 61 73 74 20 44 |h I began last D| 000001a0 65 63 65 6d 62 65 72 2c 20 63 61 6e 0d 68 61 6e |ecember, can.han| 000001b0 64 6c 65 20 69 6e 74 65 72 6e 61 74 69 6f 6e 61 |dle internationa| 000001c0 6c 20 70 68 6f 6e 65 20 6e 75 6d 62 65 72 73 2c |l phone numbers,| 000001d0 20 61 6e 64 20 35 32 32 20 61 64 64 72 65 73 65 | and 522 addrese| 000001e0 73 20 6f 6e 20 61 20 4d 61 73 74 65 72 20 31 32 |s on a Master 12| 000001f0 38 21 0d 0d 55 6e 66 6f 72 74 75 6e 61 74 65 6c |8!..Unfortunatel| 00000200 79 20 69 74 27 73 20 6e 6f 74 20 66 69 6e 69 73 |y it's not finis| 00000210 68 65 64 20 79 65 74 2c 20 62 75 74 20 77 69 74 |hed yet, but wit| 00000220 68 20 6d 65 20 68 61 76 69 6e 67 20 68 61 64 20 |h me having had | 00000230 76 65 72 79 20 6c 69 74 74 6c 65 0d 74 69 6d 65 |very little.time| 00000240 20 69 6e 20 74 68 65 20 6c 61 73 74 20 74 77 6f | in the last two| 00000250 20 6d 6f 6e 74 68 73 2c 20 49 20 74 68 6f 75 67 | months, I thoug| 00000260 68 74 20 49 20 77 6f 75 6c 64 20 73 75 62 6d 69 |ht I would submi| 00000270 74 20 77 68 61 74 20 49 27 64 20 64 6f 6e 65 2e |t what I'd done.| 00000280 0d 0d 45 76 65 6e 20 75 73 69 6e 67 20 73 68 61 |..Even using sha| 00000290 64 6f 77 20 52 41 4d 20 66 6f 72 20 74 68 65 20 |dow RAM for the | 000002a0 73 63 72 65 65 6e 20 6f 6e 20 61 20 4d 61 73 74 |screen on a Mast| 000002b0 65 72 20 31 32 38 20 6f 72 20 42 42 43 20 42 2b |er 128 or BBC B+| 000002c0 2c 20 79 6f 75 20 63 61 6e 0d 6f 6e 6c 79 20 75 |, you can.only u| 000002d0 73 75 61 6c 6c 79 20 75 73 65 20 61 62 6f 75 74 |sually use about| 000002e0 20 32 30 4b 20 66 6f 72 20 73 74 72 69 6e 67 73 | 20K for strings| 000002f0 20 62 79 20 74 68 65 20 74 69 6d 65 20 79 6f 75 | by the time you| 00000300 20 68 61 76 65 20 61 20 70 72 6f 67 72 61 6d 0d | have a program.| 00000310 74 6f 20 6d 61 6e 69 70 75 6c 61 74 65 20 74 68 |to manipulate th| 00000320 65 6d 2e 0d 0d 54 68 69 73 20 70 72 6f 67 72 61 |em...This progra| 00000330 6d 20 75 73 65 73 20 6d 61 69 6e 20 52 41 4d 2c |m uses main RAM,| 00000340 20 73 68 61 64 6f 77 20 52 41 4d 20 61 6e 64 20 | shadow RAM and | 00000350 61 6c 6c 20 66 6f 75 72 20 62 61 6e 6b 73 20 6f |all four banks o| 00000360 66 20 73 69 64 65 77 61 79 73 0d 52 41 4d 2c 20 |f sideways.RAM, | 00000370 61 6c 6c 6f 77 69 6e 67 20 61 6c 6d 6f 73 74 20 |allowing almost | 00000380 39 36 4b 20 66 6f 72 20 73 74 72 69 6e 67 73 2e |96K for strings.| 00000390 20 20 46 6f 72 20 64 65 6d 6f 20 70 75 72 70 6f | For demo purpo| 000003a0 73 65 73 20 49 20 68 61 76 65 20 64 69 76 69 64 |ses I have divid| 000003b0 65 64 0d 74 68 65 20 52 41 4d 20 69 6e 74 6f 20 |ed.the RAM into | 000003c0 35 32 32 20 73 74 72 69 6e 67 73 20 6f 66 20 31 |522 strings of 1| 000003d0 38 38 20 63 68 61 72 61 63 74 65 72 73 20 69 6e |88 characters in| 000003e0 20 36 20 62 61 6e 6b 73 20 6f 66 20 38 37 2e 0d | 6 banks of 87..| 000003f0 0d 54 68 65 20 69 64 65 61 20 69 73 20 74 68 61 |.The idea is tha| 00000400 74 20 65 61 63 68 20 73 74 72 69 6e 67 20 69 73 |t each string is| 00000410 20 61 20 64 61 74 61 62 61 73 65 20 72 65 63 6f | a database reco| 00000420 72 64 2c 20 61 6e 64 2c 20 66 6f 72 20 73 6f 72 |rd, and, for sor| 00000430 74 69 6e 67 0d 70 75 72 70 6f 73 65 73 2c 20 74 |ting.purposes, t| 00000440 68 65 20 72 65 63 6f 72 64 73 20 63 6f 75 6c 64 |he records could| 00000450 20 62 65 20 73 6f 72 74 65 64 20 62 79 20 61 20 | be sorted by a | 00000460 73 65 71 75 65 6e 63 65 20 6f 66 20 6f 66 66 73 |sequence of offs| 00000470 65 74 73 20 77 69 74 68 69 6e 0d 74 68 65 20 73 |ets within.the s| 00000480 74 72 69 6e 67 20 72 65 63 6f 72 64 2e 20 20 4d |tring record. M| 00000490 79 20 61 64 64 72 65 73 73 2c 20 69 6e 63 6c 75 |y address, inclu| 000004a0 64 69 6e 67 20 70 68 6f 6e 65 20 6e 75 6d 62 65 |ding phone numbe| 000004b0 72 2c 20 74 61 6b 65 73 20 31 30 34 20 62 79 74 |r, takes 104 byt| 000004c0 65 73 2c 0d 73 6f 20 70 65 72 68 61 70 73 20 31 |es,.so perhaps 1| 000004d0 38 38 20 62 79 74 65 73 20 69 73 20 65 6e 6f 75 |88 bytes is enou| 000004e0 67 68 20 66 6f 72 20 74 68 65 20 6c 6f 6e 67 65 |gh for the longe| 000004f0 73 74 20 61 64 64 72 65 73 73 2e 0d 0d 49 20 64 |st address...I d| 00000500 6f 6e 27 74 20 6b 6e 6f 77 20 68 6f 77 20 6c 6f |on't know how lo| 00000510 6e 67 20 79 6f 75 72 20 43 68 72 69 73 74 6d 61 |ng your Christma| 00000520 73 20 63 61 72 64 20 6c 69 73 74 20 69 73 2c 20 |s card list is, | 00000530 62 75 74 20 49 20 74 68 69 6e 6b 20 35 32 32 0d |but I think 522.| 00000540 61 64 64 72 65 73 73 65 73 20 73 68 6f 75 6c 64 |addresses should| 00000550 20 62 65 20 61 64 65 71 75 61 74 65 20 66 6f 72 | be adequate for| 00000560 20 61 6e 79 6f 6e 65 27 73 20 61 64 64 72 65 73 | anyone's addres| 00000570 73 20 62 6f 6f 6b 2e 0d 0d 54 77 6f 20 66 75 6e |s book...Two fun| 00000580 63 74 69 6f 6e 73 20 61 63 63 65 73 73 20 74 68 |ctions access th| 00000590 65 20 73 74 72 69 6e 67 73 3a 0d 0d 20 20 46 4e |e strings:.. FN| 000005a0 70 75 74 73 28 41 24 2c 49 25 29 20 20 70 75 74 |puts(A$,I%) put| 000005b0 73 20 74 68 65 20 31 38 38 2d 63 68 61 72 61 63 |s the 188-charac| 000005c0 74 65 72 20 73 74 72 69 6e 67 20 41 24 20 69 6e |ter string A$ in| 000005d0 74 6f 20 74 68 65 20 73 74 72 69 6e 67 20 69 6e |to the string in| 000005e0 64 65 78 65 64 0d 20 20 62 79 1a 20 49 25 2c 1a |dexed. by. I%,.| 000005f0 20 61 1a 20 6e 75 6d 62 65 72 1a 20 66 72 6f 6d | a. number. from| 00000600 1a 20 30 1a 20 74 6f 1a 20 35 32 31 2e 20 20 54 |. 0. to. 521. T| 00000610 6f 20 69 6e 63 72 65 61 73 65 20 74 68 65 20 69 |o increase the i| 00000620 6e 74 65 67 72 69 74 79 20 6f 66 20 74 68 65 0d |ntegrity of the.| 00000630 20 20 73 79 73 74 65 6d 2c 20 74 68 65 20 6d 61 | system, the ma| 00000640 63 68 69 6e 65 20 63 6f 64 65 20 72 6f 75 74 69 |chine code routi| 00000650 6e 65 20 73 61 76 65 73 20 41 24 20 69 6e 74 6f |ne saves A$ into| 00000660 20 70 69 67 65 6f 6e 20 68 6f 6c 65 20 49 25 2c | pigeon hole I%,| 00000670 20 62 75 74 20 61 6c 73 6f 0d 20 20 72 65 61 64 | but also. read| 00000680 73 20 69 74 20 62 61 63 6b 2c 20 72 65 74 75 72 |s it back, retur| 00000690 6e 69 6e 67 20 69 74 20 61 73 20 74 68 65 20 72 |ning it as the r| 000006a0 65 73 75 6c 74 20 6f 66 20 74 68 65 20 66 75 6e |esult of the fun| 000006b0 63 74 69 6f 6e 2e 20 20 54 68 65 72 65 66 6f 72 |ction. Therefor| 000006c0 65 0d 20 20 74 6f 20 76 65 72 69 66 79 20 61 20 |e. to verify a | 000006d0 63 6f 72 72 65 63 74 20 73 74 72 69 6e 67 20 73 |correct string s| 000006e0 74 6f 72 61 67 65 3a 0d 0d 20 20 78 79 7a 20 49 |torage:.. xyz I| 000006f0 46 20 46 4e 70 75 74 73 28 41 24 2c 49 25 29 20 |F FNputs(A$,I%) | 00000700 3c 3e 20 41 24 20 54 48 45 4e 20 50 52 4f 43 65 |<> A$ THEN PROCe| 00000710 72 72 6f 72 28 22 42 61 64 20 73 74 72 69 6e 67 |rror("Bad string| 00000720 20 70 75 73 68 22 29 0d 0d 20 20 77 6f 75 6c 64 | push").. would| 00000730 20 72 65 70 6f 72 74 20 61 20 73 74 6f 72 61 67 | report a storag| 00000740 65 20 65 72 72 6f 72 2e 0d 0d 20 20 46 4e 67 65 |e error... FNge| 00000750 74 73 28 49 25 29 20 72 65 74 75 72 6e 73 20 74 |ts(I%) returns t| 00000760 68 65 20 73 74 72 69 6e 67 20 69 6e 20 70 69 67 |he string in pig| 00000770 65 6f 6e 20 68 6f 6c 65 20 49 25 2c 20 61 6e 64 |eon hole I%, and| 00000780 20 69 73 20 63 61 6c 6c 65 64 20 62 79 3a 0d 0d | is called by:..| 00000790 20 20 78 79 7a 20 41 24 20 3d 20 46 4e 67 65 74 | xyz A$ = FNget| 000007a0 73 28 49 25 29 0d 0d 54 77 6f 20 6f 74 68 65 72 |s(I%)..Two other| 000007b0 20 66 75 6e 63 74 69 6f 6e 73 20 6c 6f 61 64 20 | functions load | 000007c0 61 6e 64 20 73 61 76 65 20 74 68 65 20 62 61 6e |and save the ban| 000007d0 6b 73 20 6f 66 20 73 74 72 69 6e 67 73 20 61 73 |ks of strings as| 000007e0 20 73 69 78 20 66 69 6c 65 73 20 6f 66 0d 31 36 | six files of.16| 000007f0 4b 20 65 61 63 68 2e 20 20 59 6f 75 20 6d 61 79 |K each. You may| 00000800 20 63 68 6f 6f 73 65 20 74 68 65 20 66 69 6c 65 | choose the file| 00000810 6e 61 6d 65 73 20 2d 20 49 20 77 6f 75 6c 64 20 |names - I would | 00000820 73 75 67 67 65 73 74 20 41 42 42 41 4e 4b 30 20 |suggest ABBANK0 | 00000830 74 6f 0d 41 42 42 41 4e 4b 35 20 66 6f 72 20 61 |to.ABBANK5 for a| 00000840 6e 20 61 64 64 72 65 73 73 20 62 6f 6f 6b 2e 0d |n address book..| 00000850 0d 49 6e 20 6f 72 64 65 72 20 74 6f 20 75 73 65 |.In order to use| 00000860 20 73 69 64 65 77 61 79 73 20 52 41 4d 2c 20 49 | sideways RAM, I| 00000870 20 68 61 76 65 20 6e 6f 74 20 75 73 65 64 20 2a | have not used *| 00000880 53 52 44 41 54 41 20 34 2c 35 2c 36 2c 20 61 6e |SRDATA 4,5,6, an| 00000890 64 20 37 2c 20 62 75 74 0d 72 61 74 68 65 72 20 |d 7, but.rather | 000008a0 6c 6f 61 64 65 64 20 61 20 31 36 2d 62 79 74 65 |loaded a 16-byte| 000008b0 20 68 65 61 64 65 72 20 69 6e 74 6f 20 65 61 63 | header into eac| 000008c0 68 20 6f 66 20 74 68 65 20 34 20 62 61 6e 6b 73 |h of the 4 banks| 000008d0 2c 20 73 6f 20 74 68 61 74 20 74 68 65 79 0d 6c |, so that they.l| 000008e0 6f 6f 6b 20 22 6c 65 67 61 6c 22 20 74 6f 20 74 |ook "legal" to t| 000008f0 68 65 20 4d 4f 53 2e 20 20 54 68 65 20 68 65 61 |he MOS. The hea| 00000900 64 65 72 73 20 77 6f 75 6c 64 20 73 74 69 6c 6c |ders would still| 00000910 20 68 61 76 65 20 62 65 65 6e 20 74 68 65 72 65 | have been there| 00000920 20 69 66 20 49 0d 68 61 64 20 75 73 65 64 20 2a | if I.had used *| 00000930 53 52 44 41 54 41 2c 20 61 73 20 65 78 70 6c 61 |SRDATA, as expla| 00000940 69 6e 65 64 20 62 79 20 70 61 72 61 67 61 70 68 |ined by paragaph| 00000950 20 32 20 6f 6e 20 70 61 67 65 20 47 37 2d 32 20 | 2 on page G7-2 | 00000960 6f 66 20 74 68 65 20 4d 61 73 74 65 72 0d 52 65 |of the Master.Re| 00000970 66 65 72 65 6e 63 65 20 4d 61 6e 75 61 6c 2c 20 |ference Manual, | 00000980 73 6f 20 74 68 69 73 20 72 65 6d 6f 76 65 64 20 |so this removed | 00000990 61 6e 79 20 61 64 76 61 6e 74 61 67 65 20 6f 66 |any advantage of| 000009a0 20 75 73 69 6e 67 20 2a 53 52 44 41 54 41 2e 0d | using *SRDATA..| 000009b0 0d 4f 74 68 65 72 20 72 65 61 73 6f 6e 73 20 66 |.Other reasons f| 000009c0 6f 72 20 6e 6f 74 20 75 73 69 6e 67 20 2a 53 52 |or not using *SR| 000009d0 44 41 54 41 20 61 72 65 20 61 73 20 66 6f 6c 6c |DATA are as foll| 000009e0 6f 77 73 3a 0d 0d 20 20 49 20 63 6f 6e 73 69 64 |ows:.. I consid| 000009f0 65 72 65 64 20 69 74 20 65 61 73 69 65 72 20 61 |ered it easier a| 00000a00 6e 64 20 71 75 69 63 6b 65 72 20 74 6f 20 70 61 |nd quicker to pa| 00000a10 67 65 20 69 6e 20 52 41 4d 20 62 61 6e 6b 73 20 |ge in RAM banks | 00000a20 62 79 20 63 68 61 6e 67 69 6e 67 0d 20 20 3f 26 |by changing. ?&| 00000a30 46 45 33 30 1a 20 28 74 68 65 1a 20 52 4f 4d 1a |FE30. (the. ROM.| 00000a40 20 73 65 6c 65 63 74 1a 20 72 65 67 69 73 74 65 | select. registe| 00000a50 72 29 2c 1a 20 72 61 74 68 65 72 1a 20 74 68 61 |r),. rather. tha| 00000a60 6e 1a 20 75 73 69 6e 67 1a 20 2a 53 52 52 45 41 |n. using. *SRREA| 00000a70 44 20 61 6e 64 0d 20 20 2a 53 52 57 52 49 54 45 |D and. *SRWRITE| 00000a80 2c 20 77 68 69 63 68 20 68 61 76 65 20 74 6f 20 |, which have to | 00000a90 70 61 67 65 20 69 6e 20 74 68 65 20 44 46 53 20 |page in the DFS | 00000aa0 52 4f 4d 2e 20 20 54 68 6f 73 65 20 74 77 6f 20 |ROM. Those two | 00000ab0 63 6f 6d 6d 61 6e 64 73 20 77 6f 75 6c 64 0d 20 |commands would. | 00000ac0 20 61 6c 73 6f 20 68 61 76 65 20 75 73 65 64 20 | also have used | 00000ad0 75 70 20 6d 6f 72 65 20 52 41 4d 20 77 69 74 68 |up more RAM with| 00000ae0 20 70 61 72 61 6d 65 74 65 72 20 62 6c 6f 63 6b | parameter block| 00000af0 73 2c 20 61 6e 64 20 61 73 20 69 74 20 69 73 2c |s, and as it is,| 00000b00 20 74 68 65 0d 20 20 50 55 54 53 20 61 6e 64 20 | the. PUTS and | 00000b10 47 45 54 53 20 72 6f 75 74 69 6e 65 73 20 75 73 |GETS routines us| 00000b20 65 20 6f 6e 6c 79 20 6f 6e 65 20 70 61 67 65 20 |e only one page | 00000b30 6f 66 20 52 41 4d 20 61 74 20 26 39 30 30 2e 20 |of RAM at &900. | 00000b40 20 50 61 67 65 20 26 41 20 69 73 0d 20 20 75 73 | Page &A is. us| 00000b50 65 64 20 61 73 20 74 68 65 20 73 74 72 69 6e 67 |ed as the string| 00000b60 20 62 75 66 66 65 72 2e 0d 0d 20 20 41 6c 73 6f | buffer... Also| 00000b70 2c 20 74 68 65 20 6d 65 6d 6f 72 79 20 63 6f 6e |, the memory con| 00000b80 76 65 6e 69 65 6e 74 6c 79 20 64 69 76 69 64 65 |veniently divide| 00000b90 73 20 69 6e 74 6f 20 36 20 65 71 75 61 6c 20 62 |s into 6 equal b| 00000ba0 61 6e 6b 73 2c 20 77 69 74 68 20 74 68 65 20 73 |anks, with the s| 00000bb0 61 6d 65 0d 20 20 61 6d 6f 75 6e 74 20 6f 66 20 |ame. amount of | 00000bc0 6d 65 6d 6f 72 79 20 28 26 33 46 46 30 20 6f 72 |memory (&3FF0 or| 00000bd0 20 36 35 34 37 32 20 62 79 74 65 73 29 20 75 73 | 65472 bytes) us| 00000be0 65 64 20 69 6e 20 65 61 63 68 2e 20 20 54 68 69 |ed in each. Thi| 00000bf0 73 20 77 6f 75 6c 64 20 68 61 76 65 0d 20 20 72 |s would have. r| 00000c00 65 71 75 69 72 65 64 20 6d 75 6c 74 69 70 6c 69 |equired multipli| 00000c10 63 61 74 69 6f 6e 20 6f 66 20 26 33 46 45 46 20 |cation of &3FEF | 00000c20 69 6e 20 61 73 73 65 6d 62 6c 65 72 20 65 76 65 |in assembler eve| 00000c30 72 79 20 74 69 6d 65 20 61 20 73 69 64 65 77 61 |ry time a sidewa| 00000c40 79 73 20 52 41 4d 0d 20 20 62 61 6e 6b 20 77 61 |ys RAM. bank wa| 00000c50 73 20 61 63 63 65 73 73 65 64 2c 20 69 6e 20 6f |s accessed, in o| 00000c60 72 64 65 72 20 74 6f 20 6d 6f 76 65 20 74 6f 20 |rder to move to | 00000c70 61 6e 6f 74 68 65 72 20 61 62 6f 6c 75 74 65 6c |another abolutel| 00000c80 79 2d 61 64 64 72 65 73 73 65 64 20 62 61 6e 6b |y-addressed bank| 00000c90 2e 0d 20 20 4e 6f 20 6d 75 6c 74 69 70 6c 69 63 |.. No multiplic| 00000ca0 61 74 69 6f 6e 20 69 73 20 72 65 71 75 69 72 65 |ation is require| 00000cb0 64 20 69 66 20 74 68 65 20 62 61 6e 6b 73 20 61 |d if the banks a| 00000cc0 72 65 20 70 61 67 65 64 20 69 6e 20 61 6e 64 20 |re paged in and | 00000cd0 6f 75 74 2c 20 65 76 65 6e 0d 20 20 74 68 6f 75 |out, even. thou| 00000ce0 67 68 20 61 6c 6c 20 62 61 6e 6b 20 61 63 63 65 |gh all bank acce| 00000cf0 73 73 65 73 1a 20 72 65 71 75 69 72 65 1a 20 74 |sses. require. t| 00000d00 68 65 1a 20 6d 75 6c 74 69 70 6c 69 63 61 74 69 |he. multiplicati| 00000d10 6f 6e 1a 20 6f 66 20 31 38 38 20 62 79 20 28 49 |on. of 188 by (I| 00000d20 25 20 4d 4f 44 0d 20 20 38 37 29 20 74 6f 20 63 |% MOD. 87) to c| 00000d30 61 6c 63 75 6c 61 74 65 20 74 68 65 20 61 64 64 |alculate the add| 00000d40 72 65 73 73 20 77 69 74 68 69 6e 20 74 68 65 20 |ress within the | 00000d50 62 61 6e 6b 2e 0d 0d 46 6f 72 1a 20 63 6f 6e 76 |bank...For. conv| 00000d60 65 6e 69 65 6e 63 65 2c 1a 20 74 68 65 20 62 61 |enience,. the ba| 00000d70 6e 6b 73 20 61 72 65 20 6c 6f 61 64 65 64 20 61 |nks are loaded a| 00000d80 6e 64 20 73 61 76 65 64 1a 20 61 73 1a 20 31 36 |nd saved. as. 16| 00000d90 4b 1a 20 62 6c 6f 63 6b 73 1a 20 28 75 73 69 6e |K. blocks. (usin| 00000da0 67 0d 26 34 30 30 30 2c 20 72 61 74 68 65 72 20 |g.&4000, rather | 00000db0 74 68 61 6e 20 26 33 46 45 46 20 61 73 20 74 68 |than &3FEF as th| 00000dc0 65 20 6c 65 6e 67 74 68 29 2c 20 62 65 63 61 75 |e length), becau| 00000dd0 73 65 20 69 74 20 69 73 20 6d 6f 72 65 20 63 6f |se it is more co| 00000de0 6e 76 65 6e 69 65 6e 74 20 74 6f 0d 6b 65 65 70 |nvenient to.keep| 00000df0 20 74 68 65 20 52 4f 4d 1a 20 68 65 61 64 65 72 | the ROM. header| 00000e00 1a 20 61 74 74 61 63 68 65 64 20 74 6f 20 74 68 |. attached to th| 00000e10 65 20 64 61 74 61 2c 20 72 61 74 68 65 72 20 74 |e data, rather t| 00000e20 68 61 6e 20 65 78 70 6c 69 63 69 74 6c 79 20 77 |han explicitly w| 00000e30 72 69 74 69 6e 67 0d 69 74 20 65 61 63 68 20 74 |riting.it each t| 00000e40 69 6d 65 2e 0d 0d 48 49 4d 45 4d 20 69 73 20 73 |ime...HIMEM is s| 00000e50 65 74 20 74 6f 20 26 33 43 30 30 2c 20 62 75 74 |et to &3C00, but| 00000e60 20 69 6e 20 74 68 65 6f 72 79 20 6f 6e 6c 79 20 | in theory only | 00000e70 74 77 6f 20 73 74 72 69 6e 67 73 2c 20 41 24 20 |two strings, A$ | 00000e80 61 6e 64 20 42 24 2c 20 77 69 6c 6c 20 62 65 0d |and B$, will be.| 00000e90 72 65 71 75 69 72 65 64 20 62 79 20 61 20 64 61 |required by a da| 00000ea0 74 61 62 61 73 65 20 70 72 6f 67 72 61 6d 2c 20 |tabase program, | 00000eb0 73 69 6e 63 65 20 74 68 61 74 20 69 73 20 61 6c |since that is al| 00000ec0 6c 20 74 68 61 74 20 69 73 20 6e 65 65 64 65 64 |l that is needed| 00000ed0 20 66 6f 72 0d 73 6f 72 74 69 6e 67 20 70 75 72 | for.sorting pur| 00000ee0 70 6f 73 65 73 2e 0d 0d 45 76 65 6e 20 61 74 20 |poses...Even at | 00000ef0 39 36 4b 2c 20 79 6f 75 20 63 61 6e 20 73 74 69 |96K, you can sti| 00000f00 6c 6c 20 66 69 74 20 73 69 78 20 73 65 74 73 20 |ll fit six sets | 00000f10 6f 66 20 64 61 74 61 20 6f 6e 20 61 20 6c 61 72 |of data on a lar| 00000f20 67 65 20 66 6f 72 6d 61 74 20 41 44 46 53 0d 64 |ge format ADFS.d| 00000f30 69 73 6b 2e 20 20 49 20 68 61 76 65 20 64 65 63 |isk. I have dec| 00000f40 69 64 65 64 20 6e 6f 74 20 74 6f 20 73 61 76 65 |ided not to save| 00000f50 20 6a 75 73 74 20 74 68 65 20 61 6d 6f 75 6e 74 | just the amount| 00000f60 20 6f 66 20 64 61 74 61 20 69 6e 20 6d 65 6d 6f | of data in memo| 00000f70 72 79 2c 0d 62 65 63 61 75 73 65 20 69 66 20 74 |ry,.because if t| 00000f80 68 65 20 64 61 74 61 20 65 78 70 61 6e 64 73 2c |he data expands,| 00000f90 20 6c 61 72 67 65 20 67 61 70 73 20 77 69 6c 6c | large gaps will| 00000fa0 20 62 65 20 63 72 65 61 74 65 64 20 6f 6e 20 74 | be created on t| 00000fb0 68 65 20 64 69 73 6b 20 77 68 65 6e 0d 74 68 65 |he disk when.the| 00000fc0 20 64 61 74 61 20 69 73 20 6e 65 78 74 20 73 61 | data is next sa| 00000fd0 76 65 64 2e 0d 0d 53 69 6e 63 65 20 74 68 65 20 |ved...Since the | 00000fe0 73 79 73 74 65 6d 20 75 73 65 73 20 61 62 73 6f |system uses abso| 00000ff0 6c 75 74 65 20 70 69 67 65 6f 6e 2d 68 6f 6c 65 |lute pigeon-hole| 00001000 73 2c 20 6e 6f 20 73 74 72 69 6e 67 20 68 65 61 |s, no string hea| 00001010 64 65 72 73 20 61 72 65 20 73 74 6f 72 65 64 2c |ders are stored,| 00001020 0d 61 73 20 61 6c 6c 20 74 68 65 20 6c 65 6e 67 |.as all the leng| 00001030 74 68 20 61 6e 64 20 61 64 64 72 65 73 73 20 69 |th and address i| 00001040 6e 66 6f 72 6d 61 74 69 6f 6e 20 69 73 20 69 6e |nformation is in| 00001050 68 65 72 65 6e 74 20 74 6f 20 74 68 65 20 70 72 |herent to the pr| 00001060 6f 67 72 61 6d 2e 0d 0d 54 68 65 20 6d 61 78 69 |ogram...The maxi| 00001070 6d 75 6d 20 6c 65 6e 67 74 68 20 6f 66 20 61 20 |mum length of a | 00001080 63 6f 6e 76 65 6e 74 69 6f 6e 61 6c 20 73 74 72 |conventional str| 00001090 69 6e 67 20 69 73 20 32 33 38 20 63 68 61 72 61 |ing is 238 chara| 000010a0 63 74 65 72 73 2c 20 61 63 63 6f 72 64 69 6e 67 |cters, according| 000010b0 0d 74 6f 20 74 68 65 20 65 6e 74 72 79 20 66 6f |.to the entry fo| 000010c0 72 20 49 4e 50 55 54 20 6f 6e 20 70 61 67 65 20 |r INPUT on page | 000010d0 4e 35 2d 33 20 6f 66 20 74 68 65 20 4d 61 73 74 |N5-3 of the Mast| 000010e0 65 72 20 52 65 66 65 72 65 6e 63 65 20 4d 61 6e |er Reference Man| 000010f0 75 61 6c 2c 20 73 6f 0d 74 68 69 73 20 77 69 6c |ual, so.this wil| 00001100 6c 20 66 69 74 20 69 6e 20 70 61 67 65 20 26 41 |l fit in page &A| 00001110 20 71 75 69 74 65 20 65 61 73 69 6c 79 2c 20 69 | quite easily, i| 00001120 66 20 74 68 65 20 64 61 74 61 20 66 6f 72 6d 61 |f the data forma| 00001130 74 20 77 65 72 65 20 63 68 61 6e 67 65 64 20 74 |t were changed t| 00001140 6f 0d 75 73 65 20 32 33 38 2d 63 68 61 72 61 63 |o.use 238-charac| 00001150 74 65 72 20 73 74 72 69 6e 67 73 20 28 34 30 38 |ter strings (408| 00001160 20 6f 66 20 74 68 65 6d 2c 20 36 38 20 70 65 72 | of them, 68 per| 00001170 20 62 61 6e 6b 29 2e 0d 0d 54 68 65 20 63 61 6c | bank)...The cal| 00001180 63 75 6c 61 74 65 64 20 61 62 73 6f 6c 75 74 65 |culated absolute| 00001190 20 73 74 72 69 6e 67 20 61 64 64 72 65 73 73 20 | string address | 000011a0 77 69 74 68 69 6e 20 74 68 65 20 62 61 6e 6b 20 |within the bank | 000011b0 69 73 20 73 74 6f 72 65 64 20 61 74 0d 26 37 30 |is stored at.&70| 000011c0 2d 37 31 2c 20 61 6e 64 20 74 68 65 73 65 20 61 |-71, and these a| 000011d0 72 65 20 74 68 65 20 6f 6e 6c 79 20 7a 65 72 6f |re the only zero| 000011e0 2d 70 61 67 65 20 6c 6f 63 61 74 69 6f 6e 73 20 |-page locations | 000011f0 75 73 65 64 2e 20 20 49 25 20 4d 4f 44 20 38 37 |used. I% MOD 87| 00001200 20 69 73 0d 73 74 6f 72 65 64 20 61 74 20 26 41 | is.stored at &A| 00001210 30 30 2d 31 2c 20 61 6e 64 20 74 68 65 20 62 61 |00-1, and the ba| 00001220 6e 6b 20 6e 75 6d 62 65 72 20 28 74 6f 70 20 62 |nk number (top b| 00001230 69 74 20 73 65 74 20 66 6f 72 20 50 55 54 53 2c |it set for PUTS,| 00001240 20 63 6c 65 61 72 20 66 6f 72 0d 47 45 54 53 29 | clear for.GETS)| 00001250 20 69 73 20 73 74 6f 72 65 64 20 69 6e 20 26 41 | is stored in &A| 00001260 30 32 2e 0d 24 26 41 30 33 20 69 73 20 74 68 65 |02..$&A03 is the| 00001270 20 73 74 72 69 6e 67 20 62 75 66 66 65 72 2c 20 | string buffer, | 00001280 74 65 72 6d 69 6e 61 74 65 64 20 62 79 20 43 48 |terminated by CH| 00001290 52 24 31 33 2e 20 20 57 69 74 68 20 61 20 32 33 |R$13. With a 23| 000012a0 38 0d 63 68 61 72 61 63 74 65 72 20 73 74 72 69 |8.character stri| 000012b0 6e 67 2c 20 74 68 69 73 20 77 69 6c 6c 20 6c 65 |ng, this will le| 000012c0 61 76 65 20 31 34 20 66 72 65 65 20 62 79 74 65 |ave 14 free byte| 000012d0 73 20 69 6e 20 70 61 67 65 20 26 41 2e 0d 0d 53 |s in page &A...S| 000012e0 75 6d 6d 61 72 79 20 6f 66 20 74 68 65 20 66 69 |ummary of the fi| 000012f0 6c 65 73 3a 0d 0d 41 42 54 45 58 54 20 20 20 56 |les:..ABTEXT V| 00001300 49 45 57 20 20 20 20 20 20 54 68 69 73 20 66 69 |IEW This fi| 00001310 6c 65 2e 20 20 44 65 73 63 72 69 70 74 69 6f 6e |le. Description| 00001320 20 6f 66 20 53 54 52 49 4e 47 20 70 72 6f 67 72 | of STRING progr| 00001330 61 6d 20 73 79 73 74 65 6d 2e 0d 0d 3f 42 4c 41 |am system...?BLA| 00001340 4e 4b 20 20 20 64 61 74 61 20 20 20 20 20 20 45 |NK data E| 00001350 6d 70 74 79 20 52 4f 4d 20 68 65 61 64 65 72 2c |mpty ROM header,| 00001360 20 77 69 74 68 20 70 75 6e 20 74 69 74 6c 65 20 | with pun title | 00001370 74 6f 20 73 61 74 69 73 66 79 20 47 75 73 27 20 |to satisfy Gus' | 00001380 73 68 6f 72 74 0d 20 20 20 20 20 20 20 20 20 20 |short. | 00001390 20 20 20 20 20 20 20 20 20 66 69 6c 65 6e 61 6d | filenam| 000013a0 65 20 72 65 71 75 65 73 74 20 3b 2d 29 2e 0d 0d |e request ;-)...| 000013b0 41 42 4f 4f 4b 31 20 20 20 42 41 53 49 43 20 49 |ABOOK1 BASIC I| 000013c0 56 20 20 44 65 6d 6f 20 6f 66 20 73 74 72 69 6e |V Demo of strin| 000013d0 67 20 73 79 73 74 65 6d 2e 0d 20 20 20 20 20 20 |g system.. | 000013e0 20 20 20 20 20 20 20 20 20 20 20 20 20 4c 6f 61 | Loa| 000013f0 64 73 20 3f 42 4c 41 4e 4b 20 69 6e 74 6f 20 65 |ds ?BLANK into e| 00001400 61 63 68 20 6f 66 20 74 68 65 20 66 6f 75 72 20 |ach of the four | 00001410 53 52 41 4d 20 62 61 6e 6b 73 2e 0d 20 20 20 20 |SRAM banks.. | 00001420 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 4c | L| 00001430 6f 61 64 73 20 3f 41 42 4f 4f 4b 20 69 6e 74 6f |oads ?ABOOK into| 00001440 20 70 61 67 65 20 26 39 2e 0d 20 20 20 20 20 20 | page &9.. | 00001450 20 20 20 20 20 20 20 20 20 20 20 20 20 53 61 76 | Sav| 00001460 65 73 20 75 70 20 74 6f 20 35 20 62 61 6e 6b 73 |es up to 5 banks| 00001470 20 6f 66 20 31 36 4b 20 2d 20 75 73 65 72 2d 64 | of 16K - user-d| 00001480 65 66 69 6e 65 64 20 66 69 6c 65 6e 61 6d 65 73 |efined filenames| 00001490 2e 0d 0d 3f 41 42 4f 4f 4b 20 20 20 36 35 30 32 |...?ABOOK 6502| 000014a0 20 4d 2f 43 20 20 50 75 74 2c 20 47 65 74 20 61 | M/C Put, Get a| 000014b0 6e 64 20 61 62 73 6f 6c 75 74 65 20 73 74 72 69 |nd absolute stri| 000014c0 6e 67 20 61 64 64 72 65 73 73 20 63 61 6c 63 75 |ng address calcu| 000014d0 6c 61 74 69 6f 6e 2e 0d 0d 54 68 65 20 73 6f 72 |lation...The sor| 000014e0 74 20 72 6f 75 74 69 6e 65 20 77 69 6c 6c 20 70 |t routine will p| 000014f0 72 6f 62 61 62 6c 79 20 62 65 20 69 6e 20 61 20 |robably be in a | 00001500 70 61 67 65 20 6f 66 20 6d 61 63 68 69 6e 65 20 |page of machine | 00001510 63 6f 64 65 2c 20 61 6e 64 20 74 68 65 0d 70 72 |code, and the.pr| 00001520 69 6e 74 69 6e 67 20 72 6f 75 74 69 6e 65 20 69 |inting routine i| 00001530 6e 20 42 41 53 49 43 20 2d 20 65 76 65 6e 74 75 |n BASIC - eventu| 00001540 61 6c 6c 79 21 0d 0d 50 6c 65 61 73 65 20 66 65 |ally!..Please fe| 00001550 65 6c 20 66 72 65 65 20 74 6f 20 73 75 67 67 65 |el free to sugge| 00001560 73 74 20 61 64 64 69 74 69 6f 6e 61 6c 20 66 65 |st additional fe| 00001570 61 74 75 72 65 73 20 65 74 63 2e 2e 2e 0d 0d 0d |atures etc......| 00001580 0d 0d 0d 0d 0d 0d |......| 00001586