Home

AIM 65/40 .. . THE NEXT GENERATION!

image

Contents

1. 4 To make the data files compatible with text files that are written and read by EDITOR a few additional things should be done The first five char acters to the tape buffer should be the filename The first position in the buffer was set to indicate block zero by statement 9010 thus the filename takes up characters 2 through 6 The 7th character must not be a CR SOD or it will not be accepted by EDITOR as a text file EDITOR also wants to see two consecutive CR s at the end of thc file to indicate EOF The EOF subroutine does this as well as filling the rest of the block with nulls However the user is free to set up his 80 byte blocks to suit his own needs e g a special character to indicate EOF Obviously to read data from tapes a proper INPUT format is nec essary to match the way the data is stored The filename will also need to be INPUT from block 0 The program on page 5 gives an example that we can follow Statements 20 through 50 load array P Statement 60 inputs a title for the data not the filename Statements 90 120 sets up tape recorder 1 or 2 for output and turns the tape controls off User should respond with a or 2 to INTERACTIVE statement 90 At statement 120 place tape recorder in record mode and answer query Input filename at 140 Statements 150 230 ac tually do the writing to tape Note that 170 prints the filename a
2. BO TATAAMy Gs OF ey fOr BO FS 90 TATA ENT 100 REM HEX YO TE CTMAL 110 GENERATES TATA LINES ON 120 REM G BRINKMANN 130 REM AUF M GRAEUERTCH 196 140 REM 095414 UALLENDAR 150 REM WEST GERMAMY 160 REM INIT L70 Hee OL 224567 180 FIRST LINE FOR COUNT OF DATA ITEMS 190 INPFUT NH OF FIRST TNE sit sleet 1 300 REM OREN TAPE FILE WITH LONG GAF POKE Gr eae rs PONE 41 93 128 MEST 09 SHE ClO nara 10 FER LINE FOR Wed TO 10 REAN AS TR THEN 390 REM SUBROUTINE HEX gt DECIMAL 4760 REM QN ERROR CLOSE FILE IF ALSIL ER THEN 319 POKE IM LINE snio0T0430 gt 1 THEN EM STRING CONCATENAT TON COSTAL INERT d TO ANY FILE INC LINE NUMBER 370 PRINT 1208010 230 380 REM PRINT LAST LINE ANT THEN FIRST 490 PRINT 54 400 amp SqzcIbstuto t nAOTA YSTRSGCOD L 3 X10tTN 12 410 PRINT 420 REM CLOSE OUTPUT FILE ASO PONE 4s432PO NE Se dlr xsuse co 440 REM JUMP TO BASIC INPUT 450 460 SUUGROUTINE HEX gt DECIMAL 470 IF LENGCAT 1 THEN 486 TO 17 TF MLOGC Ads Ly LEME CMe 191 Azsi xcl 12 60T0 820 REM AFTER LAST NEXT gt ERROR NEXT FOR 121 TO 17 IF OMIT 2 2 ASAHI
3. JSR LOALTA OF2F FO OC BEQ FRINT OF91 4C 63 OF JMF EXIT OF31 C9 84 CMF 884 OF 94 OFENFL OF33 FO 34 BEQ INFUT OF94 20 C7 OF JSR RIINAME OF35 C 3A 84 OF97 35 44 STY TAPOUT 0 37 BO 05 BCS NOTNUM OF9A 20 ES JSR DUMFTA OFS 4C CC 00 OF9D 4C 63 OF JMF EXIT OF3C 60 NOTNUM RTS 98 TYA OFAL 18 CLC OFS 48 PRINT FHA OFA2 65 C ALC PNTR OF SE 20 9E JSR FHXY OFA4 85 C STA OF 41 01 LnY 1 OFA6 90 02 BCC UFL OFA3 Bl C6 LRA CFNTRO Y OFAB C7 INC OF45 C9 23 CMF OFAA 60 UP 1 RTS OF47 FO 06 BEQ STATAF OF AE CLOSE Qnm T PRI OFAB 20 FO E9 JSR CRLE OR See uu OFAE 20 FO 9 JSR CRLF OE SE AE EXIT OFBi 20 0A ES JSR 0011 uisi MN OFFTAF ME LEA T OFB4 89 LIA 51 8h 13 A4 STA OUTFLG OEBS 20 OO AND DRE OFS4 INY OFE9 00 AB STA ORE OFSS Bi C LOA CFNTRO Y 20 FE EB JSR LL OFS7 C9 27 CMP OFBF 20 AC EB JSR PLXY OFS9 FO 39 BEQ OPENFL OFC2 68 FLA OFSR C9 23 CMF 7 OFC3 49 LIA 8 OFS FO 4C BEQ CLOSE OFCS 38 SEC OF SF STI OFC 60 RTS OF SF 88 NEY OF C7 RIINAME 40 20 AO OF JSR UPPNTR OFC7 INY Page 8 20 AO OF JSR UPFNTR 0 00 LEY 0 OFCI Ri C NEXT LIA CFNTRO Y OFCF C9 27 7 FO OE REQ OFS 99 4 STA NAME Y 6 INY CO 05 5 9 NO F2 BNE NEXT OFER 20 AO OF J
4. DUTAL L OUT MEM 1 Y TO ADER COUNT BYTES amp CRSUMS OK 0 ERRORS CODE FOR BIT ABS SEINAL MSG AND RTS INTERRUPT DRIVEN KEYBOARD FOR THE AIM 65 Dr Will Cronyn Borrego Springs CA A common requirement in interactive computer systems is the entry of ASCII characters through the keyboard at random or erratic intervals when a program is executing The program may be computational pro cess control monitoring or some combination of these or other functions The AIM 65 monitor routines require an explicit call to the keyboard and all i e READ RBYTE etc except RCHEK demand a response before execution continues The results would be disastrous if your AIM 65 controlled desert irrigation system had to wait 4 weeks before resuming execution for you to retum from your summer vacation in Alaska to answer the question Do you want the citrus put on a 3 days a week watering schedule You could lace your program with calls to RCHEK but such calls which consume 959 microseconds each if there is no keyboard entry can consume a large fraction of the execution time of the computer in spite of the fact that they are utilized for only a tiny fraction of the time One solution to the problem was described by De Jong in issue 3 of Interactive He suggested the fundamental solution to the problem gen erate interrupts for which the interrupt service routine looks for a key
5. A406 vector to intercept all data on the way to the display printer and then redirects it to both the TTY and display printer If this program or any other program that modifies DILINK is assembled on the AIM 65 the object code has to be directed to an external device If the object code is directed to memory the AIM 65 will lock up To free it the power has to be turned off Reset will not correct the problem The second program UOUT is a user output program It allows the user to select the TTY port by responding to the OUT prompt with a U In this way any command that uses the Outall subroutine will direct its output to the TTY port AIM 65 Basic uses Outall for all of its printing commands Unfortunately AIM 65 Basic also sets the Outflag to equal P To use the user output program the instruction 42003 85 needs to be inserted METHOD TO CALCULATE BAUD RATES FOR THE AIM 65 When used with terminals running at 1200 baud and up the Rockwell AIM 65 needs to have the Baud Rate entered manually To calculate the values to enter perform the procedure outlined below Note All variables are integers and have us bit as their units 1 10 Baud Rate X 2 X 67 us b Y 3 Y 256 Z remainder W 4 A417 Z in Hex 5 A418 W in Hex Page 13 In actual use there have been two major sources of failure with these pro grams The easiest to cure is if the baud rate isn t entered properly To determine the appropri
6. AIM 65 40 7 ISSUE 5 For Your Information Coming Soon AIM 65 40 Data Files for AIM 65 BASIC More BASIC Data Files A Move Relocate Program 13 14 16 19 21 22 24 TTY Output Utility Data Statement Generator Cassette Load Utility Interrupt Driven Keyboard A Basic Hint Letters to the Editor Easy RS232C Rockwell International where science gets down to business Page 2 EDITOR S CORNER I want to thank all you supporters who have been sending in articles comments suggestions It s nice to know that INTERACTIVE has so many fans out there We have a pretty good mix of articles in this issue with maybe a bias towards data files But that s what you seem to be interested in Keep in mind that this publication is a dynamic entity You are the force behind it Whatever you collectively say GOES If you wish to influence the direction we taking then write an article about the subject you d like to see It s as simple as that I would like to see more articles on how to interface the AIM 65 to dif ferent devices such as A D D A counter chips DVM chips speech synthesizers graphic output etc etc etc How about it I have received some good stuff in the area of CAD Computer Aided Design Not enough for a complete issue though so I ll start running them in issue 6 or 7 We re getting ready to do another update on t
7. board entry To allow continuation of program execution in the absence of a keyboard entry De Jong modified AIM Monitor routines The result is an interrupt routine which requires A3 163 bytes of code in 87 lines In addition to the fairly lengthy code it does not appear that his routines are fully debounced i e debounced on both keystroke initiation and termination My solution is to use two interrupt service routines one to jump from an executing main program to JSR READ and the other to jump from READ in the most likely event that no keyboard entry is available back into the main program Not only does this approach work but also it uses unmodified monitor routines and is instructive in its utilization of a dy namically programmed interrupt vector The interrupt service routines require 40 64 bytes of code in 29 lines DETAILED PROGRAM DESCRIPTION There are three parts to the code which appears in the listing 1 system configuration and initialization 200 22B 2 a main program which provides an immediate positive verification that the interrupt driven keyboard is functioning properly 22C 24C and 3 the interrupt rou tines themselves in a location which would be appropriate for most 4K AIM applications FCO FFF The interrupt routine sequences and con figurations can best be understood by referring to the IRQ signal display The timer counter 004 5 is loaded with FFFF which produces an inter
8. 00 00 OOEF 00 0 0081 00 2 OOF3 00F4 00 5 OOF6 Prompt messages are stored in ASCH as follows Ax F M LO HI unchanged INITIALIZE X INDEXES MESSAGE BYTES Y INDEXES PROGRAM 00 7 53 3D 46 3D S OOFB 44 3D 4D 5 D O0FF 3D 0000 A2 LDX 00 0002 LDY 00 0004 20 JSR 0002 0007 20 JSR 0090 000A EO CPX 000C DO BNE 0004 000 20 JSR 00D2 BYTES EACH INSTRUCTION DISPLAY PROMPT MESSAGE ASKING FOR ADDRESS GET 4 DIGIT ADDRESS AND STORE IT SEE IF 12 DIGITS ALL THREE ADDRESSES IF NOT BACK FOR NEXT ADDRESS DISPLAY FINAL PROMPT INTERACTIVE aie 0011 20 JSR E973 0014 C9 4D 0016 FO BEQ 00E 0018 AS LDA ED 001A 8D STA A425 0010 AS LDA EE OOIF 8D STA 426 0022 20 JSR 6 0025 AS LDA EA 0077 C9 CMP 02 0029 DO BNE 006 0028 AQ LDY 01 002D LDA ED Y 002F 85 STA 0031 C8 INY 0032 BI LDA ED Y 004 85 STA 0036 38 SEC 0037 AS LDA 0039 ES SBC EB 003B AS LDA 003D ES SBC EC 003F 90 006 1 AS LDA EF 0043 ES SBC 0045 AS LDA FO 00 5 SBC 0049 90 BCC 006 004B 18 CLC AS LDA FI 004E 65 ADC R 0050 48 PHA REDOUT SEE IF USER WANTS MOVE OR RELOCATE IF HE SAYS THEN GO TO MOVE ROUTINE FOR STRAIGHT COPY OTHERWISE GET CURRENT SOURCE ADDRESS FROM ED EE AND PUT IT IN SAVPC AT A425 A426 DISASM INTERPRET INSTRUCTION a
9. it requires all of 4 lines 0112 JMP 0000 this is arbitrary 0000 INC A419 00D3 JSR 0006 RTS E71D To run toggle the printer off Next disassemble the first instruction of the program under examination using the K command and a RETURN following the prompt This sets up the various flags and registers To disassemble subsequent instructions just press the F3 key The printing version goes as follows 0112 JMP 0000 again this is arbitrary 0000 INC A419 0003 JSR E71D 0006 JSR F04A 0009 RTS Toggle the printer off and disassemble the first instruction as above Hit the PRINT key to print the first instruction Each press of F3 will di sassemble and print the next line Michael L Brachman 3513 Lake Ave 307 Wilmette IL 60091 Dear Editor I think I ve hit on a good way to build data files on tape from AIM BASIC This is an alternative to the method described by Ralph Reccia in Issue No 1 To write a file on tape insert the following line in the BASIC code before the first PRINT statement you wish to send to tape POKEA 113 POKES5 232 X USR X This line calls the monitor subroutine WHEREO which issues the fa miliar prompts OUT F T Answer these prompts with T your desired file name and 1 or 2 This initializes a tape file with the given name From here on all BASIC PRINT statements will direct output to the tape buffer and when the buffer is filled it will be dumped to tape Don t forge
10. 01 A4 ER A4 A4 A4 EA 00 4 01 01 4 REAL SYNC FOUNI MORE COUNT TIBI ERROR START BLOCK AGAIN JSR JSR JSR CMF REG JSR STA INX JSR RTS JSR LUX BNE JSR Lx INX STX JSR CF X BEQ JMF LDA BNE INC RTS JSR JSR JSR JSR SEC LIA SBC STA JSR JSR JSR LIX STX LIA CMF BNE FHXY TAISET GETTAF t s FOUND 416 READ SYNC 0 GETTAF TEMP y X 1252 MORE FL XY FHXY TAF AR 79 TIBI TAPE 00 TEMP 9 X TAF AR FLXY 00 RET CHEKA BLANK ARRS TO 1 S141 8141 CRLOW NAMO TAPE 5 TAFAR 1 BLOCK 1 1 BLOCK Page 17 SET TAFE GET A CHAR BLOCK START BYN STORE IN BUFFER GET A CHAR RUFF NO FULL RUFF POINTER BUFF EMFTY NO AREAN A BLOCK GET CHAR INC BUFF POINTER SAVE POINTER 0 THEN TO CKSUM 0zN ERRORS 0 PORIG ADDR LEAUE A SPACE PADDOR TO ADIR VALUE PELEAR DISPLAY SFILE NAME NO NOT BLK NAMES DIFFERENT Page 18 0092 0093 0098 0092 00940 0091 QO9F 0061 0064 00665 0069 OO AHB OOAE OOAF OORS QORB OOBE 0003 00CS 0003 0005 00C8 0
11. DEY LOOP A DEC CNTK ENE 100 1 RTS INTRET SRUC sHNSVC LEAPS FROM P MAINS TO Re Ab ER DSU FROM READ MALIN BECAUSE OF SINTREFT DRIUVEN EXIT KEA s SAVE ESTERE PNTR P SAVE INTRET AFTER 16 ROGUE WU KE BOR CG SAUGR xxl MNS UT PHA 9 SAYS Roky INTRET YEC TOR s NEXT INTREG POY CLE CURRENT RES STA LOA X RISUC uem INTERACTIVE A BASIC HINT Howard A Chinn S Yarmouth MA Issue No 1 of INTERACTIVE called attention to the use of the AIM 65 text editor for editing BASIC programs Mention was not made how ever of the use of the text editor to write BASIC programs that contain both direct calculator mode and indirect programming mode com mands This feature which is not available on a TRS 80 until you up grade to a disc system provides an opportunity for many interesting applications Listing No 1 is that of a short demonstration program prepared in the text editor and printed using the Editor s 1 command This program was recorded on tape using the Editor s L command Next BASIC is entered and the program loaded using BASIC S and with the printer turned OFF for this particular demonstration Listing No 2 was generated automatically while the program was being loaded Listing No 2 shows that a title and explanation is printed witho
12. FOUR PROMPT MESSAGES WHICH ARE STORED IN ASCII AT 00F7 ET SEQ WHEN CALLED FOR THE FIRST TIME Y 0 AND IS USED TO INDEX ALONG THE MESSAGE TABLE EACH MESSAGE ENDS WITH AN EQUALS SIGN ASCII 3D AND THIS IS USED TO DETERMINE THE END OF EACH PROMPT MESSAGE B9 LDA 00F7 Y GET THE CHARACTER 20 JSR E97A OUTPUT DISPLAY THE CHARACTER C8 INY READY FOR NEXT CHARACTER C9 3D IS IT 2 DO BNE 00D2 NO SO GET ANOTHER CHARACTER 60 RTS Pan INTERACTIVE 1 TTY OUTPUT UTILITY PROGRAMS Mark Reardon Rockwell International Many peripheral devices printers CRT Monitors can use inputs in the form of a 20 ma current loop or RS 232 The AIM 65 has a built in 20 ma current loop that can be utilized or the loop can be modified to being an RS 232 DOC No 230 RS 232C Interface for AIM 65 One large problem still remains For the AIM 65 Firmware to use the TTY port the Keyboard TTY switch must be in the TTY position Un fortunately the AIM 65 then uses the TTY port for all of the inputs that usually come from its Keyboard Most printers have no way of commu nicating back to the AIM 65 In order for the keyboard to retain control one of the following programs can be used Each uses the TTY subrou tine in the AIM 65 Monitor They also require the user to enter the correct values for the baud rate in locations A417 and A418 The first program ECHO utilizes the DILINK
13. OUTFLG TO OUTPUT OD OD QA CHECK POINTER FOR BUFFER SPACE FILL BUFFER WITH NULLS SET OUTFLG TO D SET BLOCK 0115 TO ZERO SET COUNTER A436 TO END 50 REM TAPE WRITE EXAMPLE INPUT ENTRIES N FOR I O TO N 1 PRINT ENTRY NEXT I INPUT TITLE H DI 1 INPUT 5 1 5 70 INPUT STORE ON TAPE Y N A 80 IF A N THEN STOP 90 INPUT T T T T 1 100 POKE 42037 T REM SET TAPOUT 110 POKE 43008 204 REM TURN TAPES OFF 120 INPUT READY 130 IF A N THEN STOP 140 INPUT A 150 GOSUB 9010 REM OPEN FILE 160 POKE 42003 84 REM TAPE AOD 170 PRINTAS N 180 PRINT H 190 FOR IO TO N 1 200 PRINT I 1 P D 210 NEXTI 220 POKE 42003 13 REM DISPLAY AOD 230 GOSUB 9110 REM WRITE EOF 240 POKE 43008 252 REM TURN TAPES ON 250 END 500 REM TAPE READ EXAMPLE 510 DIM R 40 R 40 520 INPUT READ TAPE Y N A 530 IF A N THEN STOP 540 INPUT T T T T 1 550 POKE 42036 T REM SET TAPIN 560 GOSUB 9210 REM OPEN FILE 570 POKE 42002 84 REM TAPE 580 INPUT A N 590 INPUT H 600 FORI O TO N I 610 INPUT Rd RS D 620 NEXT I 630 POKE 42002 13 640 PRINT 650 PRINT PRINT HS 660 FOR I O TO N I 670 PRINT 1 TAB 5 RS 1 680 NEXT I 690 PRINT 700 POKE 43008 252 710 END Some useful locations Hex Decimal Label Remarks 0115
14. TAFAR s 6436 2000 ADR zS A41U0 2000 51 4 2000 O117 2000 2000 TAISET EDEA 2000 GETTAF EE29 2000 FLXY PE RAC 2000 sSERSE 3000 NAMO 2000 DUTALL 9 2000 SADIR z EB78 2000 COMIN z E141 2000 FR M 2000 TO 2000 ADDRSGI F 910 2000 CRLOW E ALS 2000 ELANK E83E 2000 CHEKA ES4E 2000 NXT InD E 2001 2000 NUMA 46 2000 CLACK 2000 K 1OC SET UF Fi KEY OLOC 010C 61 00 JMP START 010F Xz 00 0000 00 BYT 00 0001 45 52 MSG BYT ERRORS 000B MSGI LOATIIN 07 0011 0012 44 MSG2 BYT TION CE 0019 CE 0016 0019 001C OO UF 0021 0023 0025 0027 0029 002R QO2E 0031 0032 0034 0036 0039 0034 0031 0040 0042 0044 0047 0049 004E 0050 0054 00995 0057 0056 OOSC QOSE 0060 0061 0064 0067 OOGA 0061 006 0071 0074 0077 007A 0071 0080 0082 0089 0088 0081 0090 20 9E 20 20 29 C9 23 FQ 06 C9 16 no F2 FO F3 A2 00 20 29 16 EB EO 52 FS 20 AC 60 20 9E AE 36 4F o9 20 16 A2 00 Ro 17 36 20 00 FQ 09 4C AE 00 02 00 60 20 A3 20 SE 20 10 20 A 38 in 1k 8n ik 20 13 20 CF 20 16 2 05 36 AD 16 BO 16 20 EB ER 01 A4 00
15. comma and the number of data lines N Commas are necessary if more than one data element are to be read per line Statement 240 turns the tape recorders on to allow the user to reposition the tapes if necessary The tape read example is similar Statements 560 630 input the data 640 690 prints the data and 700 turns the tape controls back on The user can place the recorder in the play mode after the prompt is dis played for statement 580 Of course the tape should be properly placed in a gap just before the start of the desired file Statements should be kept to a minimum while the AOD or AID is set to If data is going to be written or read several different times in the program return AOD or AID to keyboard display after each PRINT or INPUT loop or routine In other words only have the AOD or AID set to when absolutely necessary I have not tried all com binations possible but do know that data can be easily written or cor rected by the EDITOR and read as data by BASIC I would be interested in hearing about any discoveries vou make If you have questions I can be reached at 612 589 3411 during normal working hours This procedure offers quite a bit of flexibility and I have left it this way even though a neater package could be written using WHEREIN and WHEREOUT and putting almost everything in the subroutines One thing to remember with this routine is that th
16. in the SOURCE area and writes it into the DESTINATION area is sufficient Examples of MOVE routines are given on pages 6 26 and 6 27 of the R6500 Programming Manual However if a machine language program has to be shifted then a simple MOVE routine may not be satisfactory Those instructions in the pro gram which use the absolute addressing mode such as JMP 0345 or LDA 0567 have operands in the form of an address If the operand points to an address within the span of the program being re located then the in struction must be modified so that its operand points to the correspond ing address in the destination area On the other hand if the instruction refers to an address outside the span of the program then it must be moved without alteration In order to shift programs a more complex routine which calculates the necessary address changes is required In AIM 65 the memory area available for programs extends from ad dress 0200 up to the limit of installed RAM 1000 if 4K of memory is installed Any MOVE RELOCATE routine which occupies part of this area will naturally be restrictive since the area it took up could not be used A special effort has been made to enable the following routine to be located entirely in Page zero which is not normally used for program instructions so as to leave the entire working area from 0200 up free DESCRIPTION Fig 1 is a disassembly of the MOVE RELOCATE routine The pro gram itself occup
17. provide the user of the AIM 65 with a cassette data file capability that is relatively painless though not very elegant I use two short BASIC subroutines to open files one each for read and write and one to write an end of file These statements start at 9000 I usually reserve certain blocks of data statement numbers for certain sub routines which can be saved and loaded individually e g 4000 s are re served for my real time clock and timing subroutines 5000 s are my sorting subroutines 6000 s are for my formatted printing subroutines etc This allows me to build programs using these standard subroutines as modules In addition to the three subroutines some BASIC statements are needed in the main program to control the tape recorder s and to select the active output device AOD and active input device AID The remote control lines to the tape recorders should be functional The minimum procedure to write on tape is to call the subroutine at 9000 to open a file set the AOD to print via BASIC PRINT statements to tape re turning AOD to display and finally end filing the tape bv calling the subroutine at 9100 This causes the 80 byte tape buffer to fill and dump to tape in blocks while automatically turning the tape recorder on and off Reading tapes is performed by calling the subroutine at 9200 to open the file setting the AID tape INPUTting the data and returning the AID to the
18. 0 9 00CC OOCF 0018 00117 OOTIF QOE2 QOE 4 00 9 OOER QOEF OOF Q OOF 2 OOF 4 OOF S OOF B OOF QOOFA QOFC A2 20 20 no FO 20 i 20 CA 20 CE 20 chi FO 20 no 20 A2 A5 ae 2c 2 BS 48 20 68 10 60 5 F2 3K F9 41 39 18 in 00 78 04 98 3A LE 13 00 00 00 01 11 91 F 00 00 ER 00 00 4 4 00 4 00 00 4 00 4 00 EA BNE LIX JSR GETCH JSR CMF BNE JSR INX JSR TAX REQ JSR CLC STA JSR STA LOAnS JSR LEY ASR ELIMINA BER JSR OK INY JSR BNE JSR CMF ENE JSR CMF BEQ JSR BNE STOF JSR L X LA STX REQ LEX QUT LEIA FHA ASR INX FLA RTS AGAIN MS61 MS6 OUT COUNT GETCH CLRCK lt gt COUNT STOF COUNT 5141 ADDRt1 COUNT ATOR COUNT 0 SADR DISPLAY LOADING A CHAR START CLEAR CRSUM LENGTH OSDONE PAL OFFSET GET DATA ANI STORE ANI CMF TE MEMORY FAIL ERRORS Q OK AND JSR ERROR OK ERROR NXTARII LOADS COUNT CKSUM 1 COUNT CRSUM GETCH ERROR GETCH CRL OW 300 23C MSO MBO MSO X
19. 0 256 25 Remainder 200 A147 25 19 418 200 C8 Wh Page 14 DATA STATEMENT GENERATOR G Brinkmann W Germany Remember the last time you had to convert a machine language program to data statements so your Basic program could poke it into RAM some where I ll bet you really enjoyed having to convert each hex byte into decimal and then typing it in No Well then maybe you ll find this pro gram will come in handy next time around What it does is convert hex data to decimal and generate BASIC data statements with the decimal data The statements that it generates are sent out to the audio cassette interface which is used as temporary stor age The input is in the form of hex numbers which could come from the conversion program itself as is in the example or from memory with a minor change to the conversion program Note that this approach needs only one tape without remote control and only on board assembly language routines The following example converts the first 26 HEX values of R Reccia s program INTERAC TIVE 1 into BASIC DATA Statements and writes them to tape It works as following the HEX values of the assembler language program are put into the BASIC Program by DATA statements They must be ended by an END DATA or any other special mark see lines 90 260 line 190 you are asked for the line number of the first DATA state ment to be generated depending o
20. 00 S000 2000 2000 0090 2000 20600 3000 2000 2000 2000 2000 2000 0001 020E QO OF VE ac AQ AQ AQ VR WILL CRONYN SYMBIOTIC COMM Fel BOX e PRORREGO SPRI NGS PLA CZO SAVE v2004 ROUTINES EXCEPT REAJI FOR DUMMY MAIN NUNA PEF GRLE BEG RERGU 3M E PTR CONFIG PO eh OC ES E RAOG PADO AO CHE PAGE 0 HOO EEK s MAIN ONLY UNTERRUPY CONFIG s 0200 LOA d zMNSUC LUS OV EREE R MODE LUA 220 UAGE POESABLE ALL VEA PINTRES EXCEPT LEA wey STA ULER LUA ERCO STA UTER MAIN AFTER MSECSSEFFF USEC LDA STA STA UT RAL INTRFT REAT AFTER 16 4000 USEC Lam STA a NIS 78 20 Sg 20 20 AC 48 48 B Au Aa INIERACIIVE LEA d 440 STA UTILL41 ULT START MAIN BEGIN LOX 410 DONT HAVE POURING FRENT OF v TLE SET JSE GM ELJ JSR TEL AY UP TO 10 BNE JSR CRLF JMP BEGIN SPOR PELAY HAVE z ELOQFS A QUTSI DE OINDEXS DNIR INDEXY nELAaY LLY FE LHA 580 STA CATR LOOP
21. 24 This resistor is labelled on the board and can be found behind the printer Older AIM 65 s have a IK ohm resistor in that position which will not work Replacing that re sistor with the higher value will correct the problem but will void the AIM s warranty Refer to section 9 2 3 of the AIM 65 USER S GUIDE for direction on initializing and operating the serial interface ie NEWSLETTER EDITOR ROCKWELL INTERNATIONAL P O Box 3669 RC55 Anaheim CA 92803 U S A Bulk Rate 0 5 POSTAGE RATE Santa Ana Calif PERMIT NO 15
22. 277 BLK Block count for input must be zero 10 start 0116 278 TABUFF 80 byte tape buffer starts here 0168 360 BLKO Block count for output set to zero A409 41993 GAP Block gap tape recorder A411 42001 PRIFLG Printer ON 0 OFF 128 80 Page 6 MORE BASIC DATA FILES Steve West and Frank Nunneley Johannesburg South Africa EDITOR S NOTE Yes I know that you ve already seen a data file han dling program But this program is a bit different and it shows a neat way to add new commands to AIM 65 BASIC The ability to process and store data on cassette greatly enhances the use fulness of BASIC programs Any system of this type should be easy to use The method described here extends the instruction set of BASIC to include instructions to open and close files and to input and output data The new instructions are Continued from previous page A409 41993 A411 42001 Block gap for tape recorder Printer 0 OFF 128 80 Tape 1 or 2 controls for input default 1 if not changed A434 42036 42037 TAPOUT Tape or2 controls for output otherwise last Tape buffer pointer for input Tape buffer pointer for output 1 2 Data Reg B for monitor 6522 4 and PBS turn tape controls on and off TAPTR TAPTR2 42038 42039 43008 DRB Hex Decimal Remarks CC 204 Both tapes OFF DC Tape on 2 off 2 1 off FC Both tapes on U
23. IT IN CURRENT DESTINATION GO TO UPDATE AND END CHECK MAKE STRAIGHT COPY OF COMPLETE INSTRUCTION INCREMENT CURRENT SOURCE AND DESTINATION ADDRESSES BY LENGTH OF INSTRUCTION PLUS ONE CLEAR THE DISPLAY CRLOW SEE IF PAST END CARRY CLEAR IF SO NOT AT END SO GO BACK FOR NEXT INSTRUCTION BRANCH ALWAYS AT END THE FOLLOWING ROUTINE IS JUMPED TO IF USER REQUIRES A MOVE OPERATION RATHER THAN RELOCATE IT TRANSFERS A STRAIGHT COPY BYTE BY BYTE FROM SOURCE INTO DESTINATION A9 85 20 20 20 LDA STA JSR JSR JSR 01 EA 00C6 OOAF 00A3 SET LENGTH TO ONE TRANSFER THE DATA INCREMENT CURRENT SOURCE AND DESTINATION ADDRESSES BY ONE SEE IF PAST END CARRY CLEAR IF SO Page 12 0088 BO BCS 007E NOT AT END SO BACK FOR NEXT BYT OF DATA 008D 4C JMP FEE9 PATCIO CLEAR DISPLAY HOME TO MONITOR 0090 0090 0093 0095 0097 009A 009C 009E 009F 00A0 00A1 00A2 00A3 00A3 00A4 00A6 00A8 00AA 00AC 00AD REVELATION 6 14 THIS SUB ROUTINE GETS A 4 DIGIT ADDRESS AND STORES IT LO BYT FIRST IN TWO ADJACENT PAIRS OF THE STORE STARTING AT SOOEB WHEN CALLED FOR THE FIRST TIME X 0 20 JSR E3FD RBYTE GET TWO DIGITS ORDER 95 STA STORE THEIR HEX VALUE 95 STA SAME AGAIN 20 JSR E3FD RBYTE GET NEXT TWO DIGITS LO ORDER 95 STA STORE 95 STA ED X AGAIN E8 INX INCREMENT X READY FOR NEXT ADDRESS E8 INX INX E8 INX 60 RTS THIS SUB ROU
24. LI 50 0880 SRO 0001 ONE ALGESTRS CAI SRE TURN REM PRINT ERROR MSG Page 16 CASSETTE LOAD UTILITY For 65 Mark Reardon Rockwell International This multi purpose utility program allows you to load programs with offset and recover programs that have load errors For example suppose you wish to reload a program to reside at 0500 that was originally dumped from 0200 First start the program by pressing the Fl key The prompt should appear first Enter 0200 to specify where the program used to reside in memory and press the RETURN key Answer the TO prompt with 0500 to show where the program is going to be loaded Programs can only be offset by even page amounts For example if a program originally resided at 0236 it could only be offset to 0436 0636 0A36 etc not 0400 0777 or 0100 Get it This is because the offset calculation is done only on the page number upper byte and not the byte number lower byte The rest of the cassette load prompts are the same as the normal ones in the standard cassette load routine This program will also let you load a program even though there are loading errors This at least gives you a chance to recover a program that would otherwise be impossible to recover The normal cassette load routines will stop when an error occurs 2000 NAME 2 2000 CRSUM A41E 2000
25. Publishers 30 NW 23rd Place Portland ORE 97210 General intro to microcomputing 6502 6800 and 8080 Assembly language programming and some system design principles 17 00 for U S and Canada and 19 00 overseas AIM 65 LABORATORY MANUAL AND STUDY GUIDE by Leo J Scanlon Published by John Wiley amp Sons Provides 17 programming and experiments for the AIM 65 5 00 U S amp Canada or 57 00 Overseas ORDERING INSTRUCTIONS for books available from Rockwell Or ders must be accompanied by payment U S and Canadian orders must be by check or money order and overseas payment must be drawn on U S bank California residents add 696 state tax Send orders to the attention of SALES SUPPORT SERVICES Rockwell Intl POB 3669 55 Anaheim 92803 CORRECTION TO THE AIM 65 USER S GUIDE There seems to be a problem with the program on pages 8 37 and 8 38 of the AIM 65 User s Guide Rev 3 December 1979 Insert the se quence HERE JMP HERE between CONTINUE and the dotted line Continued on page 22 COMING SOON AIM 65 40 Rockwell International will shortly be introducing the AIM 65 40 The AIM 65 40 microcomputer is made up of an R6502 based single board computer with on board expansion to 65 kilobytes of memory a full graphic 280 N dot matrix or 40 column alphanumeric printer a 40 character alphanumeric display and a full ASCII keyboard with user as signable function keys An advanced generation of Rock
26. SR UPFNTR 4C EE OF JMP RID OFEL 20 AO OF JSR UPFNTR OFEA 9 20 4 OFES 99 2E 4 STA Y 9 C8 OFEA CO 05 CFY 5 OFEC DO BNE OF EE ROA OFEE AQ 01 LOY 1 OFFO Ri C LOA FNTRO Y OFF2 C9 32 CMF 2 OFF4 FO AA REQ UFFNTR OFF6 C 31 1 D0 04 BNE RI OFFA 20 AO OF JSR UFFNTR OFFI 88 RID DEY OFFE 60 RTS OF FF 00 8 DIVERT 20 OF RASEXT EA NOF o0CC As a final note the BASIC data files are EDITOR compatible so that data to be processed can be produced by using the EDITOR AN EXAMPLE PROGRAM ILLUSTRATING THE USE OF THE NEW COMMANDS Notes No tape number was specified when opening the files thus tape recorder 1 is used default At 600 is a subroutine to toggle the tapes to make rewind and fast forward possible SOME COMMENTS ON THE EXAMPLE BASIC PROGRAM Line Number Action 45 turn tape 1 ON 55 wait for key when operator is ready 58 turn both tapes OFF 10 30 40 45 50 59 88 60 20 90 100 119 120 130 140 200 210 220 230 240 250 260 270 280 290 300 310 320 590 600 610 INTERACTIVE teri tala re net en 60 the output file is opened and called NAMES 100 LAST indicates that the last name has been entered 140 end of output to TAPE routine 200 start of input from TAPE routine 220 looks for file with NAME NAMES 230 pri
27. TART HERE Note that the definition on line 0 will speed up operation by eliminating the required conversions to decimal every time lines or 2 called NEWSLETTER REVIEW From thc Editor The Sept Oct issue of the Target a newsletter dedicated entirely to the AIM 65 was perhaps thc best issuc of that newsletter that I ve seen In it were two articles that should tickle the fancy of most any serious AIM 65 user The first article showed how to hook up the new General Instru ment Programmable Sound Generator AY3 8910 to the Aim 65 and presented a software driver to make the thing generate telephone touch tones from phonc numbers which are stored in memory I have plaved with this chip quite a bit and am really impressed with all its capability The AY3 8910 interfaces very easily with the user R6522 The other neat article that was in the issue presented complete plans hardware and software for an EPROM programmer that can program virtually all of the most popular EPROMS 2708 both styles of the 2716 and 2532 The software is self prompting and the hardware design is complete down to the AC power supply The Sept Oct issue 1980 of Target is easily worth the 6 00 yearly sub scription rate it s published bimonthly Outside of the U S and Canada the price is 12 00 Contact Donald Clem RR 2 Spencerville OH 45887 BEHAVIORAL SCIENCES AIM 65 USERS GROUP Workers in the behavioral and biological sciences who are curr
28. TINE CHECKS TO SEE IF THE CURRENT SOURCE ADDRESS HAS EXCEEDED THE SOURCE FINISH ADDRESS IF SO THE MOVE OR RELOCATE IS COMPLETE 38 SEC AS LDA EF ES SBC ED AS LDA FO ES SBC EE 60 RTS IF NOT PAST END CARRY REMAINS SET THIS SUB ROUTINE INCREMENTS THE CURRENT SOURCE AND CURRENT DESTINATION STORES BY AN AMOUNT EQUAL TO THE LENGTH OF THE LAST INTERPRETED INSTRUCTION PLUS ONE SO AS TO POINT TO THE NEXT INSTRUCTION TO BE READ IF DATA IS BEING MOVED THE LENGTH IN 500 IS SET TO 01 AND THIS SUB IS ENTERED AT 00AF SO THAT SOURCE AND DESTINATION ADDRESSES ARE INCREMENTED BY ONE EACH TIME 00AD OOAF 0080 0082 0084 0086 0088 00BB QOBD OOBF 00 1 00C3 00C5 00C6 00C6 00C8 00CA 00CC 00CD 00CF 00DI 00D2 00D2 00D5 00D8 00D9 00DB 00DD INTERACTIVE 6 18 CLC AS LDA EA 65 ADC ED 85 STA ED ADD ONE TO LENGTH 90 E6 INC EE 18 CLC 5 LDA EA 65 ADC F5 85 STA F5 90 00C5 E6 INC F6 60 RTS THIS SUB ROUTINE IS CALLED WHEN NO MODIFICATION OF THE OPERAND IS REQUIRED IT COPIES A COMPLETE INSTRUCTION FROM THE ADDRESS POINTED TO BY CURRENT SOURCE INTO THE ADDRESS POINTED TO BY CURRENT DESTINATION A4 LDY EA LENGTH OF INSTRUCTION LDA ED Y GET BYT FROM SOURCE 91 STA F5 Y PUT IT IN DESTINATION 88 DEY CO CPY ANY MORE DO BNE 00C8 YES GO BACK FOR NEXT BYTE 60 RTS THIS SUB ROUTINE DISPLAYS THE
29. ate values do the calculations as shown below The second source of trouble has been that different manufacturers have de signed their peripheral requiring different inputs than are provided In these situations these two programs had to be modified to satisfy the pe ripheral s needs ECHO PROGRAM 0000 OUTTTY EEA8 0000 CR 0D 0000 LF 0A 0000 NULL FF 0000 DILINK A406 0000 ZDILINK A406 00 02 ECHO SET VECTOR TO THIS ROUTINE A408 200 0200 C9 0D ECHO CMP X CR CR 0202 DO 0A BNE NOTCR No JUST OUTPUT IT 0204 20 A8 EE JSR OUTTTY YES ADD LF AND NULL 0207 A9 0A LDA LF 0209 20 AB EE JSR OUTTTY 0200 9 LDA NULL 020 4C JMPOUTTTY OUTPUT AND RTS 0211 UOUT PROGRAM 0000 OUTTTY EEA8 0000 CR 0D 0000 LF 0A 0000 NULL FF 0000 UOUT 10A 0000 UOUT 010A 00 02 START TO PROGRAM 010 4200 0200 90 12 START SETUP 0202 68 PLA A ON STACK 0203 C9 0D CMP CR CR ALSO SEND 0205 DO 0A BNE ALF AND NULL 0207 20 A8 EE JSR OUTTTY ALSO SENDS 020A A9 0A LDA LF TO DISPLAY PRINTER 0200 20 A8 EE JSR OUTTTY 020 9 LDA NULL 0211 4C A8 11 NOTCR JMP OUTTTY 0214 60 RETRN RTS 0215 END 6 Examples Baud Rate 4800 1 109 4800 Baud 208 2 208 67 us b 141 3 141 256 0 Remainder 141 4 A417 0 6 EZ 00 6 5 A418 1410 804 Baud Rate 150 1 105 150 Baud 6667 6667 67 us b 6600 666
30. ced Another question Since the AIM 65 monitor has routines in it which convert shifted characters so that the output is entirely capitals no lower case how can the AIM 65 board be used to feed a printer the necessary codes for lower casc I thought perhaps Dr DeJong s program for the Interrupt Driven Keyboard on page 12 would answer this but his routine contains at location C7F alpha characters do not shift just as does the monitor Could one just leave out the routine between QC7F and 0 85 and get lower case characters output Keep plugging along and keep up the good work Happy to see that INTERACTIVE is getting larger al the time Thanks Sincerely John U Keating M D 8415 Washington Blvd Indianapolis IN 46240 Dear John I don t know of any program available convert the TTY port to Baudot Doesn t sound too difficult however See the program on page 13 of this issue for the procedure for using the TTY port without regard to the TTY KBD switch I would assume that lower case output could be achieved by modifving an input program such as DeJong s and writing a new output program Eric Dear Editor I must apologize I am rather negligent in sending in programming goodies to share and this contribution does not make up for it How ever I noticed in Issue 2 there was an 18 line step disassembler This should make it even easier excluding the F3 jump it is only 3 lines long If printout is desired
31. e Monitor The next free available address following the re located program 0348 in the above example will be found by examining memory locations 00 5 00 6 LSB first 4803 EXECUTION MOVE If the source addresses 0456 to 0567 contain data or text then a sim ilar procedure is followed In this case however the Source Finish address entered in response to the prompt should be one address less than that of the last byte of data for example 0566 instead of 0567 After entering the addresses the response to the move relocate prompt should be for move The Destination Finish address to be found at 00 5 00 6 will be the address of the last byte of data moved for example 0345 The next free address is 0346 Page 10 If the MOVE routine is used to shift the contents of the Editor s Text Buffer then the Source Start address should be that shown Low order byte first at 00E3 00E4 The Source Finish address should be one less than the text end address shown at 00E1 E2 On completion of the MOVE operation it will be necessary to reset the Text Buffer addresses as follows OOE 00 2 00 00FA 00 5 00 6 Text end address same as 00 5 00 6 Text start address same as Destination Start Text buffer end address this can be any address higher than that in 00 1 00 2 depending on the amount of free space required During execution of the MOVE option no me
32. e intelligent periph eral controllers for mini or standard floppy disks CRT monitors and the 488 instrumentation bus plus additional communications inter faces and a selection of RAM ROM and PROM memory expansion options up to 128K bytes of memory and memory mapped VO capacity The AIM 65 40 Model 0600 graphics printer module consists of an in telligent microprocessor controller integrated with the printer mecha nism This module operates in two modes Character mode operation Page 3 prints upper and lower case ASCII characters mathematical symbols and semi graphics character font formatted as 40 characters line at 240 lines minute Full graphics mode outputs any data pattern desired as a 280XN dot matrix With its own microprocessor controller user chang able character generator ROM thermal head drivers motor control and parallel handshake ASCII interface this freestanding peripheral mini mizes demand on the AIM 65 40 central processor permitting maximum system performance The Model 0400 display module features a bright crisp vacuum flou rescent 40 character alphanumeric display This stand alone module has its own microprocessor controller for display of alphanumeric special and limited graphics characters parallel handshake ASCII interface sup port circuitry and operates from a single 5 volt power supply Special control commands permit variable display timing cursor control auto scroll and character bli
33. e tape must be positioned so that block zero will be the first block read This can be changed if de sired however Also a search procedure could be used to locate block zero of a given file MINIMUM STATEMENTS TO WRITE ON CASSETTE TAPE USER PROGRAM GOSUB 9010 OPEN FILE WRITE POKE 42003 84 ACTIVE OUTPUT DEVICE SET TO TAPE USER PRINT STATEMENTS TAPE POKE 42003 13 ACTIVE OUTPUT DEVICE RETURNED TO DISPLAY GOSUB 9110 WRITE EOF ON TAPE END MINIMUM STATEMENTS TO READ FROM TAPE USER PROGRAM GOSUB 9210 OPEN FILE READ INTERACTIVE POK E 42002 84 POKE 42002 13 END TAPE SUBROUTINES 9000 9010 9020 9030 9040 9050 9100 9110 9115 9120 9130 9140 9150 9160 9170 9200 9210 9220 9230 REM OPEN FILE WRITE POKE 278 0 POKE 42039 1 POKE POKE 360 0 41993 22 RETURN REM WRITE EOF POKE 42003 84 PRINT 13 NL 80 PEEK 42039 FOR NC 1 TO NL PRINT CHR 0 NEXT NC POKE 42003 13 RETURN REM OPEN FILE READ POKE 277 0 POKE 42038 80 RETURN EXAMPLE PROGRAM 20 30 40 50 60 DIM P 40 ACTIVE INPUT DEVICE SET TO TAPE USER INPUT STATEMENTS TO READ FROM TAPE ACTIVE INPUT DEVICE RETURNED TO KEYBOARD USER PROGRAM 0116 TO 0 SET IST CHAR IN BUFF FOR BLK 0 SET OUTPUT TAPE POINTER 4437 TO 1 BLOCK COUNT 0168 TO ZERO SET TAPE GAP A409 TO 16 SET
34. eiver The 20ma current loop transmitter can easily be converted to RS232 levels off the board with the circuitry detailed below Not vet mentioned is the fact that RS232 devices communicate serially The format is generally selectable with at least one mode that is identical to the Teletype format used by the AIM with one start bit and two stop bits We can therefore use the software in the AIM s Monitor to com municate when the convertor is added J1 RS232 SERIAL Y 1 GND IN 2 TXD 20 S 12 lt 23 RXD 20 4 RTS 5 CTS 45 A 6 DSR GND L 7 LOGIC GND THE DC TO DC CONVERTER COULD BE REPLACED BY A 5V SUPPLY WITH THE SWITCH UP AIM LOOKS LIKE MODEM SWITCH DOWN AIM LOOKS LIKE TERMINAL 8 DCD 20 DTR If the device to be connected has a handshaking version of the RS232 it is necessary to generate handshaking signals that allow continuous communication The circuit shown below uses a scheme of simply wrapping around any handshaking signals to meet this end That is when it is set to be a modem a Request To Send RTS is wrapped around to the Clear To Send CTS line Note To further confuse the issue these signals are negative logic A zero meaning level between 3V and 15V is considered the true condition ie a Request To Send is a positive voltage when true The circuit shown will work well at speeds in excess of 9600 baud if the AIM 65 used has a 3 3K ohm resistor in R
35. ell is giving AIM65 through this newsletter as well as through peripherals and tech notes Earl O Knutson 5 Ralph Place Morristown N J 07960 xx EASY RS232C R M Dumse Rockwell Int l To meet the RS232C requirements it is necessary to convert the TTL levels of the 6500 Series I O devices on the AIM to RS232C levels TTL levels are defined as values below 0 8V for a logical zero and above 2 4V for a logical one with 0V and 5V being the outside limits The middle region is undefined meaning a TTL device operating with an input be tween 0 8V and 2 4V could interpret it to be either a zero or a one Its output is therefore indeterminate To have TTL circuits work correctly we must make sure that these levels are correct RS232 levels are differ ent logical one is defined to be any voltage between 3V and 15V a logical zero between 3V and 15 in the version The region between 3V and 3V is indeterminate Note that this is inverted to the way we normally think of logic a one being negative going and a zero being positive To communicate across an RS232 interface the AIM must be able to send and receive all RS232 signals at these levels Although not well doc umented the AIM is already equipped with a receiver that will translate RS232 signals to TTL levels This receiver accepts an input from pin Y on the Applications 21 Connector Part of the circuitry used is shared with the 20ma current loop rec
36. ently us ing or are interested in using the AIM 65 are invited to participate in a user s group now forming Areas of interest include hardware and soft ware for experimental control data acquisition statistical analyses and other applications If interested please write outlining areas of interest current and planned projects etc to Dr J W Moore Jr Box 539 MTSU Murfreesboro TN 37132 gt Sern rte li gg gene egre n Eve 2 INTERACT meek uit eed Darrel LETTERS TO THE EDITOR Dear Eric In a previous letter I complained about the lack of readability of many of the programs in issues 1 and 2 of INTERACTIVE This letter is to thank you and commend you for the fine job you have done in issue 3 in rendering the programs more readable The only one which is faint at all but still is quite readable is the simultancous equations from George Sellers Here is a question you might be able to answer in the journal Does any one have a machine language program which will make a software con version from ASCII to Baudot and output serial Baudot on the AIM 65 s 20 miliampere current loop A relay could then be used to transfer the Baudot to the 60 miliampere current loop of a Model 15 five level telc type A perhaps related question can the 20 miliampere TTY loop out put of the AIM 65 be used to output to a printer and still usc the AIM 65 keyboard If so where would the KBD TTY switch be pla
37. he AIM 65 User s Guide If you have found any errors or think we could explain something better let us know Send all comments to the attention of THE DOCUMEN TATION MANAGER Rockwell Intl POB 3669 RC55 Anaheim CA 92803 Two interesting articles appeared recently in EDN magazine The Jan uary 7 1981 issue carried two articles which featured AIM 65 One of them showed how a mechanical engineer could simulate a physical model on a BASIC language equipped AIM 65 The other article gave complete details hardware and software so an AIM 65 or other 6502 6522 sys tem could control the intensity or speed of ac operated devices such as lamps or motors through an interrupt driven zero crossing detector If you don t have access to this magazine we can send you reprints of the articles Just ask for EDN 1 if you want the ac power interface or EDN 2 for the digital simulation article Send requests to the attention of SALES SUPPORT SERVICES Rockwell Intl 3669 55 Anaheim CA 92803 All subscription correspondence and articles should be sent to EDITOR INTERACTIVE ROCKWELL INTERNATIONAL POB 3669 RC 55 ANAHEIM CA 92803 COPYRIGHT 1981 ROCKWELL INTERNATIONAL CORPORATION Rockwell does not assume any liability arising out of the application or use of any products circuit or software described herein neither does it convey any license under its patent rights nor the patent rights of others Rockwell further re
38. ies addresses 0000 0000 Addresses SOOEB 00FF are borrowed from the Text Editor Find command for temporary storage pointers and prompt messages Loading of the RELOC rou tine will not disturb any operations of the Text Editor except the Find command and only then if an attempt is made to find a character string longer than 12 characters The Text buffer addresses stored in 00DF 00E9 are preserved Page 9 EXECUTION RELOCATE The program starts at 0000 and can be run using the 0000 command or by setting up a linkage to 0000 via one of the Function keys The following example illustrates the entries necessary to re locate a pro gram presently residing at addresses 0456 to 0567 to a destination starting at address 0234 In this example the address of the last in struction is 0567 the last byte of the program might be at 0569 if the program terminated with a 3 byte instruction PROGRAM PROMPTS S START ADDRESS F FINISH ADDRESS D DESTINATION ADDRESS MR MOVE RELOCATE 0000 G S Enter 0456 NOTE NO ERRORS PERMITTED IF INCORRECT DIGIT THEN RE START PROGRAM 5 0456 Enter 0567 5 lt 0456 05670 Enter 0234 Display wraps around 0456F 0567D 0234MR Enter for re locate any other key except will do The routine will run displaying a disassembly of the source program as the re location takes place On completion control returns to th
39. line LIST 3 X15 45 number becomes a direct command and those with line numbers are in RUN 4 X15 60 direct commands that are placed in RAM in the usual fashion Z 5 X15 75 pas 1 AG OF LENGTH NEXT ENTRET Sn 4 STA IRQUAM EYCLEzSFFFF USEC YERM OF THIS LE BEF INTRET CYCLE NEXT Ag STA WERL HARE 14 MSEU LDA 00 LBA so AG STA UT TELAT an 06 AO STA UTILE CL 40 Ep JSR RE AT aD 92 AG SDONT ALLOW ENTERIT BURENG OUTRO Co OF X SET 9 Ee JSF OUTPUT sip EXT FRM TAX FOR LEAF e FROM MAIN a0 RSV LHA JdZMNSUC 1000 gt a4 STA Page 22 Continued from page 2 above the IRQ Interrupt Processing section of the program Also change the instruction BNE INTRET in the IRQ Interrupt Processing section to read BEQ INTRET The disassembly listing will also have to be changed Add a JMP 0388 instruction betwecn the CLI and LDA 40 instructions The BNE 0392 will then be changed to BEQ 0395 because that part of thc program is shifted upwards in memory UNHELPFUL USR HELPER For some unknown reason the following program lines were omitted from the BASIC USR HELPER article on page 18 of issue 3 The following lines are required 0 DB 13 114 11 F 15 FA 15 16 10 GO TO 3 1 POKEA DB POKES F RETURN SET UP FOR SETARD 2 POKE4 FA POKES F RETURN SET UP FOR CALLIT 3 REM PROGRAM MAY S
40. mp DISPLAY IT LENGTH ACCUMULATOR HAS LENGTH MINUS ONE IS IT A 3 BYTE INSTRUCTION NO SO GO MAKE STRAIGHT COPY YES IS A 3 BYTE SO MAY HAVE TO ALTER GET FIRST BYT OF OPERAND SECOND BYT OF OPERAND OPERAND INTO FI F2 SUBTRACT SOURCE START ADDRESS FROM OPERAND TO SEE IF OPERAND POINTS TO ADDRESS BELOW SOURCE START IF SO CARRY CLEAR AND NO CHANGE REQUIRED SUBTRACT OPERAND FROM SOURCE FINISH ADDRESS TO SEE IF OPERAND POINTS TO ADDRESS ABOVE SOURCE FINISH IF SO CARRY CLEAR AND NO CHANGE REQUIRED OPERAND REQUIRES CHANGING SO PREPARE TO ADD ADD OPERAND TO DESTINATION START ADDRESS TEMPORARILY STORE LO BYT SUM ON STACK 0051 0053 0055 0056 0057 0058 005A 005B 005C 005 0060 0062 0064 0066 0067 0069 006B 006 0071 0074 0077 007 007C 007E 007E Q080 0082 0085 0088 5 65 38 68 5 8A ES AO 91 88 68 91 88 BI 91 4C 20 20 20 90 LDA ADC TAX SEC PLA SBC PHA TXA SBC LDY STA DEY PLA STA DEY LDA STA JMP JSR JSR JSR JSR BCS BCC F4 EB EC 02 F5 Y F5 Y ED Y F5 Y 0071 00 6 00AD EA13 00A3 0018 008D Page 11 TEMPORARILY STORE HI BYT SUM IN X NOW SUBTRACT SOURCE START ADDRESS FROM SUM GET LO BYT SUM STORE IT ON STACK GET HI BYT SUM FROM X PUT ADJUSTED OPERAND INTO CURRENT DESTINATION PLUS 3 AND PLUS 2 NOW GET OP CODE FROM CURRENT SOURCE PUT
41. n your BASIC program Line 210 performs a call to WHEREO and opens the outfile If it is a tape with a gap of 80 POKE 41993 128 The main loop starts at line 230 the STRING S is filled with the statement number and the constant lIn line 260 we read the HEX input data until END The data is added to S after converting to decimal in a subroutine Each DATA line takes 10 items The PRINT statements line 350 write the STRING S to any open output adds 1 to the statement number and goes to the start of the main loop line 230 Note that until now the first statement line has a linenumber of d 1 where d was your input Y INTERACTIVE E lIf the END mark has been read last DATA statement will be printed followed by the statement line 4 with a counter of all DATA items The file will be closed in line 410 through a jump to B52B a BASIC routine which prints a CTRL Z closes the file and waits for the new input The HEX to DECIMAL conversion takes place in statement 450 560 and uses the STRING H in 170 Leading zeroes in the HEX numbers are not needed If an error occurs the faulty item will be printed to the printer and the file is closed Therefore you should make a trial run before going to tape by hitting RETURN after OUT and any error will go to the printer which has not to be on When everything
42. nking The Model 0200 keyboard module provides a terminal style alpha numeric and special character keyboard matrix with 64 keys including locking ALL CAPS control and eight user definable function keys Three keys labelled ATTN RESET and PAPER FEED have dedicated lines to the interface connector The AIM 65 40 Series 5000 incorporates a ROM resident software sys tem and integrates all four modules into a complete microcomputer sys tem The interactive monitor software controls the AIM 65 40 system with single keystroke self prompting commands supports software de velopment with assembler debug and control commands A multi file text editor supports both line and screen editing functions Optional lan guages include a fully symbolic R6500 assembler and BASIC FORTH PASCAL and PL 65 software packages arc in development The AIM 65 40 is expected to be available sometime during the third quarter of 1981 For price and delivery information contact your local Rockwell sales office xx Page 4 DATA FILES FOR AIM 65 BASIC Jerry K Radke U S Dept of Agriculture The storage and retrieval of data on a permanent or semipermanent medium is often necessary Unfortunately Rockwell AIM 65 BASIC does not provide data file capability for its cassette recorder interface Even worse Microsoft does not provide a listing of the BASIC it wrote for the AIM 65 so the user can easily modify it However the procedure presented here will
43. nts heading 1st string in file 260 inputs name from TAPE 270 has last been read 280 echos to printer 300 closes file 600 TP 0 both tapes OFF TP 1 1 ON 2 OFF TP 2 1 OFF 2 ON TP 3 both tapes ON PRINT EXAMPLE PROGRAM FRINT REM STORE NAMES ON CASSETTE TFz1 6G05URB600 FRINT TAPE TO RECORD GETAS 1IF THENSS 2 0 260508600 NAMES NAME LIST FOR 1211080 INFUTAS PRINT HAS 2 50 TO TAFE IF ASz LAST THEN120 NEXT REM CLOSE FILE REM READ NAMES FROM TAFE FRINT TAFE TO FLAY INPUT NAMES HS PRINT TARCS SH PRINT FOR Is1T030 IFA6 LAST THEN3OO INPUT 4 FRINT DONE REM TAPE ON OFF 4 3008 2O7ANDFEER 43008 ORI RE TURN x A MOVE RELOCATE ROUTINE Anthony Chandler Montreal Canada SUMMARY This routine will at the user s option either MOVE a block of data or RELOCATE a machine language program from one area of memory into any other area of RAM from 0200 up It can perform both forward and backward shifts and resides entirely in Page Zero INTRODUCTION Often the need arises to shift a block of data or a machine language pro gram from one set of locations in memory to another If a block of data such as a look up table has to be shifted then a simple MOVE routine which sequentially reads each byte of data
44. ote controls as vided on the AIM6S interject intolerable noise into the recordings This is because the power ground is in common with the signal ground and it can be remedied by electrically isolating the power circuit 1 use opto isolators and transistors but the relay method shown on the back page of Issue No 1 is probably better The TEXT EDITOR can also be useful in dealing with these files For example I ve prepared a data file of our natural gas usage for the past five years For this it was convenient to set up a text file in which each line was one month s gas use After appending an end of file flag this file was dumped on tape under the file name GAS by means of the editor s L command The advantage here is that the file can be proofed prior to recording with the help of the T B U D K I and commands How about sending BASIC output to a serial printer I ve found that when the KB TTY switch is in the TTY position output is routed to the serial port Unfortunately this also disables the keyboard One way out is to insert the line WAIT 43008 08 08 which stops program execution until the KB TTY switch is thrown to TTY To restore normal operation insert WAIT 43008 08 which again halts execution until the switch is returned to KB Don t forget to set the baud rate parameters I have found the AIM65 to be very educational as was the case with the KIM 1 before it I use both 1 appreciate the support Rockw
45. r entering BASIC after assem bling the file it will be necessary to modify the instructions on page zero using Mneumonic Entry After the file is working and the initialization procedure from tape is used this is not required C8 lt I gt 00C8 4C JMP OF2D 00CB EA NOP 00CC lt When the file is working dump it object to cassette the link to the ex tension must be included here lt D gt FROM F2D TO FFF OUT T F BASEX T 1 MORE Y FROM C8 TO CB MORE N INTERACTIVE rm 2000 TAFE DATA FILES OF63 20 EH EXIT JSR FLXY 2000 STEVE WEST AUG 780 OF66 68 FLA OF67 38 SEC 2000 E BOE OF 68 60 RTS 2000 PLXY s EBAC OF 69 INFUT 2000 CRLF s E9FO OF69 48 PHA 2000 LL lt 20 9E JSR 2000 OUTFLG A413 OF amp D AO 01 LDY 2000 INFLG A412 OF6F Bi C LIA 2000 OUTDIS s EFOS OF71 C9 23 CMP 4 4 2000 F18B OF73 10 04 PRY 2000 DILINN 406 OF75 A 54 LIA T 2000 DUMPTA ES6F OF77 12 4 STA INFLG 2000 TAF UT 4435 OF7A CB INY 2000 6434 OF7BKB Bi C LIA FNTR Y 2000 ABOO oF7n C9 27 t 2000 DULL E50A OF7F FO 07 BEQ LOADFL 2000 NAME A42E OFB1 C9 2 2000 L ADTA E32F OF83 FO 2F BEQ OFF TAF 2000 6 0 85 4C SF OF JMF 571 2000 K F OT OF B88 LOADFL OF 2I OF88 20 C7 OF JSR RIINAME OF 20 BASE XT OFBR 34 4 STY TAFIN OFeD C 97 CMF 897 OFBE 20
46. rupt 65 milliseconds execution of the main program begins The Page 19 timer latch A006 7 is loaded with 4000 Thus in the T1 free run mode UACR loaded with 40 when times out after 65 milliseconds which results in a jump to MNS VC the contents of the latch is trans ferred to the counter thereby setting up another interrupt 16 milliseconds later The interrupt vector is reconfigured to RDSVC and the T1 latch is loaded with SFFFF Thus after 16 milliseconds in MNS VC the inter rupt results in a jump to RDSVC which returns program execution to the program for another 65 milliseconds Parameters for the next cycle are established by reconfiguring the interrupt vector to MNSVC and loading the T1 latch with 4000 It may appear that 16 milliseconds is a long time to decide whether or not READ wil actually be presented with a keyboard entry However because of timing requirements in READ which are based on the need to debounce key stroke and key release a total of about 11 milliseconds this time cannot be significantly reduced In tests 1 performed errors were evident at an allowance of 2800 microseconds while none were seen at 2C00 I tested the program at keystroke rates up to about 540 minute my maximum single key stroking rate with no sign of errors Note that the stack pointer is saved in SAVSP when MNSVC is entered This procedure is required because normally i e when there is no key board ent
47. ry for READ exit from READ is achieved through use of the interrupt rather than through an RTS within READ itself Thus the stack is not properly restored and since there are 3 layers of subroutines within READ it would be unnecessarily difficult and risky to keep track of the depth of the stack when READ is exitted via interrupt The main program was a key element in testing and debugging interrupt driven keyboard Through the display of at the rate of about 3 second with a carriage return line feed after 10 it provides an immediate indication that both the main program and the keyboard program are functioning Of course a character entered through the key board would normally be placed in a buffer accessible to other parts of the program instead of simply being displayed via OUTPUT The source code even in its fully annotated form is short enough that it the As sembler symbol table and the object code can all be co resident in the AIM during development or modification 2000 THIS PROGRAM ENABLES 2600 Have S000 CHYERRUE Y TRTUEM 23000 PREY ROAR ENTRY SUITHOLY EXPLICIT SENTRY CALL PARTS KYO THIS STERRUPT CONFIGURA ST LON Se DUMMY MAIN SPROGRAM WHICH DES PLAYS X SECS 10 pO ENES SRUPY SERVICE STINES WRITTEN BY Page 20 2000 POG 2000 2000 2000 POG 2060 2000 2000 420
48. seful Monitor Subroutines Hi Lo Decimal Decimal Decimal Remarks 59069 230 189 Toggle Tape 1 control Toggle Tape 2 control Xx 59083 230 203 E E cnm vorum ACTIVE PRINT NAME Opens a cassette output file The name of the file is in single quotes and is followed by the recorder number Default is T 1 PRINT A BS Outputs data to the currently open output file Format is identical to standard PRINT Statement PRINT Closes current output file INPUT NAME 2 Opens an input file by finding the file NAME The file name is again fol lowed by the recorder number Default to tape recorder 1 INPUT AS BS Inputs data from currently open input file INPUT Closes Input file Only one tape buffer is available while BASIC is in use thus only one VO file can be open at a time To use BASEX BASIC must be limited to 3883 bytes in response to the question SIZE when entering BASIC Answer WIDTH as before then ESCape to monitor and Load BASEX from cassette Reenter BASIC using 6 and the extension program is ready to work This order is important as the divert routine on page zero must be modified after BASIC is initialized The assembly listing follows When entering this file in source it is rec ommended that the editor be placed above 800 the assembler symbol table can be placed between 200 and 800 This way the Editor won t be corrupted when the program is tested Afte
49. serves the right to make changes in any products herein without notice INTERACTIVE A version of the PASCAL programming language is now works for AIM 65 At this point all the information I can give you is that it will consist of a five ROM set and be a subset of Standard Pascal which was defined in a book called Pascal User Manual and Report by Jensen and Wirth No there s no data sheet as of yet so please don t call or write until we say that more information is available This is not a product an nouncement just some advance information that is intended to give a hint about where Rockwell is heading More on Pascal later Eric C Rehnke Newsletter Editor FOR YOUR INFORMATION From the Editor Here are some books that may help you along on the road to mastering microcomputers BASIC FOR HOME COMPUTERS by Albrecht Finke and Brown Published by John Wiley amp Sons 605 Third Ave New York NY 10016 PROGRAMMING AND INTERFACING THE 6502 by Marvin De Jong Published by Howard W Sams amp Co 4300 W 62nd St In dianapolis Ind 46268 THE FOLLOWING BOOKS ARE AVAILABLE FROM ROCKWELL INTERNATIONAL AT SPECIAL PRICES 6502 SOFTWARE DESIGN by Leo J Scanlon Published by Howard W Sams amp Co 6502 Assembly language tutorial and hardware inter facing examples 7 00 U S amp Canada 9 00 overseas MICROCOMPUTER SYSTEMS ENGINEERING by Camp Smay and Triska Published by Matrix
50. ssages are displayed and return to the Monitor is very rapid OVERLAPPING The routine permits backward overlapping for programs the DESTI NATION START address must be at least three addresses lower than the SOURCE START For a data MOVE there is no restriction Forward overlapping is not possible but a program or data block can be temporarily re located or moved to a high or low memory area and then shifted back to overlay its original source area SELF REPRODUCTION Incidentally the program will successfully re locate itself and so if the terminating instruction were replaced with instructions calculating a new destination it could become self perpetuating until its progeny filled available RAM STORING ON CASSETTE TAPE When dumping the routine for storage on to cassette tape the addresses to dump are FROM 0000 TO 0000 MORE Y FROM 00 7 TO 00FF This procedure avoids recording on tape the Editor s Text start and finish addresses from 800 1 to 00E6 This means that when is loaded from tape at some futurc time it will not affect any Text Editor which is set up erm A tetany RUE 4 INTERACTIVE co rece emer PROGRAM LISTING AND COMMENTS The following temporary stores and pointers are used SOURCE START S CURRENT SOURCE ADDRESS SOURCE FINISH F OPERAND ADDRESS from instruction being read DESTINATION START D CURRENT DESTINATION ADDRESS 00EB
51. t to close the tape file before leaving the BASIC program This is necessary to ensure recording the last dab of output To close insert the following line after the last PRINT which you want directed to tape POKEA 10 POKES5 229 X USR X This calls thc monitor subroutine which closes the file and re directs output to the display printer As a final touch optional but nice stop the tape recorder by inserting the line POKEA43008 207 AND PEEK 43008 assumed that you have the tape recorder remote control connected To read a tape file insert the following code before the INPUT statements POKEA 72 POKES5 232 X USR X Page 23 This calls WHEREI which issues input prompts searches for the desired file and loads the first block into the buffer Additional blocks are loaded as they are needed To restore normal operation insert the line 2002 13 A potential problem on input from tape and be sidestepped by ending the file with a distinctive end of file flag say 9999 when it is written Thus the end of file can be detected on input by testing each datum as it is read There is room for some ingenuity here Adroit use of 2002 84 and 42002 13 permit reading alter nately from the tape and from the keyboard The tape file need not be re initialized each time 2003 84 and POKE42003 13 serve similar function for output Incidentally I ve found that the tape recorder rem
52. ut the distracting s Program lines 10 to 40 are then placed in RAM Next the POKE command turned the printer The list command did its thing just as if you had typed in the command using the keyboard Page 21 The possibilities of this feature of the AIM 65 are limited only by your imagination Now can someone tell me how to write a BASIC program in the text editor including the essential CTRL 2 and a command to automati cally turn off the cassette recorder after a dump to tape The 2 at the end of Listing 1 is a control 2 LISTING NO 1 L OUT BASIC VIA EDITOR Clas mam Soe I AUTOMATICALLY LISTS AND RUNS PROGRAM ALSO TURNS PRINTER ON AUTOMATICALLY FOR LIST AND RUN LISTING NO 2 BASIC PGM VIA EDITOR AUTOMATICALLY LISTS AND RUNS PROGRAM ALSO TURNS PRINTER ON AUTOMATICALLY FOR LIST AND RUN LIST 10 FOR N 1 5 20 PRINTN X15 N 15 And finally command ran the program automatically and 10 FOR N 1 TO 5 30 NEXT N since the printer was still ON the result is shown on the printout The 207N X152 N 15 40 END program of course resides in RAM It could have been made to disap 30 NEXT N RUN pear had the original listing contained NEW at its end 40 END 1 X157 15 POKE 42001 128 2 X15 30 In a nutshell when using the AIM 65 text editor any entry without a
53. well s popular AIM 65 microcomputer the AIM 65 40 will be available as a complete system or as individual computer and intelligent peripheral modules The AIM 65 40 Series 1000 single board computer modules feature system address expansion up to 128K bytes with on board memory up to 48 kilobytes of RAM and up to 32 kilobytes of ROM or EPROM Six level priority interrupt logic and six 16 bit multi mode timers are included for flexibility in production automation and laboratory control applications Extensive FVO capability provides an RS 232C asyn chronous communications interface channel with programmable data rates of up to 19 200 baud for terminals or modems plus a 20 ma current loop TTY interface dual audio cassette interfaces and two user defin able 8 bit parallel ports with handshake control two 16 bit timer counters and an 8 serial shift register Three additional 8 bit parallel ports are directly programmable as dic tated by user s application to provide more TTL level I O or inter face to keyboards displays and printer modules Manufacturer supplied ROM resident software included with the AIM 65 40 Series 1000 com puter provide I O drivers for the intelligent peripherals and more The printer connector is compatible with the Centronics parallel interface that is so popular with high speed dot matrix printers A buffered system bus accommodates off board expansion via Rock well s RM 65 microcomputer modules which includ
54. worked ok until now you have a file with DAT A state ments on tape To read it into your actual program just use a statement as 100 N FOR I 0 TO N READ xxxx 1 X NEXT Remember the first DATA statement contains a counter of the following DATA items So you don t have to bother about it the first READ will get it for you This is extremely useful during the test phase where changes occur quite frequently The next step is to load the statements into your BASIC program with the LOAD command Be sure that you have chosen the right line number the LOAD command will over write duplicate line numbers However while testing it might save you deleting the old lines If you are working with the ASSEMBLER and the BASIC at the same time you could change the READ in line 260 to PEEK 5 This saves you the initia typing in of DATA statements and the conversion will be done by BASIC However you should either use a counter or a unique mark as 0 0 0 to find an end to the data Of course the data need not to be in memory at all You can generate DATA statements by reading from keyboard or by using your BASIC program to compute them from other data I use this program regularly while computing moving averages and other statistics and then replacing the old values by the new ones for the next run mover ree t gegen nen INTER ACTIVE Page 15 A 70 Ble Le Py Ae yea e 20e

Download Pdf Manuals

image

Related Search

Related Contents

BF-571取扱説明書  Nwe- Qibla.indd - AWB attawba watches of berne  Otterbox Defender Case  Ruhe-Elektrokardiograph mit 12 Ableitungen CP 50  Serie W600    減 圧 弁 ︵ 液 体 ・ 気 体 用 ︶ RD  DELL Vostro 2521  13 - Fiat  平成24年度 施設名:新堂元気老人ステーション 所管課:伊賀支所住民  

Copyright © All rights reserved.
Failed to retrieve file