Apple Assembly Line Volume 2 -- Issue 4 January, 1982 In This Issue... ---------------- Hi-Res SCRN Funtion with Color . . . . . . . . . . . . . . 2 A Correction to "Step-Trace Untility" . . . . . . . . . . 6 6502 Relocator . . . . . . . . . . . . . . . . . . . . . . 8 A Review of THE INDEX . . . . . . . . . . . . . . . . . . 12 Serious Problem in Apple DOS . . . . . . . . . . . . . . . 13 Putting S-C Assembler II on the Language Card . . . . . . 15 Handy EXEC Files . . . . . . . . . . . . . . . . . . . . . 20 6500/1 One-Chip Microcomputer . . . . . . . . . . . . . . 21 A Review of FLASH!, an Integer BASIC Compiler . . . . . . 22 Renew Now, the Price is Going Up -------------------------------- If you renew your subscription before March 1, 1982, you can renew at the current rate of $12/year. Starting March 1st, the price will go up to $15/year (2nd class mail in the USA). Subscriptions sent First Class Mail to USA, Canada, and Mexico will be $18/year. Air Mail subscriptions to all other countries will be $28/year. The price for back issues will be $1.50 each (plus $1.00 postage outside of USA, Canada, and Mexico). S-C MACRO Assembler II is almost here! -------------------------------------- I am committed to having a finished product by February 15th. This is what I have been calling Version 5.0, but I have decided to call it S-C MACRO Assembler II instead. Version 4.0 will still be sold at $55. The MACRO version will be $80. Owners of Version 4.0 can upgrade for only $27.50. There will be an all new manual, rather than the current 2-part manual. The MACRO Assembler includes macros (of course!), conditional assembly, EDIT, COPY, global string replacement, and many more new features. And it assembles even faster than version 4.0! Hi-Res SCRN Function with Color...............David Doudna ---------------------------------------------------------- I am a 15-year-old living in St. Louis, Missouri. While looking through the back issues of Apple Assembly Line, I found "Hi-Res SCRN Function for Applesoft" (May, 1981 issue). I noticed the routine only returned a 0 or 1, and you challenged readers to write one to return a color value 0-7. Well, I did it. My version is not interfaced to Applesoft; that is an exercise for the reader! (I use the Programmer's Aid ROM with FORTH.) I am not going to explain how hi-res colors work, beyond the facts that two adjacent dots are white; the upper bit in each byte of the hi-res screen adds 4 to the color value; an isolated bit is color 1 or 2 (or 5 or 6) depending on the X-position. If you want to understand my program, you should study more about hi-res plotting first. A word about the color value.... In Applesoft you specify color value with a number from 0 to 7. The Programmer's Aid ROM uses color values of 0, 42, 85, 127, 128, 170, 213, and 255. My program returns both numbers for the color: the 0-7 index in HCOLOR, and the P.A.ROM color value in COLOR.BYTE. Lines 1060-1140 define the variables used; these are in the same locations as those used by the Programmer's Aid ROM. If you want to modify the program to work with Applesoft, be sure to put these variables in the correct locations. Two more variables are defined at lines 2120,2130. Lines 1160-1180 pick up the X- and Y-coordinates. I assume you have stored the coordinates here before calling HSCRN. Lines 1190-1390 calculate the base address for the particular horizontal line your point is on. This code is just copied out of P.A.ROM. Lines 1410-1530 divide the X-coordinate by 7 to get the byte offset on the line. The quotient is left in the Y-register. The remainder is used to pick up a bit mask to select the particular bit within the byte. Lines 1540-1650 make the first color check. The high-order bit of the byte (half-dot shift control). If the bit specified = zero, the color is black. If it = one, the color depends on whether either neighbor of this dot = one. If neither neighbor = one, the color depends on whether this dot is in an even or odd column. If the color is not black, I put 1 or 2 in the X-register to indicate the color it will be if it is not white. Lines 1660-1790 check the neighbor bit on the left to see if it = one. Notice that there are several special cases. First, the left-neighbor might be in the same byte. Second, it might be in the byte to the left of this one. Third, there might not be a byte to the left of this one. Lines 1800-1920 check the neighbor bit on the right. The same kind of special cases exist here, and they are handled the same way. Line 1940 sets X = 3 for white color. Line 1960 gets the color value in the A-register. All paths merge at line 1980, with the color index 0-3 in the A-register. All that remains is to add 4 if the half-dot shift control = 1 (Lines 1980-2010. Lines 2020-2060 convert the color index to a color byte (by simple table-lookup), and return. Line 2100 is the table of color values. Here is a table of colors (their names, index numbers, and P.A.ROM numbers): Color Byte Value Color Index Hex Dec Binary ---------------------------------- BLACK 0 00 0 00000000 GREEN 1 2A 42 00101010 VIOLET 2 55 85 01010101 WHITE 3 7F 127 01111111 BLACK2 4 80 128 10000000 ORANGE 5 AA 170 10101010 BLUE 6 D5 213 11010101 WHITE2 7 FF 255 11111111 The program works with either page 1 or page 2 of Hi-Res. Set HPAGE to $20 for page 1, or $40 for page 2. To call this program from Integer BASIC, you would first POKE the X- and Y-coordinates, then CALL the program, and then PEEK the color value. From assembly language, set up the coordinates and JSR HSCRN. The color index is returned in the X-register, and the color byte value in the A-register. [ Program and article modified somewhat by the editor ] 1000 *-------------------------------- 1010 * HI-RES SCRN FUNCTION WITH COLOR 1020 * 1030 * BY DAVID DOUDNA, FERGUSON, MISSOURI 1040 * NOVEMBER 30, 1981 1050 *-------------------------------- 1060 HBASL .EQ $26 BASE ADDRESS 1070 HBASH .EQ $27 1080 HMASK .EQ $30 BIT MASK 1090 *-------------------------------- 1100 X0L .EQ $320 X-COORDINATE 1110 X0H .EQ $321 1120 Y0 .EQ $322 Y-COORDINATE 1130 HCOLOR.BYTE .EQ $324 1140 HPAGE .EQ $326 HI-RES PAGE ($20 OR $40) 1150 *-------------------------------- 1160 HSCRN LDA Y0 GET (A)=Y-COORDINATE 1170 LDX X0L GET (Y,X)=X-COORD. 1180 LDY X0H 1190 PHA Y-COORD BITS LABELED ABCDEFGH 1200 AND #$C0 CALCULATE BASE ADDRESS FOR Y-COORD 1210 STA HBASL IN HBASL,HBASH FOR 1220 LSR ACCESSING SCREEN MEMORY 1230 LSR VIA (HBASL),Y 1240 ORA HBASL HBASH = PPPFGHCD 1250 STA HBASL HBASL = EABAB000 1260 PLA WHERE PPP=001 FOR $2000-3FFF 1270 STA HBASH AND PPP=010 FOR $4000-5FFF 1280 ASL 1290 ASL 1300 ASL 1310 ROL HBASH 1320 ASL 1330 ROL HBASH 1340 ASL 1350 ROR HBASL 1360 LDA HBASH 1370 AND #$1F 1380 ORA HPAGE 1390 STA HBASH 1400 *-------------------------------- 1410 TXA DIVIDE X-COORD BY 7 (7 DOTS PER BYTE) 1420 CPY #0 IS X-COORD > 255? 1430 BEQ .2 NO, ENTER SUBTRACTION LOOP 1440 LDY #35 YES: 256 = 7*36 + 4 1450 ADC #4 CARRY WAS SET, SO ADDS 5 1460 * ALSO CLEARS CARRY, SO SBC #7 BELOW 1470 * ACTUALLY SUBTRACTS 8 1480 .1 INY INCREASE QUOTIENT 1490 .2 SBC #7 SUBTRACT 7 (OR 8 IF CARRY CLEAR) 1500 BCS .1 STILL MORE 7'S 1510 TAX REMAINDER IS BIT POSITION 1520 LDA MSKTBL-249,X 1530 STA HMASK 1540 *-------------------------------- 1550 LDA (HBASL),Y GET BYTE WHICH HAS OUR SPOT 1560 AND #$80 ISOLATE HALF-DOT SHIFT BIT 1570 STA HIBIT 1580 LDA (HBASL),Y GET BYTE AGAIN 1590 AND HMASK ISOLATE OUR SPOT 1600 BEQ .9 COLOR IS BLACK (0 OR 4) 1610 LDA X0L NOT BLACK 1620 LDX #1 1630 LSR ODD OR EVEN X-COORD.? 1640 BCS .3 ODD, COLOR=1 OR 5 1650 INX EVEN, COLOR=2 OR 6 1660 *-------------------------------- 1670 .3 LDA HMASK LOOK AT NEIGHBOR BIT ON LEFT 1680 LSR BITS ARE IN BYTE BACKWARDS 1690 BCC .4 NEIGHBOR IN SAME BYTE 1700 TYA NEIGHBOR IN DIFFERENT BYTE 1710 BEQ .5 NO BYTE LEFT OF THIS ONE 1720 DEY 1730 LDA (HBASL),Y 1740 AND #$40 1750 BNE .7 WHITE 1760 INY RESTORE Y 1770 BNE .5 ...ALWAYS 1780 .4 AND (HBASL),Y 1790 BNE .7 WHITE 1800 *-------------------------------- 1810 .5 LDA HMASK LOOK AT NEIGHBOR BIT ON RIGHT 1820 ASL 1830 BPL .6 NEIGHBOR IS IN SAME BYTE 1840 CPY #39 ALREADY AT RIGHT END? 1850 BCS .8 YES, NOT WHITE THEN 1860 INY 1870 LDA (HBASL),Y 1880 AND #1 1890 BNE .7 WHITE 1900 BEQ .8 ...ALWAYS (NOT WHITE) 1910 .6 AND (HBASL),Y 1920 BEQ .8 NOT WHITE 1930 *-------------------------------- 1940 .7 LDX #3 COLOR IS WHITE (3 OR 7) 1950 *-------------------------------- 1960 .8 TXA COLOR TO A-REG 1970 *-------------------------------- 1980 .9 BIT HIBIT SEE IF HALF DOT SHIFT 1990 BPL .10 NO 2000 CLC 2010 ADC #4 YES 2020 .10 STA HCOLOR 2030 TAX USE COLOR # (0-7) TO GET COLOR BYTE 2040 LDA COLOR.TABLE,X 2050 STA HCOLOR.BYTE 2060 RTS 2070 *-------------------------------- 2080 MSKTBL .HS 01020408102040 2090 *-------------------------------- 2100 COLOR.TABLE .HS 002A557F80AAD5FF 2110 *-------------------------------- 2120 HIBIT .BS 1 MSB 2130 HCOLOR .BS 1 COLOR INDEX 0-7 A Correction to "Step-Trace Utility"....Bob Sander-Cederlof ----------------------------------------------------------- "Step-Trace Utility", published in the July 1981 issue of AAL (pages 17-20), has a bug. Three or four of you ran into the problem and called me about it, but I was never able to duplicate the problem. Finally Bob Leedom managed to pinpoint the bug, and I found out how to fix it. If you have used Step-Trace, you might have noticed that it sometimes will hang-up or go crazy after a relative branch instruction. The problem is that if the 6502 was in decimal mode, the calculations are all incorrect. This affects the branch target, and also messes up screen output. To fix it, insert the following line: 2095 CLD SELECT bINARY MODE But how did the 6502 get into decimal mode, when I wasn't ever setting it? The contents of SAVE.P were random on initial start-up. Sometimes the contents managed to switch on decimal mode! Perhaps you should also insert the following two lines, to be certain of the initial status of the program you are tracing: 1455 LDA #0 CLEAR INITIAL STATUS 1456 STA SAVE.P Future copies of Quarterly Disk #4 already have these two patches installed. 6502 Relocator..........................Bob Sander-Cederlof ----------------------------------------------------------- Programs that are already assembled usually must be loaded at a specific memory address to execute properly. If you want to run it somewhere else, you have a problem. All the data references, JMP's, and JSR's will have to be examined to see if they need to be modified for the new location. If you don't have the source code, you can't re-assemble it. The other way, patching, can be quite a tedious operation! Fortunately, way back in 1977, the WOZ (Steve Wozniak to you newcomers) wrote a program to do the work automatically. If you have the Programmer's Aid ROM then you have his RELOCATE program. You who have Apple II Plusses with the Language Card (also called 16K RAM card) can also use his program, because it is in the INTBASIC file along with Integer BASIC. (The latter group of people probably don't have the manual, though, because they didn't buy the ROM.) I would like to see the RELOCATE program made more widely available, but it cannot be used as is unless you have Integer BASIC. Why? Because it uses SWEET-16 opcodes. RELOCATE also is itself tied to running at whatever location it is assembled for, so it can be a little trouble to find a place for it sometimes. By now you have probably guessed that I have recoded RELOCATE to solve both of these problems! Paul Schlyter's article elsewhere in this issue of AAL shows RELOCATE put to good use. You can examine his instructions and learn most of what you need to know to use RELOCATE on your own programs. Basically, there are four steps: 1. Initialize. This sets up the control-Y monitor command. If RELOCATE is on a file, you do this with "BRUN RELOCATE". 2. Specify the program start and end addresses (where it now is in memory), and the new starting address (where you want it to be relocated to). This is done with the monitor command: target SRCEND 1740 SEC COMPARE ADDR TO BEGINNING OF SRC 1750 LDA INST+1 1760 SBC R1 1770 TAY 1780 LDA INST+2 1790 SBC R1+1 1800 BCC .3 ADDR < SRCBEG 1810 TAX 1820 TYA ADDR = ADDR-SRCBEG+DESTBEG 1830 CLC 1840 ADC R4 1850 STA INST+1 1860 TXA 1870 ADC R4+1 1880 STA INST+2 1890 *-------------------------------- 1900 .3 LDX #0 COPY MODIFIED INSTRUCTION TO DESTINATION 1910 LDY #0 1920 .4 LDA INST,X NEXT BYTE OF THIS INSTRUCTION 1930 STA (A4),Y 1940 INX 1950 JSR MON.NXTA4 ADVANCE A1 AND A4, TEST FOR END 1960 DEC MON.LENGTH TEST FOR END OF THIS INSTRUCTION 1970 BPL .4 MORE IN THIS INSTRUCTION 1980 BCC RELOC2 END OF SOURCE BLOCK 1990 RTS A Review of THE INDEX...................Bob Sander-Cederlof ----------------------------------------------------------- THE INDEX is a new book that you can use. No doubt you subscribe to three or more magazines and newsletters, out of the 100 or so that are being published with information Apple owners want and need. Wouldn't you like a composite index that covered the best ones? Bill Wallace an attorney in St. Louis, Missouri, has put together just such an index. His book compiles over 12000 articles, editorials, and columns from over 900 issues of personal computer magazines published during the last six years. Over 40 different magazines and newsletters are covered. I am honored that Bill has chosen to include both of my newsletters: Apple Assembly Line, and AppleGram. Organized as a Key-Word in Context (KWIC) index, there are over 30000 entries. There are 92 pages of Apple-related articles, 160 pages covering other computers (Apple owners will be interested in the CP/M and 6502 sections), and over 200 pages of general articles. All the information necessary for obtaining copies and/or subscriptions of the various magazines and newsletters is also included. Bill plans to publish a second edition later this year to include the issues published since the cutoff date of the first edition, as well as lots of additional publications that were not previously covered. THE INDEX costs $14.95, and is available from Missouri Indexing, Inc., P. O. Box 301, St. Ann, MO 63074. Bill is responsive to requests for group rates, if you can interest your local Apple club; call him at (314) 997-6470. Serious Problem in Apple DOS..............Bob Sander-Cederlof ------------------------------------------------------------- If you are trying to use the IRQ interrupt line for any purpose, and also DOS, you may have run across this problem before. Apparently at random, for no good reason, you may get the NO BUFFERS AVAILABLE message. The reason is that both DOS and the IRQ interrupt code are trying to use the same page zero location: $0045. DOS uses this location as part of a pointer address when looking for the next available buffer. (See the code at $A2CB-A2CF and $A764-A780.) DOS also uses $0045 when printing the catalog (see $ADB9, $AE09, and $AE53). The IRQ interrupt code in the Apple Monitor ROM (at $FA86) uses $0045 to save the contents of the A-register. If an interrupt occurs while DOS is in the process of looking for a buffer, POW! One solution is to turn off interrupts whenever DOS may be active, using the SEI opcode. A better solution would be quite difficult: look through all of DOS and modify every reference to $0045 (or to $0044 and $0045 as a pair) to use some other location in page zero. A third possible solution for those who can do it is to modify the Apple Monitor ROM to use some other location to save the A-register. In case you ARE using interrupts and DOS together, you should also know that RWTS does inhibit interrupts while it is active. After a call to RWTS is complete, the interrupt-inhibit status is restored to whatever it was before the call. Interrupts cannot be allowed during RWTS, because of the critical software timing code involved in reading and writing the disk. Putting S-C Assembler II on the Language Card . . Paul Schlyter --------------------------------------------------------------- [ Paul is a subscriber in Stockholm, Sweden. ] Introduction I have owned the S-C Assembler II for only a little more than three weeks, and already I have stopped using the two other assemblers I used to use before ("Apple Text Processing System" and "DOS Tool Kit Assembler"). Although the others have some powerful features, the S-C Assembler is so much easier to use it now takes me only about half the time to finish an assembly language program as it did before. The many similarities between the S-C Assembler and Integer BASIC made me curious, so I disassembled the Assembler. Earlier I have done the same thing with Integer BASIC, Applesoft, and DOS. It wasn't too long (about a week) that I had a fair understanding of the first third of the assembler. Then the idea turned up in my head: "Why not try to relocate it into the language card?" Another week of sleepless nights and it was up and running! There were several traps on the way. It took a long time for me to discover the address stack put into DOS at $1333-133C. Sometimes I just entered the regular assembler at $1000-24FF and didn't notice anything, sometimes the machine crashed when a DOS error occurred. But that was a week ago, and the last week nothing like that has happened...now I feel fairly confident that I have found all bytes that need to be relocated. If anything does turn up, I will let you know. Why and How Have you ever thought about how very similar to Integer BASIC the S-C Assembler II is? It stores its source files as DOS type-I files, and numbers the lines the same way as Integer BASIC. Just like in Integer BASIC, you have access to all DOS commands. Well, the similarities don't stop there. Integer BASIC starts at address $E000 and ends a little bit above $F400; the S-C Assembler starts at $1000 and ends a little bit above $2400. The byte at $E000 is $20 in Integer BASIC (JSR opcode) while it is $4C in Applesoft (JMP opcode); it is by looking at this byte that DOS decides whether Integer BASIC or Applesoft is the current language. Well, guess what the byte at $1000 in the S-C Assembler is: it's $20! When putting all these facts together, I started to wonder if it wasn't possible to relocate the S-C Assembler up into the Language card, making DOS believe it is in Integer BASIC. This of course requires that you have Applesoft on the motherboard ROMs, so that DOS will be able to distinguish between the ROM and Language card languages. Sure enough, it is possible. I did move it up there, and it works, and it turned out to be really convenient. The DOS command FP puts me in Applesoft, while INT puts me into the S-C Assembler! Also, if I am currently in Applesoft and LOAD an S-C Assembler source file (type-I, of course), DOS will automatically start up the assembler! Can you really ask for more? To relocate the S-C Assembler into the language card, you need of course a language card (any of the several RAM cards no available will do). You also need to have Applesoft in ROM on the motherboard (not Integer BASIC). You also need a relocation program; I used the one in the Programmer's Aid #1 software, which is in the INTBASIC file on the DOS 3.3 System Master. You could use the one in Bob Sander-Cederlof's article elsewhere in this AAL just as well. Step-by-step Procedure 1. Boot the DOS 3.3 System Master. This will load Integer BASIC into the Language Card. 2. Type INT to enter Integer BASIC. 3. Put in the S-C Assembler II disk, and BLOAD ASMDISK 4.0 (do not BRUN it). 4. Enter the Apple monitor by typing CALL -151. (Throughout the following steps, be sure you do NOT hit RESET!) 5. Now that you are in the monitor, type the following commands: C083 C083 (write-enable the language card) D4D5G (initialize the relocation program) E000<1000.24FF^Y* (specify source and destination blocks for the relocation program. Note that "^Y" means "control-Y". The asterisk at the end IS necessary.) E000<1000.100E^Y (relocate the first segment) .100FM .121E^Y .1282M .1330^Y .133CM .1436^Y .1438M .147C^Y .14A9M .14DB^Y .141EM .14F3^Y .14F5M .15D0^Y .15D6M .17A6^Y .17AEM .1A8C^Y .1A91M .1BB7^Y .1CAEM .2149^Y .2150M .221C^Y .24FFM (The monitor commands on the above four lines relocate the program segments and move the data segments. They can be typed as shown, or one per line, or even all on one line. Just be sure to type them correctly -- check and double check -- before pressing RETURN.) 6. The machine code relocator automatically updates any direct address references in the program being relocated. This saves us a lot of work, but it does not finish the work. We also have to fix all the address tables and all immediate address references. Enter the following monitor commands to fix all of these (only one command per line): E042:E2 E254:E2 E334:E0 F234:F1 E227:E7 E259:EB E336:E0 F239:F0 E22C:E5 E25E:E3 E338:E0 F23E:F0 E231:E0 E263:E0 E33A:E3 F243:F0 E236:E5 E268:E5 E33C:E0 F248:F2 E23B:E1 E26D:F1 E4A3:E4 F24D:F0 E240:E4 E272:E6 E83E:F2 F252:F1 E245:E1 E277:E1 F225:F0 F257:F0 E24A:E6 E27C:E0 F22A:F1 F25C:EE E24F:E3 E281:EB F22F:F0 F261:E0 7. The cold start routine in the Assembler must be patched: E030:ED E2 E2E0:AD 83 C0 AD 83 C0 A9 00 85 D9 4C 08 E3 AD 83 C0 E2F0:AD 83 C0 4C 75 E3 8. If you wish, you may change the starting address of the Assembler Symbol Table to make more space: E011:10 E2D6:10 9. If you enter Applesoft from the S-C Assembler, the output hook from DOS will still be connected to the S-C Assembler output routine. But the assembler will be banked away since now the motherboard ROMs are enabled! The result is that the Apple will hang. To cure this problem, you will have to sacrifice the SLOW and FAST commands, and the ability to suspend/abort listings using the space bar and RETURN keys. This is not such a big sacrifice anyway, since all language card owners have the Autostart Monitor: you can use control-S to suspend a listing. You can also use RESET to abort one (provided your language card has a switch and it is in the UP position). [If you can't bear to part with SLOW and FAST, you can type FP and then hit RESET to get out of the Assembler.] Here are the patches to eliminate SLOW and FAST: E1E9:EA EA EA EA E22D:4D 4E 54 68 FF E273:FF FF FF These patches also change FAST to MNT, a command that gracefully enters the monitor. From the monitor, a control-C will re-enter the S-C Assembler with the current source program intact; a control-B will cold start the S-C Assembler. 10. Save the completed package on disk with: BSAVE LANGASM,A$E000,L$2000. 11. Modify a copy of the HELLO program from the DOS 3.3 System Master Disk to BLOAD LANGASM instead of INTBASIC, and use this as your HELLO program. When you boot it will automatically load the S-C Assembler II into your language card. Parting Shots Maybe you think that I must have a thorough knowledge of how the S-C Assembler II works internally to be able to do this relocation, but this is not actually the case. I made a disassembly and also hex and ASCII dumps of the whole assembler, and I also started to untangle the code, but I only really know about a third of the code fairly well. I still have not the faintest idea of how the actual assembly is performed, although looking at the ASCII dump immediately revealed where the opcode and command tables were located, and the error messages. I also did find out the places where the error messages are produced... this helps a lot in figuring out what is happening in the code. And with this not-too-well understanding of the inner workings, and with a lot of trial-and-error, I was able to find all the places where changes needed to be made. My S-C Assembler has been running from my language card for over a week, and I have used it a lot during this time; all has gone very well. And believe me, it is SO CONVENIENT to have it there! I really benefit from the language card, not only when using Pascal or CP/M, but also when I am running DOS. And I use the S-C Assembler II much more than Integer BASIC, so having the assembler in the language card is really the right thing for me. Maybe it is for you too! So, Bob, although you have made an excellent and very easy to use assembler, it is not quite true anymore that the S-C Assembler II is the easiest assembler to use... LANGASM is. And as you have guessed, LANGASM is nothing but the S-C Assembler II relocated into the language card! [ If the instructions for making LANGASM leave you breathless, you can order Quarterly Disk #6 ($15.00). It will include all the source code from this issue and the next two of AAL, and also an EXEC file which will create LANGASM from ASMDISK 4.0. It will be ready in early March, 1982. Another shortcut is to order the source code of the S-C Assembler II ($95.00). Then simply change the origin, modify the SLOW and FAST commands, and re-assemble it. Voila! LANGASM! ] Handy EXEC Files........................Bob Sander-Cederlof ----------------------------------------------------------- Now that I have my Firmware card with Integer BASIC on it plugged into slot 4, I am all too frequently needing to fix those two bytes in DOS. For some reason I don't get around to putting the patched DOS onto every disk. But with a few EXEC files I can make the patches very easily now. The first EXEC file, which I call INT, is like this: CALL -151 (get into the monitor) C081 (turn off the language card, if on) C0C1 (turn off the firmware card, if on) A5B8:C0 (patch DOS to use firmware card) A5C0:C1 3D3G (return to DOS and Applesoft) INT (enter Integer BASIC) The second file I use to load LANGASM into the Language Card (see Paul Schlyter's article elsewhere in this issue of AAL). Here is what it looks like: CALL-151 (get into the monitor) C0C1 (turn off the firmware card, if on) C081 C081 (write enable the language card) BLOAD LANGASM (load LANGASM into the language card) A5B8:80 (patch DOS to use the language card) A5C0:81 3D3G (return to DOS and Applesoft) INT (enter the assembler) The third EXEC file I use to patch DOS back to its normal mode of using the language card in slot 0. If I have already loaded the S-C Assembler II (LANGASM) into that card, but was using Integer BASIC, EXEC ASM will get me back to the assembler. CALL-151 (get into the monitor) C081 (turn off the language card, if on) C0C1 (turn off the firmware card, if on) A5B8:80 (patch DOS to use the language card) A5C0:81 3D3G (return to DOS and Applesoft) INT (enter the assembler) Just for fun, here is one more EXEC file. This one copies the contents of the firmware card in slot 4 into the language card in slot 0. A much faster way of loading it with Integer BASIC than running HELLO on the DOS 3.3 System Master! CALL-151 (get into the monitor) C0C0 (turn on the firmware card) 1000 141 THEN 180 190 GOTO 160 220 PRINT D$"CLOSE" 230 END 500 REM INPUT A LINE WITHOUT DOS KNOWING 505 IN# 0: PR# 0: CALL 64874: CALL 1002: RETURN 100 REM READ EXEC FILE 130 D$ = CHR$ (4): INPUT "FILE NAME: ";F$ 140 PRINT D$"NOMONCIO": PRINT D$"OPEN"F$: PRINT D$"READ"F$ 150 ONERR GOTO 220 160 CALL 64874 170 I = 511 180 I = I + 1: C = PEEK (I): PRINT CHR$ (C);: IF C < > 141 THEN 180 190 GOTO 160 220 CALL - 3288: PRINT D$"CLOSE" 6500/1 One-Chip Computer...........................Dan Pote ----------------------------------------------------------- Commodore Semiconductor Group has announced a new one-chip microcomputer, called the 6500/1. (I believe the same chip is available from Synertek and Rockwell.) The 6500/1 has a 6502 CPU and is compatible with existing 6502 programs. There are also four I/O ports (32 bi-directional lines, the equivalent of two 6522 devices), a counter, 2048 bytes of ROM, and 64 bytes of static RAM. Your choice of 1- or 2-MHz internal clock. It can be ordered as masked-ROM, PROM, or piggy-back EPROM. For more information call Commodore at (214) 387-0006. A Review of FLASH!, an Integer BASIC Compiler --------------------------------------------- *MISSING* Apple Assembly Line is published monthly by S-C SOFTWARE, P. O. Box 280300, Dallas, Texas 75228. Phone (214) 324-2050. Subscription rate is $12 per year in the U.S.A., Canada, and Mexico. Other countries add $12/year for extra postage. Back issues are available for $1.20 each (other countries add $1 per back issue for postage). All material herein is copyrighted by S-C SOFTWARE, all rights reserved. Unless otherwise indicated, all material herein is authored by Bob Sander-Cederlof. (Apple is a registered trademark of Apple Computer, Inc.)