0000-1FFF ROM 0 8K (VZ-200) 2000-3FFF ROM 1 8K (VZ-200) 0000-3FFF ROM (VZ-300) 4000-5FFF DOS ROM 8K 6000-67FF RESERVED FOR ROM CARTRIDGES (2K) 6800-6FFF MEMORY MAPPED I/O 2K; KEYBOARD, CASSETTE I/O, SPEAKER, VDP CONTROOL 7000-77FF VIDEO RAM 2K 7800-8FFF INTERNAL USER RAM 6K (RESERVED RAM VZ-200) 7800-B7FF INTERNAL USER RAM 16K (RESERVED RAM VZ-300) 9000-CFFF 16K EXPANSION (VZ-200) B800-F7FF 16K EXPANSION (VZ-300) 5640 5711 Routine pointer table 1 5712 6177 word table 6178 6297 Routine pointer table 2 31465 7AE9 START OF USER MEMORY 36864 9000 TOP OF MEMORY VZ-200 (6K) 45184 B800 TOP OF MEMORY VZ-300 (16K) 53348 D000 TOP OF MEMORY VZ-200 (6K + 16K EXPANSION) 63488 F800 TOP OF MEMORY VZ-300 (16K + 16k EXPANSION) 65535 FFFF THE VERY TOP token routine address address token word dec lo hi hex 5712 128 end 7598 174 29 1dae 5715 129 for 7329 161 28 1ca1 5718 130 reset 312 56 1 0138 5723 131 set 309 53 1 0135 5726 132 cls 457 201 1 01c9 5732 134 random 467 211 1 01d3 5738 135 next 8886 182 34 22B6 5742 136 DATA 7941 5 31 1F05 5746 137 INPUT 8602 154 33 219A 5751 138 DIM 9736 8 38 2608 5754 139 READ 8687 239 33 21EF 5758 140 LET 7969 33 31 1F21 5761 141 GOTO 7874 194 30 1EC2 5765 142 RUN 7843 163 30 1EA3 5768 143 IF 8249 57 32 2039 5770 144 RESTORE 7569 145 29 1D91 5777 145 GOSUB 7857 177 30 1EB1 5782 146 RETURN 7902 222 30 1EDE 5788 147 REM 7943 7 31 1F07 5791 148 STOP 7953 169 29 1DA9 5795 149 ELSE 7943 7 31 1F07 5799 150 COPY 14610 18 57 3912 5803 151 COLOR 14493 157 56 389D 5808 152 VERIFY 14136 56 55 3738 5814 153 DEFINT 7683 3 30 1E03 5820 154 DEFSNG 7686 6 30 1E06 5826 155 DEFDBL 7689 9 30 1E09 5832 156 CRUN 14126 46 55 372E 5836 157 MODE 11875 99 46 2E63 5840 158 SOUND 11253 245 43 2BF5 5845 159 RESUME 8111 175 31 1FAF 5851 160 OUT 11003 251 42 2AFB 5854 161 ON 8044 108 31 1F6C 5856 162 OPEN 31097 121 121 7979 5860 163 FIELD 31100 124 121 797C 5865 164 GET 31103 127 121 797F 5868 165 PUT 31106 130 121 7982 5871 166 CLOSE 31109 131 121 7988 5876 167 LOAD 31112 136 121 7988 5880 168 MERGE 31115 139 121 798B 5885 169 NAME 31118 142 121 798E 5889 170 KILL 31121 145 121 7991 5893 171 LSET 31127 151 121 7997 5897 172 RSET 31130 154 121 799A 5901 173 SAVE 31136 160 121 79A0 5905 174 SYSTEM 0 0 0 0000 5911 175 LPRINT 8295 103 32 2067 5917 176 DEF 31067 91 121 795B 5920 177 POKE 11441 177 44 2CB1 5924 178 PRINT 8303 111 32 206F 5929 179 CONT 7652 228 29 1DE4 5933 180 LIST 11054 46 43 2B2E 5937 181 LLIST 11049 41 43 2B29 5942 182 DELETE 11206 198 43 2BC6 5948 183 AUTO 8200 8 32 2008 5952 184 CLEAR 7802 122 30 1E7A 5957 185 CLOAD 13910 86 54 3656 5962 186 CSAVE 13481 169 52 34A9 5967 187 NEW 6985 73 27 1B49 5970 188 TAB( NO ADDRESS LIST 5974 189 TO NO ADDRESS LIST 5976 190 FN NO ADDRESS LIST 597B 191 USING NO ADDRESS LIST 5983 192 VARPTR NO ADDRESS LIST 5989 193 USR NO ADDRESS LIST 5992 194 ERL NO ADDRESS LIST 5995 195 ERR NO ADDRESS LIST 5998 196 STRING$ NO ADDRESS LIST 6005 197 INSTR NO ADDRESS LIST 6010 198 POINT NO ADDRESS LIST 6015 199 TIME$ NO ADDRESS LIST 6020 200 MEM NO ADDRESS LIST 6023 201 INKEY$ NO ADDRESS LIST 6029 202 THEN NO ADDRESS LIST 6033 203 NOT NO ADDRESS LIST 6036 204 STEP NO ADDRESS LIST 6040 205 + NO ADDRESS LIST 6041 206 - NO ADDRESS LIST 6042 207 * NO ADDRESS LIST 6043 208 / NO ADDRESS LIST 6044 209 ^ NO ADDRESS LIST 6045 210 AND NO ADDRESS LIST 6048 211 OR NO ADDRESS LIST 6050 212 > NO ADDRESS LIST 6051 213 = NO ADDRESS LIST 6052 214 < NO ADDRESS LIST 6053 215 SGN 2442 138 9 098A 6056 216 INT 2871 55 11 0B37 6059 217 ABS 2423 119 9 0997 6062 218 FRE 10196 212 39 27D4 6065 219 INP 10991 239 42 2AEF 6068 220 POS 10229 245 39 27F5 6071 221 SQR 5095 231 19 13E7 6074 222 RND 5321 201 20 14C9 6077 223 LOG 2057 9 8 0809 6080 224 EXP 5177 57 20 1439 (?) 6083 225 COS 5441 65 21 1541 6086 226 SIN 5447 71 21 1549 (?) 6089 227 TAN 5544 168 21 15AB 6092 228 ATN 5565 189 21 15BD 6095 229 PEEK 11434 170 44 2CAA 6099 230 CVI 31058 82 121 7952 6102 231 CVS 31064 88 121 7954 6105 232 CVD 31070 94 121 795E 6108 233 EOF 31073 97 121 7961 6111 234 LOC 31076 100 121 7964 6114 235 LOF 31079 103 121 7967 6117 236 MKI$ 31082 106 121 796A 6121 237 MKS$ 31085 109 121 796D 6125 238 MKD$ 31088 112 121 7970 6129 239 CINT 2687 127 10 0A7F 6133 240 CSNG 2737 177 10 0AB1 6137 241 CDBL 2779 219 10 0ADB 6141 242 FIX 2854 38 11 0B26 6144 243 LEN 10755 3 42 2A03 6147 244 STR$ 10294 54 40 2836 6151 245 VAL 10949 197 42 2AC5 6154 246 ASC 10767 15 42 2A0F 6157 247 CHR$ 10783 31 42 2A1F 6161 248 LEFT$ 10849 97 42 2A81 (?) 6166 249 RIGHT$ 10897 145 42 2A91 6172 250 MID$ 10906 154 42 2A9A Disk tokens and offsets WITH NO ROUTINES AT THESE LOCATIONS (SPARE TOKENS) word address token word address in pointer 5729 133 CMD 31091 5856 162 OPEN 31097 5860 163 FIELD 31100 5865 164 GET 31103 5868 165 PUT 31106 5871 166 CLOSE 31109 5876 167 LOAD 31112 5880 168 MERGE 31115 5885 169 NAME 31118 5889 170 KILL 31121 5893 171 LSET 31127 5897 172 RSET 31130 5901 173 SAVE 31136 5905 174 SYSTEM 0 5917 176 DEF 31067 5976 190 FN NO ADDRESS LIST 6005 197 INSTR NO ADDRESS LIST 6015 199 TIME$ NO ADDRESS LIST 6099 230 CVI 31058 6102 231 CVS 31064 6105 232 CVD 31070 6108 233 EOF 31073 6111 234 LOC 31076 6114 235 LOF 31079 6117 236 MKI$ 31082 6121 237 MKS$ 31085 6125 238 MKD$ 31088 Most of the VZs BASIC words that were never enabled in the VZ have dedicated processing routines in ROM. Each of these words is listed along with its token code, its start address in the WORD TABLE, and the start address for the routine that processes it. The routine addresses are listed in decimal, then in LO HI format (where address = LO + HI * 256) and in hex. Words from END (token 128) to NEW (token 187) are all words that must begin a BASIC statement if they are used at all. Some such as END,CLS,NEW,STOP must stand alaone as the entire statement or be the primary word of an extended statement. Each of these words has a two byte pointer in the POINTER TABLE that follows the WORD TABLE. The pointer contains the address (in LO HI format) of the routine that executes the word. Words from SGN (token 215) to MID$ (token 250) are all words that cannot occur at the start of a basic statement. Each has a pointer in the POINTER TABLE which proceeds the WORD TABLE, where again the pointer addresses a processing routine (execute!) for that word. Words from TAB( (token 188) to < (token 214) do not have pointers in either of the POINTER TABLES. They are executed by the primary words of statements in which they occur. Strictly speaking it is the tokens that do all the dirty work. When the program is RUN, tokens 205 to 208 and 212 to 214 designate words that display on screen as graphic characters (sort of like the ZX spectrum had). The program is accurate. The first byte of each word being in inverse form to mark the start of a new word. This is strictly true for words which begin with alphabetical characters, the majority, but not for those few words that consist of nonalphabetical characters. A more accurate wording would be: The first byte of each word being the ASCII character code + 128 to mark the start of a new word. For alphabetical characters, adding 128 to the ASCII code will yield the inverse character code. Most BASIC words begin with an alphabetical character, so most of the words in the WORD TABLE will begin with an inverse character. However a few BASIC words consist of a single nonalphabetical character: +,,*,/,^,>,=,< They too are represented in the WORD TABLE by the ascii code + 128, but this does not yield the inverse character codes. On the VZ, for those characters with ASCII codes less than 64, the inverse character code is the ASCII code + 192. Still, when the VZ BASIC INTERPRETER comes across one of these words in the WORD TABLE, it subtracts 128 to get the ASCII code. RAM Communication Region 30720 - 30740 7800-7814 RST JUMP VECTORS 30720-2 7800-2 RST 8 JP 1C96 30723-5 7803-5 RST 10 JP 1D78 (dos 4293) 30726-8 7806-8 RST 18 JP 1C90 30729-31 7809-B RST 20 JP 25D9 30732-4 780C-E RST 28 SET TO RETURN 30735-7 780F-11 RST 30 SET TO RETURN 30738-40 7812-4 RST 38 SET TO EI,RETURN 30741 - 30748 7815 - 781C KEYBOARD D.B.C 30741 7815 DEVICE TYPE 1 30742-3 7816 DRIVER ADDRESS 12020 30744 7818 INVERSE SCREEN 30745 7819 INVERSE CHARACTERS 30746 781A ? NOT USED 30747-8 781B-C RAM BUFFER ADDRESS NOT USED 30749-30756 781D-7824 VIDEO D.B.C 30749 781D DEVICE TYPE 0 30750-1 781E-F DRIVER ADDRESS 30752-3 7820-1 CURSOR POSITION RANGE 28672 TO 29183 30754 7822 ? NOT USED 30755-6 7823-4 CHECKSUM DURING TAPE LOAD 30757 - 30764 7825 - 782C PRINTER D.B.C 30757 7825 DEVICE TYPE 6 30758-9 7826-7 DRIVER ADDRESS 1421 30760 7828 LINES PER PAGE ? NOT USED 30761 7829 LINES PRINTED SO FAR ? NOT USED 30762 782A ?NOT USED 30763-4 782B-C RAM BUFFER ADDRESS ? NOT USED 30765-70 782D-32 ?UNUSED BY VZ 30771-3 7833-5 LD A,0 RET PRINTER ERROR VECTOR 30774 7836 START OF KEYBOARD WORK AREA STORE FOR CHARACTER OF KEY PRESSED 30775 7837 ? 30776 7838 INVERSE PRINTING 2 enables 30777 7839 LOW RES SPEED UP 35 is slow BIT 3 - VERIFY FLAG (LOADING ROUTINE) BIT 4 - UP/DOWN CURSOR DISABLE BIT 5 - AUTORUN (CRUN) FLAG 30778 783A ? 30779 783B COPY OF O/P LATCH / BACKGROUND COLOUR; 32 GREEN 48 buff 30780 783C STORES CHARACTERS AT CURSOR POSITION 30781 783D VIDEO CONTROL WORD ? NOT USED 30782-844 783E-7C USED DURING IPL SEQUENCE - when computer first switched on 30785 7841 CURSOR FLASH RATE 30786-89 USED IN KEYBOARD SCAN ROUTINE 30786 STORES ROW NUMBER OF KEYBOARD ; range 1-8 30787 STORES COLUMN NUMBER OF KEYBOARD ; range 1-6 30788-9 STORES THE ROW ADDRESS 30790 STORES FOREGROUND COLOUR; 0,16,32,48,64,80,96,112 -colours green to orange 30796 LOADING MESSAGE DISABLE FLAG (nonzero=disable) 30845-7 INTERRUPT EXIT 30848-61 DIVISION SUPPORT ROUTINE 30862-3 USR POINTER 30864 RND NUMBER SEED 30867-9 IN A,0 RET INP ROUTINE 30870-2 OUT (O),A RET OUT ROUTINE 30873 LAST KEY PRESSED 30874 ERROR CODE STORAGE/SIGNALS RESUME ENTERED 30875 PRINTER CARRIAGE POSITION 30876 OUTUT DEVICE CODE 0=video,1=printer,255(-1)=cassette 30877 SIZE OF VIDEO LINE ?NOT USED 30878 HIGH OR LOW RES?NOT USED 30879 ?NOT USED 30880-1 BASIC STACK ADDRESS/LOWER BOUNDARY OF STRING SPACE 30882-3 CURRENT BASIC LINE NUMBER/ADDRESS OF LINE WITH ERROR 30884-5 START OF PROGRAM 30886 TAB CURSOR POSITION 30887-8 KEYBOARD BUFFER POINTER;31208 30889 0 IF CASSETTE INPUT ELSE NONZERO 30890-3 RANDOM NUMBER SEED 30894 VARIABLE FLAG 30895 VARIABLE TYPE FLAG (integer,string,single,double) 30896 EXPRESSION EVALUATION/DATA STATEMENT FLAG 30897-8 TOP OF MEMORY POINTER 30899-900 NEXT LOCATION IN LITERAL STRING POOL 30901-30 LITERAL STRING POOL; 30bytes 30931 LENGTH OF LAST DEFINED STRING 30932-3 ADDRESS OF LAST DEFINED STRING 30934-5 POINTER TO NEXT AVAILABLE PLACE IN STRING SPACE 30936-7 INDEX OF LAST BYTE EXECUTED IN CURRENT STATEMENT EDIT FLAG DURING PRINT USING 30938-9 LINE NUMBER OF LAST DATA STATEMENT READ 30940 'FOR' STATEMENT FLAG; 1 FOR IN PROGRESS; 0 NO FOR 30941 INPUT PHRASE ENTERED FLAG; 0 DURING INPUT PHASE 30942 INPUT/READ FLAG; 0 INPUT; 1 READ 30943-4 POINTER TO START OF PROGRAM WHEN RUN 30945 AUTO INPUT FLAG FIELD; 0=no auto 30946-7 CURRENT LINE NUMBER DURING INPUT PHASE 30948-9 AUTOLINE INCREMENR 30950-1 ADDRESS OF LAST BYTE EXECUTED IN CURRENT LINE 30952-3 BACKSPACED STACK ADDRESS 30954-5 ERROR LINE NUMBER 30956-7 ERROR LINE NUMBER / LINE NUMBER FOR LAST BASIC LINE ENTERED OR DELETED 30958-68 ? 30969-70 END OF PROGRAM/START SIMPLE VARIABLES TABLE 30971-2 START OF DIM VARIABLES TABLE 30973-4 START OF FREE MEMORY 30975-6 DATA POINTER (read statement) 30977-1002 VARIABLE DECLARATION TABLE 26 entries (A to Z) 31003 TRACE FLAG 1=on 0=off 31004 TEMPORARY STORAGE USED BY NUBERIC ROUTINES WHEN UNPACKING A FLOATING POINT NUMBER 31005-31012 WORKING REGISTER AREA INTEGER SINGLE DOUBLE, 31005 LSB 31006 LSB 31007 LSB 31008 LSB 31009 LSB LSB LSB ;31009-10 USER ARGUMENT STORE 31010 MSB LSB LSB 31011 MSB MSB 31012 EXP EXP 31013 SIGN OF RESULT DURING MATH & ARITHMETIC OPERATIONS 31014 BIT BUCKET USED DURING DP ADDITION 31015-22 WRA2 SAME AS WRA1 31023 not used 31024-49 PRINTER BUFFER 31050-7 TEMPORAY STORAGE USED BY DOUBLE PRECISION DIVISION ROUTINE 31058-147 TRS-80 DISK BASIC EXITS - INITIALISED TO RETURNS 31148-204 79AC-79E4 TRS-80 DOS EXIT ADDRESSES 31148 79AC DOS EXIT FROM: 1A1C 79AF 79B2 1AA1 79B5 1AEC 79B8 1AF2 79BB 1B8C 79BE 2174 79C1 032C 79C4 0358 79C7 1EA6 79CA 206F 79CD 79D0 2103 79D3 2108 79D6 219E 79DC 222D 79DF 2278 79E2 31205-7 USED BY INPUT 31208-72 BASIC LINE INPUT BUFFER 31273 116 BYTES OF UNUSED MEMORY 31389 TAPE NAME 31405-31446 ? 31447-31462 TAPE LOADING ROUTINE 31463-4 ZERO End of Communications RAM Region ----------------------------------------------------------------------------- DOS ENTRY POINTS a jump table to the dos subroutines is positioned at the fixed address from 4008h to 4044h. the jump table contains the following elements: 4008h jp pwrin disk power on 400bh jp pwoff disk power off 400eh jp error error handling routine 4011 jp rdmap read the track map of the disk 4014 jp clear clear a sector of the disk 4017 jp svmap save the track map to the disk 401a jp init initialises the disk 401d jp csi command string interpreter 4020 jp hex convert ascii to hex 4023 jp idam read the identification address mark 4026 jp create create an entry in directory 4029 jp map search for empty sector 402c jp search search for file in directory 402f jp find search empty space in directory 4032 jp write write a sector to disk 4035 jp read read a sector from disk 4038 jp dly delay ms in reg c 403b jp stpin step in 403e jp stpout step out 4041 jp dkload load a file from disk 4044 jp saveob save a file to disk