home *** CD-ROM | disk | FTP | other *** search
/ ftp.whtech.com / ftp.whtech.com.tar / ftp.whtech.com / club100 / ref / rcmap0.100 < prev    next >
Text File  |  2006-10-19  |  16KB  |  378 lines

  1.  
  2.  
  3.                      ------------------------
  4.                      | Model 100 System Map |
  5.                      ------------------------
  6.  
  7.                           Copyright 1985
  8.                      Revision Date: 09/30/85
  9.                    Compiled and Researched by:
  10.                        Robert D. Covington
  11.             Systems Information Management Consultants
  12.       [Not associated with The Covington Group, N. Y., N. Y.]
  13.  
  14.     This document may be duplicated and distributed free of
  15. charge to any individuals who desire it.  Any duplications of
  16. this document, however, must inluce all of the information
  17. contained here-in, with no deletions or changes.
  18.     The author and distributors of this document make no 
  19. expressed or implied warrantees as to the validity of the 
  20. information contained here in.
  21.  
  22.  
  23.                            - File formatts -
  24.  .BA Files:
  25.            2 bytes -  Address of next line
  26.            2 bytes -  Line number
  27.            Up to 255 characters ending with a null
  28.            EOF is 3 consecutive nulls
  29.  
  30.  .DO Files:
  31.            Text ended with a EOF character 1AH
  32.  
  33.  .CO Files:
  34.            2 bytes -  Address to load to
  35.            2 bytes -  Number of bytes to load (-start 6)
  36.            2 bytes -  Transfer address
  37.  
  38.  
  39.    - File Descriptor Block (Address Given by VARPTR(#file)) Format -
  40.  
  41. Byte:
  42.       0 - File status (0-not open, 1-open for input, 2 open for 
  43.           output or append)
  44.   2 & 3 - Address of file directory entry
  45.       4 - File device (248-RAM, 249-MoDeM, 250-LinePrinTer, 
  46.           251-WAND, 252-COM, 253-CASsette, 254-CRT, 255-LCD)
  47.       6 - Offset from buffer start (see bytes 9) for start of next 
  48.           record
  49.       7 & 8 -  Relative position of next 256 byte block from
  50.           beginning of file
  51.       9 - Start of 256 byte buffer for data transfer
  52.  
  53.                  - Floating Point Accumulator Format -
  54.  
  55. ---------------------------------------------------------------
  56.  FAC1   |  FAC2   |     DP    |    SP    |  Integer |   SP
  57. Address | Address |   Format  |  Format  |  Format  | Register
  58. ---------------------------------------------------------------
  59. FC18H   | FC69H   |   S & E   |  S & E   |    -     |    C
  60. FC19H   | FC6AH   |   BCD M   |  BCD M   |    -     |    B
  61. FC1AH   | FC6BH   |   BCD #   |  BCD #   |   LSB    |    E
  62. FC1BH   | FC6CH   |   BCD #   |  BCD L   |   MSB    |    D
  63. FC1CH   | FC6DH   |   BCD #   |    -     |    -     |    -
  64. FC1DH   | FC6EH   |   BCD #   |    -     |    -     |    -
  65. FC1EH   | FC6FH   |   BCD #   |    -     |    -     |    -
  66. FC1FH   | FC70H   |   BCD L   |    -     |    -     |    -
  67. ---------------------------------------------------------------
  68.  
  69.   LSB =  Least significant byte of intger
  70.   MSB =  Most significant byte of integer.  Bit 7 contains the sign 
  71.         of the integer
  72. BCD L =  Least significant BCD byte
  73. BCD H =  Most significant BCD byte
  74. BCD # =  Middle BCD bytes.  Each digit of the number is represented 
  75.         by one of the values in the two nibbles in each byte
  76. S & E =  Sign and exponent of each number.  Bit 7 contains the sign 
  77.         of the floating point number. Bit 6 must be set.  Bits 0-5 
  78.         determine where the decimal point is to be inserted.  For 
  79.         example, if this byte contained a 65, the sign would be 
  80.         positive and the decimal point would be placed between the 
  81.         first and second digits (#.###....)
  82.  
  83.  
  84.                   - Option ROM Important Addresses -
  85.  
  86. 40H = 54H
  87. 41H = 43H - Required for ROM to be detected on BOOT
  88. 42H - 47H - Name of file associated with ROM program
  89.  
  90. Code at 7E24H-7E43H executed on BOOT to handle option ROM.
  91. Code at 0365H loaded at F605H on BOOT to detect option ROM.
  92.  
  93.                     - Model 100 Hardware Port Map -
  94.  
  95. A0H -  Modem control port
  96.       Output:
  97.         Bit:
  98.             0 - Modem telephone relay (1-Modem connected to phone 
  99.                 line)
  100.             1 - Modem enable (1-Modem chip enabled)
  101.  
  102. B0H -  8155 PIO Command/Status Register
  103.       Output:
  104.         Bit:
  105.             0 - Direction of Port A (0-input, 1-output)
  106.             1 - Direction of Port B (0-input, 1-output)
  107.         2 & 3 - Port C definition (00 - All input, 11 - All output, 
  108.                 01 - Alt 3, 10 - Alt 4 (see Intel technical sheets 
  109.                 for more information))
  110.             4 - Enable Port A interrupt (1 - enable)
  111.             5 - Enable Port B interrupt (1 - enable)
  112.         6 & 7 - Timer mode (00 - No effect on counter, 01 - Stop 
  113.                 counter immediately, 10 - Stop counter after TC, 11 
  114.                 - Start counter)
  115.       Input:
  116.         Bit:
  117.             0 - Port A interrupt request
  118.             1 - Port A buffer full/empty (input/output)
  119.             2 - Port A interrupt enabled
  120.             3 - Port B interrupt request
  121.             4 - Port B buffer full/empty (input/output)
  122.             5 - Port B interrupt enabled
  123.             6 - Timer interrupt (status of TC pin)
  124.             7 - Not used
  125.  
  126. B1H -  8155 PIO Port A
  127.       Output:
  128.         8 bit data port for printer output, keyboard column strobe, 
  129.         and LCD
  130.         In addition, the first 5 bits of this port is used to 
  131.         control the 1990 real time clock chip.  The configuration of 
  132.         these five bits are:
  133.         Bit:
  134.             0 -  C0
  135.             1 -  C1
  136.             2 -  C2
  137.             3 -  Clock
  138.             4 -  Serial data into clock chip
  139.  
  140.  
  141. B2H -  8155 PIO Port B.
  142.       Output:
  143.         Bit:
  144.             0 - Column 9 select line for keyboard.  This line is 
  145.                 also used for the CS-28 line of the LCD.
  146.             1 - CS 29 line of LCD
  147.             2 - Beep toggle (1-Data from bit 5, 0-Data from 8155 
  148.                 timer)
  149.             3 - Serial toggle (1-Modem, 0-RS232)
  150.             4 - Software on/off switch for computer
  151.             5 - Data to beeper if bit 2 set.  Set if bit 2 low.
  152.             6 - DTR (not) line for RS232
  153.             7 - RTS (not) line for RS232
  154.  
  155. B3H -  8155 PIO Port C
  156.       Input:
  157.         Bits:
  158.             0 - Serial data input from clock chip
  159.             1 - Busy (not) signal from printer
  160.             2 - Busy signal from printer
  161.             3 - Data from BCR
  162.             4 - CTS (not) line from RS232
  163.             5 - DSR (not) line from RS232
  164.             6-7 - Not avaiable on 8155
  165.  
  166. B4H -  8155 Timer register.  LSB of timer counter
  167.  
  168. B5H -  8155 Timer register.  MSB of timer counter
  169.  
  170. B8H -  Same as port B0H
  171.  
  172. B9H - Same as port B1H
  173.  
  174. BAH - Same as port B2H
  175.  
  176. BBH - Same as port B3H
  177.  
  178. BCH - Same as port B4H
  179.  
  180. BDH - Same as port B5H
  181.  
  182. C0H -  Bidirectional data bus for UART (6402) (C0H-CFH same)
  183.  
  184.  
  185. D0H -  Status control register for UART, modem, and phone (6402) 
  186.       (D0H-DFH same)
  187.       Output:
  188.         Bits:
  189.             0 - Stop Bits (1-1.5, 0-2)
  190.             1 - Parity (1-even, 0-odd)
  191.             2 - Parity Enable (1-no parity, 0-parity enabled)
  192.             3 - Data length (00-5 bits, 10-6 bits, 01-7 bits, 11-8 
  193.                 bits)
  194.             4 - Data length (see bit 3)
  195.       Input:
  196.         Bits:
  197.             0 - Data on telephone line (used to detect carrier)
  198.             1 - Overrun error from UART
  199.             2 - Framing error from UART
  200.             3 - Parity error from UART
  201.             4 - Transmit buffer empty from UART
  202.             5 - Ring line on modem connector
  203.             6 - Not used
  204.             7 - Low Power signal from power supply (LPS not)
  205.  
  206. E0H -  Keyboard input and misc. device select (E0H-EFH same)
  207.       Output:
  208.         Bits:
  209.             0 - ROM select (0-Standard ROM, 1-Option ROM)
  210.             1 - STROBE (not) signal to printer
  211.             2 - STROBE for Clock chip (1990)
  212.             3 - Remote plug control signal
  213.       Input:
  214.             8 bit data row from keyboard strobe
  215.  
  216. F0H - LCD display data bus (F0H-FFH same)
  217.  
  218.  
  219.                   - Model 100 Keyboard Matrix -
  220.  
  221.            ------------------------------------------------
  222.           7 |  L    K    I    ?    *    ->   Ent  f8   Brk
  223. Row       6 |  M    J    U    >    &    <-   Prt  f7   
  224. In        5 |  N    H    Y    <    ^    Up   Lbl  f6   Cap
  225.           4 |  B    G    T    "    %    Dwn  Pst  f5   Num
  226. 0E0H-     3 |  V    F    R    :    $    +    Esc  f4   Cde
  227. 0EFH      2 |  C    D    E    ]    #    -    Tab  f3   Gph
  228. (224-     1 |  X    S    W    P    @    )    Del  f2   Ctl
  229. 239)      0 |  Z    A    Q    O    !    (    Spc  f1   Sft
  230.            ------------------------------------------------
  231.          bit  0    1    2    3    4    5    6    7    0
  232.              [----------- 0B1H or 0B9H -----------] [0B2H]
  233.              [----------- 177  or 185 ------------] [178 ]
  234.                            Column Strobe
  235.  
  236. Note:     This table is incorrectly documented in Radio Shack's 
  237.          "Model 100 Technical Reference Manual" (26-3810)
  238.  
  239.  
  240.                      - Math Routine Summary -
  241.  
  242. -------------------------------------------------------------
  243. Function       Single Precision    Double Precision    Integer
  244. -------------------------------------------------------------
  245.     +               37F4H               2B78H           3704H
  246.     -               37FDH               2B69H           36F8H
  247.     *               3803H               2CFFH           3725H
  248.     /               380EH               2DC7H           0F0DH
  249.     ^               3D7FH               3D8EH           3DF7H
  250.  Compare            3498H               34FAH           34C2H
  251. -------------------------------------------------------------
  252.  
  253.  
  254.                      - RIM and SIM Bit Maps -
  255.  
  256. SIM Bit 0: RST 5.5 mask (set mask) RIM Bit 0: RST 5.5 mask
  257.         1: RST 6.5 mask (set mask)          1: RST 6.5 mask
  258.         2: RST 7.5 mask (set mask)          2: RST 7.5 mask
  259.         3: Mask set enable                  3: Int. enable
  260.         4: Reset RST 7.5 flip/flop          4: RST 5.5 pending
  261.         5: Not used                         5: RST 6.5 pending
  262.         6: SOD change enable                6: RST 7.5 pending
  263.         7: SOD pin output                   7: SOD pin input
  264.  
  265. Note: SOD pin is used for cassette I/O on Model 100
  266.  
  267.  
  268.              - Model 100 Special Control Characters -
  269.  
  270. --------------------------------------------------------------
  271. Control Code |  Print  | Routine |                            
  272.   Sequence   | Address | Address |        Description         
  273. --------------------------------------------------------------
  274. Beep (7)         4229H     7662H   Beep
  275. Tab (9)            -       4480H   Tab cursor
  276. LF (10)          4225H     4494H   Move down one line
  277. Home (11)        422DH     44A8H   Home cursor
  278. CLS (12)         4231H     4548H   Clear screen
  279. CR (13)            -       44AAH   Move cursor to beginning of 
  280.                                    next line
  281. ESC A              -       4469H   Move cursor up one line
  282. ESC B              -       446EH   Move cursor down one line
  283. ESC C              -       4453H   Move cursor to the right
  284. ESC D              -       445CH   Move cursor to the left
  285. ESC E              -       4548H   Clear screen
  286. ESC H              -       44A8H   Home cursor
  287. ESC J              -       454EH   
  288. ESC K            425DH     4537H   Erase from the cursor to the 
  289.                                    end of the screen
  290. ESC L            4258H     44EAH   Insert blank line at current 
  291.                                    line
  292. ESC M            4253H     44C4H   Delete current line
  293. ESC P            4249H     44AFH   Turn cursor on
  294. ESC Q            424EH     44BAH   Turn cursor off
  295. ESC T            4235H     4439H   Protect line 8
  296. ESC U            423AH     4437H   Unprotect line 8
  297. ESC V            423FH     443FH   Stop automatic scrolling
  298. ESC W            4244H     4440H   Resume automatic scrolling
  299. ESC X            4262H     444AH   
  300. ESC Y            427CH     43AFH   Set cursor position.  
  301.                                    Coordinate for cursor (row 
  302.                                    and column) follow ESC Y 
  303.                                    sequence
  304. ESC j              -       4548H   Clear screen
  305. ESC l              -       4535H   Erase current line
  306. ESC p              -       4431H   Start inverse video mode
  307. ESC q              -       4432H   Cancel inverse video mode
  308.  
  309.  
  310.                        References & History
  311.  
  312.     This documented was created with well over 200 hours of 
  313. sweating over a Model 100 ROM disassembly.  I started my first 
  314. research on the Model 100 ROM about 2 hours after purchasing it 
  315. (Note: I had one of the first 100's off the production line.  I 
  316. believe I purchased my 100 in June of 1983).  After I figured 
  317. out how to use TELCOM, I downloaded a BASIC Z-80 disassembler 
  318. that friend of mine (Mike Livorsi) wrote from my Model 3.  After 
  319. making a few changes to the disassembler, I was able to get it 
  320. to work on the Model 100.  Then, I tested my Model 100's 
  321. parallel printer port by printing a disassembly of the Model 
  322. 100's ROM on my old LP8 (note:the disassembly requires a 3 inch 
  323. note book to fit in).  A day later, I came back to my Model 100 
  324. and found what every machine language addict loves; a complete 
  325. dissasembly of the ROM.
  326.     At this point, I had a big problem; where to start.  At the 
  327. time, the only documentation for the 100 was the Instruction 
  328. Manual.  "Hacker reliefs" like schematics, memory maps, 
  329. debuggers, etc. could only be found in the dreams of the infant 
  330. portable hackers.
  331.     What did I end up doing?  Well, I decided to write a little 
  332. BASIC program to search for specific bytes in ROM.  This program 
  333. was used initially for finding the text string "Ok" in ROM.  
  334. Once I found out where the message was in ROM, I then searched 
  335. for any ML instructions that referenced the message.  Then, on a 
  336. warm July night in St. Louis, I found what I was looking for; a 
  337. 16 bit register load that referenced the message "Ok" followed 
  338. by a CALL instruction.  This was the key I needed to open the 
  339. door to the Model 100's ROM.  With my experience from the Model 
  340. 1/3/Coco ROMs, I knew that the load/CALL sequence I found was 
  341. used to print a text string on the screen.  From this little 
  342. information, I was able to interrogate the subroutine called and 
  343. find out how the display operated.  In addition, since "Ok" is 
  344. only printed at BASIC ready, I was able to trace out the 
  345. keyboard input routines and eventually, the entire BASIC 
  346. interpreter.
  347.     About 200 or so hours later, I documented most of the Model 
  348. 100's ROM.  At this time, I knew enough about my Model 100 to 
  349. write just about any machine langauge program that I needed.
  350.     When I started writing ML programs for the 100, I found one 
  351. problem with my ROM documentation; it was too hard to find a 
  352. particular ROM address.  What I needed was an organized 
  353. collection of all my notes, "chicken scratches", etc.
  354.     From this came the memory map you hold in your hand right 
  355. now.  In this memory map, I basically included the information 
  356. that I use the most when ML programming.  I did not include a 
  357. lot of information on how the ROM handles certain task, but I 
  358. did include information that can be used by external stand alone 
  359. ML programs.
  360.     In creating this document, I had a little help along the 
  361. way with figuring out a few things.  Below is a list of sources 
  362. I used to help me determine or verify what certain things in the 
  363. Model 100 did:
  364.  
  365. Model 100 User Manual, Radio Shack
  366.  
  367. Model 100 Service Manual (26-3801), Radio Shack
  368.  
  369. Microsystem Components Handbook, Volume 1, Intel (1984)
  370.  
  371. MOS Microprocessors and Peripherals, Advanced Micro Devices
  372.     (1983)
  373.  
  374. Microsoft BASIC Decoded & other Mysteries for the TRS-80, by
  375.     James Lee Farvour, IJG (December 1982)
  376.  
  377. "Inside the 100", by David P. Sumner, 80 Micro (December 1983)
  378.