Home » Archimedes archive » Archimedes World » AW-1994-06-Disc2.adf » Disk2Jun94 » !AWJune94/Goodies/Zap/!Zap/Docs/ReadMe
!AWJune94/Goodies/Zap/!Zap/Docs/ReadMe
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 » Archimedes archive » Archimedes World » AW-1994-06-Disc2.adf » Disk2Jun94 |
Filename: | !AWJune94/Goodies/Zap/!Zap/Docs/ReadMe |
Read OK: | ✔ |
File size: | 1E14 bytes |
Load address: | 0000 |
Exec address: | 0000 |
File contents
************************************************************************* * >ReadMe Introduction to Zap documentation. * ************************************************************************* This file is an 'index' to all the other documentation files in the Docs directory. All other documentation files begin with the prefix "E-". This file is split into 3 sections: Section A: How Zap works. Section B: Writing extension modes. Section C: Adding new commands to Zap. Please read them in this order. The following abbreviations/notations will be used in the documentation files: '\E' = The entry conditions for this subroutine are ... '\X' = The exit conditions for this subroutine are ... The following register conventions will be used: R8 = Window block pointer. (See E-Windows for defn) R9 = File block pointer. (See E-File for defn) R10 = Cursor block pointer. (See E-Cursors for defn) R11 = Extension mode's workspace. R12 = Zap module's workspace. R13 = Full descending stack (1K), bottom = &8000 Thus for example if I write: \E R8/R9 Then I mean that on entry, the subroutine has R8 pointing to the window block, and R9 pointing to a file block on some file (the file the call deals with). See also the files E-Zapcalls and E-Entry for the standard entry/exit conditions of most Zap calls. Two BASIC programs are provided for you in the Docs directory. The first, E-Library defines all the Zap variable names you will need. The second, E-Template gives a template program for producing new modes/adding command tables. It creates a mode called 'Test' with mode number 15 based on text mode, and adds a command table with the command 'BEEPBEEP'. ************************************************************************* * Section A: How Zap works. * ************************************************************************* When Zap starts up it initialises a 1K stack, claims fixed size buffers and initialises an operating system heap. File buffers are stacked on top of the heap and shifted about as the heap or other files changes size. Thus Zap's memory map can be summarised as: TOP Wimpslot end File n ... File 1 Heap Fixed size buffers &8000 Processor stack (R13) full descending. To find out how to call Zap please see the file E-Zapcalls. All Zap calls will be described by their name beginning "Zap_". The calls Zap_Claim, Zap_Free, Zap_Ensure should be used to claim blocks from the heap. The call Zap_SplitBuffer should be used to change the buffer size of a file. Each file has a corresponding file block giving information about that file. By convention R9 is used to hold a file block pointer. New file buffers can be created via Zap_CreateFile, Zap_CreateFileBlk, Zap_InstallFile and can be deleted via Zap_DeleteFile, Zap_DiscardFile. Files are stored in split buffer form. Please see E-File for details. Similarly, each window has a corresponding information block. By convention a window block pointer is held in R8. Each window block determines uniquely a file block, giving the file showing in the window. Please see the file E-windows for details. New editing windows can be created by Zap_CreateFile, Zap_CreateWindBlk, Zap_InstallFile, Zap_NewView and can be deleted by Zap_DeleteWindow, Zap_DiscardWindow. Cursor information blocks are described in the file E-Cursors. Cursor block pointers are conventionally held in R10. Zap's internal variables can be read by the call Zap_ReadVar and written by Zap_WriteVar. See the file E-Vars for details. By using this call you may read the block pointers of the standard cursor blocks. Inserting/deleting/replacing data in files is accomplished via the calls Zap_Command and Zap_DoCommand. The former calls the extension mode to perform the required action and the latter is the low level call which performs the action directly. Thus in practice, Zap_Command calls the extension mode which then calls Zap_DoCommand. In this way the extension mode may alter the action of all inserts or deletes. For example, text mode uses this to accomplish wordwrap on all operations. See the file E-Zapcalls and E-Entry for more details. Please use the Zap_StartOp/Zap_StopOp structure to concatenate insertions/ deletions. This will give smooth update and will ensure that the operation is undone with only one press of the undo key. ************************************************************************* * Section B: Writing extension modes. * ************************************************************************* Zap extension modes are numbered 0-255. Currently I have only reserved space for 16 of these (numbered 0-15). A mode consists of a table of entry points and flags. This should be held in a module so that the code is always 'mapped in to memory'. Currently defined modes are listed below. Please note that mode names are CASE SENSITIVE throughout Zap. 0 Text 1 Byte 2 Word 3 Ascii 4 Code 5 BASIC 6 BASTXT 7 CMode 8-10 - 11 Throwback 12 Taskwindow 13-15 - Before you start writing an extension mode, you should be familiar with writing modules (preferably in assembler). In most cases, you will simply wish to 'doctor' the input/output of one of the currently defined mode entry points. For example, you may wish to change the typed characters entry point of the TEXT mode to change `` to a left double quote. This is fairly simple to do. If, however, you wish to write a full blown mode with, for example, it's own display format, then you are strongly advised to contact me first. I will be able to give you more support than these text files, and will be able to add the new zap calls and entry points that you may require. To install a new mode you should write a module, which on initialisation calls Zap_AddMode with a pointer to the mode table. This module should then be RMLOAD'ed from the !Run file. It should be loaded AFTER the Zap module has been loaded but BEFORE Zap starts up via the *Zap_Desktop call (see !Run file). When Zap starts up, it will examine the mode entry point table and copy it into its workspace, converting module offsets to actual addresses in the process. The call Zap_ReadMode can be used to find the address of both these tables for any given mode. Hence you can manually alter the mode entry point of any mode. The entry point table format is described in the file E-Entry. Please note that you only have to fill in the first 8 words. In the fourth entry you specify a BASE MODE. This mode is called instead of yours for all the mode entry points you don't want to support/change. Hence in most cases you will set a base mode of 0 (ie TEXT), and set all of the entry points except those you wish to change to 0. ************************************************************************* * Section C: Adding new tables of commands * ************************************************************************* Zap currently has space reserved for up to 16 command tables, though I can easily increase this. The Zap,ZapBasic modules each use one, leaving 14 for other uses. A command table consists of a pointer to a table of commands as described in the file E-Commands. The command table should be stored in a module and registered with Zap when the module initialises by calling the Zap entry point Zap_AddCommands. As with adding a mode, the module should be loaded by altering Zap's !Run file, so that the module is loaded after Zap, but before the Zap_Desktop command. The main use of adding new commands is to add additional keymaps to Zap. For example, the extra commands needed by the EMACS keymap for Zap are store in the ZapBasic module. See the file E-Command for fuller details.
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 0a 2a 20 3e 52 65 61 |*********.* >Rea| 00000050 64 4d 65 09 49 6e 74 72 6f 64 75 63 74 69 6f 6e |dMe.Introduction| 00000060 20 74 6f 20 5a 61 70 20 64 6f 63 75 6d 65 6e 74 | to Zap document| 00000070 61 74 69 6f 6e 2e 09 09 09 2a 0a 2a 2a 2a 2a 2a |ation....*.*****| 00000080 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a |****************| * 000000c0 2a 2a 2a 2a 0a 0a 54 68 69 73 20 66 69 6c 65 20 |****..This file | 000000d0 69 73 20 61 6e 20 27 69 6e 64 65 78 27 20 74 6f |is an 'index' to| 000000e0 20 61 6c 6c 20 74 68 65 20 6f 74 68 65 72 20 64 | all the other d| 000000f0 6f 63 75 6d 65 6e 74 61 74 69 6f 6e 20 66 69 6c |ocumentation fil| 00000100 65 73 20 69 6e 20 74 68 65 20 44 6f 63 73 0a 64 |es in the Docs.d| 00000110 69 72 65 63 74 6f 72 79 2e 20 41 6c 6c 20 6f 74 |irectory. All ot| 00000120 68 65 72 20 64 6f 63 75 6d 65 6e 74 61 74 69 6f |her documentatio| 00000130 6e 20 66 69 6c 65 73 20 62 65 67 69 6e 20 77 69 |n files begin wi| 00000140 74 68 20 74 68 65 20 70 72 65 66 69 78 20 22 45 |th the prefix "E| 00000150 2d 22 2e 0a 0a 54 68 69 73 20 66 69 6c 65 20 69 |-"...This file i| 00000160 73 20 73 70 6c 69 74 20 69 6e 74 6f 20 33 20 73 |s split into 3 s| 00000170 65 63 74 69 6f 6e 73 3a 0a 0a 09 53 65 63 74 69 |ections:...Secti| 00000180 6f 6e 20 41 3a 09 48 6f 77 20 5a 61 70 20 77 6f |on A:.How Zap wo| 00000190 72 6b 73 2e 0a 09 0a 09 53 65 63 74 69 6f 6e 20 |rks.....Section | 000001a0 42 3a 09 57 72 69 74 69 6e 67 20 65 78 74 65 6e |B:.Writing exten| 000001b0 73 69 6f 6e 20 6d 6f 64 65 73 2e 0a 09 0a 09 53 |sion modes.....S| 000001c0 65 63 74 69 6f 6e 20 43 3a 09 41 64 64 69 6e 67 |ection C:.Adding| 000001d0 20 6e 65 77 20 63 6f 6d 6d 61 6e 64 73 20 74 6f | new commands to| 000001e0 20 5a 61 70 2e 0a 09 0a 50 6c 65 61 73 65 20 72 | Zap....Please r| 000001f0 65 61 64 20 74 68 65 6d 20 69 6e 20 74 68 69 73 |ead them in this| 00000200 20 6f 72 64 65 72 2e 0a 0a 54 68 65 20 66 6f 6c | order...The fol| 00000210 6c 6f 77 69 6e 67 20 61 62 62 72 65 76 69 61 74 |lowing abbreviat| 00000220 69 6f 6e 73 2f 6e 6f 74 61 74 69 6f 6e 73 20 77 |ions/notations w| 00000230 69 6c 6c 20 62 65 20 75 73 65 64 20 69 6e 20 74 |ill be used in t| 00000240 68 65 20 64 6f 63 75 6d 65 6e 74 61 74 69 6f 6e |he documentation| 00000250 0a 66 69 6c 65 73 3a 0a 0a 27 5c 45 27 09 3d 09 |.files:..'\E'.=.| 00000260 54 68 65 20 65 6e 74 72 79 20 63 6f 6e 64 69 74 |The entry condit| 00000270 69 6f 6e 73 20 66 6f 72 20 74 68 69 73 20 73 75 |ions for this su| 00000280 62 72 6f 75 74 69 6e 65 20 61 72 65 20 2e 2e 2e |broutine are ...| 00000290 0a 27 5c 58 27 09 3d 09 54 68 65 20 65 78 69 74 |.'\X'.=.The exit| 000002a0 20 63 6f 6e 64 69 74 69 6f 6e 73 20 66 6f 72 20 | conditions for | 000002b0 74 68 69 73 20 73 75 62 72 6f 75 74 69 6e 65 20 |this subroutine | 000002c0 61 72 65 20 2e 2e 2e 0a 0a 54 68 65 20 66 6f 6c |are .....The fol| 000002d0 6c 6f 77 69 6e 67 20 72 65 67 69 73 74 65 72 20 |lowing register | 000002e0 63 6f 6e 76 65 6e 74 69 6f 6e 73 20 77 69 6c 6c |conventions will| 000002f0 20 62 65 20 75 73 65 64 3a 0a 0a 52 38 09 3d 09 | be used:..R8.=.| 00000300 57 69 6e 64 6f 77 20 62 6c 6f 63 6b 20 70 6f 69 |Window block poi| 00000310 6e 74 65 72 2e 20 28 53 65 65 20 45 2d 57 69 6e |nter. (See E-Win| 00000320 64 6f 77 73 20 66 6f 72 20 64 65 66 6e 29 0a 52 |dows for defn).R| 00000330 39 09 3d 09 46 69 6c 65 20 62 6c 6f 63 6b 20 70 |9.=.File block p| 00000340 6f 69 6e 74 65 72 2e 20 28 53 65 65 20 45 2d 46 |ointer. (See E-F| 00000350 69 6c 65 20 66 6f 72 20 64 65 66 6e 29 0a 52 31 |ile for defn).R1| 00000360 30 09 3d 09 43 75 72 73 6f 72 20 62 6c 6f 63 6b |0.=.Cursor block| 00000370 20 70 6f 69 6e 74 65 72 2e 20 28 53 65 65 20 45 | pointer. (See E| 00000380 2d 43 75 72 73 6f 72 73 20 66 6f 72 20 64 65 66 |-Cursors for def| 00000390 6e 29 0a 52 31 31 09 3d 09 45 78 74 65 6e 73 69 |n).R11.=.Extensi| 000003a0 6f 6e 20 6d 6f 64 65 27 73 20 77 6f 72 6b 73 70 |on mode's worksp| 000003b0 61 63 65 2e 0a 52 31 32 09 3d 09 5a 61 70 20 6d |ace..R12.=.Zap m| 000003c0 6f 64 75 6c 65 27 73 20 77 6f 72 6b 73 70 61 63 |odule's workspac| 000003d0 65 2e 0a 52 31 33 09 3d 09 46 75 6c 6c 20 64 65 |e..R13.=.Full de| 000003e0 73 63 65 6e 64 69 6e 67 20 73 74 61 63 6b 20 28 |scending stack (| 000003f0 31 4b 29 2c 20 62 6f 74 74 6f 6d 20 3d 20 26 38 |1K), bottom = &8| 00000400 30 30 30 0a 0a 54 68 75 73 20 66 6f 72 20 65 78 |000..Thus for ex| 00000410 61 6d 70 6c 65 20 69 66 20 49 20 77 72 69 74 65 |ample if I write| 00000420 3a 0a 0a 5c 45 20 52 38 2f 52 39 0a 0a 54 68 65 |:..\E R8/R9..The| 00000430 6e 20 49 20 6d 65 61 6e 20 74 68 61 74 20 6f 6e |n I mean that on| 00000440 20 65 6e 74 72 79 2c 20 74 68 65 20 73 75 62 72 | entry, the subr| 00000450 6f 75 74 69 6e 65 20 68 61 73 20 52 38 20 70 6f |outine has R8 po| 00000460 69 6e 74 69 6e 67 20 74 6f 20 74 68 65 20 77 69 |inting to the wi| 00000470 6e 64 6f 77 0a 62 6c 6f 63 6b 2c 20 61 6e 64 20 |ndow.block, and | 00000480 52 39 20 70 6f 69 6e 74 69 6e 67 20 74 6f 20 61 |R9 pointing to a| 00000490 20 66 69 6c 65 20 62 6c 6f 63 6b 20 6f 6e 20 73 | file block on s| 000004a0 6f 6d 65 20 66 69 6c 65 20 28 74 68 65 20 66 69 |ome file (the fi| 000004b0 6c 65 20 74 68 65 20 63 61 6c 6c 20 64 65 61 6c |le the call deal| 000004c0 73 0a 77 69 74 68 29 2e 20 53 65 65 20 61 6c 73 |s.with). See als| 000004d0 6f 20 74 68 65 20 66 69 6c 65 73 20 45 2d 5a 61 |o the files E-Za| 000004e0 70 63 61 6c 6c 73 20 61 6e 64 20 45 2d 45 6e 74 |pcalls and E-Ent| 000004f0 72 79 20 66 6f 72 20 74 68 65 20 73 74 61 6e 64 |ry for the stand| 00000500 61 72 64 20 65 6e 74 72 79 2f 65 78 69 74 0a 63 |ard entry/exit.c| 00000510 6f 6e 64 69 74 69 6f 6e 73 20 6f 66 20 6d 6f 73 |onditions of mos| 00000520 74 20 5a 61 70 20 63 61 6c 6c 73 2e 0a 0a 54 77 |t Zap calls...Tw| 00000530 6f 20 42 41 53 49 43 20 70 72 6f 67 72 61 6d 73 |o BASIC programs| 00000540 20 61 72 65 20 70 72 6f 76 69 64 65 64 20 66 6f | are provided fo| 00000550 72 20 79 6f 75 20 69 6e 20 74 68 65 20 44 6f 63 |r you in the Doc| 00000560 73 20 64 69 72 65 63 74 6f 72 79 2e 20 54 68 65 |s directory. The| 00000570 20 66 69 72 73 74 2c 0a 45 2d 4c 69 62 72 61 72 | first,.E-Librar| 00000580 79 20 64 65 66 69 6e 65 73 20 61 6c 6c 20 74 68 |y defines all th| 00000590 65 20 5a 61 70 20 76 61 72 69 61 62 6c 65 20 6e |e Zap variable n| 000005a0 61 6d 65 73 20 79 6f 75 20 77 69 6c 6c 20 6e 65 |ames you will ne| 000005b0 65 64 2e 20 54 68 65 20 73 65 63 6f 6e 64 2c 0a |ed. The second,.| 000005c0 45 2d 54 65 6d 70 6c 61 74 65 20 67 69 76 65 73 |E-Template gives| 000005d0 20 61 20 74 65 6d 70 6c 61 74 65 20 70 72 6f 67 | a template prog| 000005e0 72 61 6d 20 66 6f 72 20 70 72 6f 64 75 63 69 6e |ram for producin| 000005f0 67 20 6e 65 77 20 6d 6f 64 65 73 2f 61 64 64 69 |g new modes/addi| 00000600 6e 67 20 63 6f 6d 6d 61 6e 64 0a 74 61 62 6c 65 |ng command.table| 00000610 73 2e 20 49 74 20 63 72 65 61 74 65 73 20 61 20 |s. It creates a | 00000620 6d 6f 64 65 20 63 61 6c 6c 65 64 20 27 54 65 73 |mode called 'Tes| 00000630 74 27 20 77 69 74 68 20 6d 6f 64 65 20 6e 75 6d |t' with mode num| 00000640 62 65 72 20 31 35 20 62 61 73 65 64 20 6f 6e 20 |ber 15 based on | 00000650 74 65 78 74 0a 6d 6f 64 65 2c 20 61 6e 64 20 61 |text.mode, and a| 00000660 64 64 73 20 61 20 63 6f 6d 6d 61 6e 64 20 74 61 |dds a command ta| 00000670 62 6c 65 20 77 69 74 68 20 74 68 65 20 63 6f 6d |ble with the com| 00000680 6d 61 6e 64 20 27 42 45 45 50 42 45 45 50 27 2e |mand 'BEEPBEEP'.| 00000690 0a 0a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a |..**************| 000006a0 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a |****************| * 000006d0 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 0a 2a 20 53 65 |***********.* Se| 000006e0 63 74 69 6f 6e 20 41 3a 09 48 6f 77 20 5a 61 70 |ction A:.How Zap| 000006f0 20 77 6f 72 6b 73 2e 09 09 09 09 09 09 2a 0a 2a | works.......*.*| 00000700 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a |****************| * 00000740 2a 2a 2a 2a 2a 2a 2a 2a 0a 0a 57 68 65 6e 20 5a |********..When Z| 00000750 61 70 20 73 74 61 72 74 73 20 75 70 20 69 74 20 |ap starts up it | 00000760 69 6e 69 74 69 61 6c 69 73 65 73 20 61 20 31 4b |initialises a 1K| 00000770 20 73 74 61 63 6b 2c 20 63 6c 61 69 6d 73 20 66 | stack, claims f| 00000780 69 78 65 64 20 73 69 7a 65 20 62 75 66 66 65 72 |ixed size buffer| 00000790 73 20 61 6e 64 0a 69 6e 69 74 69 61 6c 69 73 65 |s and.initialise| 000007a0 73 20 61 6e 20 6f 70 65 72 61 74 69 6e 67 20 73 |s an operating s| 000007b0 79 73 74 65 6d 20 68 65 61 70 2e 20 46 69 6c 65 |ystem heap. File| 000007c0 20 62 75 66 66 65 72 73 20 61 72 65 20 73 74 61 | buffers are sta| 000007d0 63 6b 65 64 20 6f 6e 20 74 6f 70 20 6f 66 20 74 |cked on top of t| 000007e0 68 65 0a 68 65 61 70 20 61 6e 64 20 73 68 69 66 |he.heap and shif| 000007f0 74 65 64 20 61 62 6f 75 74 20 61 73 20 74 68 65 |ted about as the| 00000800 20 68 65 61 70 20 6f 72 20 6f 74 68 65 72 20 66 | heap or other f| 00000810 69 6c 65 73 20 63 68 61 6e 67 65 73 20 73 69 7a |iles changes siz| 00000820 65 2e 20 54 68 75 73 20 5a 61 70 27 73 0a 6d 65 |e. Thus Zap's.me| 00000830 6d 6f 72 79 20 6d 61 70 20 63 61 6e 20 62 65 20 |mory map can be | 00000840 73 75 6d 6d 61 72 69 73 65 64 20 61 73 3a 0a 0a |summarised as:..| 00000850 09 09 54 4f 50 09 57 69 6d 70 73 6c 6f 74 20 65 |..TOP.Wimpslot e| 00000860 6e 64 0a 09 09 09 46 69 6c 65 20 6e 0a 09 09 09 |nd....File n....| 00000870 2e 2e 2e 0a 09 09 09 46 69 6c 65 20 31 0a 09 09 |.......File 1...| 00000880 09 48 65 61 70 0a 09 09 09 46 69 78 65 64 20 73 |.Heap....Fixed s| 00000890 69 7a 65 20 62 75 66 66 65 72 73 0a 09 09 26 38 |ize buffers...&8| 000008a0 30 30 30 09 50 72 6f 63 65 73 73 6f 72 20 73 74 |000.Processor st| 000008b0 61 63 6b 20 28 52 31 33 29 20 66 75 6c 6c 20 64 |ack (R13) full d| 000008c0 65 73 63 65 6e 64 69 6e 67 2e 0a 09 09 0a 54 6f |escending.....To| 000008d0 20 66 69 6e 64 20 6f 75 74 20 68 6f 77 20 74 6f | find out how to| 000008e0 20 63 61 6c 6c 20 5a 61 70 20 70 6c 65 61 73 65 | call Zap please| 000008f0 20 73 65 65 20 74 68 65 20 66 69 6c 65 20 45 2d | see the file E-| 00000900 5a 61 70 63 61 6c 6c 73 2e 20 41 6c 6c 20 5a 61 |Zapcalls. All Za| 00000910 70 20 63 61 6c 6c 73 0a 77 69 6c 6c 20 62 65 20 |p calls.will be | 00000920 64 65 73 63 72 69 62 65 64 20 62 79 20 74 68 65 |described by the| 00000930 69 72 20 6e 61 6d 65 20 62 65 67 69 6e 6e 69 6e |ir name beginnin| 00000940 67 20 22 5a 61 70 5f 22 2e 20 54 68 65 20 63 61 |g "Zap_". The ca| 00000950 6c 6c 73 20 5a 61 70 5f 43 6c 61 69 6d 2c 0a 5a |lls Zap_Claim,.Z| 00000960 61 70 5f 46 72 65 65 2c 20 5a 61 70 5f 45 6e 73 |ap_Free, Zap_Ens| 00000970 75 72 65 20 73 68 6f 75 6c 64 20 62 65 20 75 73 |ure should be us| 00000980 65 64 20 74 6f 20 63 6c 61 69 6d 20 62 6c 6f 63 |ed to claim bloc| 00000990 6b 73 20 66 72 6f 6d 20 74 68 65 20 68 65 61 70 |ks from the heap| 000009a0 2e 20 54 68 65 20 63 61 6c 6c 0a 5a 61 70 5f 53 |. The call.Zap_S| 000009b0 70 6c 69 74 42 75 66 66 65 72 20 73 68 6f 75 6c |plitBuffer shoul| 000009c0 64 20 62 65 20 75 73 65 64 20 74 6f 20 63 68 61 |d be used to cha| 000009d0 6e 67 65 20 74 68 65 20 62 75 66 66 65 72 20 73 |nge the buffer s| 000009e0 69 7a 65 20 6f 66 20 61 20 66 69 6c 65 2e 0a 0a |ize of a file...| 000009f0 45 61 63 68 20 66 69 6c 65 20 68 61 73 20 61 20 |Each file has a | 00000a00 63 6f 72 72 65 73 70 6f 6e 64 69 6e 67 20 66 69 |corresponding fi| 00000a10 6c 65 20 62 6c 6f 63 6b 20 67 69 76 69 6e 67 20 |le block giving | 00000a20 69 6e 66 6f 72 6d 61 74 69 6f 6e 20 61 62 6f 75 |information abou| 00000a30 74 20 74 68 61 74 20 66 69 6c 65 2e 0a 42 79 20 |t that file..By | 00000a40 63 6f 6e 76 65 6e 74 69 6f 6e 20 52 39 20 69 73 |convention R9 is| 00000a50 20 75 73 65 64 20 74 6f 20 68 6f 6c 64 20 61 20 | used to hold a | 00000a60 66 69 6c 65 20 62 6c 6f 63 6b 20 70 6f 69 6e 74 |file block point| 00000a70 65 72 2e 20 4e 65 77 20 66 69 6c 65 20 62 75 66 |er. New file buf| 00000a80 66 65 72 73 20 63 61 6e 0a 62 65 20 63 72 65 61 |fers can.be crea| 00000a90 74 65 64 20 76 69 61 20 5a 61 70 5f 43 72 65 61 |ted via Zap_Crea| 00000aa0 74 65 46 69 6c 65 2c 20 5a 61 70 5f 43 72 65 61 |teFile, Zap_Crea| 00000ab0 74 65 46 69 6c 65 42 6c 6b 2c 20 5a 61 70 5f 49 |teFileBlk, Zap_I| 00000ac0 6e 73 74 61 6c 6c 46 69 6c 65 20 61 6e 64 20 63 |nstallFile and c| 00000ad0 61 6e 20 62 65 0a 64 65 6c 65 74 65 64 20 76 69 |an be.deleted vi| 00000ae0 61 20 5a 61 70 5f 44 65 6c 65 74 65 46 69 6c 65 |a Zap_DeleteFile| 00000af0 2c 20 5a 61 70 5f 44 69 73 63 61 72 64 46 69 6c |, Zap_DiscardFil| 00000b00 65 2e 20 46 69 6c 65 73 20 61 72 65 20 73 74 6f |e. Files are sto| 00000b10 72 65 64 20 69 6e 20 73 70 6c 69 74 20 62 75 66 |red in split buf| 00000b20 66 65 72 0a 66 6f 72 6d 2e 20 50 6c 65 61 73 65 |fer.form. Please| 00000b30 20 73 65 65 20 45 2d 46 69 6c 65 20 66 6f 72 20 | see E-File for | 00000b40 64 65 74 61 69 6c 73 2e 0a 0a 53 69 6d 69 6c 61 |details...Simila| 00000b50 72 6c 79 2c 20 65 61 63 68 20 77 69 6e 64 6f 77 |rly, each window| 00000b60 20 68 61 73 20 61 20 63 6f 72 72 65 73 70 6f 6e | has a correspon| 00000b70 64 69 6e 67 20 69 6e 66 6f 72 6d 61 74 69 6f 6e |ding information| 00000b80 20 62 6c 6f 63 6b 2e 20 42 79 20 63 6f 6e 76 65 | block. By conve| 00000b90 6e 74 69 6f 6e 20 61 0a 77 69 6e 64 6f 77 20 62 |ntion a.window b| 00000ba0 6c 6f 63 6b 20 70 6f 69 6e 74 65 72 20 69 73 20 |lock pointer is | 00000bb0 68 65 6c 64 20 69 6e 20 52 38 2e 20 45 61 63 68 |held in R8. Each| 00000bc0 20 77 69 6e 64 6f 77 20 62 6c 6f 63 6b 20 64 65 | window block de| 00000bd0 74 65 72 6d 69 6e 65 73 20 75 6e 69 71 75 65 6c |termines uniquel| 00000be0 79 20 61 0a 66 69 6c 65 20 62 6c 6f 63 6b 2c 20 |y a.file block, | 00000bf0 67 69 76 69 6e 67 20 74 68 65 20 66 69 6c 65 20 |giving the file | 00000c00 73 68 6f 77 69 6e 67 20 69 6e 20 74 68 65 20 77 |showing in the w| 00000c10 69 6e 64 6f 77 2e 20 50 6c 65 61 73 65 20 73 65 |indow. Please se| 00000c20 65 20 74 68 65 20 66 69 6c 65 0a 45 2d 77 69 6e |e the file.E-win| 00000c30 64 6f 77 73 20 66 6f 72 20 64 65 74 61 69 6c 73 |dows for details| 00000c40 2e 20 4e 65 77 20 65 64 69 74 69 6e 67 20 77 69 |. New editing wi| 00000c50 6e 64 6f 77 73 20 63 61 6e 20 62 65 20 63 72 65 |ndows can be cre| 00000c60 61 74 65 64 20 62 79 20 5a 61 70 5f 43 72 65 61 |ated by Zap_Crea| 00000c70 74 65 46 69 6c 65 2c 0a 5a 61 70 5f 43 72 65 61 |teFile,.Zap_Crea| 00000c80 74 65 57 69 6e 64 42 6c 6b 2c 20 5a 61 70 5f 49 |teWindBlk, Zap_I| 00000c90 6e 73 74 61 6c 6c 46 69 6c 65 2c 20 5a 61 70 5f |nstallFile, Zap_| 00000ca0 4e 65 77 56 69 65 77 20 61 6e 64 20 63 61 6e 20 |NewView and can | 00000cb0 62 65 20 64 65 6c 65 74 65 64 20 62 79 0a 5a 61 |be deleted by.Za| 00000cc0 70 5f 44 65 6c 65 74 65 57 69 6e 64 6f 77 2c 20 |p_DeleteWindow, | 00000cd0 5a 61 70 5f 44 69 73 63 61 72 64 57 69 6e 64 6f |Zap_DiscardWindo| 00000ce0 77 2e 0a 0a 43 75 72 73 6f 72 20 69 6e 66 6f 72 |w...Cursor infor| 00000cf0 6d 61 74 69 6f 6e 20 62 6c 6f 63 6b 73 20 61 72 |mation blocks ar| 00000d00 65 20 64 65 73 63 72 69 62 65 64 20 69 6e 20 74 |e described in t| 00000d10 68 65 20 66 69 6c 65 20 45 2d 43 75 72 73 6f 72 |he file E-Cursor| 00000d20 73 2e 20 43 75 72 73 6f 72 20 62 6c 6f 63 6b 0a |s. Cursor block.| 00000d30 70 6f 69 6e 74 65 72 73 20 61 72 65 20 63 6f 6e |pointers are con| 00000d40 76 65 6e 74 69 6f 6e 61 6c 6c 79 20 68 65 6c 64 |ventionally held| 00000d50 20 69 6e 20 52 31 30 2e 20 5a 61 70 27 73 20 69 | in R10. Zap's i| 00000d60 6e 74 65 72 6e 61 6c 20 76 61 72 69 61 62 6c 65 |nternal variable| 00000d70 73 20 63 61 6e 20 62 65 20 72 65 61 64 0a 62 79 |s can be read.by| 00000d80 20 74 68 65 20 63 61 6c 6c 20 5a 61 70 5f 52 65 | the call Zap_Re| 00000d90 61 64 56 61 72 20 61 6e 64 20 77 72 69 74 74 65 |adVar and writte| 00000da0 6e 20 62 79 20 5a 61 70 5f 57 72 69 74 65 56 61 |n by Zap_WriteVa| 00000db0 72 2e 20 53 65 65 20 74 68 65 20 66 69 6c 65 20 |r. See the file | 00000dc0 45 2d 56 61 72 73 20 66 6f 72 0a 64 65 74 61 69 |E-Vars for.detai| 00000dd0 6c 73 2e 20 42 79 20 75 73 69 6e 67 20 74 68 69 |ls. By using thi| 00000de0 73 20 63 61 6c 6c 20 79 6f 75 20 6d 61 79 20 72 |s call you may r| 00000df0 65 61 64 20 74 68 65 20 62 6c 6f 63 6b 20 70 6f |ead the block po| 00000e00 69 6e 74 65 72 73 20 6f 66 20 74 68 65 20 73 74 |inters of the st| 00000e10 61 6e 64 61 72 64 0a 63 75 72 73 6f 72 20 62 6c |andard.cursor bl| 00000e20 6f 63 6b 73 2e 0a 0a 49 6e 73 65 72 74 69 6e 67 |ocks...Inserting| 00000e30 2f 64 65 6c 65 74 69 6e 67 2f 72 65 70 6c 61 63 |/deleting/replac| 00000e40 69 6e 67 20 64 61 74 61 20 69 6e 20 66 69 6c 65 |ing data in file| 00000e50 73 20 69 73 20 61 63 63 6f 6d 70 6c 69 73 68 65 |s is accomplishe| 00000e60 64 20 76 69 61 20 74 68 65 20 63 61 6c 6c 73 0a |d via the calls.| 00000e70 5a 61 70 5f 43 6f 6d 6d 61 6e 64 20 61 6e 64 20 |Zap_Command and | 00000e80 5a 61 70 5f 44 6f 43 6f 6d 6d 61 6e 64 2e 20 54 |Zap_DoCommand. T| 00000e90 68 65 20 66 6f 72 6d 65 72 20 63 61 6c 6c 73 20 |he former calls | 00000ea0 74 68 65 20 65 78 74 65 6e 73 69 6f 6e 20 6d 6f |the extension mo| 00000eb0 64 65 20 74 6f 20 70 65 72 66 6f 72 6d 0a 74 68 |de to perform.th| 00000ec0 65 20 72 65 71 75 69 72 65 64 20 61 63 74 69 6f |e required actio| 00000ed0 6e 20 61 6e 64 20 74 68 65 20 6c 61 74 74 65 72 |n and the latter| 00000ee0 20 69 73 20 74 68 65 20 6c 6f 77 20 6c 65 76 65 | is the low leve| 00000ef0 6c 20 63 61 6c 6c 20 77 68 69 63 68 20 70 65 72 |l call which per| 00000f00 66 6f 72 6d 73 20 74 68 65 0a 61 63 74 69 6f 6e |forms the.action| 00000f10 20 64 69 72 65 63 74 6c 79 2e 20 54 68 75 73 20 | directly. Thus | 00000f20 69 6e 20 70 72 61 63 74 69 63 65 2c 20 5a 61 70 |in practice, Zap| 00000f30 5f 43 6f 6d 6d 61 6e 64 20 63 61 6c 6c 73 20 74 |_Command calls t| 00000f40 68 65 20 65 78 74 65 6e 73 69 6f 6e 20 6d 6f 64 |he extension mod| 00000f50 65 20 77 68 69 63 68 0a 74 68 65 6e 20 63 61 6c |e which.then cal| 00000f60 6c 73 20 5a 61 70 5f 44 6f 43 6f 6d 6d 61 6e 64 |ls Zap_DoCommand| 00000f70 2e 20 49 6e 20 74 68 69 73 20 77 61 79 20 74 68 |. In this way th| 00000f80 65 20 65 78 74 65 6e 73 69 6f 6e 20 6d 6f 64 65 |e extension mode| 00000f90 20 6d 61 79 20 61 6c 74 65 72 20 74 68 65 20 61 | may alter the a| 00000fa0 63 74 69 6f 6e 0a 6f 66 20 61 6c 6c 20 69 6e 73 |ction.of all ins| 00000fb0 65 72 74 73 20 6f 72 20 64 65 6c 65 74 65 73 2e |erts or deletes.| 00000fc0 20 46 6f 72 20 65 78 61 6d 70 6c 65 2c 20 74 65 | For example, te| 00000fd0 78 74 20 6d 6f 64 65 20 75 73 65 73 20 74 68 69 |xt mode uses thi| 00000fe0 73 20 74 6f 20 61 63 63 6f 6d 70 6c 69 73 68 0a |s to accomplish.| 00000ff0 77 6f 72 64 77 72 61 70 20 6f 6e 20 61 6c 6c 20 |wordwrap on all | 00001000 6f 70 65 72 61 74 69 6f 6e 73 2e 20 53 65 65 20 |operations. See | 00001010 74 68 65 20 66 69 6c 65 20 45 2d 5a 61 70 63 61 |the file E-Zapca| 00001020 6c 6c 73 20 61 6e 64 20 45 2d 45 6e 74 72 79 20 |lls and E-Entry | 00001030 66 6f 72 20 6d 6f 72 65 0a 64 65 74 61 69 6c 73 |for more.details| 00001040 2e 0a 0a 50 6c 65 61 73 65 20 75 73 65 20 74 68 |...Please use th| 00001050 65 20 5a 61 70 5f 53 74 61 72 74 4f 70 2f 5a 61 |e Zap_StartOp/Za| 00001060 70 5f 53 74 6f 70 4f 70 20 73 74 72 75 63 74 75 |p_StopOp structu| 00001070 72 65 20 74 6f 20 63 6f 6e 63 61 74 65 6e 61 74 |re to concatenat| 00001080 65 20 69 6e 73 65 72 74 69 6f 6e 73 2f 0a 64 65 |e insertions/.de| 00001090 6c 65 74 69 6f 6e 73 2e 20 54 68 69 73 20 77 69 |letions. This wi| 000010a0 6c 6c 20 67 69 76 65 20 73 6d 6f 6f 74 68 20 75 |ll give smooth u| 000010b0 70 64 61 74 65 20 61 6e 64 20 77 69 6c 6c 20 65 |pdate and will e| 000010c0 6e 73 75 72 65 20 74 68 61 74 20 74 68 65 20 6f |nsure that the o| 000010d0 70 65 72 61 74 69 6f 6e 20 69 73 0a 75 6e 64 6f |peration is.undo| 000010e0 6e 65 20 77 69 74 68 20 6f 6e 6c 79 20 6f 6e 65 |ne with only one| 000010f0 20 70 72 65 73 73 20 6f 66 20 74 68 65 20 75 6e | press of the un| 00001100 64 6f 20 6b 65 79 2e 0a 0a 2a 2a 2a 2a 2a 2a 2a |do key...*******| 00001110 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a |****************| * 00001150 2a 2a 0a 2a 20 53 65 63 74 69 6f 6e 20 42 3a 09 |**.* Section B:.| 00001160 57 72 69 74 69 6e 67 20 65 78 74 65 6e 73 69 6f |Writing extensio| 00001170 6e 20 6d 6f 64 65 73 2e 09 09 09 09 2a 0a 2a 2a |n modes.....*.**| 00001180 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a |****************| * 000011c0 2a 2a 2a 2a 2a 2a 2a 09 0a 0a 5a 61 70 20 65 78 |*******...Zap ex| 000011d0 74 65 6e 73 69 6f 6e 20 6d 6f 64 65 73 20 61 72 |tension modes ar| 000011e0 65 20 6e 75 6d 62 65 72 65 64 20 30 2d 32 35 35 |e numbered 0-255| 000011f0 2e 20 43 75 72 72 65 6e 74 6c 79 20 49 20 68 61 |. Currently I ha| 00001200 76 65 20 6f 6e 6c 79 20 72 65 73 65 72 76 65 64 |ve only reserved| 00001210 20 73 70 61 63 65 0a 66 6f 72 20 31 36 20 6f 66 | space.for 16 of| 00001220 20 74 68 65 73 65 20 28 6e 75 6d 62 65 72 65 64 | these (numbered| 00001230 20 30 2d 31 35 29 2e 20 41 20 6d 6f 64 65 20 63 | 0-15). A mode c| 00001240 6f 6e 73 69 73 74 73 20 6f 66 20 61 20 74 61 62 |onsists of a tab| 00001250 6c 65 20 6f 66 20 65 6e 74 72 79 20 70 6f 69 6e |le of entry poin| 00001260 74 73 0a 61 6e 64 20 66 6c 61 67 73 2e 20 54 68 |ts.and flags. Th| 00001270 69 73 20 73 68 6f 75 6c 64 20 62 65 20 68 65 6c |is should be hel| 00001280 64 20 69 6e 20 61 20 6d 6f 64 75 6c 65 20 73 6f |d in a module so| 00001290 20 74 68 61 74 20 74 68 65 20 63 6f 64 65 20 69 | that the code i| 000012a0 73 20 61 6c 77 61 79 73 20 27 6d 61 70 70 65 64 |s always 'mapped| 000012b0 0a 69 6e 20 74 6f 20 6d 65 6d 6f 72 79 27 2e 20 |.in to memory'. | 000012c0 43 75 72 72 65 6e 74 6c 79 20 64 65 66 69 6e 65 |Currently define| 000012d0 64 20 6d 6f 64 65 73 20 61 72 65 20 6c 69 73 74 |d modes are list| 000012e0 65 64 20 62 65 6c 6f 77 2e 20 50 6c 65 61 73 65 |ed below. Please| 000012f0 20 6e 6f 74 65 20 74 68 61 74 0a 6d 6f 64 65 20 | note that.mode | 00001300 6e 61 6d 65 73 20 61 72 65 20 43 41 53 45 20 53 |names are CASE S| 00001310 45 4e 53 49 54 49 56 45 20 74 68 72 6f 75 67 68 |ENSITIVE through| 00001320 6f 75 74 20 5a 61 70 2e 0a 0a 09 30 09 54 65 78 |out Zap....0.Tex| 00001330 74 0a 09 31 09 42 79 74 65 0a 09 32 09 57 6f 72 |t..1.Byte..2.Wor| 00001340 64 0a 09 33 09 41 73 63 69 69 0a 09 34 09 43 6f |d..3.Ascii..4.Co| 00001350 64 65 0a 09 35 09 42 41 53 49 43 0a 09 36 09 42 |de..5.BASIC..6.B| 00001360 41 53 54 58 54 0a 09 37 09 43 4d 6f 64 65 0a 09 |ASTXT..7.CMode..| 00001370 38 2d 31 30 09 2d 0a 09 31 31 09 54 68 72 6f 77 |8-10.-..11.Throw| 00001380 62 61 63 6b 0a 09 31 32 09 54 61 73 6b 77 69 6e |back..12.Taskwin| 00001390 64 6f 77 0a 09 31 33 2d 31 35 09 2d 0a 09 0a 42 |dow..13-15.-...B| 000013a0 65 66 6f 72 65 20 79 6f 75 20 73 74 61 72 74 20 |efore you start | 000013b0 77 72 69 74 69 6e 67 20 61 6e 20 65 78 74 65 6e |writing an exten| 000013c0 73 69 6f 6e 20 6d 6f 64 65 2c 20 79 6f 75 20 73 |sion mode, you s| 000013d0 68 6f 75 6c 64 20 62 65 20 66 61 6d 69 6c 69 61 |hould be familia| 000013e0 72 20 77 69 74 68 0a 77 72 69 74 69 6e 67 20 6d |r with.writing m| 000013f0 6f 64 75 6c 65 73 20 28 70 72 65 66 65 72 61 62 |odules (preferab| 00001400 6c 79 20 69 6e 20 61 73 73 65 6d 62 6c 65 72 29 |ly in assembler)| 00001410 2e 20 49 6e 20 6d 6f 73 74 20 63 61 73 65 73 2c |. In most cases,| 00001420 20 79 6f 75 20 77 69 6c 6c 20 73 69 6d 70 6c 79 | you will simply| 00001430 0a 77 69 73 68 20 74 6f 20 27 64 6f 63 74 6f 72 |.wish to 'doctor| 00001440 27 20 74 68 65 20 69 6e 70 75 74 2f 6f 75 74 70 |' the input/outp| 00001450 75 74 20 6f 66 20 6f 6e 65 20 6f 66 20 74 68 65 |ut of one of the| 00001460 20 63 75 72 72 65 6e 74 6c 79 20 64 65 66 69 6e | currently defin| 00001470 65 64 20 6d 6f 64 65 20 65 6e 74 72 79 0a 70 6f |ed mode entry.po| 00001480 69 6e 74 73 2e 20 46 6f 72 20 65 78 61 6d 70 6c |ints. For exampl| 00001490 65 2c 20 79 6f 75 20 6d 61 79 20 77 69 73 68 20 |e, you may wish | 000014a0 74 6f 20 63 68 61 6e 67 65 20 74 68 65 20 74 79 |to change the ty| 000014b0 70 65 64 20 63 68 61 72 61 63 74 65 72 73 20 65 |ped characters e| 000014c0 6e 74 72 79 20 70 6f 69 6e 74 0a 6f 66 20 74 68 |ntry point.of th| 000014d0 65 20 54 45 58 54 20 6d 6f 64 65 20 74 6f 20 63 |e TEXT mode to c| 000014e0 68 61 6e 67 65 20 60 60 20 74 6f 20 61 20 6c 65 |hange `` to a le| 000014f0 66 74 20 64 6f 75 62 6c 65 20 71 75 6f 74 65 2e |ft double quote.| 00001500 20 54 68 69 73 20 69 73 20 66 61 69 72 6c 79 20 | This is fairly | 00001510 73 69 6d 70 6c 65 0a 74 6f 20 64 6f 2e 20 49 66 |simple.to do. If| 00001520 2c 20 68 6f 77 65 76 65 72 2c 20 79 6f 75 20 77 |, however, you w| 00001530 69 73 68 20 74 6f 20 77 72 69 74 65 20 61 20 66 |ish to write a f| 00001540 75 6c 6c 20 62 6c 6f 77 6e 20 6d 6f 64 65 20 77 |ull blown mode w| 00001550 69 74 68 2c 20 66 6f 72 20 65 78 61 6d 70 6c 65 |ith, for example| 00001560 2c 0a 69 74 27 73 20 6f 77 6e 20 64 69 73 70 6c |,.it's own displ| 00001570 61 79 20 66 6f 72 6d 61 74 2c 20 74 68 65 6e 20 |ay format, then | 00001580 79 6f 75 20 61 72 65 20 73 74 72 6f 6e 67 6c 79 |you are strongly| 00001590 20 61 64 76 69 73 65 64 20 74 6f 20 63 6f 6e 74 | advised to cont| 000015a0 61 63 74 20 6d 65 20 66 69 72 73 74 2e 0a 49 20 |act me first..I | 000015b0 77 69 6c 6c 20 62 65 20 61 62 6c 65 20 74 6f 20 |will be able to | 000015c0 67 69 76 65 20 79 6f 75 20 6d 6f 72 65 20 73 75 |give you more su| 000015d0 70 70 6f 72 74 20 74 68 61 6e 20 74 68 65 73 65 |pport than these| 000015e0 20 74 65 78 74 20 66 69 6c 65 73 2c 20 61 6e 64 | text files, and| 000015f0 20 77 69 6c 6c 20 62 65 0a 61 62 6c 65 20 74 6f | will be.able to| 00001600 20 61 64 64 20 74 68 65 20 6e 65 77 20 7a 61 70 | add the new zap| 00001610 20 63 61 6c 6c 73 20 61 6e 64 20 65 6e 74 72 79 | calls and entry| 00001620 20 70 6f 69 6e 74 73 20 74 68 61 74 20 79 6f 75 | points that you| 00001630 20 6d 61 79 20 72 65 71 75 69 72 65 2e 0a 0a 54 | may require...T| 00001640 6f 20 69 6e 73 74 61 6c 6c 20 61 20 6e 65 77 20 |o install a new | 00001650 6d 6f 64 65 20 79 6f 75 20 73 68 6f 75 6c 64 20 |mode you should | 00001660 77 72 69 74 65 20 61 20 6d 6f 64 75 6c 65 2c 20 |write a module, | 00001670 77 68 69 63 68 20 6f 6e 20 69 6e 69 74 69 61 6c |which on initial| 00001680 69 73 61 74 69 6f 6e 0a 63 61 6c 6c 73 20 5a 61 |isation.calls Za| 00001690 70 5f 41 64 64 4d 6f 64 65 20 77 69 74 68 20 61 |p_AddMode with a| 000016a0 20 70 6f 69 6e 74 65 72 20 74 6f 20 74 68 65 20 | pointer to the | 000016b0 6d 6f 64 65 20 74 61 62 6c 65 2e 20 54 68 69 73 |mode table. This| 000016c0 20 6d 6f 64 75 6c 65 20 73 68 6f 75 6c 64 20 74 | module should t| 000016d0 68 65 6e 0a 62 65 20 52 4d 4c 4f 41 44 27 65 64 |hen.be RMLOAD'ed| 000016e0 20 66 72 6f 6d 20 74 68 65 20 21 52 75 6e 20 66 | from the !Run f| 000016f0 69 6c 65 2e 20 49 74 20 73 68 6f 75 6c 64 20 62 |ile. It should b| 00001700 65 20 6c 6f 61 64 65 64 20 41 46 54 45 52 20 74 |e loaded AFTER t| 00001710 68 65 20 5a 61 70 20 6d 6f 64 75 6c 65 20 68 61 |he Zap module ha| 00001720 73 0a 62 65 65 6e 20 6c 6f 61 64 65 64 20 62 75 |s.been loaded bu| 00001730 74 20 42 45 46 4f 52 45 20 5a 61 70 20 73 74 61 |t BEFORE Zap sta| 00001740 72 74 73 20 75 70 20 76 69 61 20 74 68 65 20 2a |rts up via the *| 00001750 5a 61 70 5f 44 65 73 6b 74 6f 70 20 63 61 6c 6c |Zap_Desktop call| 00001760 20 28 73 65 65 20 21 52 75 6e 0a 66 69 6c 65 29 | (see !Run.file)| 00001770 2e 20 57 68 65 6e 20 5a 61 70 20 73 74 61 72 74 |. When Zap start| 00001780 73 20 75 70 2c 20 69 74 20 77 69 6c 6c 20 65 78 |s up, it will ex| 00001790 61 6d 69 6e 65 20 74 68 65 20 6d 6f 64 65 20 65 |amine the mode e| 000017a0 6e 74 72 79 20 70 6f 69 6e 74 20 74 61 62 6c 65 |ntry point table| 000017b0 20 61 6e 64 0a 63 6f 70 79 20 69 74 20 69 6e 74 | and.copy it int| 000017c0 6f 20 69 74 73 20 77 6f 72 6b 73 70 61 63 65 2c |o its workspace,| 000017d0 20 63 6f 6e 76 65 72 74 69 6e 67 20 6d 6f 64 75 | converting modu| 000017e0 6c 65 20 6f 66 66 73 65 74 73 20 74 6f 20 61 63 |le offsets to ac| 000017f0 74 75 61 6c 20 61 64 64 72 65 73 73 65 73 0a 69 |tual addresses.i| 00001800 6e 20 74 68 65 20 70 72 6f 63 65 73 73 2e 20 54 |n the process. T| 00001810 68 65 20 63 61 6c 6c 20 5a 61 70 5f 52 65 61 64 |he call Zap_Read| 00001820 4d 6f 64 65 20 63 61 6e 20 62 65 20 75 73 65 64 |Mode can be used| 00001830 20 74 6f 20 66 69 6e 64 20 74 68 65 20 61 64 64 | to find the add| 00001840 72 65 73 73 20 6f 66 20 62 6f 74 68 0a 74 68 65 |ress of both.the| 00001850 73 65 20 74 61 62 6c 65 73 20 66 6f 72 20 61 6e |se tables for an| 00001860 79 20 67 69 76 65 6e 20 6d 6f 64 65 2e 20 48 65 |y given mode. He| 00001870 6e 63 65 20 79 6f 75 20 63 61 6e 20 6d 61 6e 75 |nce you can manu| 00001880 61 6c 6c 79 20 61 6c 74 65 72 20 74 68 65 20 6d |ally alter the m| 00001890 6f 64 65 20 65 6e 74 72 79 0a 70 6f 69 6e 74 20 |ode entry.point | 000018a0 6f 66 20 61 6e 79 20 6d 6f 64 65 2e 0a 0a 54 68 |of any mode...Th| 000018b0 65 20 65 6e 74 72 79 20 70 6f 69 6e 74 20 74 61 |e entry point ta| 000018c0 62 6c 65 20 66 6f 72 6d 61 74 20 69 73 20 64 65 |ble format is de| 000018d0 73 63 72 69 62 65 64 20 69 6e 20 74 68 65 20 66 |scribed in the f| 000018e0 69 6c 65 20 45 2d 45 6e 74 72 79 2e 20 50 6c 65 |ile E-Entry. Ple| 000018f0 61 73 65 20 6e 6f 74 65 0a 74 68 61 74 20 79 6f |ase note.that yo| 00001900 75 20 6f 6e 6c 79 20 68 61 76 65 20 74 6f 20 66 |u only have to f| 00001910 69 6c 6c 20 69 6e 20 74 68 65 20 66 69 72 73 74 |ill in the first| 00001920 20 38 20 77 6f 72 64 73 2e 20 49 6e 20 74 68 65 | 8 words. In the| 00001930 20 66 6f 75 72 74 68 20 65 6e 74 72 79 20 79 6f | fourth entry yo| 00001940 75 0a 73 70 65 63 69 66 79 20 61 20 42 41 53 45 |u.specify a BASE| 00001950 20 4d 4f 44 45 2e 20 54 68 69 73 20 6d 6f 64 65 | MODE. This mode| 00001960 20 69 73 20 63 61 6c 6c 65 64 20 69 6e 73 74 65 | is called inste| 00001970 61 64 20 6f 66 20 79 6f 75 72 73 20 66 6f 72 20 |ad of yours for | 00001980 61 6c 6c 20 74 68 65 20 6d 6f 64 65 0a 65 6e 74 |all the mode.ent| 00001990 72 79 20 70 6f 69 6e 74 73 20 79 6f 75 20 64 6f |ry points you do| 000019a0 6e 27 74 20 77 61 6e 74 20 74 6f 20 73 75 70 70 |n't want to supp| 000019b0 6f 72 74 2f 63 68 61 6e 67 65 2e 20 48 65 6e 63 |ort/change. Henc| 000019c0 65 20 69 6e 20 6d 6f 73 74 20 63 61 73 65 73 20 |e in most cases | 000019d0 79 6f 75 20 77 69 6c 6c 0a 73 65 74 20 61 20 62 |you will.set a b| 000019e0 61 73 65 20 6d 6f 64 65 20 6f 66 20 30 20 28 69 |ase mode of 0 (i| 000019f0 65 20 54 45 58 54 29 2c 20 61 6e 64 20 73 65 74 |e TEXT), and set| 00001a00 20 61 6c 6c 20 6f 66 20 74 68 65 20 65 6e 74 72 | all of the entr| 00001a10 79 20 70 6f 69 6e 74 73 20 65 78 63 65 70 74 20 |y points except | 00001a20 74 68 6f 73 65 0a 79 6f 75 20 77 69 73 68 20 74 |those.you wish t| 00001a30 6f 20 63 68 61 6e 67 65 20 74 6f 20 30 2e 0a 0a |o change to 0...| 00001a40 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a |****************| * 00001a80 2a 2a 2a 2a 2a 2a 2a 2a 2a 0a 2a 20 53 65 63 74 |*********.* Sect| 00001a90 69 6f 6e 20 43 3a 09 41 64 64 69 6e 67 20 6e 65 |ion C:.Adding ne| 00001aa0 77 20 74 61 62 6c 65 73 20 6f 66 20 63 6f 6d 6d |w tables of comm| 00001ab0 61 6e 64 73 09 09 09 09 2a 0a 2a 2a 2a 2a 2a 2a |ands....*.******| 00001ac0 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a |****************| * 00001b00 2a 2a 2a 0a 0a 5a 61 70 20 63 75 72 72 65 6e 74 |***..Zap current| 00001b10 6c 79 20 68 61 73 20 73 70 61 63 65 20 72 65 73 |ly has space res| 00001b20 65 72 76 65 64 20 66 6f 72 20 75 70 20 74 6f 20 |erved for up to | 00001b30 31 36 20 63 6f 6d 6d 61 6e 64 20 74 61 62 6c 65 |16 command table| 00001b40 73 2c 20 74 68 6f 75 67 68 20 49 20 63 61 6e 0a |s, though I can.| 00001b50 65 61 73 69 6c 79 20 69 6e 63 72 65 61 73 65 20 |easily increase | 00001b60 74 68 69 73 2e 20 54 68 65 20 5a 61 70 2c 5a 61 |this. The Zap,Za| 00001b70 70 42 61 73 69 63 20 6d 6f 64 75 6c 65 73 20 65 |pBasic modules e| 00001b80 61 63 68 20 75 73 65 20 6f 6e 65 2c 20 6c 65 61 |ach use one, lea| 00001b90 76 69 6e 67 20 31 34 20 66 6f 72 0a 6f 74 68 65 |ving 14 for.othe| 00001ba0 72 20 75 73 65 73 2e 20 41 20 63 6f 6d 6d 61 6e |r uses. A comman| 00001bb0 64 20 74 61 62 6c 65 20 63 6f 6e 73 69 73 74 73 |d table consists| 00001bc0 20 6f 66 20 61 20 70 6f 69 6e 74 65 72 20 74 6f | of a pointer to| 00001bd0 20 61 20 74 61 62 6c 65 20 6f 66 20 63 6f 6d 6d | a table of comm| 00001be0 61 6e 64 73 20 61 73 0a 64 65 73 63 72 69 62 65 |ands as.describe| 00001bf0 64 20 69 6e 20 74 68 65 20 66 69 6c 65 20 45 2d |d in the file E-| 00001c00 43 6f 6d 6d 61 6e 64 73 2e 20 54 68 65 20 63 6f |Commands. The co| 00001c10 6d 6d 61 6e 64 20 74 61 62 6c 65 20 73 68 6f 75 |mmand table shou| 00001c20 6c 64 20 62 65 20 73 74 6f 72 65 64 20 69 6e 20 |ld be stored in | 00001c30 61 0a 6d 6f 64 75 6c 65 20 61 6e 64 20 72 65 67 |a.module and reg| 00001c40 69 73 74 65 72 65 64 20 77 69 74 68 20 5a 61 70 |istered with Zap| 00001c50 20 77 68 65 6e 20 74 68 65 20 6d 6f 64 75 6c 65 | when the module| 00001c60 20 69 6e 69 74 69 61 6c 69 73 65 73 20 62 79 20 | initialises by | 00001c70 63 61 6c 6c 69 6e 67 20 74 68 65 20 5a 61 70 0a |calling the Zap.| 00001c80 65 6e 74 72 79 20 70 6f 69 6e 74 20 5a 61 70 5f |entry point Zap_| 00001c90 41 64 64 43 6f 6d 6d 61 6e 64 73 2e 20 41 73 20 |AddCommands. As | 00001ca0 77 69 74 68 20 61 64 64 69 6e 67 20 61 20 6d 6f |with adding a mo| 00001cb0 64 65 2c 20 74 68 65 20 6d 6f 64 75 6c 65 20 73 |de, the module s| 00001cc0 68 6f 75 6c 64 20 62 65 0a 6c 6f 61 64 65 64 20 |hould be.loaded | 00001cd0 62 79 20 61 6c 74 65 72 69 6e 67 20 5a 61 70 27 |by altering Zap'| 00001ce0 73 20 21 52 75 6e 20 66 69 6c 65 2c 20 73 6f 20 |s !Run file, so | 00001cf0 74 68 61 74 20 74 68 65 20 6d 6f 64 75 6c 65 20 |that the module | 00001d00 69 73 20 6c 6f 61 64 65 64 20 61 66 74 65 72 20 |is loaded after | 00001d10 5a 61 70 2c 0a 62 75 74 20 62 65 66 6f 72 65 20 |Zap,.but before | 00001d20 74 68 65 20 5a 61 70 5f 44 65 73 6b 74 6f 70 20 |the Zap_Desktop | 00001d30 63 6f 6d 6d 61 6e 64 2e 0a 0a 54 68 65 20 6d 61 |command...The ma| 00001d40 69 6e 20 75 73 65 20 6f 66 20 61 64 64 69 6e 67 |in use of adding| 00001d50 20 6e 65 77 20 63 6f 6d 6d 61 6e 64 73 20 69 73 | new commands is| 00001d60 20 74 6f 20 61 64 64 20 61 64 64 69 74 69 6f 6e | to add addition| 00001d70 61 6c 20 6b 65 79 6d 61 70 73 20 74 6f 20 5a 61 |al keymaps to Za| 00001d80 70 2e 20 46 6f 72 0a 65 78 61 6d 70 6c 65 2c 20 |p. For.example, | 00001d90 74 68 65 20 65 78 74 72 61 20 63 6f 6d 6d 61 6e |the extra comman| 00001da0 64 73 20 6e 65 65 64 65 64 20 62 79 20 74 68 65 |ds needed by the| 00001db0 20 45 4d 41 43 53 20 6b 65 79 6d 61 70 20 66 6f | EMACS keymap fo| 00001dc0 72 20 5a 61 70 20 61 72 65 20 73 74 6f 72 65 20 |r Zap are store | 00001dd0 69 6e 0a 74 68 65 20 5a 61 70 42 61 73 69 63 20 |in.the ZapBasic | 00001de0 6d 6f 64 75 6c 65 2e 0a 0a 53 65 65 20 74 68 65 |module...See the| 00001df0 20 66 69 6c 65 20 45 2d 43 6f 6d 6d 61 6e 64 20 | file E-Command | 00001e00 66 6f 72 20 66 75 6c 6c 65 72 20 64 65 74 61 69 |for fuller detai| 00001e10 6c 73 2e 0a |ls..| 00001e14