Home

Mountain Computer ROMPlus+ Operating Manual

image

Contents

1. Mountain ih Computer ym ies t 244 ION mh Ky Lr tt Y VN n Pale 7 LAT yy hen 4 7 a bee 2 4 WH 7 7 j 7 7 4 A j 9 M i y 4 v d aA y 2 me 4 to T ele 7 No ip y 4 P 2 Worms i 1 wu 277 A 2 ih Pe Wt 27 hy 7 f 4 Vy 7 7 IAE VE T H4 F l A 7 2 n f ht in s Wie D 5 7 Wo mE 9 a t CMY e WAN PAY af A 4 n ha GMO A Wi dU Wy t yp Ue d MN YW EE LOM LE j S 4 2 eH hh M 4 iy if 5 Mi f s M 7 22 i v r fi 2 n Iv d 4 Y hy veni MES ar MT ry La 4 ROMPLUS OPERATING MANUAL 1981 MOUNTAIN COMPUTER INC Manual Part Number 11 00233 01D Table of Contents Chapter 1 Chapter 2 Chapter 3 Chapter 4 Apendix A INTRODUCTION INSTALLATION HARDWARE FEATURES General ROM Space RAM Space TTL Inputs Control ROM
2. 6382 6385 63 6 BB 63C1 63C4 ugu gs um Po ded bel LJ le C3 m R9 85 BO R9 e 2 EC CC D c cn uo C Appendix A CONTROL ROM SOURCE LISTING 38 66 59 Ca FF CF z 38 65 88 82 CF zi CF 38 65 2 GE FD a2 1B 3A 12 253 254 255 256 E P a ZG A X THE FOLLOWING ROUTINE HANDLES THE VECTORING TO CHIP 1 0 HOOKS FIRST WE ENABLE THE SELECTED CHIP VECTOR PLP RECOVER STATUS 50 LDA CONTROL v PHA LDA CFFF DISABLE OTHER RONS LDA CUFCHIP X ORA 4f38 STA CONTROL Y FLA STR FCF 82 STY SC F S LDA CURCHIF BNE YECHOOK NO CHIP HAS BEEN ACTIVATED YET S0 60 TO STANDARD KEVIN OR KEYQUT X LDA S2CHBROUT STA 1 LDA SCHRRDUT BCS ITSUUTPUT LDA SCEDEEV ITSQUTPUT STA FC EIT ALWAYS TAKEN NOM OBTAIN THE ADDRESS VECTOR TO BY INDEXING INTO THE INITIALIZATION TABLE ON THE CHIP WE STORE THE ADDRESS IN LOCASL RAM AND THEN VECTOR THERE BY HN INDIRECT JUMP LDY WHICH GET INDEX CHIPLIM BCS NOGOOD2 LDA ENTRIES4 1 V STA PC 1 LDR ENTRIES Y STA FC XXXXXX Appendix A CONTROL ROM SOURCE LISTING 268 261 NOM ME RESTORE REGISTERS AND GOTO 262 THE HOOK ROUTINE 263 63E6
3. THE FOLLOWING CODE IS FOR THE 112 INITIAL ENTRY ONTO THE BOARD 113 ME INITIALIZE OUR VARIABLES 114 AND SET THE HOOKS TO POINT To 115 THE RE ENTRY POINT 116 6332 RD 87 117 INIT LOA MSLOT 6335 85 37 118 STR CSN 6337 85 39 119 STA CSW 2 6339 R9 86 145 LDA lt OENTRY 6338 85 36 121 STA CSH 6330 R9 88 122 LEA CIENTRY 623F 85 38 125 STR CSW 6341 800 124 LDA 00 6243 9D B8 03 125 STA X 6346 35 26 RESET ALWAYS TAKEN 127 125 i23 WE COME HERE FOR A RE ENTRY 159 WE CHECK FOR COMMANDS JUST i131 ON OUTPUT AT THIS POINT THE 132 CARRY STILL MARKS WHERE 133 WE CAME FROM 134 6348 BO 87 425 REENTRY BCS OUTHOOK 136 is SET WHICH TO INFUT HOOK 138 634A R9 a2 129 LDA 02 amp 34C BS 04 140 STR MHICH X 34F DA 56 141 BNE VECTOR ALWAYS TAKEN id2 44 HERE WE HANDLE THE OUTPUT HODK id4 WE SET WHICH AND UPDATE THE 145 CURRENT CHIP AND THEN GO CHECK 146 FOR COMMANDS 14 6351 R9 00 1458 DOUTHODKE LOR 4 6353 9D BS 804 149 STA WHICH X 158 151 THE FOLLOWING ROUTINE CHECKS 152 FOR THE CHIP INITIALIZATION 153 COMMAND IT IS CALLED ONLY 454 ON OUTPUT TO PREVENT THE SAME 155 CHARACTER FROM PASSING THROUGH 156 TWICE THE MODE VARIABLE KEEPS 157 TRACK OF OUR CURRENT STATE A 4 49 Be LE SD D E H3 3D Fe BA 90 AS 3p BD 9 c
4. USING ROMPLUS Activating ROMPLUS Commands CTRL SHIFT M CTRL SHIFT N Selecting RAM ADVANCED PROGRAMMER S INFORMATION The Control Word Control ROM The Branch Table Writing Your Own ROM Programs On Two ROMs REFERENCE CONTROL ROM SOURCE LISTING General Information INTRODUCTION Mountain Hardware s ROMPLUS is a powerful addition to your Apple II computer ROMPLUS has room for six of the 2316 type ROM s or the 2716 EPROM With each 2316 chip holding 2K bytes of memory ROMPLUS has the capacity of 12K bytes of read only memory Whether your applications of the Apple II are for business education research or just fun eventually you will discover a set of programs that you use constantly Examples are special peripheral drivers utility routines and data collection programs You may access these programs on the ROMPLUS board as soon as you turn your Apple II on Additionally ROMPLUS provides 255 bytes of RAM which may be activated or deactivated under program control on board control ROM simplifies your program selection You need only type a few keystrokes to run any program on ROMPLUS The control ROM relieves the burden of remembering many different addresses ROMPLUS also has two TTL level inputs and these are available for any user application For example an option on Mountain Hardware s Keyboard Filter ROM uses one of these inputs to monitor the shift key on the Apple II s Keyboard This
5. 68 264 EXIT 63E7 R8 265 TAY 63E8 68 266 PLA 63E9 AA 267 TAX 63EA 68 268 PLA 63EB 20 BC FE 269 JSR GOVECTOR 270 63EE 48 274 PHR 63EF 98 272 TYR 63F0 48 273 PHR 63F1 RC CF 274 LDv s CF03 63F4 RD 82 CF 275 LDA CF02 63F7 09 08 276 ORA 63F9 99 80 CO 277 STA CONTROL Y 63FC 68 278 PLR 63FD AB 279 TAY 63FE 68 280 PLA 63FF 60 284 RTS 202 283 204 ALL DONE 285 END ASSEMBLY TOTAL ERRORS 00 256 BVTES OF OBJECT CODE WERE GENERATED THIS ASSEMBLY 7 Located in the Santa Cruz Mountains of Northern California Mountain Computer Inc is a computer peripheral manufacturer dedicated to production use oriented high technology products for the microcomputer On going research and development projects are geared to the continual supply of unique innovative products that are easy to use and highly complementary in a broad variety of applications
6. 2 bytes long with the low order byte first All branch tables must have at least one entry point With only one entry point the branch table would end at C806 and the value of the byte at C80 would be 07 The value contained at C80H is the total number of bytes in the branch table Therefore if there are N entry point address the value of C80H is 2 N 5 The input and output hook address C800 and C802 are used by the CTRL SHIFT M command C800 contains the address of the routine to be called every time a character is to be outputed This output hook address is usually the address of a routine on that particular ROM C802 contains the address of the routine on a particular ROM to be called every time a character is to be inputted All character I O routines should end with a return from subroutine instruction If the ROM that you write does not use the CTRL SHIFT M command then these I O hooks will not point to a routine on the ROM Instead you should use the addresses of the standard Apple I O drivers The output hook C800 should contain the address FDFO with the low oder byte first Likewise the input hook C802 should contain the address FD1B These I O hooks on the ROM must always point to valid I O routine addresses The branch table is the only requirement for ROM s The application program s code may begin immediately after the branch table 3 5 Chapter 3 ADVANCED PROGRAMMERS INFORMATION Writing Your
7. and then control returns If this command was printed as part of a BASIC program then control returns to BASIC If this command was entered immediately from the keyboard then control returns to the keyboard Chapter 2 USING ROMPLUS A program executed by the CTRL SHIFT N command in one ROM may execute another ROMPLUS program in another ROM by outputting anothr CTRL SHIFT N command However a program executed by the CTRL SHIFT N command may not output a CTRL SHIFT M command In the former case the control ROM keeps track of control In the later case the control ROM keeps track of control In the later case we have a situation which is logically meaningless It does not make sense to have a routine type of program calling special driver type program It does make sense however to have a driver type program activated by CTRL SHIFT M call upon a routine type program CTRL SHIFT N For example a program such as Keyboard Filter might call upon a routine on another ROM It would output a CTRL SHIFT N command The control ROM keeps track of the calling ROM and the called ROM It returns control to the calling ROM when the called ROM returns Selecting RAM Any time ROMPLUS is activated or any ROM is activated via the CTRL SHIFT M or CTRL SHIFT N commands the on board RAM is activated Whenever this RAM is active the top 256 bytes of the selected ROM are not available If your program uses the top 256 bytes of the ROM you must
8. at a slot dependent memory address The address of the control word is 080 9 0 or 16256 16 N from BASIC where is equal to the slot number Ihe following table summarizes Slot Hex Address BASIC Address 1 090 162H0 2 COA0 16224 3 COBO 16208 COCO 16192 5 CODO 16176 6 COEO 16160 T COFO 16144 A write to the control word location may be used to select a ROM socket activate or deactivate the board or activate or deactivate the RAM The function of the particular bits are described below 1716151413121 1 lol control word Bit 7 This bit controls the RAM If a 0 is written the RAM is deactivated If a 1 is written the RAM is activated Bit 6 4 Unused Bit 3 This bit controls the board If is written the ROMPLUS is deactivated Df a IM is written the board is activated Chapter 3 ADVANCED PROGRAMMERS INFORMATION Bit 2 0 These bits select the ROM socket to be enabled Bit two is the most significant bit of the value If the value 0 then none of the ROMs are enabled If set from 1 6 the corresp onding ROM is enabled The value should never equal 7 A read to the control word is used to check the status of the RAM find the currently enabled ROM socket number or to sense the value of the two TTL inputs The function of the particular bits are described below 171615141312 1 lol control word Bit 73 This bit reads the status of RAM If equal to 0 then RAM is deact
9. next two characters are interpreted as parameters of the Control ROM command NOTE The Control ROM makes use of two locations in memory that are normally used by the monitor These two loca tions are 3A and 3B Whenever the ROMPLUS card is active the monitor L command for disassembly and the Apple II mini assembler will not work properly Appendix A CONTROL ROM SOURCE LISTING OON EROR 3 CONTROL PROM FOR MOUNTHIN ROM BOARD EY ANDY HERTZFELD C 1979 BY ANDY HERTZFELD VERSION 1 6 4 16 79 o x ok EQUATES FOR SCREEN SPACE MSLOT Em PFS CHIP EQU 268 MODE EQU 426 WHICH EQU 465 CURCHIP EQU 528 TCHIP 568 5a EQU 639 MISC EQUATES 5 Em FF58 CSH EQU 36 STACK EO 108 RDKEY EQU FDI6 CHARCUT EGU BELL Em FBDD CONTROL C AGH ENTRIES EQU CHIPLIM EGU 594 G VECTOR EQU FEBC PC En CTLR Em 90 CR EDU CTLB EGU 9E SCTLR 3R ORG OB D led ted 1 wW mm O3 iS RN Appendix A CONTROL ROM SOURCE LISTING 48 49 USE 3 DIFFERENT ENTRY 51 POINTS FIRST FOR THE 52 INITIAL ENTRY AND 93 AND TENTRY FOR THE OUTPUT 54 AND INPUT RE ENTRIES THE 29 C AND BITS ARE USED TO 56 REMEMBER WHICH ENTRY OC
10. recommend the page zero addresses of 1 and 2 _ Ihe program CHIPCALL is a subroutine and should be called with the JSR instruction Before you call the subroutine set up the A and Y registers The value of the X register must be preserved Chapter 4 REFERENCE This chapter is a concise description of the hardware and software of ROMPLUS It is intended to serve as a reference section only The hardware features of ROMPLUS are 1 Sockets for six 2K ROMs 2316 or EPROMs 2716 Total ROM capacity is 12K bytes ROM is selected by software 256 bytes of RAM which can be enabled or disabled under software control Two TTL levels inputs which are held high by pull up resistors The inputs are read from the control word A 256 byte control ROM which controls the operation of ROMPLUS The software features of ROMPLUS are summarized below L ROMPLUS is activated by the IN n or PR n commands from BASIC ROMPLUS is deactivated by both IN n and PR n commands or by RESET or by referencing location CFFF There are two modes of operation available These modes are selected by these commands a CTRL SHIFT M This mode will run the selected ROM program every time a character is inputted or outputted b CTRL SHIFT N This mode will run the selected ROM program immediately and then return control to the calling pro gram The command structure is CTRL SHIFT M lt ROM socket number
11. 3 4 6 ROM RO SOCKET SOCKET 5 i Control ROM FIGURE 1 ROM Space ROMPLUS has six 24 pin sockets located on the left side of the board These sockets accept the 5 volt 2316 type of ROM chips with each chip holding 2048 bytes pin for pin compatible cEPROM such as the 2716 may also be used in the ROM sockets All of the ROM chips are mapped into the C800 CFFF memory address space but only one chip is mapped at any one time If 1 1 Chapter 1 HARDWARE FEATURES your application program is larger than 2048 bytes do not worry There is a scheme for switching control from one chip to another chip This scheme plus information for creating your own chips is given in the Advanced Programmers Information chapter RAM Space ROMPLUS has 256 bytes of read write memory RAM on board This RAM may be activated or deactivated under program control When activated the RAM maps into the CFOO CFFE memory address space Notice that only 255 bytes are available last byte at location CFFF may not be used This is because of the Apple II s peripheral convention which deactivates all peripheral boards when memory address CFFF is referenced Also when the RAM is active the top 256 bytes of the selected ROM chip are not available This is because the RAM maps into the same space used by the ROM chip If your ROM chip uses all of its 2048 bytes Simply deactivate the RAM See chapter 5 for information on the contr
12. CURED 5 5200 2C 38 FF 58 FIRST BIT TORTS VFLAG FOR INITIAL ENTRY 6 085 38 93 SEC gt MAKE INITIAL ENTRY OUTPUT e3n4 70 04 EYS ENTRY ALWAYS 6306 38 61 SEC 6387 90 HER TRICK TO SAVE A BYTE 6383 18 53 TENTRY CLC HIDE AS BRANCH OFFSET 6599 BS 4 CLWY 65 Ge COMMON ENTRY POINT 5b BS A 43 58 B2GB SA Bo 48 ra PHH 6 00 98 fi TrA 630E 48 ve 08 DE FHF r4 fo NOM MUST FIND OUT WHAT SLOT IM THIS 15 ACHIEVED BY rr MAKING A DUMMY JSE WHICH HILL fits LEAVE OUR ADDRESS ABOVE THE ra STACK INTERRUPTS MUST BE 80 DISABLED 81 6510 78 ez SEI 6511 26 58 FF 55 JSk TORTS GUMMY TSE 6314 BA a4 6315 68 85 6316 686 a6 PLA 6317 68 ay PLA 6318 65 53 FLA RECQVER INPUT CHARACTER 6319 AS 59 TAY AND KEEP IN Y REGISTER FOR NOH 631A CA 99 DES e31B 91 TAS o31C 68 32 PLA GET CN FROM STACK 6210 80 F8 93 STA MSLOT Be RA 94 TAX 3 SLUT IN X 2221 95 ASL 6 22 GAR ae RSL BA 97 RSL 0 24 98 ASL 5325 90 38 He 99 STA 50 4 Been BD Be Bs 108 LDA CHIP X o3zb 35 65 181 STR CURCHIP 182 A 3 Appendix A CONTROL ROM SOURCE LISTING i83 184 NOW RECOVER STATUS AND GO TO i85 THE PROPER ROUTINE ACCORDINGLY 106 632E 28 187 PLP RE ENABLE INTERRUPTS e32F 08 188 PHP SAVE STATUS 6338 50 16 109 REENTRY 110 111
13. OMPLUS is not active input and output are not vectored through the control ROM Instead they are vectored to the normal input and output drivers of the Apple When the CTRL SHIFT M command is given the input and output are now vectored through the input and output hooks on the selected ROM Normally these input and output hooks point to locations within the selected ROM More information about the hooks is in the next chapter In general all of the hooks and vectors transparent to the user When ROMPLUS is deactivated I O vectors through the normal Apple II I O drivers When ROMPLUS is active I O is vectored through the control ROM When a CTRL SHIFT M command is given all subsequent I O is vectored through the selected ROMs I O hooks The ROMs I O hooks are located in the branch table More information about the branch table is in the next chapter The net effect of the CTRL SHIFT M command is that the selected ROM gains control on every input or output character This continues until ROMPLUS is deactivated or the particular ROM is deactivated Examples of the type of program which use this mode of operation are printer drivers or Mountain Hardware s Keyboard Filter These programs need to execute with every input or output operation CTRL SHIFT N This command selects one of two operating modes of ROMPLUS The CTRL SHIFT N command will pass control to the selected ROM program This program is executed immediately
14. Own ROM There are a few things you should remember when writing your own ROMs First your program should never reference location CFFF Any reference to that address will disable all memory that maps into C800 CFFF If you do reference that address you will disable ROMPLUS The slot number of ROMPLUS may be found by your program by reading 7F8 It will contain the value CN where N is the slot number Location 6F8 N contains the value NO The control ROM makes sure that RAM is active whenever a ROM socket is selected If your program must deactivate the RAM it must reactivate RAM before it finishes executing Programs On Two ROMs The 2K bytes of storage on each ROM is large enough for all but the larger programs If you have an application program that is larger than 2K bytes there is a scheme allowing you to use two ROMs in conjunction ROMPLUS will map any one of the six ROMs into the C800 CFFF address space at one time If you simply had the first ROM write a control word which switches the ROM socket number to the new ROM socket number your program will immediately switch to the Other ROM This usually blows up the program One solution to this problem is to write a subroutine dispatching Subroutine and place this subroutine into identical addresses on the two ROMs This way you enter the subroutine dispatching Subroutine on the first ROM the switching of ROM occurs and the dispatching routine continues on the s
15. SLOT S It is necessary to set bit 3 so that you don t deactivate ROMPLUS This final example will test the TTL input at bit 4 LDA C080 X Read control word BIT 10 Mask bit 4 BNE If bit is set BEQ If bit is clear In BASIC IF PEEK 16256416 SLOT MOD 32 gt 15 THEN BIT IS SET Remember that when writing the control word bit 3 must be set to activate ROMPLUS Even if ROMPLUS is already active bit 3 must be set if you do not want to deactivate ROMPLUS If a read of the current ROM chip yields ROM socket number zero as the active ROM then no ROM is active If ROMPLUS is not active then the current ROM chip will read as ROM socket number zero Control ROM The control ROM provides intelligence for ROMPLUS It isa 256 byte memory which controls the functions of ROMPLUS A complete source listing is in the Appendix In this section we will detail memory usage and entry points of the control ROM Chapter 3 ADVANCED PROGRAMMERS INFORMATION The control ROM uses two bytes of memory in the zero page These two locations are 3A and 3B These two locations were chosen to take advantage of the monitor indirect jump at FEBC The use of the two page zero memory locations 3A amp 3B causes a memory conflict with two of the monitor s commands As mentioned erlier when ROMPLUS is activated the mini assembler and the disassembler will not work Additionally the control ROM uses seven bytes in the scr
16. a De BC ag ae a Appendix A 38 GF 29 84 41 38 2 DD an 38 t 38 a4 a4 a4 a FE m cen I F3 pa P3 PO pa P3 ER pe pa RR pa dE ee n3 D UC og oc OCT CHE UR ed C 7 j ML toto Wo Lo to to hice amp ia Co 4o PO E COMMAND CONTROL ROM SOURCE LISTING LOY MODE X BMI GETNUM GETINIT CMF amp CTLR SRVEMODE CMF sCTLE ENE VECTOR SAVEMODE STA MODE VECTOR ALWAYS TAKEN PARSE THE NUMBER CHECKING TO MAKE SURE ITS FROM amp TO 6 60 MUST 87 BCS NOGOOD AND C F RSL MODE X STR 3 TCHIF VECTOR ALWAYS TAKEN THE FOLLOWING CODE HANDLES ERRORS BY RINGING THE BELL AND CANCELLING ANY PARTIAL COMMANDS ITS IN THIS WEIRD PLACE BECAUSE OF THE 65 2 5 RELATIVE ADDRESSING CONSTRAINT E FHA NOGGOD BELL RESET LDR 46 STR CURCHIP X STA MODE X BEQ VECTOR ALWAYS TAKEN HANDLE THE SELECTION BUT DON T ERROR CHECK IT TILL THE CHIP I5 ACTIVATED ASL CARRY 15 SET SEC 70 S BARS SETWHICH STA WHICH X LDA 46 STR LDA TCHIP STR CURCHIP X CPY SCTLA BNE VECTOR STA CHIP X SOX 88 STA CONTROL Y A 5 65 6588 63RE OSPF
17. ce which makes ROMPLUS easy to use It controls input and output functions and allows for easy ROM socket selection and entry point selection Many of its features are in the next chapter Using ROMPLUS The control ROM occupies the memory address space CNOO CNFF where N is the slot number The ROM is supplied with power whenever it is addressed This results in a power saving Chapter 2 USING ROMPLUS This chapter covers the basic information you need for typical operation of ROMPLUS This chapter should be read carefully We will cover such topics as selecting ROMPLUS activating RAM ROM socket selection and entry point selection Activating ROMPLUS ROMPLUS is a peripheral that is activated in the same manner as other Apple II peripherals From BASIC ROMPLUS is turned on by a IN n or PR n command where n is the slot number From the monitor a nCTRL K or nCTRL P command will turn on ROMPLUS If you are running BASIC under DOS use the regular DOS procedure of printing a CTRL D followed by the command Whenever the board is activated the RAM is also activated The board is deactivated by using both the IN 0 and PRfO commands Hitting the RESET key will also deactivate ROMPLUS If another peripheral card is accessed via the IN n or PR n commands ROMPLUS will be deactivated Of course any reference to address CFFF will deactivate ROMPLUS or any other peripheral board Once ROMPLUS has been a
18. ctivated all input and output operations are vectored through the control ROM This is transparent to the user i e nothing seems different However the control ROM is looking for one of two special command characters If the character passed on input or output is not a special command character it is passed to the input or output routine If the character is command then the next two characters are interpreted as parameters of the command i Chapter 2 USING ROMPLUS Commands The two command characters are CTRL SHIFT M and CTRL SHIFT N ASCII codes 9D and 9E respectively You may obtain these characters by pressing the CONTROL SHIFT and letter keys simultaneously These characters were chosen to minimize typing accidents The syntax of the commands are CTRL SHIFT M ROM socket gt lt entrypoint gt CTRL SHIFT N ROM socket gt lt entry point There are no spaces between the command character the ROM socket and the entry point The brackets are not entered No return is necessary after the command Notice the command is three characters long ROM socket number is a value from 0 to 6 which specifies which ROM socket you want to select Only one ROM socket is active at one time but one ROM socket may call another ROM socket Selecting chip number O will deactivate the current ROM socket without deactivating ROMPLUS If an invalid ROM socket is selected the bell will beep Entry point is a lett
19. deactivate the RAM before the code is executed Otherwise the computer will read the contents of and interpret that data as instructions This usually results in disaster It is necessary to reactivate RAM before returning control The next chapter contains a few routines used for con trolling the state of the RAM Notes The control ROM on ROMPLUS makes use of two locations in memory normally used by the monitor These two locations are 3A and 3B As a result whenever ROMPLUS is active the monitor L command for disassembly and the Apple II mini assembler will not work properly To restore these commands deactivate ROMPLUS The Apple II peripheral scheme states that all ROM s in the C800 CFFF space must be de selected whenever CFFF is referenced Therefore take care that your programs never reference location CFFF 2 4 Chapter 3 ADVANCED PROGRAMMER S INFORMATION This chapter contains information for the advanced use of ROMPLUS The sections about the control word and the control ROM should be read by anyone using ROMPLUS The other sections about the branch table preparing your ROM and programs greater than 2K bytes are intended for the user that will prepare their own ROM chip for use in ROMPLUS However anyone using ROMPLUS will benefit from the information in those sections The Control Word The features of ROMPLUS are controlled by the control word The control word is a read write word located
20. econd ROM because the identical addresses contain identical code Here is the code which will do the task The A register contains the ROM socket number you wish to use The Y register contains a value which determines which routine is run routine number 2 You must preserve the X register MSLOT EQU 7F8 CONTROL EQU 080 CHIPNUM EQU 0 SUBADDR EQU 1 3 6 Chapter 3 ADVANCED PROGRAMMERS INFORMATION CHIPCALL STA CHIPNUM ssave ROM number LDX MSLOT get CN LDA 638 X get NO TAX X contains value N LDA CONTROL X get control word ORA 08 turn on activate bit 3 PHA ssave so we can restore later AND sset ROM number to zero ORA CHIPNUM sor in new ROM number STA CONTROL X swrite to control word At this point we are now on the other ROM Call routine Specified by Y LDA X SUBTABLE X get low byte of address STA SUBADDR and store here LDA SUBTABLE 1 y get high byte of address STA SUBADDR 1 sand store here JSR CALLSUB sindirect subroutine call PLA sreturn get old state STA CONTROL X restore old ROM a RTS return out of this routine CALLSUB JMP SUBADDR indirect jump to routine SUBTABLE DA SUB1 stable of routine addresses DA SUB2 slow byte first high byte Second It is necessary for this routine to be located at identical addresses on the two ROMs Otherwise it will not work SUBADDR may be located anywhere in memory as long as there are no possible memory conflicts We
21. een space These locations are slot dependent and they are Summarized in the following table Symbolic Name Byte Location Usage CHIP 478 SLOT Contains active ROM socket for CTRL SHIFT M commands MODE 4F84Slot Used to parse commands WHICH 578 Slot Used to hold the entry point letter CURCHIP 5F84 Slot Contains number of most rec ently used ROM socket TCHIP 678 Sloti A scratch location SO 6F8 Slot Contains the value Slot 16 MSLOT 7F8 Contains the value CN where N Slot The control ROM has three entry points Assuming that N Slot number the entry points are CNOO Initial entry point used when ROMPLUS is activated It will initialize variables and I O hooks CNO6 Output entry point Vector here to output a character CNO8 Input entry point Vector here to input a character 3 4 Chapter 3 ADVANCED PROGRAMMERS INFORMATION The Branch Table Every ROM that is to be used on ROMPLUS must have a branch table at the beginning of the ROM The branch table allows the user to select an entry point into the ROM by using just a letter to designate the entry point A summary of the branch table is as follows Address C800 Address of output hook routine C802 Address of input hook routine C804 Value which indicates length of Branch table C805 Address for entry point 1 C807 Address for entry point 2 C805 2 n 1 Address for entry point iin All of the addresses are
22. er starting with A and ending with a letter depending on the particular ROM chip selected The number of entry points on any ROM is determined by information on that particular ROM first entry point is always A the second entry point is B and so on If an illegal entry point is specified the bell will beep The documentation accompanying any commercially available ROM for ROMPLUS will detail the valid entry points of that ROM If you write your own ROM you will place a table of entry points on the ROM The number of entry points determines the valid entry point characters More information on writing your own ROM chips is in the next chapter Chapter 2 USING ROMPLUS CTRL SHIFT M This command selects one of the two operating modes of ROMPLUS The CTRL SHIFT M command will let the selected ROM gain control every time a character is inputed or outputed When this command is issued all subsequent input and output is vectored through two hooks which are located on the selected ROM Recall that when ROMPLUS is activated the input and output is vectored through the control ROM This means that when a character is input a call is placed to the control ROM which calls the input driver The control ROM inspects this character and then passes it along to the program requesting input Similarly on output of a character a call is placed to the control ROM which inspects the character and then calls the output driver Whenever R
23. ivated If equal to 1 then RAM is active Bit 6 Unused Bit 5t TTL input from pin 4 Bit 4 TTL input from pin 1 Bit 3 Unused Bit 2 0 These bits indicate which Rom socket is current ly enabled The value is determined the same Way as the bits 2 0 of the written control word We next examine several programming examples of control word use First if we wish to activate ROMPLUS and select ROM socket number one we use these machine language instructions LDA 89 RAM active board active ROM 1 STA C080 X Write control word In that example and in the examples to follow we assume that the X register contains the slot number 1 7 multiplied by 16 This is the standard convention for slot independent I O on Apple LI To do the same thing in BASIC we use a statement like this POKE 16256416 SLOT 137 Chapter ADVANCED PROGRAMMERS INFORMATION Now suppose you wish to activate ROMPLUS deactivate the RAM and select ROM 5 You would do one of the following LDA 0D Deactivate RAM activate ROMPLUS select ROM 5 STA 080 Write control word or POKE 162564 16 SLOT 13 If you wish to toggle the state of the RAM i e turn off when it is on and turn on when it is off you would use this code LDA C080 X Read control word EOR 80 ORA 80 STA C080 X Write control word From BASIC use these statements S PEEK 16256 16 SLOT 128 MOD 256 IF S MOD 16 lt 8 THEN S S 8 POKE 16256 16
24. manual is a user s manual for ROMPLUS In this manual we cover installation hardware features of ROMPLUS using the ROMPLUS and writing your own PROMs Apple II is a trademark of Apple Computer Cupertino CA INSTALLATION To install ROMPLUS simply follow these instructions 1 Turn off the power switch at the back of the Apple II The removal or insertion of any card with power on could cause severe damage to both the computer and ROMPLUS Remove the cover from the Apple II by pulling up on the cover at the rear edge Now choose an Apple II slot number SLOT number 0 should never be used as it is reserved for Apple s language cards In general we recommend that you install ROMPLUS into a slot immediately below the disk controller card For example if the disk is in slot 6 place ROMPLUS into slot 5 The only restric tion is that you may not place ROMPLUS into slot number 0 Plug ROMPLUS into the slot you have chosen Make sure the board is firmly seated in the socket Replace the cover on your Apple II and turn on your computer 11 Chapter 1 HARDWARE FEATURES General In this section we discuss in detail the hardware features of ROMPLUS The four basic parts are the ROM sockets the RAM the TTL inputs and the control ROM Ihe ROMPLUS board is shown in Figure l This figure gives the layout of the board s features ROM SOCKET 1 2 ROM ROM SOCKET SOCKET
25. ol word used to activate or deactivate the RAM The RAM will retain its contents whether ROMPLUS is active or not in use The RAM of course loses its contents when power is switched off The RAM provides the ROM chips with their own private storage area This will help to minimize memory conflicts However the RAM may be used by any program in the Apple II We recommend that the RAM be allocated in the following way Address Use CFOO CFO3 Seratch area for control ROM CFOlH CF5F Seratch area for ROM socket 1 60 Scratch area for ROM socket 2 CF80 CF9F Scratch area for ROM socket 3 CFAO CFBF Seratch area for ROM socket 4 CFCO CFDF Seratch area for ROM socket 5 CFEO CFFE Scratch area for ROM socket 6 1 2 Chapter 1 HARDWARE FEATURES TTL Inputs A four pin connector on ROMPLUS provides two TTL level inputs and two ground pins A matching four pin plug with wire is available from Mountain Computer Order Part 021 Price 3 00 1234 Pins 2 and 3 are grounded Pins 1 and 4 are the TTL inputs The inputs are held high by pull up resistors Therefore an unused input will be read as a high level or 1 The TTL inputs read through the control word Chapter 5 has more information on the control word Pin 1 on the connector maps to bit 4 of the control word Pin 4 on the connector maps to bit 5 of the control word Control ROM The control ROM provides the intelligen
26. s lt entry point gt CTRL SHIFT N ROM socket number entry point gt CTRL SHIFT letter character is typed by holding down the CONTROL and SHIFT keys while typing either M or N lt ROM socket number gt value from 0 to 6 and selects Chapter 4 REFERENCE a ROM socket ROM socket zero will disable all the ROMs without disabling ROMPLUS entry point is a character used to select the entry point into the ROM All ROMs must have at least one entry point Entry point A is the first entry point B is the second entry point ete There are no spaces between the command character the Ram socket number and the entry point character The brackets are not typed RAM is enabled and disabled by bit 7 of the control word The top 256 bytes of any selected ROM is not available when RAM is enabled If RAM is disabled by any ROM then it must be enabled before the ROM returns Appendix A CONTROL ROM SOURCE LISTING General Information The following pages contain the Control ROM Source listing Once ROMPLUS has been activated all input and output operations are vectored through the control ROM This is transparent to the user The Control ROM is looking for one of two special command characters CTRL SHIFT M or CTRL SHIFT N If the character passed on input or output is not one of these special commands then it is passed on to the input routine If the character is one of the special commands then the

Download Pdf Manuals

image

Related Search

Related Contents

Table of Contents  Impralit KDS - Madeiras Importadas.  Panasonic DMC-LZ3S compact camera  Mode d`emploi  r SANTÉ / Le handicap en Franche—Comté  iStarUSA DD-REARMOUNT mounting kit  操作マニュアル  

Copyright © All rights reserved.
Failed to retrieve file