Download 6 - Forth Interest Group
Transcript
both in function and code size. Assembly code words which do not contain short absolute addresses are also unaffected. For those that do, their code has been modified to use long absolute addressing. For the programmer who is coding in assembly, only two adjustments in coding technique must be made. Follow each short absolute address with the system's base-page address (BPAGE)and use the long absolute assembly mnemonic [i.e., L#) vs. # ) 1 whenever addressing memory directly. For example, to copy the 16-bit value from the variable SPAN to D l , instead of using: SPAN #) MOVE Dl write: SPAN BPAGE L#) Dl MOVE ( $FF FFFF) Where F83 needs to be4 ( RAM AREA ) -Top of my system RAM Memory grows downwards ( I10 AREA ) r:SZrLram P ( ROM AREA ) I system Boot RoMs Figure One. Memory map of the HP9920. Page of Memory m - Relative Memory Location 31 Address Register 15Forth addr Page addr 4 A System Memory -4 64Kb page Address of Memory Page / Figure Two. Representation of page and local addresses in memory. Volwne IX.Number 6 21 0 where BPAGE is a 16-bit constant which returns the 64K page address to which the system was compiled. A second constant BOFFSET specifies the starting address of the kemel within this page. These two words are defined twice in the kernel source: Screen #1 contains the definitions used by the metacompiler to target the kernel, and screen #I34 contains the definitions for use by the Forth programmer. To compile the kernel at a new target address, simply edit the definitions BPAGE and BOFFSET in screen #1 of the kemel, and compile the system as described by Laxen and Perry. (See Listing One, screen #I.) Note: each listing contains the original source screens in the left column, and its corresponding 'extended' source screens in the right column. Screen lines (in the 'extended' source) that actually contain modified code are marked with a vertical bar at the beginning of the line. Extending F83 resulted in 10words and five source screens requiring modifications in the KERNEL68 file (see Listing One), and 10 words and one source screen in the EXTEND68 and CPU68000 files (see Listing Two). No modifications were required in either the METACOMPILER or UTILITY files. The effect on code size and execution speed was as follows: a 640 byte growth in size and a 3% increase in execution time (based on the benchmark published in Forth Dimensions VIIV4 - see Listing Three). To run this modified F83 (F83X). your system must meet only three requirements. First, the computer must be 680x0 based. Second, the computer must use CP/M-68K as its operating system. Thud, the Transient Program Area (TPA) of the CP/M68K system must define a region of memory that contains at least one 64K bounded page of RAM (i.e., $F2 0000 through $F2 FFFF). (See Figure Four.) For those of you interested in loading F83X onto your system, I have written a CPM-68K relocatable program called GENF83X.REL that enables the user to bootstrap a relocatable version of F83X, called F83XREL.HEX, onto their system. To install F83X, the users copies GENF83X.REL and F83XREL.HEX onto an empty, formatted diskette and places it into the default drive. The user then exeForth Dimensions