home *** CD-ROM | disk | FTP | other *** search
/ ftp.whtech.com / ftp.whtech.com.tar / ftp.whtech.com / compuserve / P-Code / SYSMAP.TXT < prev    next >
Text File  |  2006-10-19  |  13KB  |  369 lines

  1.  
  2.                     The p-code card
  3.                    -----------------
  4.  
  5. The p-code card has a total memory capacity of 60 kilobytes.
  6. This memory consists of 12 K ROM and 48 K GROM.
  7.  
  8. ROM:
  9. The ROM memory is located at 4000-5FFF.
  10. 5000-5FFF is paged in two pages, but the lower four kilobytes are always the
  11. same.
  12. The paging is done with CRU bit 1F80. Resetting the bit to zero gives access
  13. to the normal page. Setting the bit to one switches in the extra page.
  14.  
  15. GROM:
  16. The GROM chips contain the files that are located in unit #14: (OS:).
  17. They also contain various data and assembly code, which is loaded into RAM
  18. when the card is initialized.
  19.  
  20. The p-code GROM is accessed just like the console and module GROM chips,
  21. but at different addresses.
  22. The following are used:
  23. PGRMRD 5BFC Read data.
  24. PGRMRA 5BFE Read address.
  25. PGRMWD 5FFC Write data. (Not used. No GRAM here.)
  26. PGRMWA 5FFE Write address.
  27.  
  28.  
  29. When running, the p-system uses several different workspaces. The main one
  30. used, however, is located at 8380.
  31. Others used are 83A0, 83C0, 83E0 (GPLWS), 2896 and 28B6.
  32. Maybe others too, for special purposes.
  33.  
  34. R8  in the main workspace (8380) is the p-code instruction pointer.
  35. R9  is used as a frame pointer for activation records allocated on the stack.
  36. R10 is the stack pointer.
  37. R11 is the return link.
  38. R12 contains the address of the PME instruction fetch routine.
  39. R13 contains the Read Data address of the currently executing code segment.
  40.     Could be PGRMRD, VDPRD or 0 (for CPU RAM).
  41. R14 Global data frame pointer for current segment.
  42. R15 is a flag used to remember where the p-code currently interpreted is
  43.     located.
  44.     =0: CPU RAM
  45.     <0: VDP RAM
  46.     >0: GROM
  47.  
  48.  
  49.                        Map of 8K RAM under the p-system.
  50.                        All addresses in hex.
  51. =============================================================================
  52.  
  53. 2000-277F  80 column screen.
  54.            Temporarily used for other purposes during power-up.
  55. 2780       INTMEM   Interpreters memory pointer in VDP RAM.
  56.            Initialized to 0DF8.
  57. 2782       TOPMEM   Top memory pointer in VDP RAM.
  58.            Initialized to 3EDF.
  59. 2784-27B7  Sound data.
  60. ***
  61. 27D8-27E6  Sound data.
  62. ***
  63. 2808       Last sprite coincidence counter.
  64. 280A-280C  Bit maps for moving sprites.
  65. ***
  66. 2810-281C  Copies of VDP register 1-7 (standard mode).
  67.            Used when initializing the p-code card.
  68. 281E       VDP status copy.
  69. ***
  70. 2886       Cursor addressing flag.
  71. ***
  72. 288A       Keyboard buffer pointer.
  73. 288C       Keyboard layout area pointer.
  74. 288E       Screen blanking timer.
  75. 2890       Stop flag.           False=0, true=FFFF
  76. 2892       Alpha lock flag.
  77. 2894       Flush flag
  78. 2896-28B4  Subsidary workspace.
  79.  28A2      Key buffer mode flag. (FF40=empty, FF00=something, FF80=full)
  80.  28A4      Key buffer store pointer  [0..31]
  81.  28A6      Key buffer fetch pointer  [0..31]
  82.  28AA      VDPWA (at least sometimes).
  83. 28B6-28D4  "Interrupt" workspace.
  84. ***
  85. 2960       PAB pointer
  86. ***
  87. 2964-2982  Workspace
  88. 2984       Index into interrupt address table.
  89. 2986-29A2  CRU addresses of cards with interrupt routines. End marker=0000.
  90.  29AA      Block number.
  91.  29AC      Byte count.
  92.  29AE      Buffer address.
  93.  29B0      Drive number.
  94.  29B2      Control parameter.
  95. ***
  96. 29A8-29B8  Data passed to I/O routines.
  97. ***
  98. 29DC-2A1C  PAB pointer table for units.
  99. ***
  100. 2A24-2A32  Register save area R0-R7.
  101. 2A34       Save area.
  102. ***
  103. 2AA0-2AA4  KSCAN data for 83C6-83CA
  104. ***
  105. 2AAA-2AAC  Vector for "interrupt".                           (28B6  32DC)
  106. 2AAE-2AB0  Vector for keyboard scanning and buffer storage.  (2896  41BA)
  107.  
  108.            (* Various PME data located at 2AB2-2AF6.
  109.               Used for task switching and similar. *)
  110.  
  111. 2AB2       Current SIB pointer.                     (CURSIB)
  112. 2AB4       Current Environment Record Pointer       (E_Rec_P)
  113. 2AB6       Pointer to TIB at head of ready queue.   (READYQ)
  114. 2AB8       Current Environment Vector Pointer       (E_Vec_P).
  115. 2ABA       Current TIB pointer.                     (CURTSK)
  116.              See Internal Architecture Guide for descriptions of TIB, SIB and
  117.              environment vectors and records.
  118. ***
  119. 2ABE       Current segment constant pool pointer (absolute).
  120. 2AC0       Current segment constant pool pointer (relative).
  121. 2AC3       Current procedure number (byte). (High byte not used?)
  122. ***
  123. 2ACC       P-code IPC save area. Used by the PME.
  124. ***
  125. 2ADC       Return address (R11) savearea.
  126. ***
  127. 2AE2       Segment base. IPC is segment relative.
  128. 2AE4       Routine dictionary pointer.
  129. ***
  130. 2AE8       PME flip indicator.
  131. ***
  132. 2AF2       Save area.
  133. ***
  134. 2AF8-2B12  'Segment ________ not found:'
  135. 2B14-2B31  'Put volume _______ in unit #__'
  136. 2B33-2B4F  'Press spacebar to continue...'
  137. ***
  138. 2BA4-2BA6  System clock (low,high).
  139. ***
  140. 2BB8       24 (Screen height).
  141. 2BBA       40 (Screen width).
  142. 2BBC       Code for arrow down.
  143. 2BBD       Code for arrow up.
  144. 2BBE       Code for arrow right.
  145. 2BBF       Code for arrow left.
  146. 2BC0       Code for FLUSH.
  147. 2BC1       Code for etx.
  148. 2BC2       Code for STOP.
  149. 2BC3       Code for BREAK.
  150. 2BC4       Code for editor unknown character?
  151. 2BC5       Code for backspace.
  152. 2BC6       Code for escape.
  153. 2BC7       Code for line delete.
  154. 2BC8       Code for etx.
  155. 2BC9       ?
  156. 2BCA       Code for alpha lock.
  157. ***
  158. 2BD0-2BEA  TIB for main task.
  159. ***
  160. 2BFC-2C1C  Corresponding drive number (byte) for blocked units.
  161. ***
  162. 2C20-2C60  Table with pointers for different units.
  163.  2C20      0000     #0  (Reserved)
  164.  2C22      2C68     #1  CONSOLE
  165.  2C24      2C68     #2  SYSTERM
  166.  2C26      0000     #3  (Graphic)  Reserved for Terak microcomputers.
  167.  2C28      2C70     #4  Diskette name
  168.  2C2A      2C70     #5  Diskette name
  169.  2C2C      2C80     #6  PRINTER
  170.  2C2E      2C80     #7  REMIN
  171.  2C30      2C80     #8  REMOUT
  172.  2C32      2C70     #9  Diskette name
  173.  2C34      0000     #10 (Diskette name)
  174.  2C36      0000     #11 (Diskette name)
  175.  2C38      0000     #12 (Diskette name)
  176.  2C3A      2C70     #13 Assigned to unit loaded from tape.
  177.  2C3C      2C70     #14 OS
  178.  2C3E      2C70     #15
  179.    ...and so on...
  180.  2C5C      2C70     #30
  181.  2C5E      2C88     #31 TAPE
  182.  2C60      2C78     #32 TP
  183. ***
  184.            (* Addresses in secondary ROM page *)
  185. 2C68-2C6E  538E 547E 5270 5360  (Computer console)
  186. 2C70-2C76  5796 5740 568C 5652  (Blocked devices)
  187. 2C78-2C7E  0000 59FA 59CA 0000  (Thermal printer)
  188. 2C80-2C86  5ABE 5AD8 5AB4 0000  (RS232 card)
  189. 2C88-2C8E  5B68 5B22 5B10 0000  (Tape)
  190. 2C90-2C93  Sound data.
  191. ***
  192. 2CAC       DSR validation indicator  (AA).
  193. ***
  194. 2CB0-2CBC  Copies of VDP register 1-7.
  195. 2CBE       Pointer to 80 column screen memory.
  196. 2CC0       Current line.
  197. 2CC2       Current column.
  198. 2CC4       Current 80 col address.
  199. 2CC6       Screen width.
  200. 2CC8       Screen height.
  201. 2CCA       Current screen window.
  202. 2CCC       Number of bytes on 23 lines.
  203. ***
  204. 2CD0       Autorepeat counter
  205. 2CD2       Keyscan limitation counter. (Key buffering isn't done on every
  206.            interrupt.)
  207. 2CD4       Keyscan limitation value.
  208. ***
  209. 2CFA-      Some table.
  210. ***
  211. 2D20-      Some table.
  212. ***
  213. 2D92-2DB0  Bit masks for general use.
  214. 2DB2-2FB0  Address table for p-code interpreter. Opcode is a word index.
  215. ***
  216. 2FFE-3016  Code which resets the computer and branches to the normal OS.
  217. 3018-3024  Code calling something in secondary page on card.
  218. 3026-308C  Table with pointers to some of the keywords in the next table.
  219.            Each pointer is followed by a value.
  220.  3026      AND      2
  221.  302A      BEGIN    1
  222.  302E      CASE     2
  223.  3032      DEFINITI 4
  224.  3036      ELSE     3
  225.  303A      FOR      4
  226.  303E      GOTO     1
  227.  3042      @@@@@@@@ 1
  228.  3046      IF       4
  229.  304A      @@@@@@@@ 1
  230.  304E      @@@@@@@@ 1
  231.  3052      LABEL    1
  232.  3056      MOD      1
  233.  305A      NOT      1
  234.  305E      OF       2
  235.  3062      PACKED   4
  236.  3066      @@@@@@@@ 1
  237.  306A      RECORD   2
  238.  306E      SEPARATE 3
  239.  3072      THEN     3
  240.  3076      UNIT     3
  241.  307A      VAR      1
  242.  307E      WHILE    2
  243.  3082      @@@@@@@@ 1
  244.  3086      @@@@@@@@ 1
  245.  308A      @@@@@@@@ 1
  246.            Data for IDSEARCH.
  247. 308E       '@@@@@@@@' 000F  Unknown identifier code
  248. 3098       'AND     ' 2702
  249. 30A2       'ARRAY   ' 2C0F
  250. 30AC       'BEGIN   ' 130F
  251. 30B6       'CASE    ' 150F
  252. 30C0       'CONST   ' 1C0F
  253. 30CA       'DEFINITI' 000F
  254. 30D4       'DIV     ' 2703
  255. 30DE       'DO      ' 060F
  256. 30E8       'DOWNTO  ' 080F
  257. 30F2       'ELSE    ' 0D0F
  258. 30FC       'END     ' 090F
  259. 3106       'EXTERNAL' 350F
  260. 3110       'FOR     ' 180F
  261. 311A       'FILE    ' 2E0F
  262. 3124       'FORWARD ' 220F
  263. 312E       'FUNCTION' 200F
  264. 3138       'GOTO    ' 1A0F
  265. 3142       'IF      ' 140F
  266. 314C       'IMPLEMEN' 340F
  267. 3156       'IN      ' 290E
  268. 3160       'INTERFAC' 330F
  269. 316A       'LABEL   ' 1B0F
  270. 3174       'MOD     ' 2704
  271. 317E       'NOT     ' 260F
  272. 3188       'OF      ' 0B0F
  273. 3192       'OR      ' 2807
  274. 319C       'PACKED  ' 2B0F
  275. 31A6       'PROCEDUR' 1F0F
  276. 31B0       'PROCESS ' 380F
  277. 31BA       'PROGRAM ' 210F
  278. 31C4       'RECORD  ' 2D0F
  279. 31CE       'REPEAT  ' 160F
  280. 31D8       'SEPARATE' 360F
  281. 31E2       'SET     ' 2A0F
  282. 31EC       'SEGMENT ' 210F
  283. 31F6       'THEN    ' 0C0F
  284. 3200       'TO      ' 070F
  285. 320A       'TYPE    ' 1D0F
  286. 3214       'UNIT    ' 320F
  287. 321E       'UNTIL   ' 0A0F
  288. 3228       'USES    ' 310F
  289. 3232       'VAR     ' 1E0F
  290. 323C       'WHILE   ' 170F
  291. 3246       'WITH    ' 190F
  292. 3250-3296  Code for PME instruction decode. Used when p-code is in mapped
  293.            memory, i.e. VDP RAM or GROM.
  294. 3298-32DA  Code for PME kernel. Used when interpreted code is in CPU RAM.
  295.            The code portions above are transferred to RAM PAD (8300-8344)
  296.            when executing for speed reasons.
  297. 32DC-337C  Code for simulated interrupts.
  298.            The p-system always runs wih interrupts disabled. Interrupt
  299.            service is provided by reading the interrupt request as an ordinary
  300.            I/O bit. If it's active, this code is executed.
  301.            The I/O bit is tested after every taken (p-code) JUMP instruction,
  302.            and also during various output tasks.
  303.            Both vertical blanking and external interrupts are serviced.
  304. 337E-34AA  Code for some kind of I/O.
  305. 34AC-34C2  Code...
  306. 34C4-34DA  Code...
  307. 34DC-34EC  Code...
  308. 34EE-34FE  Code...
  309. 3500-3508  Pops two values, pushes zero and fetches next p-code.
  310. 350A-350E  Pops one value, then next p-code.
  311. 3510-352A  Code... Turns on normal page and some more things.
  312. 352C-353A  Code which switches in alternate p-code ROM page.
  313. 353C-354A  Code for normal page. Sometimes entered @3540.
  314. 354C-355C  Code...
  315. 355E-3566  Code giving normal page and then run-time error (unknown instr.).
  316. 3568-357E  Code erasing the 80 column screen memory.
  317. 3580-38FC  Kernel global data area.
  318.   3600-3607  Prefix volume name (string[7]).
  319.   3608-360F  Root volume name   (string[7]).
  320.   3610       System date.
  321.              packed record
  322.                month:1..12;   (* 4 bits *)
  323.                date :1..31;   (* 5 bits *)
  324.                year :0..99;   (* 7 bits *)
  325.              end;
  326.   ***
  327.   3614-3616  Heap_Info.lock      :semaphore;
  328.   3618       Heap_Info.HeapTop   :MemPtr;
  329.   361A       Heap_Info.TopMark   :MemPtr;
  330.   361C-361E  Task_Info.Task_Done :semaphore;
  331.   3620-3622  Task_Info.Lock      :semaphore;
  332.   3624       Task_Info.N_Tasks   :integer;
  333.   3626           1 (decimal constants)
  334.   3628          10
  335.   362A         100
  336.   362C        1000
  337.   362E       10000
  338.   ***
  339.   3696-3820  Table with name and type of units #0..#32.
  340.              record
  341.                volume_id   :string[7];
  342.                is_blocked  :boolean;
  343.                no_of_blocks:integer;    (* maxint if not blocked *)
  344.              end;
  345.   3822-3839  File name for the assembler.      Type is string[23].
  346.   383A-3851  File name for the compiler.
  347.   3852-3869  File name for the editor.
  348.   386A-3881  File name for the filer.
  349.   3882-3899  File name for the linker.
  350.   ***
  351.   38CA-38E1  File name for the library text file (usually '*USERLIB.TEXT').
  352.   ***
  353.   38FA       '99' when running.
  354.              'GO' when stopped because e.g. stack overflow.
  355.              'NO' when stopped by H(alt.
  356.              The p-system doesn't start on reset if this location contains 'NO'.
  357.   38FC       '/4' when running.
  358. ***
  359. =============================================================================
  360.  
  361. Note! All information provided here has been gathered by inspection of the
  362. p-system in operation and by disassembly of the p-code interpreter. No official
  363. information from TI or SofTech has been available.
  364. Correctness in the mapping of the p-system is not guaranteed.
  365.  
  366.                                                 A-DATA 87
  367.                                     Anders Persson, Lund, Sweden.
  368.  
  369.