October 3, 1983 Mr. John A. Toebes, VIII 145 C Jones Franklin Raleigh, N.C. 27606 Dear John: I return the enclosed disk without removing anything. I have had five requests so far for your opsysdis and tke careful changes to reflect the '.' you are now using. Re- member we get hordes of angry letters if we blow it.... I'd like it back, revised, as soon as you have time, since I propose to really dig into this one. At this point, we face two extremely iasm etc., which does a nice job, and scrolls a screenful at a time (Use only to scroll it, not STOP). All it wants is a '1' or a '0' for the drive wanted. Thanks for the new WP version. I'd give a pretty to know what ROM it uses for reference.  he same number for the editor disassembly-assy, which have gone out. A few important items: 1. I reassembled and relinked NEWTERM (version 2.4) with the change to keep the ESCAPE key from erasing to end line under any circumstances. It seems to wor mportant matters: I. NO FURTHER CHANGES! Nothing will louse up a package faster than a number of undefined versions floating about, unidentified and different. When I say 'No Further Changes' I mean, of course, unless we find a bloody bug which MUST Also include, on disk, a 'setabs' package, which I use all the time (in conjuction with reset). Easy to change the tab settings if you want different configurations from menu. I particularly like the 'structured programming' settings. Thanks for all thk as intended. 2. Version 2.4 is configured standard SuperPET-ASCII with one exception: incoming linefeeds are zeroed. In the instructions, the transmit tables and the translate (incoming) tables have been revised to reflect this. I have converted t be corrected. Otherwise, hold the line! The NEWTERM I distribute will be version 2.4, and so identified on disk. Let us stick with it as a base point and reference. Better a recognized program with a deficiency or two than a dozen undefined versions rune help and the changes to NEWTERM to debug it and to handle duplex and ESCAPE. Take some time to eat and sleep. Incidentally, you write beautiful assembler code. I've learned more from you than ever will come out of the Waterloo documentation. he example, in the instructions, to show how to convert ESCAPE key code from ASCII 6 to ASCII 27 on transmit, and have left the example you used (CONTROL Z to CONTROL L) in the translate tables. 3. On disk, find all files for NEWTERM2.4 (as well as ning around loose with incorrect instructions! II. TEST! I have to hit the long-distance lines to test (it's expensive). You can dial up a mainframe. Please test 2.4. Have Rob test 2.4. Test the s..t out of it before October 17. I don't want to dist` Best regards, Dick . Easy to change the tab settings if you want different configurations from menu. I particularly like the 'structured programming' settings. Thanks for all thfor NEWTERM2.3, which is the version you sent). I have amended the .asm file for 2.4 to reflect the changes in the comments, as well as in the .cmd file. 4. I have amended the instructions also; find them on disk. PLEASE double check me and let me kribute a dodo. So far, with one **!* exception, everything the Gazette has published or distributed has RUN without trouble. If we send out anything that doesn't, mail, not s..t, hits the fan. Ever get over 100 letters in two days? And, remember, the mainow if all is okay. Note: the locations of the transmit and translate tables have changed: transmit begins at $7134, and translate (incoming) begins at $7114. 5. Your article on macros is on disk as 'macros10' (for issue 10). PLEASE review it and mal will come to you as well as to me.... Enough on NEWTERM. I think we have a well-done package. As to the rest of the stuff on disk: See my note on dir. It crashes, as discussed on the phone. I have included a complete package from Commodore: directory. is disk.) If you hit the control key and then press RETURN, HOME, TAB, or any other non-character key, then the control key is ignored. REDEFINING THE KEYBOARD NEWTERM allows you to redefine any of the non-character keys on the transmits ASCII 6. The default codes transmitted from non-character keys are shown below. They are standard Waterloo-SuperPET ASCII codes. I show below how to reconfigure the ESCAPE key to send ASCII 27 instead of ASCII 6. Remember you can recon- figur (EOT) INSERT | 5 05 | 05 ^E (ENQ) ESC | 6 06 | 1b ^[ (ESC) ASCII 27 decimal ==> | 7 07 | 07 ^G (BEL) <== | 8 08 | 08 ^H (BS) TAB | 9 09 | 09 ^I (HT) {down} | 10 0a | 0a ^J (LF) here] ;713c 08 09 0a 0b 0c 0d 6b 00 *......k. (Note that the first byte is $00, for ASCII NULL, the second byte is $01 for HOME, the third byte $02 for RUN, etc., in the order shown in TABLE 1, printed immediately above. Simply change the valucters that were changed. You can do this for as many of the characters as you like, but be sure of what you want the key to send before you change it. There is no restriction on what code you can program any key to send. After you are through changing from any other system. For example, if the system you are communicating with sends you a ^Z to clear the screen (like my big system does), then you would want to translate that ^Z to the SuperPET CLR, which is ASCII 12 decimal, ^L, or $0c (all the same . for ~~ comments. ~~ NOTE: Again the characters are defined in their ASCII order, the first byte of 00 being ASCII NULL, the second byte 01, for ASCII 1; the third byte, 02, for ASCII 2, etc. Currently all characters are translatedto put $0a back in. And, remember, if you don't want a character to go to the display, then you translate it to a zero. Now, suppose a mainframe sends ^Z (ASCII 26, or hex 1a) to clear screen. It won't clear SuperPET's screen. We translate the ^Z to a ^end a ',prg'. Example: If you want to save it as MYTERM, then you would enter (I'd suggest lower case to avoid confusion with 6502 filenames): Enter filename: {== it prompts you for the file name myterm,prg {== you enter COMMENTS Hopefully this package should be a little more useful when you must communi- cate with a system other than another SuperPET. With the translate tables, it is meant to give you some of the primitive terminal control codes, but by keyboard. These keys and their corresponding values are shown below. Note these assign- ments will be those you TRANSMIT. In all cases but one, they will also be the characters/functions you see on your screen. That exception is ESCAPE. Since many userse any non-chararacter key. Col. 1 Col. 2 Col. 3 This key SPET- One reconfigur- TABLE 1. Transmit Codes sends the ASCII ation to send code in 2. Values: ESCAPE as ASCII 27 --------+--------+---------------- or linefeed {up} | 11 0b | 0b ^K (VT) CLR | 12 0c | 0c ^L (FF) or formfeed RETURN | 13 0d | 0d ^M (CR) To change any of these defaults, quit NEWTERM with PF., type mon either in the microEDITOR, loaded aloes to those you want, test, and then save the new configuration using the instructions below.) To change the default, simply move the cursor to the code that you wish to replace and type over it with the new hex code that you want the key to send; i.e., code, at the prompt in monitor, give: >g 7000 and you'll be back in NEWTERM. Instructions on how to save the reconfigured version are found below. CHANGING THE TERMINAL CHARACTER TRANSLATION TABLE NEWTERM allows you to translate any controthing). To change the TERMINAL translate table, enter the monitor and display the table at $7114 with the command: >D 7114.1f TABLE 2. Terminal Translate ;7114 00 01 02 03 04 05 06 07 *........  back to themselves except for the line- feed $0a (ASCII 10), which is translated to a null, since most non-Commodore computers (including most mainframes) transmit both a carriage return and a linefeed together. This would double-space everything on SupL (ASCII 12, $0c), which does clear our screen, as shown below: ;712c 18 19 0c 1b 1c 1d 1e 1f *........ ~~ As shown by the '~~', any time that a ^Z comes in from the serial port it will be translated to a CLR (ASCII 12, $0c this and hit RETURN and it will create the new copy of NEWTERM for you. If you leave off the ',prg' then you will get an error message, at which point you press PF4 again and enter the file name correctly. When you wish to run your new copy of NEWTER no means is it a terminal emulator. If you experience problems with the program, feel free to contact me: John Toebes 145C Jones Franklin Rd Raleigh N.C. 27606 (919) 851-4095 or 851-5423  will redefine this key to send true ESCAPE code (ASCII 27), you do not want the key to wipe out a line of code when you press ESCAPE. For this reason, ESCAPE in NEWTERM, when pressed, will not erase to end line, even though, in the default condition, it--- |Dec Hex| Hex ASCII Code in CONTROL characters. CONTROL is HOME | 1 01 | 01 ^A (SOH) abbreviated with: ^ RUN | 2 02 | 02 ^B (STX) STOP | 3 03 | 03 ^C (ETX) DEL | 4 04 | 04 ^Dne, or on the main menu, and enter the monitor. There, display the transmit table in NEWTERM, at $7134, with the command: >D 7134.0d ;7134 00 01 02 03 04 05 06 07 *........ ~~ [comment line, inserted if you want the ESC key to send true ESCAPE (ASCII 27 decimal, or $1B) overtype the 06 entry on the first line (at the ~~), with $1b, as below: ;7114 00 01 02 03 04 05 1b 07 *........ ~~ The '~~' show the charal character that is read in from the serial port from whomever and whatever system you are communicating with. This allows you to have simple cursor control and a few of the SuperPET fea- tures you are accustomed to, despite the strange codes you may getTable ;711c 08 09 00 0b 0c 0d 0e 0f *........ ~~ Note $0a (CURSOR DOWN, or LINE- ;7124 10 11 12 13 14 15 16 17 *........ FEED), is set null. See below ;712c 18 19 1a 1b 1c 1d 1e 1f *.......erPET disks and on screen, since a carriage return on SuperPET automatically generates a line- feed. If you are working with a computer (such as another SuperPET) which does not generate a linefeed AND a carriage return, you can reconfigure these tables ), which will clear the SuperPET screen. SAVING A CONFIGURED COPY OF NEWTERM When you are satisfied with your translate tables, you can save a copy of NEWTERM by pressing PF4. It will prompt you for a filename to which you must app M, just enter the load command from the monitor with your file name instead of NEWTERM and proceed as you would normally do with NEWTERM. Example: >l myterm (That's a lower case letter 'l', not a number '1') >g 7000  Root : newterm2.4.b09 = 7000 - 714c . 014d openfile.b09 = 714d - 71bf . 0073 sendfile.b09 = 71c0 - 720c . 004d getfile.b09 = 720d - 7272 . 0066 scrolls.b09 = 7273 - 72ab . 0039 display.b09 = 72ac - 72d1 . 0026 saveterm.b09 = 72d2 -  p>qEqGO_qKqB'b݂]'\,qB&|qB ZXpn C . 4q4 }qC' a-z.}qB'45qB}qD'' qGqGqG'' ,q]' qGqGqGrl?qDqD~p~r ~p~q~p~qCqC~p~ 00&~p~ܢ4H5ݢ~p~Qp4 4s<2b5 s>&s%s%s%s<944s<2bs<2b9}sk/1qq4q2bqoq4q2b&qO_9Unable to open file%nEnter filename: %nrqMr '=݂'0'$r r r &r qGqEXPORT SAVETERM = $72d2 EXPORT DISPLAY = $72ac EXPORT SCROLLS = $7273 EXPORT GETFILE = $720d EXPORT SENDFILE = $71c0 EXPORT OPENFILE = $714d EXPORT NEWTERM = $7000 EXPORT NEXT = $7145 EXPORT LAST = $7147 EXPORT YSTO = $714b  ͠ by John A. Toebes, VIII This program is a modification of FASTERM to allow a little more flexibility for the user. In addition to tWordPro). The programmed function (PF) keys on the keypad must be shifted to perform their NEWTERM functions. NEWTERM will allow you to directly invoke the SETUP program to reconfigure the serial port. It also allows you to save a copy of your transla you may enter the command as >l newterm. One warning: FASTERM loads at $1000; NEWTERM loads at $7000. Be sure to say, after NEWTERM is loaded: g 7000. NUMERIC KEYPAD The numeric keypad is used to issue all the NEWTERM commaf0142f6eff1c4102762bddd825d275c2c177f0142c1 ff26057c01422009c40f5a588e00fe6e952043c10d2e0934048e0134e68520187d0143270ac1612d 06c17a2e02c4df7d01422702c41f3404f7eff035047f01427d01442711c106270de79f0147fc0147 bde1c7fd0147f6eff1c408271ef6eff02719c1202c058e01nitially, the program is configured for half duplex (echo all characters) and non-alpha-lock (upper and lower case characters). When you hit PF0 the first time, alpha lock will be turned on and all lower case characters that you type will be translated eive. Files on disk/1 may be sent or received with the usual SuperPET filename of: disk/1.filetitle. The break function (PF6) has been added to allow you to transmit a BREAK to whatever you are communicating with. It transmits the BREAK for approximate)733d . 006c Length of Module = 033e 0d0e0f101112131415161718191a1b1c1d1e1f000102030405060708090a0b 0c0d6b0001006469736b2f3100 a2e02c4df7d01422702c41f3404f7eff035047f01427d01442711c106270de79f0147fc0147 bde1c7fd0147f6eff1c408271ef6eff02719c1202c058e01r~p~p~p~p~pppppppp  kdisk/1qq4q2bqoq4q2b&qO_9Unable to open file%nEnter filename: %nrqMr '=݂'0'$r r r &r qGqure the serial port. Information on using the SETUP program is found in the SYSTEM OVERVIEW manual. The save-function key (PF4) will let you save a configured copy of NEWTERM so you don't have to change the translate tables every time you reload the pr. If you should, by chance, overwrite NEWTERM code with material in one of the languages or in the microEDITOR, simply load it again while in monitor with a >L NEWTERM, and then give the 'go'. CONTROL CHARACTERS NEWTERM alloransmitting and receiving files as FASTERM does, this program allows FULL/HALF duplex communications, an alpha lock for upper case only communications, translation of the non-character keys and input translation of all control codes. It also loads highete tables so you don't have to re-enter the changes every time you load NEWTERM. Last, be sure your modem is ON before you load NEWTERM. Do not attempt to use NEWTERM until you have set the baud rate (or other serial port characteristics) to match your nds. Currently the assignments to the numeric keypad PF keys in NEWTERM are: PF0 - Turn Alpha lock on/off PF. - Exit NEWTERM to the monitor (same as FASTERM) PF1-PF3 - PF4 - Save14e6855d270de79f0147fc0147bde1c7 fd0147bd000016ff6c3ff60144c801f701447e007ebd00007e007ebd00007e007ef60143c801f701 437e007ef6eff21f98ca0cf7eff28e3000301f26fcb7eff27e007e9ea0dca23416cc0001bd000035 16dda29fa07e007ebd00007e007e007e007e007e00f800e300cc00aa00bto uppercase automatically; hitting PF0 again turns off the uppercase lock. The same situation applies to the local echo (PF7) where each time you press the function key, the echo will be turned off if it was on and on if it was off. Note that when you ly 300 milliseconds. Why the BREAK? It stops transmission of a file from the other end if you have, for example, inadvertently asked for one you don't want.... The setup function key (PF5) allows you to use the system SETUP program in SuperPET to config) you would press the OFF/RVS and then the 'A' key. Remember that the control key is like a shift key, but in NEWTERM you must release it BEFORE you select and press the character key. (If CONTROL codes confuse you, see the file 'control_codes:e' on thGqGr r 9uwqMrq'X'݂''B&qGqGqG' ' '4rq5qGqGqGr rq9qK&P1>&0&P 1>&"P"qK9"%rs qEqG'qEqEqE9sqMs<'Gps%s>ps%s% ogram. Finally, the exit-function key (PF.) takes you out of NEWTERM. You can return to NEWTERM by entering the command: >G 7000 in the monitor (assuming you have already loaded NEWTERM with: >l newterm. The load module is on disk in lower case)ws you to transmit control characters directly from the keyboard. To transmit a control character you first press and RELEASE the OFF/RVS key; then you press the key corresponding to the control character you want. Example: To transmit a control A ($01r to avoid conflicts with editing or running most of the languages. Additionally, the commands to NEWTERM have all been moved to the numeric keypad to allow use of the carat key (UP ARROW, or ^) and to implement a pseudo-control key at RVS/OFF (as does modem and your communications partner--or mad things will happen. In the instructions below, I use capital letters to emphasize commands. They may, of course, be given in lower case. As an example: where I show >L NEWTERM to load NEWTERM in the monitor, a configured copy of NEWTERM PF5 - Invoke the setup program PF6 - Transmit a break PF7 - Turn on/off local echo (Full/Half duplex) PF8 - Receive a file PF9 - Send a file I500bb00c100a900010203 040506070809000b0c0d0e0f101112131415161718191a1b1c1d1e1f000102030405060708090a0b 0c0d6b0001006469736b2f3100 a2e02c4df7d01422702c41f3404f7eff035047f01427d01442711c106270de79f0147fc0147 bde1c7fd0147f6eff1c408271ef6eff02719c1202c058e01 hit either of these keys the terminal will make no visible response. The send-file (PF9) and receive-file (PF8) function keys work exactly as in FASTERM. When you press either of them, they will prompt you for the filename of the file to send or to rec s tst control if ne ;control key modifys this character andb #$1f ;so make it a control character endif pshs b  endif endif checkin guess LDB $eff1 ;get the prot status ANDB #$08 ;is there a character quif eq LDB $eff0 ;get the character quif eq cm stb duplex jmp checkin ;receive a file doget jsr getfile jmp checkin ;send a file dosend jsr sendfile jmp checkin ;turn on/off the alpha lock swapalfa ldb alfalock eorb #$01 stb alfalo what functions each of the function keys will do jmptable fdb checkin ;shift 1 fdb checkin ;shift 2 fdb checkin ;shift 3 fdb dosave ;shift 4 fdb dosetup ;shift 5 fdb dobreak ;shift 6 1f ;this is the keyboard translate table for all the special keys. intrnstb fcb $00,$01,$02,$03,$04,$05,$06,$07,$08,$09,$0a,$0b,$0c,$0d control rmb 1 alfalock fcb 0 duplex fcb 1 next rmb 2 last rmb 2 temp rmb 2 ysto rmball.macro> xref setup_ xref sendfile,getfile,display,saveterm xdef next,last,ysto,newterm ;******************************************************************************* newterm LDS #$0fff LDD #$0400  cmpb #$ff ;is it the control key? if eq inc control ;set the control key flag else ;it is a function key andb #$0f rive1 fcc "disk/1" 118 011C 00 fcb 0 119 120 011D 43 61 6E 6E direrrmsg fcc "Cannot open directory" 121 0132 0D 00 fcb 13,0 122 ranslate table ldb b,x else guess ;translate lower case to uppercase if necessary tst alfalock quif eq ;not alpha lock on Errors 0 $014c ; Length Import SAVETERM 249(both) Import SETUP_ 237(both) Import SENDFILE 188(both) Import GETFILE 182(both) Import DISPLAY 164(both) Export YSTO=$014b Export LAST=$0147 Export NEXT=$0145 Export NEWTERM=$0000 Reloc 0,274(both),0,272(both) ;patch v2.3 endif STB $eff0 puls b ;patch v2.3 clr control guess tst duplex pb #' ' ;do we translate it? if lt ldx #trnstbl ;point to the translate table ldb b,x ;get the translated character endif tstb quif eq ck jmp checkin ;transmit a break for approximately 300 ms. dobreak ldb $eff2 tfr b,a orb #$0c stb $eff2 ldx #$3000 loop leax -1,x until eq sta $eff2  fdb swapecho ;shift 7 fdb doget ;shift 8 fdb dosend ;shift 9 fdb swapalfa ;shift 0 fdb quitloop ;shift . ;this is the translate table for all input characters comming in from ;the serial port and goin 2 the terminal screen ;note line feed after carriage return is done by making the entry a zero. trnstbl fcb $00,$01,$02,$03,$04,$05,$06,$07,$08,$09,$00,$0b,$0c,$0d,$0e,$0f fcb $10,$11,$12,$13,$14,$15,$16,$17,$18,$19,$1a,$1b,$1c,$1d,$1e,$translation ; added full/half duplex selection ; v2.1 - added setup invocation directly ; v2.2 - added ability to save configured terminal ; v2.3 - fixed setup bug ; added non translation for half duplex s STD next STD last clra clrb STD ysto clr control ; loop looptop LDB $eff1 ANDB #$10 ;is the transmit register full? if ne call $dd82 ;get a 123 0134 49 6E 63 6F drivemsg fcc "Incorrect drive number. Use 0 or 1" 124 0156 00 fcb 0 0157 bytes of object code (ASM6809 V1.1 00:05:27) 117 0116 64 69 73 6B d decb ;normalize for a lookup lslb ;adjust for a word lookup ldx #jmptable jmp [b,x] ;and call the appropriate routine endif  cmpb #'a' quif lt ;char not lower case cmpb #'z' quif gt andb #$df ;convert to uppercase endgues quif eq CMPB #$6 quif eq STB [last] call $e1c7,last STD last endguess endif  STB [last] call $e1c7,last STD last endguess call display lbra looptop quitloop SWI end ;turn on/off the local echo swapecho ldb duplex eorb #$01  jmp checkin dosetup ldx $a0 ldd $a2 pshs d,x call setup_,#1 puls d,x std $a2 stx $a0 jmp checkin dosave call saveterm jmp checkin ;this table determines g to the terminal screen ;note line feed after carriage return is done by making the entry a zero. trnstbl fcb $00,$01,$02,$03,$04,$05,$06,$07,$08,$09,$00,$0b,$0c,$0d,$0e,$0f fcb $10,$11,$12,$13,$14,$15,$16,$17,$18,$19,$1a,$1b,$1c,$1d,$1e,$,0,270(both),0,268(both),0,266(both),0,264(both), 0,262(both),0,260(both),0,258(both),0,256(both),0,254(both),0,252(both), 0,246(both),0,225(both),0,202(both),0,199(both),0,194(both),0,191(both), 0,185(both),0,179(both),0,176(both),0,171(both),0,161(botho keys act correctly ; on the terminal but can still be translated on output. ; v2.4 - mod to not EOL on screen when ESC key is transmitted. ;******************************************************************************* ;INCLUDE 50 004E 34 06 pshs d 51 0050 CC 20 00 ldd #buffer 52 0053 BD 00 00 jsr getrec_ 53 0056 35 06 puls  address 61 0066 BD 00 00 jsr dirreadf_ ;get a directory entry 62 0069 35 06 puls d ;clean up stack 63 006B CC 20 00 ldd #buffer ;get address of di end of file 70 71 0080 FC 31 00 ldd dirblock ;get address of file control block 72 0083 BD 00 00 jsr dirclose_ ;close file 73 7 display tfr d,x ;put P1 in X 82 loop 83 0098 E6 80 ldb ,x+ ;get character 84 009A 27 09 quif eq 85 009C 34 10 disk error message 93 00AC BD 00 96 jsr display ;put message on screen 94 00AF 7E 00 86 jmp leave ;get and exit 95 96 00B2 BD 00 00  103 104 00C1 0C whatdrive fcb 12 105 00C2 44 69 72 65 fcc "Directory program" 106 00D3 0D fcb 13 107 00D4 46 72 6F 6D fcc "From  15 FF80 out equ $ff80 ;Micro-menu jump address 16 2000 buffer equ $2000 ;buffer for directory entry 17 3000 drive equ $3000 ;driv display ;display it 25 000C CC 00 09 ldd #9 ;maximum length of drive number entry 26 000F 34 06 pshs d ;save on stack as P2 27 0011 CC 30 00  ;check next 34 0023 CC 01 0F ldd #drive0 ;get drive 0 address 35 0026 7E 00 32 jmp opendir ;go and open the file 36 0029 81 31 not0 cmpa #'1  loop 44 003C FC 31 04 ldd line ;get current line 45 003F C3 00 01 addd #1 ;add 1 to it 46 0042 FD 31 04 std line d 54 0058 CC 00 00 ldd #0 ;clear line count 55 005B FD 31 04 std line 56 endif 57 58 005E CCrectory entry 64 006E BD 00 96 jsr display ;put it on screen 65 0071 BD 00 00 jsr putnl_ ;crlf on screen 66 0074 FC 31 00 ldd dirblock ;get file control4 0086 CC 00 01 leave ldd #1 ;arbitrary length 75 0089 34 06 pshs d ;P2 76 008B CC 20 00 ldd #buffer ;address of buffer 77 008E BD 00 00  pshs x ;save address 86 009E BD 00 00 jsr putchar_ ;display character 87 00A1 35 10 puls x ;restore address 88 00A3 20 F3  driverr jsr putnl_ ;crlf to screen 97 00B5 CC 01 34 ldd #drivemsg ;get address of drive number error message 98 00B8 BD 00 96 jsr display ;put message on screen 99 00BB Commodore Business Machines" 108 00F4 0D fcb 13 109 00F5 42 79 20 45 fcc "By Eric Brandon" 110 0104 0D 0D askagain fcb 13,13 111 0106 44 72 69 76 fcc "Drive ? "e number entry buffer 18 3100 dirblock equ $3100 ;directory file control block address 19 3104 line equ $3104 ;current screen line 20 21 0000 CC ldd #drive ;address of buffer for "Drive ? x" 28 0014 BD 00 00 jsr getrec_ ;get record 29 0017 35 06 puls d ;clean up stack 30 0019 BD 00 00  ;check if drive 1 wanted 37 002B 10 26 00 83 lbne driverr ;incorrect drive number 38 002F CC 01 16 ldd #drive1 ;get drive 1 address 39 0032 BD 00 00 opendir jsr diropenf_ ;save it 47 0045 10 83 00 18 cmpd #24 ;check if on line 24 yet 48 0049 26 13 if eq ;if 24 lines 49 004B CC 00 01 ldd #1 ;wait for 20 00 ldd #buffer ;get P2, address where entry will go 59 0061 34 06 pshs d ;save it on stack 60 0063 FC 31 00 ldd dirblock ;get file control block  block address 67 0077 BD 00 00 jsr errorf_ ;check if end of file 68 007A 10 83 00 02 cmpd #2 ;check if end of file 69 007E 26 BC until eq ;until jsr getrec_ ;get 78 0091 35 06 puls d ;clean stack 79 0093 7E FF 80 jmp out ;quit 80 81 0096 1F 01  endloop 89 00A5 39 rts 90 91 00A6 BD 00 00 direrr jsr putnl_ ;crlf to screen 92 00A9 CC 01 1D ldd #direrrmsg ;get address of  CC 01 04 ldd #askagain ;get address of string to reprint 100 00BE 7E 00 09 jmp again ;do it again 101 102 ;all data needed by program 112 010E 00 fcb 0 113 114 010F 64 69 73 6B drive0 fcc "disk/0" 115 0115 00 fcb 0 116 117 0116 64 69 73 6B d 00 00 ldd #0 ;clear line counter 22 0003 FD 31 04 std line 23 0006 CC 00 C1 ldd #whatdrive ;get address of message 24 0009 BD 00 96 again jsr;newterm - routine to emulate a terminal with ability to send & recieve files ; ; modified by John A. Toebes - 8 Sept 1983 ; 145 C Jones Franklin Rd ; Raleign N.C. 27606 ; Phone - (919) 85 ;Program to get directories from the Waterloo micromenu ;By Eric Brandon ;Version 1.10 09/06/82 xref putchar_ xref getchar_ xref getrec_ xref tbreak_ xref putnl_ xref diropenf_  ay ;display it ldd #9 ;maximum length of drive number entry pshs d ;save on stack as P2 ldd #drive ;address of buffer for "Drive ? x" jsr getrec_ ;get record  ndir jsr diropenf_ ;open directory file lbeq direrr ;could not open file std dirblock ;save file control block address loop ldd line ;get current line addd #1will go pshs d ;save it on stack ldd dirblock ;get file control block address jsr dirreadf_ ;get a directory entry puls d ;clean up stack ldd #buffer ;g1-4095 ; v2.0 - added control keys ; added break key ; moved the command keys to the function keypad ; added the alpha lock ; added keyboard translation ; added terminal output  pshs d ;P2 ldd #buffer ;address of buffer jsr getrec_ ;get puls d ;clean stack jmp out ;quit display tfr d,x ;put P1 in X reak key? cmpb #3 until eq ;done, so print the ending banner to pause the screen call printf_,#pausemsg ;wait for a carriage return loop call fgetchar_,(,s) r specs for directory:" pausemsg fcc "Press " fcb 'R'+$80,'E'+$80,'T'+$80,'U'+$80,'R'+$80,'N'+$80 fcs " to continue" openfail fcs "Unable to open directory file '%s'%n" keyboard fcs "KEYBOARD" read fcs "R" inbuff rmb _ ;crlf to screen ldd #drivemsg ;get address of drive number error message jsr display ;put message on screen ldd #askagain ;get address of string to reprint jmp again ;do ? " fcb 0 drive0 fcc "disk/0" fcb 0 drive1 fcc "disk/1" fcb 0 direrrmsg fcc "Cannot open directory" fcb 13,0 drivemsg fcc "Incorrect drive number. Use 0 or 1" fcb 0 gain ;do xref dirreadf_ xref dirclose_ xref errorf_ out equ $ff80 ;Micro-menu jump address buffer equ $2000 ;buffer for directory entry drive equ $3000 ;drive number entry buffer dirblock equ puls d ;clean up stack jsr putnl_ ;new line ldd drive+8 ;get character back cmpa #'0 ;check if drive 0 wanted bne not0 ;check next ldd #d ;add 1 to it std line ;save it cmpd #24 ;check if on line 24 yet if eq ;if 24 lines ldd #1 ;wait for pshs d et address of directory entry jsr display ;put it on screen jsr putnl_ ;crlf on screen ldd dirblock ;get file control block address jsr errorf_ ;check if end of file C"directory" org $1000 include "disk/1.watlib.exp" "directory.b09"  loop ldb ,x+ ;get character quif eq pshs x ;save address jsr putchar_ ;display character puls x ;restore address endloop  cmpb #$0d until eq ;close the keyboard and the directory file call closef_,(,s++) call dirclosef_,(,s++) endif lds savesys ;restore the system stack ; the next line us= 80 bufflen equ *-inbuff-1 savesys rmb 2 rts ;issue a break in case we were invoked from the monitor clr $32 ;clear the system result code rts ;and return to the operating system banner fcs "Ente it again ;all data needed by program whatdrive fcb 12 fcc "Directory program" fcb 13 fcc "From Commodore Business Machines" fcb 13 fcc "By Eric Brandon" askagain fcb 13,13 fcc "Drive 1 ;Program to get directories from the Waterloo micromenu 2 ;By Eric Brandon 3 ;Version 1.10 09/06/82 4 5  $3100 ;directory file control block address line equ $3104 ;current screen line ldd #0 ;clear line counter std line ldd #whatdrive ;get address of message again jsr displrive0 ;get drive 0 address jmp opendir ;go and open the file not0 cmpa #'1 ;check if drive 1 wanted lbne driverr ;incorrect drive number ldd #drive1 ;get drive 1 address ope ldd #buffer jsr getrec_ puls d ldd #0 ;clear line count std line endif ldd #buffer ;get P2, address where entry  cmpd #2 ;check if end of file until eq ;until end of file ldd dirblock ;get address of file control block jsr dirclose_ ;close file leave ldd #1 ;arbitrary length  xref putchar_ 6 xref getchar_ 7 xref getrec_ 8 xref tbreak_ 9 xref putnl_  rts direrr jsr putnl_ ;crlf to screen ldd #direrrmsg ;get address of disk error message jsr display ;put message on screen jmp leave ;get and exit driverr jsr putnled to work for me, now it works intermittently. ; swi ;issue a break in case we were invoked from the monitor clr $32 ;clear the system result code rts ;and return to the operating system banner fcs "Ente10 xref diropenf_ 11 xref dirreadf_ 12 xref dirclose_ 13 xref errorf_ 14  xref printf_,getrec_,diropenf_,openf_,dirreadf_,putrec_ xref dirclosef_,closef_,fgetchar_,eof_,putnl_ ;INCLUDE ;INCLUDE addnull macr clra tfr d,y clr \0,y endm ;**** 2b92voiַ&i5'O&'''{ 'w 's 'o 'kO' ' 'icOecOg'''#''' 'g&4g gP&P4gW2b~ cOa &c_cַ&cO׻ݪi'5aca5& 472b 942|̀"̀4f4P`5bb$S  4d4P`4̀4dj4P`54̀4f4P`5K E42|̀4f4P`5bb4d5P.4b 5 2f9Oֺ4P`ۻÀ4Oֺ4P`ۻÀ45O $$넉$ݾ̗~$44 4$42d942z@efB0 -L 0je': o2h9A2rfjfghgde@Xad=eedheh炯ba"@䤤4& ha&bTT&2n94OaĀ2b94'5   ZccOee o2f94d' dd 2b942{((넉ib"b$e4gk4iK2d(i(0i02g942|((넉bdhbd4f4dK2d(h(0h02f92}ob̘R9'Ob넉b ObbOb2c9 ڐ22|̓:45<̓4A3:45?2b'g&oh LA:45bd'A1:4A:45n2bA1:45<̓4A3:45?2b'g& A:45zA1:4A:45n2b̓4A3:452bbA1:4dF2bb&~BhA:45A:4bj2b'Yb&4b2b佰&3b'%A :4cF2b?&A2:4eF2bca2[942A:45bd'A:45A:45佰oc֭&$bO֬:&Occ%c'A:45 TA:45Odc # c4A:4iK2dOc4A:4554O_5A :45A:45~4̘.2bObb ڽ2i9TORW%s %s%n%d 2  Z 佰  L  ̽ M v   $ . ν  A45zhA-:4A:45n2bA-:4A:45ndloop ;at this point, the x register points to the first character in ;their input string that didn't match, so it must be what they typed. ;so use it to open the directory file tfr y,d pshs y ;savoop ;read the next record call dirreadf_,(4,s),#inbuff ;print the record to the terminal call printf_,#inbuff call putnl_ ;check to see if we are done with th*************************************************************************** sts savesys ;save our entry stack pointer ;print the opening banner and get their file specs call printf_,#banner call getrec_,#inbuf ' O0 coa2j9$&&&ֺ'.44&2dOֺ׺~ֺ& Z$9O׺ C$(&%ֺ'-44&2dOֺ׺ nֺ% Z$9O׺Z$ݸ94n42b4̖2d9n4 !4 d.4ʀ5"À4"À45Oʀ VOֺ4P`ۻÀ4Oֺ4P`ۻÀ45O5"À4"À45O59KEYBOARDRW%s%n%s$42b942~R'&b(fb&& bbf(&ff$9׷99~-% "!X  29 - "l::2b9$(& Z$ݽ]~$&' $('~9Eaݓә(ؐL aLa2|Ob' $ bocOcc$b&  c#cOcOb'Y$2b$(&8$'?4̓ 3&>?'4̓H2b ܴݴ 佑FbD$J2d942{O_aݪee&, ' '40Ob5aax-ed coPc2g9&.(02~̓L'F.$&&8$$('(V4̓4d2d体d&E44f2dA1:4d'2b? & 佰b&b'2Z94?'4f4\2d2b942~b?',b' 4b 4̓սH2b4߽̓Q2bO?2d9r!Memory full.w%s%n Lines transferred =TOWi/o error.2A:45zA :4A:451' 4̘%2bA :45A :4̘)292A45zhA:4A:45n2bA:45~=2A45zA:4A:45n2bA45zA-:4A:45n2bA-:45<̘4A/:45?2b' c& A45zhA-:4A:45n2bA-:4A:45 if eq ;they are pressing the space bar, so wait for them to press ;it again loop ;get the next character call fgetchar_,(,s) ;abe the directory file name start call diropenf_ puls y ;check the return code if eq pshs y call printf_,#openfail ;no good, tell them so leas 2,s else ;e directory call eof_,(2,s) quif ne ;here is where you could check for errors ;see if they are pressing the space bar call fgetchar_,(,s) cmpb #' ' f,#bufflen addnull inbuff ;skip over the banner in their input ldy #inbuff ldx #banner loop lda ,y quif eq cmpa ,x+ quif ne leay 1,y eb5# 42b9$ݼܾ&(ݾ942z4hX2bfкܼb-.$d佗Z$jd$f2h94d4b2b"À4"À45Oʀ5 24"À4"À45O54P`d"2b92$&&̖ $(&̖  OPP4̖2bOP2affb%fb4d42dݾ2d942|O_b&d'bb(&b2f94' L2b942~$b-b'k('ebb b'P&'Jbb 42~&b'(b(& 2|$b($b$ C '~9$(' OccE4be4b554b4dgK2d~EcO4$2bOc$Oc4$4K2d$cOc2d92zO$44$K2dc'dOecce $Obcc4eg4gK2dcce'Ob ܴݴ$0&ܲ$* g42~O_ݴ?^b4ܢ2bܢ4bF2b r4佰?&o4̓Q2bܴ44ܢ4 \2h9 ܢ4 \2b92|A45bh'ܢ4A:45n2b& t2d92O_b?A:45bA:4A:45n2bd'A1:4A:45n2bA1n2bA:45zA2:4A:45n2bA2:45<̘4A4:45?2b'h& A:45zhA2:4A:45n2b̘!4A :452baA :4cF2ba'̘#4A4:452bcA2:4eF2bc'daa&Qa'a&#c O4e2ba'c& 2bA:4O_F2X92A45zhA:4A:45n2bA:45A:4O_F2/92wodobA:45be'A:45֭&]cP#ocd#"ObXI4Oe5ObbOcd ,Obc $#OXI4OeXIb455Oc A:45b #kobb " andon if it is a break cmpb #3 quif eq ;is it the space for us to continue? cmpb #' ' until eq endif ;did they hit the b good open, save the FCB on the stack pshs d ;open up the keyboard and save its FCB on the stack call openf_,#keyboard,#read pshs d ;now just read the records one after another l 003406ec62a3e435103510c300013406ec623406ec64eb678900bdb04b32647e098dcc04 00bdb045c30001e7634fc300013406dc24bd0b1932624fe663c300019e24e7844fe6633406dc24c3 00013406cc0400bdb04b3264dc24eb638900ede44fe663e7f4326439327a4f9e24e684c3fffeede4 3406cc04003406dc24cb3264dc28a368dd28dc30a368dd30326639327d 6f62cc0852ede4aee4e684c13927104fe662eb848900e762ece4c3000120e64fe662c3ff03e7624f e662326339 65eb678900 c3fffe3406ec67bdb04b3264ec63c3fffeed63e66527af4fe662e7f803ec63c30001ed634fe665c3 ffffe76520e56ff8033266393406ec 4Oa 0f Eh4h 7h4h ,'~K9Oc4̐ *M& "7::2b942~c&( &$$0$0$$(0$'&$2d9E̐Ƚ̐̑&ƃ &29Bad request %d%nWaterloo microEditor Version 1.2%n%nCopyright 1 ܲ$2a942{&>i& &$.0'.$ $ $O~ս~1~-$34 2b9 429ܠcܢeH2cݠeݢ~9 29?u~E O_~Kh&$~-9y::O2g92|oܪboa5焽 o/&2b942|O_b$&'z$('tܨ4b2b&4b5'9 e'Ibb h& 3bb hh b''$ b2f942|ܦ'8&-xӦ4Oֶ4dW2dOֶ4b4hK2d۶  ܦEbx4dжh string requiredNo search string definedNo file name%s%s - %s %d%dNot found%d occurrences changed%s - %sMemory fullReplacing string too long֬ ' & 9ݪO׬0!' O֬$' ׭94 &T 4O_oo֬'oܪ&ܨE& a4cO_5֬&2d942|oah4j5O'@&d & & &'hh &4ֶbh4f2b'a Pb׶hh45&hh & +& dd d4f5& Oֶ׶~Oa2f92}ܨ4b2bb&0bdb060dbbb8900c3ffffc3800034064fd6bac3ffff3406cc0050bdb060dbbb8900c3ffffc38000 340635104fe684c47f3510e784fc0122c380003406fc0122c38000340635104fe684c47f3510e784 394b4559424f41524400520057003c454449543e002573256e003c4d4f52453e003c484f4c443e00 2573003c626562ece4c3ffffede4e0f48200ede420c53406327edc26ed e4ec622728c3ffffed62ece4ebf48900ede4932826eb2015327cdc24ed62dc28dd24ccffff8d8bed e4ec62dd24ece420438d092706cc00107e000039dc249328270adc249e24eb848900dd24ccffffdd becc07ff7eb000dc243406cc04003406cc0004200ccc03d732398e090c c3ffff2d0bc10c22078e096c3a3aae84ad84bd00dd3262397f0400dc249328260bccffffbd075add 24bd00ddbd015dbd07d97e019bdc249326270cdc2493282706bd06b57e019d39094508e2036108eb 08dd031b08f008d3092808d8004c0908090c090c090c090c090c090c090c0361031b004c03613230001bdb04b3264cc0400ed63ece42764c3ffffede44fe6f803e765ec63c3 0001ed63e665c12024e4ece4c3ffffede44fe6f803e762ec63c30001ed63ece43406ec65eb678900 c3fffe3406ec67bdb04b3264ec63c3fffeed63e66527af4fe662e7f803ec63c30001ed634fe665c3 ffffe76520e56ff8033266393406ec ̖r4̖i2b5̖t4̖i2b7~! ׺׻׷nnF42b̖v~42b~5742b~׷O_ݴ944̖}2bܴݴ- F42b̖O_ݴ2b9F42b̖~!2~$4ܸ4b55982 by Waterloo Computing Systems Limited%n%nPress %n!ߝ  ~"ݨݨoݦoݤoݢoݠݾ̒2'~iNPUTgETpUT#cHANGEdELETErunbyesetUPmonITORtALKdiRECTORYnAMEscrATCHrenAMEmouNTcopYdatE֬& <#& 余 /֭& Oaa a'O4d4̑W2d&O2d92~?̑'$4bH2bQ4bE5 ֽE2b9OW][Uqx~ciou{>ŝ֬' J.0'.$-$&'$(&92~,''$ 4h۶2db4f4ܦK2ddb Y42|h,dh4fH2b Bh& ֬& 1O 4ݪ 4넉ݪ' &0 g42~O(/(4h4fK2df4O_52d92~֭' ܲ$-O_4 `۬余֭' !֬'!94h4h4h4Og2f2b942~̘O4b5&⽛6Ob2c92}̐P9'4b5&'  ob bOb2c92~$(&$-,c'̝4?2b& & ν 佞2b9.$0&-$('$&'~04.2b~9.$-$0'$('' 9.  67696e6e696e67206f662066696c653e003c656e64206f662066696c653e00dc2434 068d033262393406327ebd08522708dc26ed62dc28ed66ec6293262609ec62ebf8028900ed62ec66 9328260eec66c3ffffed66e0f8068200ed66ec66a362251eec66a362ebf8068900ede43406ec6434 06cc0007bdb0f03264ccfff4003406dc243406cc0005bdb0f032643934 06327a1f40bdb0fcc603e765ae661f428630e6a0c10a2d054cc00a20f7a780cb30e7806a65270686 3aa78020e36f843268391f41327286f0a7666a66a7676867a6f8068a11a764a765c64058e761e7f8 06ec643de765aa65a764c8d768f806e8f806a665a7f80668f806a6f87c cc0400ede44faee4e684e7621027008ec1202406c620e762e784ece4c30001ede46f634fe663c300 01e763c11f240fe6f4e1622609ece4c30001ede420e5e663c10223c1ece4e0638200ede44fe663e7 f4ece4c30001ede44fe662e7f4ece4c30001ede44fe663c3fffee763cc0400bdb0453406ec62eb65 89008304642714c620e7f4ece4c30001ede4ec64c3ffffed6420e83262 393406327bdc289e28eb848900ede4e369ed6293a02206ec62a3e42403bdb003ece4a3653406ec67 e36b3406ec69bdb04b3264dc28e369dd28dc30e369dd303267393406327cdc289e28eb848900ed62 ec64e368ede4ec62a3643406ec663406ec64bdb04, 佰c- A/ c44d&2d4b ",#c4b4&2d佰c42b$ݸ2b94Oֺ4&2d׻Oֺn94Oֺ4&2d׷ 44Oֺ&2d$ݸ9Oֺ~n2~ַ& 4 Oֻ4ֺ2b佖ntimEtabSEThELP2}ob, cbַ&1b'&$&'$(''$ 佞  '佞 2c9O_ݴ֬?&6!֬'$ݲ.0֬*& /& O_ U2$ݲ&$P'$('5'{$.0)佛6$ݲ&'$׷2b92yO_cob֭& ֬*&b֬/'P½.$0&-4Od2b& g bܲ3e$('&$0' c4b4Of2b5c'$ c4b4Ofg2b5ce$c'c42b2g92~ܦ֬/'*%& ֬&&ƀ׬֬'4bO(4 -&&472b .' $&$֬+& -& c'$$94֭& 4` /֬/&'P$d' 佞'$'$d&ܲ$ 佞'$2b9Say what?Missing operand!Illegal line rangeIllegal search stringSearch string not foundSearccc'4b5&&㽞j4j4j4f2f2d9ܤ4H2bO֬װ֭ױܪݮ94ܤH2bOְ׬ֱ׭ܮݪ92|O֬ܨa֬'{֬'w%&]֬^& O$& G.& ?*& ;INCLUDE ;INCLUDE opt list bnk29000 LEAS -4,S # STD 3,S CLRA LDB 5,S PULS X STB ,X LDB #$de ENDIF E# CALL bnk09abf,#8 ELSE LDD 1,S PSHS D ADDD #1 STD 3,S CLRA CLRB PULS X STB ,X ENDIF addr9c03 LDB $ac CMPB ,S # ELSE CMPB #$db BNE addr9c3f LDB [4,S] ENDIF LBNE addr9cbd ENDLOOP addr9c3f CMPB #$dd IF EQ LOOP # LDD 8,S ADDD #-1 STD 8,S PSHS D PULS X LDB ,X CMPB #$dd UNTIL EQ LDD 8,S ADDD #1 STD 8,S# STB $b6 JMP addr9c15 ENDIF ENDIF addr9cbd CLRA LDB 1,S LEAS 6,S RTS bnk09cc3 LEAS -3,S CALL bnk09b1c CALL bnk1980d LDD #$0400 STD ,S #23 LDD ,S PSHS D ADDD #1 STD 2,S PULS X LDB ,X CMPB #$bd UNTIL EQ LDD [,S] SUBD #bnk19852 B# CALL ___neg STD ,S ENDIF SUBD #3 QUIF EQ CALL streq_,#$0400,#addr9dcb QUIF NE CALL bnk197d9 CALL bnk1919b LDD ,S SUB#e,$2e,$30 JMP bnk1904c addr9dae RTS bnk09daf LDD $2e LOOP STD $24 CALL bnk190dd LDD $24 SUBD $30 QUIF EQ LDD $24 SUBD $28 QUIF EQ #c,bnk099ba,bnk09a4d,bnk09ab6,bnk09abf,bnk09abd xref bnk1975a,bnk197a1,bnk19719,bnk197e4,bnk1980d,bnk1904c,bnk19076 xref bnk19081,bnk190c1,bnk19814,bnk09a24,bnk09a2e,bnk09995 xref bnk09a81,bnk193ce xref tbreak_ " CALL addr911e,#addr93a3 STD ,S IF NE CALL bnk19719,$24 STD 2,S LDD $24 SUBD $28 IF EQ CALL bnk1975a,#-1 STD $24 END#NDIF ENDIF FCB $21 ;BRN instruction ENDIF addr9bc9 CLRA STB 3,S LDD 1,S PSHS D ADDD #1 STD 3,S # IF EQ CALL bnk09995 ENDIF LEAS 4,S RTS bnk09c0f PSHS D LEAS -4,S CLR 1,S LOOP addr9c15 LOOP LDD 8,S PSHS D ADDD #1 # LDB [8,S] CMPB #$de BEQ addr9c15 LDD 8,S ADDD #1 STD 8,S ENDLOOP ENDIF CMPB #$de QUIF NE # ENDLOOP LDB [4,S] IF EQ ELSE LDB ,S CMPB #$dc IF EQ LDD 4,S ADDD #1 STD 4,S BRA addr9cb2 EN# LOOP CALL bnk09c0f,(2,S),$a8 STB 2,S QUIF NE LDD ,S PSHS D ADDD #1 STD 2,S PULS X LDB ,X UNTIL EQ CALL #EQ addr9d27 LDD ,S ADDD #2 ENDLOOP addr9d23 CLR 2,S BRA addr9d2b addr9d27 LDB #$ff STB 2,S addr9d2b CLRA LDB 2,S LEAS 3,S RTS bnk09d31 LEAS -2,S #D #$0d BNE addr9d7b ENDLOOP CALL bnk1917c BRA addr9d80 addr9d7b LDD ,S CALL bnk198c7 addr9d80 LEAS 2,S RTS bnk09d83 LDD $2e STD $24 SUBD $30 IF EQ b CALL bnk19743,#1 ENDLOOP RTS addr9dcb FCS "." end LDD $24 SUBD $26 BEQ addr9dae CALL bnk196b5 JMP bnk1919d ENDIF CALL bnk196b# xref copystr_,suffixst_,zupstr_,streq_,length_,copy_ xref fgetchar_,fputchar_,fprintf_,fputrec_,fputnl_ xref printf_,putnl_ xref eor_,eof_,openf_,closef_,errorf_,errormsg_ xref diropenf_,dirreadf_,dirclosef_B064 which must follow this routine addr9604 equ * END IF EQ LDD ,S PSHS D ADDD #1 STD 2,S CLRA LDB $ac PULS X STB ,X CALL $ ;waterloo editor ;part 5 ; opt nolist ;INCLUDE ;INCLUDE ;INCLUDE ;INCLUDE opt list xref bnk09050 xref bnk19852,bnk198c7,bnk191c3 xref bnk190dd,bnk1$ bnk09cc3,bnk09cf7,bnk09d31,bnk09d83,bnk09daf addr9886 fcs "Say what?" addr9890 fcs "Missing operand" addr98a0 fcs "!" addr98a2 fcs "Illegal line range" addr98b5 fcs "Illegal search string" addr98cb fcs "Search string not found" addr98e3 fcs$ ENDLOOP RTS bnk09990 LDD #$0400 STD $aa bnk09995 CLRA LDX $aa LDB ,X STB $ac LEAX 1,X STX $aa CALL isalpha_ IF NE LDB #1 ELSE $ BEQ addr9a4b BSR bnk09981 LDD $aa ADDD #-1 LDX ,S STD 1,X LDB $ac CMPB #$27 BEQ addr99f1 CMPB #$22 IF EQ addr99f1 LDD 1,X $,X BRA addr99fd bnk09a24 PSHS D LDX ,S LDD 1,X STD $aa BRA addr9a48 bnk09a2e PSHS D LDX ,S LDD 1,X ADDB ,X ADCA #0 STD $aa LDB 3,X $LL copy_,(1,X) LEAS 4,S LDD ,S ADDD 6,S PSHS D CLRA CLRB PULS X STB ,X LEAS 4,S RTS bnk09a81 LEAS -2,S LDB $ad CMPB #3 $nstruction ENDIF RTS bnk09abf PSHS D LDD 8,S PSHS D LDD 8,S PSHS D LDD 8,S PSHS D CLRA LDB 7,S SCALL bnk09ada LEAS 6,S CA$intf_,(6,S),(10,S),(10,S),(10,S) CALL putnl_ LEAS 4,S RTS bnk09b1c CALL copystr_,#$0400,$a4 CLRA LDB $ac STB $b0 LDB $ad STB $b1 LDD $aa STD $a$bnk09995 LDB $ac CMPB #$5e IF EQ LDB #$da ELSE CMPB #$24 IF EQ LDB #$db $ LDD 1,S SUBD $a8 IF EQ CALL bnk09abf,#5 ENDIF LDD 1,S ADDD #-1 $96b5,bnk197d9,bnk1975a,bnk19743 xref bnk1980d,bnk1904c xref bnk193ce,bnk196be,bnk1915d,bnk1917c,bnk1919b,bnk1919d xref ___mul,isdigit_,isalpha_,___neg xref suicide_ xref printf_,putnl_ xref copy$ "Search string required" addr98fa fcs "No search string defined" addr9913 fcs "No file name" addr9920 fcs "%s" addr9924 fcs "%s - %s %d" addr992e fcs "%d" addr9931 fcs "Not found" addr993b fcs "%d occurrences changed" addr9952 fcs "%s $ CLRA LDB $ac CALL isdigit_ IF NE LDB #3 ELSE LDB #2 ENDIF ENDIF STB $ad RTS bnk099ba PSHS D SCALL bn$ADDD #1 STD 1,X CLRA LDB $ac STB 3,X addr99fd BSR bnk09995 ENDIF addr99ff LDB $ac BEQ addr9a4b CMPB #$20 IF EQ LDX ,S LDB $ IF NE LDX $aa CMPB ,X IF EQ LEAX 1,X STX $aa ENDIF ENDIF addr9a48 CALL bnk09995 addr9a4b BRA addr9ab4 bnk09a4d PSHS D LEAS -2,S $ IF NE LDD $b2 STD $24 SCALL bnk09abf,#1 ENDIF CLRA CLRB STD ,S LOOP CALLN ___mul,#10,(,S) ADDB $ac ADCA #0 $LL Suicide_ addr9ad7 LEAS 2,S RTS bnk09ada PSHS D LEAS -2,S LDD #addr9886 STD ,S LOOP CLRA LDB 3,S ADDD #-1 STB 3,S QUIF EQ $e RTS bnk09b36 CALL copystr_,$a4,#$0400 CLRA LDB $b0 STB $ac LDB $b1 STB $ad LDD $ae STD $aa RTS bnk09b50 LEAS -4,S CLRA LDB $a$ ELSE CMPB #$2e IF EQ LDB #$dc ELSE CMPB #$2a BNE addr9bc9 # STD 1,S CLRA LDB [1,S] STB 3,S LDD 1,S PSHS D ADDD #1 $str_,length_,streq_,copy_ xdef bnk09981,bnk09990,bnk09995 xdef bnk099ba,bnk099cc,bnk09a24,bnk09a2e,bnk09a4d xdef bnk09a81,bnk09ab6,bnk09abd,bnk09abf xdef bnk09ada,bnk09b1c,bnk09b36,bnk09b50,bnk09c0f xdef $- %s" addr995a fcs "Memory full" addr9966 fcs "Replacing string too long" fcb 0 bnk09981 LOOP LDB $ac CMPB #$20 BEQ addr998b CMPB #$09 QUIF NE addr998b BSR bnk09995 $k099cc,(,S) LDB [,S] BNE addr9a18 CALL bnk09abf,#2 BRA addr9a4b bnk099cc PSHS D CLRA CLRB LDX ,S STD 1,X CLR ,X CLR 3,X LDB $ac $3,X BEQ addr9a4b ENDIF LDB $ac LDX ,S CMPB 3,X IF EQ CALL bnk09995 addr9a18 BRA addr9a4b ENDIF addr9a1a CLRA LDB ,X ADDD #1 STB $ CLRA LDB [2,S] STD ,S SUBD #$0028 IF GT LDD #$0028 STD ,S ENDIF addr9a61 LDD ,S PSHS D LDD 8,S PSHS D LDX 6,S CA$ ADDD #$ffd0 STD ,S CALL bnk09995 LDB $ad CMPB #3 UNTIL NE LDD ,S addr9ab4 BRA addr9ad7 bnk09ab6 LDB $ac IF NE LDD #1 bnk09abd FCB $21 ;brn i$ LOOP LDD ,S PSHS D ADDD #1 STD 2,S PULS X LDB ,X UNTIL EQ LDB [,S] UNTIL EQ CALL bnk193ce CALL pr$ c STB ,S LDD $a8 STD 1,S addr9b5b CALL bnk09995 LDB $ac CMPB ,S IF NE LDB $ac IF NE CMPB #$25 IF EQ CALL % ;waterloo editor ;part 3 opt nolist ;INCLUDE ;INCLUDE ;INCLUDE opt list xref tableloo_,length_,copystr_ xref bnk0918f xref bnk0934f,bnk09355,bnk0935b,bnk09371,% xdef bnk093e2,bnk09479 bnk093e2 LEAS -4,S CALL bnk09981 CLR ,S LDD $aa ADDD #-1 STD 2,S CLR 1,S LDB $ac IF EQ LDB #$16 STB ,S % RTS addr9095 CALL cls CALL printf_,#title CALL printf_,#copyrite CALL printf_,#pressmsg LOOP CALL getchar_ SUBD #13 ;carriage return UNTIL EQ LDB #$02 % S D LDD 4,S PSHS D CALL tableloo_,#bnk0918f LEAS 4,S STB ,S ENDIF LDB ,S IF EQ CALL bnk% LEAS 2,S RTS bnk09479 fdb bnk09ab6 fdb bnk0934f fdb bnk29000 fdb bnk290c3 fdb bnk0935b fdb addr94ab fdb bnk09355 fdb bnk09371 fdb bnk09378 % NE CALL bnk09abf,#4 ENDIF LDD $2e STD $24 CALL bnk190dd LDD $24 SUBD $26 IF NE LDD $24 SUBD $28 BNE addr94d1 ENDI% LDD #1 STD ,S CLR 2,S LDB $ad CMPB #$03 IF EQ CALL bnk09a81 STD ,S ELSE LDB $ac CMPB #$2a IF EQ CALL % IF EQ CALL bnk09ada,#13 BRA addr95bf ENDIF CALL bnk191bd ELSE LDD $b2 CALL bnk19119 STD 5,S LOOP LDD $24 % LDD 2,S PSHS D CLRA LDB 6,S SCALL addr9604 LEAS 2,S ADDD ,S PULS X STD 3,S CALL bnk197a1,(5,S) STD $24 LDD% ENDIF ENDIF LDB $ac QUIF EQ LDD ,S PSHS D ADDD #1 STD 2,S CLRA LDB $ac PULS X STB ,X CALL %bnk09378,bnk0937e xref bnk0939e,bnk093af,bnk093bb,bnk093c0,bnk093c5 xref bnk09604 xref bnk09981,bnk09990,bnk09995 xref bnk09a81,bnk09ab6,bnk09abf,bnk09ada xref bnk09b50 xref bnk09daf,bnk191c3,bn% ELSE CMPB #$23 IF EQ LDB #$04 STB ,S CALL bnk09995 ELSE LOOP LDB $ad CMPB #$01 QUIF NE % STB $32 RTS addr90b7 fcs "Bad request %d%n" title fcs "Waterloo microEditor Version 1.2%n%n" copyrite fcs "Copyright 1982 by Waterloo Computing Systems Limited%n%n" pressmsg fcs "Press %n" reqtable fdb addr9007 %09990 ENDIF ENDIF ENDIF CLRA LDB ,S LEAS 4,S RTS addr943e LEAS -2,S CALL bnk09ab6 CALL bnk19076 LDD #bnk0918f LOOP STD ,S % fdb bnk0937e fdb bnk0939e fdb bnk093af fdb bnk291bb fdb bnk29179 fdb bnk2970d fdb bnk29663 fdb bnk29630 fdb bnk293e1 fdb bnk093bb fdb bnk0%F addr94d0 RTS addr94d1 LEAS -2,S CLR $b7 CALL bnk191c3 STD ,S IF LT SUBD #$fffd IF NE CALL bnk196b5 CALL bnk19743,#-1 STD $24 % bnk09995 LDB #$ff STB 2,S ENDIF ENDIF LDB $ac CMPB #$2f IF NE CALL bnk09abf,#7 ENDIF CALL bnk09b50 CALL addr95c2 C% SUBD $28 QUIF EQ LDD $24 SUBD $30 QUIF EQ LDD 3,S PSHS D LDD 2,S PSHS D CLRA LDB 6,S % 3,S IF NE CALL bnk1904c ENDIF CALL bnk09ada,#14,(3,S) ENDIF addr95bf LEAS 7,S RTS addr95c2 LEAS -2,S LDD $a6 STD ,S LOOP LDB $ac $bnk09995 ENDLOOP CLR [,S] CMPB #$2f IF EQ CALL bnk09995 ENDIF LEAS 2,S RTS ;this is a patch to allow the BSR on line 237 to compile. It corresponds ;to the routine BNK09%k19076 xref bnk19081,bnk190c1,bnk191bd,bnk190dd,bnk196b5,bnk19119 xref bnk197d9,bnk19743,bnk29000,bnk290cb,bnk290c3,bnk291bb xref bnk29179,bnk2970d,bnk29663,bnk29630,bnk293e1,bnk2974d xref bnk197a1,bnk1904c % CLRA LDB 1,S ADDD #$0001 STB 1,S CALL bnk09995 ENDLOOP LDB 1,S IF NE CLRA PSH fdb addr9021 fdb addr9095 fdb bnk19986 fdb bnk19a6c fdb addr900b fdb addr9016 cls LDD #12 JMP putchar_ end rriage return UNTIL EQ LDB #$02 % LDB [,S] QUIF EQ CALL copystr_,(2,S),#$0400 CALL bnk19081,#$0400 CALLN length_,(2,S),(,S) ADDD ,S PULS X ADDD #1 ENDLOOP CALL bnk190c1 %93c0 fdb bnk2974d fdb addr943e fdb bnk093c5 fdb bnk09daf fdb bnk290cb addr94ab LDB $ac IF NE BRA addr94fb ENDIF LDD $2e SUBD $30 IF% CALL bnk197d9 ELSE addr94f1 CALL bnk191bd ENDIF ENDIF LDB #$01 STB $b7 LEAS 2,S RTS addr94fb LEAS -7,S CLRA CLRB STD 3,S %ALL bnk09ab6 LDD $2e STD $24 SUBD $30 IF EQ CALL bnk190dd LDD ,S PSHS D CLRA LDB 4,S CALL bnk09604 LEAS 2,S % CALL bnk09604 LEAS 2,S ADDD ,S PULS X STD 3,S CALL bnk19743,#1 STD $24 ENDLOOP LDD 3,S PSHS D % CMPB #$2f QUIF EQ CMPB #$25 IF EQ CALL bnk09995 LDB $ac CMPB #$26 IF EQ LDB #$80 STB $ac &C3 cl& call macr ;call a system procedure pcount__ set 0 ifnc .,\1. ifnc .,\2. pcount__ set 2 ifnc .,\3. pcount__ set 4 ifnc .,\4. pcount__ set 6 & calln macr ;call a system procedure ifnc .,\1. ifnc .,\2. ifnc .,\3. ifnc .,\4. ldd \4 pshs d endc ldd \3 'C3N  1(&scall macr ;call a system procedure pcount__ set 0 ifnc .,\1. ifnc .,\2. pcount__ set 2 ifnc .,\3. pcount__ set 4 ifnc .,\4. pcount__ set 6 @fcs macr fcc \0 fcb 0 endm endc bsr \0 ifne pcount__ leas pcount__,s endc endm 4 ifnc .,\4. pcount__ set 6 &export Spawn_ = $B000 export Suicide_ = $B003 export ConBInt_ = $B006 export BankSW = $B009 export BankInit_ = $B00C export StoI_ = $B00F export ItoS_ = $B012 export ItoHS_ = $B015 export Hex_ = $B018 export BtoHS_ = &ableLoo_ = $B057 export ___RET = $B05A export ___RET2 = $B05D export ___MUL = $B060 export ___NEG = $B063 export ___DIV = $B066 export ___MOD = $B069 export _RSHIFT = $B06C export _LSHIFT = $B06F export CARRYSET_ = $B072 ex& = $B0AB export Openf_ = $B0AE export Closef_ = $B0B1 export FSeek_ = $B0B4 export Printf_ = $B0B7 export PutRec_ = $B0BA export PutChar_ = $B0BD export PutNL_ = $B0C0 export GetRec_ = $B0C3 export GetChar_ = $B0C6 export FPr2 export TimeOut_ = $B105 export SysRead_ = $B108 export SysWrite_ = $B10B export SysNL_ = $B10E export IntPow10_ = $B11a export DevList_ = $B124 export setup_ = $ad48 export monitor_ = $f020 f_ = $B0E1 export ErrorMsg_ = $B0E4 expo"edit" include "watlib.exp" bank 0 "edit1.b09" "edit2.b09" "edit3.b09" "edit4.b09" "edit5.b09" bank 1 "bank1.b09" bank 2 "bank2.b09" ib.exp & ldd \4 pshs d endc ldd \3 pshs d endc ldd \2 pshs d endc ldd \1 endc jsr pshs d endc ldd \2 pshs d endc ldd \1 endc jsr \0 endm &;Waterloo editor ;Initial parts opt nolist ;INCLUDE ;INCLUDE ;INCLUDE opt list xref printf_,suicide_,getchar_,putchar_ xref bnk19b19,bnk19b5a,bnk09cf7,bnk19852 xr& ifnc .,\5. fail endc ldd \4 pshs d endc ldd \3 pshs d endc ldd \2 &k19b5a,(8,S),(8,S) BRA addr904d addr9021 CALL bnk09cf7 IF NE JMP bnk0914b ENDIF RTS addr902a CLRA LDB 3,S PSHS D CALL printf_,#addr90b7 BRA addr904d ad&$B01B export HStoB_ = $B01E export IsAlpha_ = $B021 export IsDigit_ = $B024 export IsDelim_ = $B027 export IsHex_ = $B02A export IsUpper_ = $B02D export IsLower_ = $B030 export Upper_ = $B033 export Lower_ = $B036 export ZLoStr_&port PassThru_ = $B075 export TIOInit_ = $B078 export TPutChr_ = $B07B export TGetChr_ = $B07E export TBreak_ = $B081 export TGetCurs_ = $B084 export TPutCurs_ = $B087 export TSetChar_ = $B08A export TabSet_ = $B08D export TabGet_ = $B&intf_ = $B0C9 export FPutRec_ = $B0CC export FPutChar_ = $B0CF export FPutNL_ = $B0D2 export FGetRec_ = $B0D5 export FGetChar_ = $B0D8 export Eor_ = $B0DB export Eof_ = $B0DE export Errorf_ = $B0E1 export ErrorMsg_ = $B0E4 expo&904d LEAS 2,S RTS bnk09050 PSHS D LEAS -2,S CALL bnk19852 STD ,S LDB 3,S IF EQ LDD $20 STD $26 STD $24 LDB #$02 LDX $2&4 STB ,X LEAX 1,X STX $24 LDB #$01 STB ,X LEAX 1,X STX $24 LDD $24 STD $28 LDB #$02 STB ,X X\0 ifne pcount__ leas pcount__,s endc endm ifnc .,\2. pcount__ set 2 ifnc .,\3. pcount__ set 4 ifnc .,\4. pcount__ set 6 % LEAX 1,X STX $24 LDB #$01 STB ,X ENDIF LDD ,S IF NE CALL Suicide_ ENDIF LDD $26 STD $24 bsr addr9095 LEAS 4,S &ef bnk19986,bnk19a6c,bnk0914b xdef bnk09050 addr9000 PSHS D CLRA LDB 1,S BRA addr9037 addr9007 LDD 6,S BRA bnk09050 addr900b CALLN bnk19b19,(8,S),(8,S) BRA addr904d addr9016 CALLN bn pshs d endc ldd \1 endc bsr \0 ifne pcount__ leas pcount__,s endc endm 4 ifnc .,\4. pcount__ set 6 &dr9037 LDX #addr902a ADDD #-1 GUESS TSTA QUIF NE CMPB #$06 QUIF HI LDX #reqtable ABX ABX LDX ,X ENDGUESS JSR ,X addr& = $B039 export ZUpStr_ = $B03C export StrEq_ = $B03F export Equal_ = $B042 export Length_ = $B045 export CopyStr_ = $B048 export Copy_ = $B04B export PrefixSt_ = $B04E export SuffixSt_ = $B051 export Decimal_ = $B054 export T&090 export SIOInit_ = $B093 export SPutChr_ = $B096 export SGetChr_ = $B099 export SBreak_ = $B09C export DirOpenf_ = $B09F export DirReadf_ = $B0A2 export DirClose_ = $B0A5 export DirClosef_ = $B0A5 export SysIOIni_ = $B0A8 export InitStd_ & rt Mount_ = $B0E7 export Scratchf_ = $B0EA export Renamef_ = $B0ED export Request_ = $B0F0 export SetDate_ = $B0F3 export GetDate_ = $B0F6 export SetTime_ = $B0F9 export GetTime_ = $B0FC export KBEnable_ = $B0FF export KBDisabl_ = $B10&CEDITOR SOURCEES2C'&call.macro&calln.macro&scall.macro&fcs.macro&watlib.exp & edit.cmd& edit1.asm (edit2.asm'%edit3.asm)edit4.asm$edit5.asm4*bank1.asml#bank2.asmS edit1.b09 edit2.b09 .edit3.b09 ' .edit4.b09 . edit5.b09bank1.b09!/bank2.b09edit.mod$0edit.map0edit.exp 0dir.cmd' dir.asm1dir.b091dir.mod1dir.map1dir.exp1newterm2.3.asmnewterm2.4.asm2newterm2.3.b09'directory.asmdirectory.cmddirectory.lst"2directory.b092directory.map2directory.exp2 directory.mod2note_on_dir'3newterm2.4.cmd3newterm2.4.lst: newterm2.4.b09newterm2.4.mapnewterm2.4.modnewterm2.4.expnewterm.inst:e0letter.john5setabs.asm5setabs.cmd6setabs.lst 6setabs.map6setabs.mod5macros100letter.toebes( ;waterloo editor ;part 2 xref setup_,monitor_,passthru_,spawn_,___neg xref bnk093e2,bnk09479,bnk09769 xref bnk09981,bnk09990,bnk09995 xref bnk09ab6,bnk09abf,bnk09ada xref bnk09b1c,bnk09b36,bnk09b50,bnk09( CLRB BRA addr9300 ENDGUESS LEAS -1,S LDD $24 STD $b2 LDD $26 STD $24 LOOP CALL bnk09b50 LOOP CALL bnk19743,#1 ( bnk0914b LDD $22 STD $a8 ADDD #$ff88 STD $a8 LDX $a8 CLR ,X ADDD #$ff88 STD $a6 LDX $a6 CLR ,X ADDD #$ff88 STD $a4 LDX $a4 ( CALL bnk09981 CALL bnk09995 ENDLOOP addr92f9 LDD $b2 STD $24 LEAS 1,S RTS addr9300 PSHS D LEAS -5,S CALL bnk093e2 STB ,S IF EQ CAL( fcs "setUP" fcs "monITOR" fcs "tALK" fcs "diRECTORY" fcs "nAME" fcs "scrATCH" fcs "renAME" fcs "mouNT" fcs "copY" fcs "datE" fcs "timE( CMPB #7 IF CS ELSE CMPB #22 IF CS CALL bnk09abf,#4 ENDIF ENDIF ENDIF ENDIF CLRA ( SUBD $28 QUIF EQ LDD ,S SUBD #3 QUIF EQ CALL bnk196b5 CALL bnk1975a,#-1 STD $24 CALL bnk197d9 ( 5,S CALL setup_,#1 LDB #2 STB $32 LDD 3,S STD $a0 LDD 5,S STD $a2 JMP bnk19021 bnk0939e CALL bnk09ab6 CALL monitor_,#1 CALL bnk19000 l( CALL bnk09ab6 CALL bnk09b36 CALL bnk193ac,#$0400 CALL bnk191c9 ENDIF LDB $ac IF NE CALL bnk09b1c ENDIF LDD $24 STD $b2 ( IF EQ CALL bnk1975a,#1 STD $24 ENDIF JMP bnk190dd RTS addr93d5 LDX #bnk09479 ABX ABX JSR [,X] CLRA LDB ,S LEAS 7,S (cc3 xref bnk09d31,bnk09d83,bnk19000,bnk1905c,bnk198c7,bnk191c3 xref bnk191c9,bnk19076,bnk190c1,bnk191bd,bnk190dd,bnk19021 xref bnk193ac,bnk196b5,bnk197d9,bnk19119,bnk1975a,bnk19743 xref bnk2952c xdef bnk( STD $24 SUBD $28 BEQ addr92f9 CALL bnk09cc3 UNTIL NE CALL bnk09b1c LDD $24 STD $2e STD $30 SCALL addr9300,#-1 ( CLR ,X ADDD #$ffd8 STD $a2 LDX $a2 CLR ,X ADDD #-1 STD $a0 LDD #-1 STD $be CALL bnk19000 LOOP CALL Spawn_,#addr9208 (L bnk09769 CALL bnk093e2 STB ,S CMPB #22 IF EQ LDB #23 ELSE CMPB #3 BNE addr9323 LDB #24 ENDIF (" fcs "tabSET" fcs "hELP" fcb 0 addr9208 LEAS -3,S CALL bnk191c3 STD ,S CLR 2,S LDD ,S IF LT CALL ___neg STD ,S LDB #$ff ( LDB ,S JMP addr93d5 bnk0934f CALL bnk09ab6 JMP bnk09d31 bnk09355 CALL bnk09ab6 JMP bnk09d83 bnk0935b CALL bnk09ab6 CALL bnk190dd CALL bnk19119,$24 PSHS D CALL bnk09ada,#( ADMIT CALL bnk191bd ENDGUESS ENDIF CALL bnk198c7,(,S) ELSE LDD ,S SUBD #13 IF NE CALL bnk198c7,(,S) ELSE( db #2 addr93ac STB $32 RTS bnk093af CALL bnk09ab6 CALL bnk19076 CALL passthru_ JMP bnk190c1 bnk093bb LDD #-1 BRA addr93c2 bnk093c0 CLRA CLRB addr93c2 JMP bnk2952c bnk093c5 LDB 8,S( STD $2e STD $30 GUESS LDB $ac CMPB #$2a QUIF NE LDX $aa LDB ,X CMPB #$2f QUIF NE CALL bnk09995 ADMIT CLRA  RTS END B $32 RTS bnk093af CALL bnk09ab6 CALL bnk19076 CALL passthru_ JMP bnk190c1 bnk093bb LDD #-1 BRA addr93c2 bnk093c0 CLRA CLRB addr93c2 JMP bnk2952c bnk093c5 LDB 8,S(0914b,bnk0918f,bnk0934f,bnk09355,bnk0935b xdef bnk09371,bnk09378,bnk0937e,bnk0939e,bnk093af xdef bnk093bb,bnk093c0,bnk093c5 opt nolist ;INCLUDE ;INCLUDE ;INCLUDE opt list ( STB ,S CALL bnk09b36 LDD $24 STD $b2 LDB ,S CMPB #6 IF EQ CALL bnk19743,#-1 STD $24 ENDIF CALL bnk09990 ( LDB $32 CMPB #$02 UNTIL NE JMP bnk1905c bnk0918f fcs "iNPUT" fcs "gET" fcs "pUT" fcs "#" fcs "cHANGE" fcs "dELETE" fcs "run" fcs "bye" (STB ,S addr9323 CMPB #5 IF CS LDD $2e SUBD $30 IF NE CALL bnk09abf,#4 ENDIF LDD $2e STD $24 ELSE ( STB 2,S ENDIF LDB $b7 IF EQ LDB 2,S IF NE GUESS LDD $24 SUBD $26 QUIF EQ LDD $24 (12 LEAS 2,S RTS bnk09371 CALL bnk09ab6 LDB #3 BRA addr93ac bnk09378 CALL bnk09ab6 CLR $32 RTS bnk0937e CALL bnk09ab6 LDD $a0 STD 3,S LDD $a2 STD ( SCALL addr9266 ENDIF ENDIF LEAS 3,S RTS addr9266 CLRA CLRB STD $b4 CALL bnk09981 LDB $ac CMPB #$3f IF EQ CALL bnk09995 ) ;waterloo editor ;part 4 opt nolist ;INCLUDE ;INCLUDE ;INCLUDE opt list xref ___mul,___neg,suicide_,copy_,length_,copystr_ xref bnk09981,bnk09990,bnk09995 xref ) ,S PULS X STD ,S ADDD 8,S STD 2,S SUBD 10,S IF HI CALL bnk1904c CALL bnk09abf,#17 ENDIF ) LOOP LOOP CLR $b6 CALL bnk09c0f,(2,S),$a8 QUIF NE LDD ,S PSHS D ADDD #1 ) CALL bnk09995 CALL bnk197a1,#1 STD $2e CALL bnk197c0 ELSE SCALL addr97d2 STD $2e LDB $ac CMPB #$2c IF EQ LDD ) BSR addr9691 LDD 2,S ADDD #1 STD 2,S BRA addr9677 ENDGUESS LDD ,S ADDD #1 STD ,S LD) STD $24 CALL bnk19743,#20 ELSE LDD $2e ENDIF ENDIF ENDIF STD $30 addr97c5 LDD $b2 STD $24 CALL bnk19b8e ) CMPB #$80 QUIF NE LDD #$0078 ADDD $a6 PSHS D CLRA LDB $b6 ADDD #-1 PSHS D SCALL addr970d,(4,S) ) LDD $26 PSHS D LDD #-1 addr9802 SCALL bnk0983b LEAS 2,S ELSE CMPB #$2e BEQ addr9815 CMPB #$24 IF EQ CALL bnk197c0 ) ADDB $b6 ADCA #$00 SCALL addr970d LEAS 4,S CALL copy_,$a6,(6,S),(2,S) LDD 4,S ADDD 2,S BRA addr9766 addr970d PSHS D LEAS -4,S LDD 8,S IF LT) CALL bnk09995 CALL bnk09a81 CALL ___neg ENDIF ENDIF CALL bnk19743 STD $24 LDD $24 RTS bnk0983b PSHS D LDB $ad CMPB #3 ) bnk09a81,bnk09abf,bnk09c0f,bnk09cc3,bnk09b50 xref bnk196b5,bnk197d9,bnk19743,bnk1980d,bnk1904c,bnk197a1 xref bnk197c0,bnk19b8e xdef bnk09604,bnk09769,bnk0983b bnk09604 PSHS D LEAS -4,S CLRA CL) LOOP CLRA LDB [,S] STB [2,S] LDD ,S SUBD 4,S QUIF EQ LDD ,S ADDD #-1 STD ,S )STD 2,S PULS X LDB ,X BEQ addr9677 ENDLOOP LDB 5,S QUIF EQ LDD ,S BSR addr9691 )$b2 STD $24 CALL bnk09995 SCALL addr97d2 ELSE CMPB #$5e IF EQ CALL bnk09995 LDD $2e STD $30 )D 8,S ADDD #-1 STD 8,S ENDLOOP addr9677 LDD 2,S QUIF EQ CALL bnk196b5 CALL bnk19743,#-1 STD $24 CALL bnk09990 CALL bnk197d9 ) IF NE JMP Suicide_ ENDIF RTS addr97d2 LDB $ad CMPB #$03 IF NE LDB $ac CMPB #$2f BNE addr97e4 ENDIF LDD $26 STD $24 ) LEAS 4,S CLRA LDB $b6 PSHS D CALLN copy_,(8,S),(2,S) LEAS 4,S LDD ,S ADDB $b6 ADCA #$00 ENDLOOP ) STD $24 addr9815 CALL bnk09995 ENDIF ENDIF addr9818 LDB $ac CMPB #$2b IF EQ CALL bnk09995 CALL bnk09a81 ELSE CMPB #$2d IF EQ ) LDD 4,S ADDD 8,S PSHS D CALLN copystr_,(6,S) LEAS 2,S ELSE LDD 8,S IF EQ ELSE CALLN length_,(6,S),(4,S) ADDD* IF EQ LDD ,S PSHS D CALL bnk09a81 CALL ___mul ELSE addr984f LDB $ac CMPB #$2f IF EQ CALL bnk09b50 LOOP )RB STD 2,S LDD $24 SUBD $26 GUESS QUIF EQ LDD $24 SUBD $28 QUIF EQ CALL bnk1980d LDD #$0400 STD ,S LOOP ) LDD 2,S ADDD #-1 STD 2,S ENDLOOP ENDIF ENDIF addr9766 LEAS 6,S RTS bnk09769 CALL bnk09981 LDB $ac CMPB #$2a IF EQ ) STD ,S LDD 2,S ADDD #1 STD 2,S ENDLOOP GUESS LDD 8,S SUBD #1 QUIF NE LDD ,S ) STD $24 CALL bnk19743,#$ffec STD $2e BRA addr97c5 ENDIF CMPB #$26 IF EQ CALL bnk09995 LDD $2e ) ENDGUESS LDD 2,S LEAS 6,S RTS addr9691 PSHS D LEAS -4,S LDD $a6 LOOP LOOP STD ,S LDX ,S LDB ,X BEQ addr96d7 ) BRA addr97eb addr97e4 CMPB #$2b IF EQ CALL bnk09995 addr97eb LDD $28 PSHS D LDD #1 BRA addr9802 ENDIF addr97f4 CMPB #$2d IF EQ CALL bnk09995 ) LDD ,S ADDD #1 ENDLOOP addr96d7 CALL length_,$a6 STD 2,S LDD #$0078 ADDD #$0400 PSHS D LDD 4,S SUBB $b6 SBCA #$00 PSHS D LDD 8,S * xdef bnk19000,bnk19021,bnk1904c,bnk1905c,bnk19076,bnk19081 xdef bnk190c1,bnk190dd,bnk19119,bnk1915d,bnk1917c,bnk1919d xdef bnk191bd,bnk191c3,bnk191c9,bnk193ac,bnk193ce,bnk196b5 xdef bnk196be,bnk19719,bnk19743,bnk19* LDD $24 SUBD 4,S QUIF EQ LDD ,S CALL bnk19743 STD $24 CALL bnk09cc3 UNTIL NE LDD $24 SUBD * TB $bb STB $b7 SCALL bnk1904c call addr956e,#24 call addr956e,#25 call addr9480,#24,#$0046 LDD #addr9676 JMP $b0b7 bnk1904c CALL addr93e1,#1,#22 JMP addr91b8 bnk1905c* LEAS 4,S LDD #22 CALL addr93fa addr91b8 LDD $24 STD $b8 RTS bnk191bd CLRA LDB $ba JMP addr93fa bnk191c3 CALL addr956e,#23 bnk191c9 LEAS -2,S LDB $b7 CMPB #$0* $b0c0 CLRA CLRB STD $b4 ENDIF CALL $b081 LEAS 2,S RTS bnk190c1 CALL $b0c0 CALL addr9480,#24,#70 CALL $b0b7,#addr9689 CALL addr91fc J* IF EQ LDB #-1 STB 9,S ENDIF addr920d LOOP LDD $35 CALL $b0d8 STB ,S UNTIL NE CLRA CALL addr98bd LBNE addr* bnk19119 LDD 4,S ADDD #1 CALL addr9526 LEAS 4,S LDD #22 PSHS D SUBD 2,S ADDD #1 ELSE LDD ,S BGE addr9156 CA*LRA CALL $b0bd LDB ,S CMPB #$07 ;==> QUIF EQ CMPB #$08 ;<== QUIF EQ CMPB #$09 ;TAB QUIF EQ LDB #* STB $bb CLRA LDB $ba CALL addr956e CLR $b7 RTS bnk1917c LDD #1 PSHS D CLRA LDB $ba ADDD #-1 PSHS D CALL addr9526,#1 LEAS* LDB ,S CMPB #$08 ;<== QUIF EQ CMPB #$7f ;rub out QUIF EQ CMPB #$04 ;del key BEQ addr920d CMPB #$05 ;insert key BEQ ad*75a,bnk197a1,bnk197c0 xdef bnk197d9,bnk197e4,bnk1980d,bnk19814,bnk19852,bnk198c7 xdef bnk1919b,bnk19986,bnk19a6c,bnk19b19,bnk19b5a,bnk19b8e xref bnk09990,bnk09abf,bnk09ada ;INCLUDE ;INCLUDE ;INCL* 4,S BNE addr9883 LDD $b2 STD $24 LDD #$0006 CALL bnk09abf BRA addr9883 ENDIF LDD ,S ENDIF CALL bnk19743 * call $b0b1,$35 call $b0b1,$37 addr9066 call addr9480,#24,#1 JMP $b0ff bnk19076 SCALL addr9066 LDB #$02 STB $b7 CLRA CLRB STD $b4 RTS bnk19081 PSHS D CA*1 IF EQ LDD #1 PSHS D LDD #23 ELSE CLRA LDB $bb PSHS D LDB $ba ENDIF CALL addr9480 LEAS 2,S CALL add*MP bnk19021 bnk190dd LEAS -2,S CALL bnk19719,$24 PSHS D CALL bnk19719,$b8 PSHS D LDD 2,S SUBD ,S PULS X PULS X STD ,S SUBD #22 IF LT *92ab LDB ,S CMPB #$01 ;home LBEQ addr92ab CMPB #$02 ;run LBEQ addr92ab CMPB #$03 ;stop BEQ addr92ab CMPB #$0a ;down arrow *LL $b063 PSHS D LDD #22 ADDD 2,S PSHS D CALL addr9526,#1 LEAS 4,S CALL $b063,(,S) addr914c PSHS D LDD #1 ENDIF CALL addr93e1* $ff STB 9,S ENDGUESS addr9256 CALL $b084 STD 3,S TFR A,B CLRA STD 5,S LDD 3,S CLRA STD 7,S GUESS * 4,S CALL addr93fa,#1 LDB #$01 STB $b7 bnk1919b BRA addr91b8 bnk1919d LDD #-1 PSHS D LDD #22 PSHS D CLRA LDB $ba ADDD #1 CALL addr9526 +dr920d CMPB #$06 ;erase eol key BEQ addr920d CMPB #$09 ;tab key BEQ addr920d LDD 7,S SUBD #1 BNE addr920d LDD #1 *UDE ;INCLUDE bnk19000 CALL $b0ae,#addr9669,#addr9672 STD $35 CALL $b0ae,#addr9669,#addr9674 STD $37 JMP bnk19021 bnk19021 LDB #$0b STB $ba LDB #$01 S4 STD $24 addr9883 LEAS 2,S RTS QUIF EQ LDD ,S CALL bnk19743 STD $24 CALL bnk09cc3 UNTIL NE LDD $24 SUBD *LL $b0b7,#addr967d,(,S) LDD $b4 ADDD #1 STD $b4 SUBD #22 IF GE CALL $b0c0 CALL addr9480,#24,#70 CALL $b0b7,#addr9682 CALL addr91fc CALL*r95b6 SCALL addr91fc STD ,S CALL addr960e CALL addr956e,#24 LDD ,S LEAS 2,S RTS addr91fc LEAS -10,S CALL $b0ff CLR 9,S LDB $b7 CMPB #1 * CALL $b063,(,S) SUBD #22 BLT addr910b ENDIF LDD #22 BRA addr914c addr910b LDD ,S IF GT CALL $b063 PSHS D LDD #22 PSHS D* BEQ addr92ab CMPB #$0b ;up arrow BEQ addr92ab CMPB #$0c ;clear screen BEQ addr92ab CMPB #$0d ;carriage return BEQ addr92ab GUESS C* LEAS 2,S addr9156 LDD $24 STD $b8 LEAS 2,S RTS bnk1915d LDD #-1 PSHS D CLRA LDB $ba PSHS D CALL addr9526,#2 LEAS 4,S LDB #$01 + CALLN addr9480,#24,#1 BRA addr9402 addr93e1 PSHS D SCALL addr9405 LOOP LDD ,S SUBD 4,S BGT addr9402 LDD ,S PSHS D ADDD #1 STD 2,+ PSHS D LDD 7,S ADDD #-1 ADMIT ;we come here when they hit the rubout or the left arrow key LDD 7,S SUBD #80 BNE addr92a8 LDD #80 + GUESS LDD $bc ADDD ,S STD 2,S QUIF LT SUBD $be QUIF GT LDD $24 STD 4,S CALL bnk1975a,(,S) STD $24 SCALL addr94+ IF EQ LDD 3,S CLRA STB $bb ENDIF LDD #$0400 STD $aa LDB 9,S IF NE CALL $b063,(1,S) STD 1,S LOOP C+ D LDD $0122 ADDD #$8000 PSHS D PULS X CLRA LDB ,X ANDB #$7f PULS X STB ,X LDD ,S ADDD #-1 PSHS D CALL $b060,#80 + LEAS 10,S RTS addr931b LDD $24 SUBD $26 BNE addr9347 LDB $ba CMPB #$01 BEQ addr9355 CALL addr9526,#2,#22,#-1 CLRA LDB $ba ADDD #-1 +400 CLRA LDB ,S STB $0450 ENDIF LEAS 1,S RTS addr94f2 PSHS D LEAS -4,S LDD #$8000 ADDD $0122 STD ,S LDD #$8000 PSHS D +TB $ba LDD #1 BRA addr93fa addr938c LDB $ba CMPB #22 BCS addr939b CALL bnk1975a,#1 STD $24 addr939a RTS addr939b CLRA ADDD #1 STB $ba LDD #1 addr93a+4,S ADDD #-1 ADDD 10,S PSHS D CALL $b060,#80 ADDD ,S PULS X PSHS D LDD #$8000 PSHS D LDD 6,S ADDD #-1 PSHS D CALL $b060,#8+,S PULS X STD ,S LDD #1 STD 2,S LOOP LDD 2,S PSHS D ADDD #1 STD 4,S LDD ,S PULS X SUBD #80 QUIF GT+S PULS D SCALL addr941b ENDLOOP addr93fa PSHS D SCALL addr9405 SCALL addr941b,(,S) addr9402 LEAS 2,S RTS addr9405 CALL bnk19719,$24 STD $bc LDD $be SUBD + PSHS D LDD 7,S ADDD #1 ENDGUESS addr92a3 CALL addr9457 LEAS 2,S addr92a8 JMP addr920d ;go back for the next key ; they hit a key that takes them out so do it. addr92ab CALL $b10+b5 LDD 4,S STD $24 ENDGUESS CALL addr94f2,(6,S) LEAS 8,S RTS addr9457 PSHS D SCALL addr9480,(2,S),(4,S) LDD $0122 ADDD #$8000 PSHS D L+ALL $b0d8,$35 STB ,S UNTIL EQ CALL $b0cf,$37,#$0d LOOP CALL $b0c6 STB ,S CMPB #$0d QUIF EQ CLRA LDX $aa + ADDD 4,S ADDD #-1 STD $0122 addr94b2 LEAS 2,S RTS addr94b5 LEAS -1,S LDD $24 SUBD $26 IF EQ LDD #addr9693 BRA addr94cb ENDIF LDD $24+ STB $ba LDD #22 JMP addr93fa addr9347 LDB $ba CMPB #$01 BNE addr9356 CALL bnk1975a,#-1 STD $24 addr9355 RTS addr9356 CLRA ADDD #-1 STB $ba LDD+ LDD 6,S PSHS D CALL $b060,#80 ADDD ,S PULS X STD 2,S LOOP LDD ,S SUBD 2,S BCC addr956c LDB #' ' STB [,S] +4 CALL bnk1975a STD $24 STD $b8 RTS bnk193ac PSHS D CALL addr956e,#23 CALL addr9480,#23,#1 CALLN $b0b7,#addr9690,(,S) LEAS 4,S RTS bnk193ce CALL addr956e,#24 + 0 ADDD ,S PULS X CALL $b04b addr956c BRA addr95b3 addr956e PSHS D LEAS -4,S LDD #$8000 PSHS D LDD 6,S ADDD #-1 PSHS D CALL $b060,#80 ADDD , LDD ,S PSHS D ADDD #1 STD 2,S LDD #$0020 PULS X STB ,X ENDLOOP addr95b3 LEAS 6,S RTS addr95b6 CLRA LDB $ba ADDD +#-1 IF EQ CALL bnk19719,$28 STD $be ENDIF RTS addr941b PSHS D LEAS -6,S SCALL addr9480,(8,S),#1 LDD 6,S SUBB $ba SBCA #0 STD ,S +2 CALL $b084 STD 3,S CLRA LDB ,S STD 1,S SUBD #$000d IF EQ LDD 3,S CLRB ADDD #1 STD 3,S ENDIF LDB $b7 +DD $0122 ADDD #$8000 PSHS D PULS X CLRA LDB ,X ORB #$80 PULS X STB ,X BRA addr94b2 addr9480 PSHS D LDD $0122 ADDD #$8000 PSHS+ STB ,X LEAX 1,X STX $aa ENDLOOP LDD 3,S CALL $b087 ENDIF CALL $b0ff LDX $aa CLR ,X CALL bnk09990 LDD 1,S+ SUBD $28 IF EQ LDD #addr96a7 addr94cb CALL $b0b7 ELSE CALL bnk1980d CLRA LDB $0450 STB ,S CLR $0450 CALL $b0b7,#addr9690,#$0+ #-1 BRA addr93a4 addr9361 LDD $24 SUBD $28 BNE addr938c LDB $ba CMPB #$16 BEQ addr939a CALL addr9526,#1,#21,#1 CLRA LDB $ba ADDD #1 S+LDD ,S ADDD #1 STD ,S ENDLOOP addr9526 PSHS D LDD 4,S SUBD ,S ADDD #1 PSHS D CALL $b060,#80 PSHS D LDD #$8000 PSHS D LDD , QUIF EQ LDD 2,S ADDD #1 STD 2,S LDD ,S ADDB [,S] ADCA #0 STD ,S SUBD $28 UNTIL EQ LDD 2,S LEAS 6,S , #-1 PSHS D CALL $b060,#80 ADDB $bb ADCA #0 ADDD #-1 ADDD #$8000 PSHS D CLRA LDB $ba ADDD #-1 PSHS D CALL $b060,#80 ADDB $b, ADDD #-1 STD 2,S LDD ,S ADDB [,S] ADCA #0 STD ,S ENDLOOP mylabel LDD 2,S BEQ addr97d5 LDD ,S SUBD $26 , B $bb ADCA #0 ADDD #-1 ADDD #$8000 PSHS D CLRA LDB $ba ADDD #-1 PSHS D CALL $b060,#80 ADDB $bb ADCA #0 ADDD #-1 ADDD #$80,SUBD $28 UNTIL EQ BRA addr97d5 bnk197c0 LEAS -4,S LDD $24 STD 2,S LDD $28 STD $24 SCALL bnk1975a,#-1 STD ,S LDD 2,S STD $24 addr97d5 LDD ,S ,689 fcs "" addr9690 fcs "%s" addr9693 fcs "" addr96a7 fcs "" bnk196b5 ldd $24 pshs d bsr bnk196be leas 2,s RTS bnk196be PSHS D LEAS -2,S CALL, BRA addr9819 bnk1980d LDD #$0400 PSHS D LDD $24 bnk19814 PSHS D LDD #5 addr9819 CALL $b0f0 addr981c LEAS 4,S RTS addr981f PSHS D LEAS -6,S TFR S,D CALL $b0fc , 6,S SUBD 2,S IF CC LDD 6,S SUBD 2,S ADDB [6,S] ADCA #0 STD ,S PSHS D CALLN $b0f0,#7,(4,S) LEAS 4,S LDD #-1 ,EAS -14,S LDA #$f0 STA 6,S DEC 6,S STA 7,S LSL 7,S LDA [6,S] ORA #$11 STA 4,S STA 5,S LDB #$40 LOOP LSLB STB , LSL [6,S] LDA [6,S] STA ,S STB ,-X STX 2,S LDB 1,S SCALL addr989f FCB $10,$80,$22,$00,$40,$00,$04,$a8 addr989f LDY ,S++ LOOP ,RTS bnk19743 PSHS D CALL $b081 IF NE CALL bnk1904c CALL bnk09abf,#3 ENDIF SCALL bnk1975a,(,S) LEAS 2,S RTS bnk1975a PSHS D LEAS -2,S LDD $,b ADCA #0 ADDD #-1 ADDD #$8000 PSHS D PULS X CLRA LDB ,X ORB #$80 PULS X STB ,X LDD $0122 ADDD #$8000 PSHS D L, BEQ addr97d5 LDD 2,S ADDD #1 STD 2,S LDD ,S ADDD #-1 STD ,S SUBB [,S] SBCA #0 STD ,S ENDLOOP bnk197a1 PSHS D ,00 PSHS D PULS X CLRA LDB ,X ANDB #$7f PULS X STB ,X LDD $0122 ADDD #$8000 PSHS D LDD $0122 ADDD #$8000 PSHS D , BRA addr981c bnk197d9 SCALL bnk197e4 IF NE LDD #$0010 JMP bnk09ada ENDIF RTS bnk197e4 LDD $24 SUBD $28 IF NE LDD $24 LDX $24 , bnk19852 IF NE LDD $26 STD 2,S LDD $28 STD 6,S ENDIF LDD 2,S SUBD $26 IF EQ LDD 2,S ADDB [2,S] ADCA #0, LDB #3 STB 5,S LDX 6,S TFR S,Y LOOP LDA #'0' LDB ,Y+ LOOP CMPB #10 QUIF LT INCA SUBB #10 ENDLOOP , STD $be ENDIF addr9716 LEAS 4,S RTS bnk19719 PSHS D LEAS -4,S CLRA CLRB STD 2,S LDD $26 STD ,S LOOP LDD ,S SUBD 4,S , 1,S STB [6,S] LDD 4,S MUL STB 5,S ORA 5,S STA 4,S EORB #$d7 LSL [6,S] EORB [6,S] LDA 5,S STA [6,S] - ORA ,S ANDA ,Y PSHS A LDA ,X+ ANDA ,Y+ SUBA ,S+ BNE addr98ba LSL 1,S UNTIL EQ LDX 2,S LSRB ,24 STD ,S LDD 2,S BLT mylabel LOOP LOOP LDD 2,S BEQ addr97d5 LDD ,S SUBD $28 BEQ addr97d5 LDD 2,S ,DD $0122 ADDD #$8000 PSHS D PULS X CLRA LDB ,X ORB #$80 BRA addr9664 addr960e CLRA LDB $ba ADDD #-1 PSHS D CALL $b060,#80 ADD, LEAS -2,S LDD $26 STD ,S LOOP LDD 2,S BEQ addr97d5 ADDD #-1 STD 2,S LDD ,S ADDB [,S] ADCA #0 STD ,S , PULS X CLRA LDB ,X ANDB #$7f addr9664 PULS X STB ,X RTS addr9669 fcs "KEYBOARD" addr9672 fcs "R" addr9674 fcs "W" addr9676 fcs "" addr967d fcs "%s%n" addr9682 fcs "" addr9, ADDB ,X ADCA #0 STD $24 ENDIF LDD #-1 STD $be LDD #addr97ff JMP $b000 addr97ff LDD $24 PSHS D LDD #$0400 PSHS D LDD #4 , STD 2,S ENDIF LDD 6,S SUBD $28 IF EQ LDD 6,S ADDD #-1 STD 6,S SUBB [6,S] SBCA #0 STD 6,S ENDIF LDD, STA ,X+ ADDB #'0' STB ,X+ DEC 5,S QUIF EQ LDA #'9'+1 STA ,X+ ENDLOOP CLR ,X LEAS 8,S RTS bnk19852 TFR S,X L- LDD ,S ADDD #1 STD ,S ENDLOOP LDB 3,S CMPB #2 UNTIL HI LDD ,S SUBB 3,S SBCA #0 STD ,S CLRA LDB 3,S - LSRB UNTIL EQ addr98ba LEAS 14,S RTS addr98bd PSHS D CLRA LDB 1,S ANDB #$80 LEAS 2,S RTS bnk198c7 PSHS D SCALL addr98bd,(,S) BEQ addr9904 - D 2,S PSHS D LDD 4,S ADDB 7,S ADCA #0 CALL $b04b LEAS 4,S JMP addr998d addr9a26 CALL $b045,#$0400 ADDD #1 STB 3,S CLRA ADDD #1 - dr9904 LDD ,S BRA addr990d addr9908 LDB #$03 STB $32 addr990c RTS addr990d LDX #addr990c ADDD #-1 BLT addr9920 CMPB #$0c BHI addr9920 LDX #addr996c addr991c ABX -LDX $24 LDB ,X ADDD #-2 STD ,S PSHS D LDD #$0400 PSHS D LDD $24 ADDD #1 CALL $b04b LEAS 4,S LDD #$0400 STD 3,S LOOP - JMP bnk1919d ENDIF ENDIF RTS addr9958 fdb addr9945 fdb addr98e2 fdb addr9361 fdb addr98eb fdb addr98dd fdb addr931b fdb addr98f0 fdb - STD 3,S LDD ,S PSHS D LDD 5,S ADDB 7,S ADCA #0 ADDD #-2 PSHS D CALL $b04b,(7,S) LEAS 4,S LDD 3,S AD- STB 2,S LBEQ addr9a26 CMPB #' ' IF CS LDB #' ' STB 2,S STB ,X ENDIF LDD ,S ADDD #1 STD ,S -STD ,S LDD 4,S ADDD #-1 STD 4,S ENDLOOP LEAS 2,S RTS bnk19b19 PSHS D LEAS -5,S LDD $28 LDX $28 ADDB ,X ADCA #0 STD -,S ADDD 11,S PSHS D CALL $b04b,(9,S) LEAS 4,S LDD $28 ADDD 9,S STD $28 LDD $30 ADDD 9,S STD $30 LEAS 7,S RTS bnk19b5a PSHS D - STB [,S] LDD ,S ADDD #1 STD ,S CLRA LDB 2,S STB [,S] LDD ,S ADDD #1 STD ,S CLRA LDB 3,S ADDD #-2 STB 3,S - LDD ,S BRA addr98f3 addr98d3 LDD #-20 BRA addr98e5 addr98d8 LDD #20 BRA addr98e5 addr98dd LDD #-1 BRA addr98e5 addr98e2 LDD #1 addr98e5 CALL bnk1975a STD $24 RTS addr9-PSHS D CALL bnk19b19,$24 LEAS 2,S CLRA LDB 3,S ADDD #1 LDX $24 STB ,X CLRA LDB 3,S PSHS D LDD $24 ADDD #1 PSHS D - ABX LDX ,X addr9920 JSR ,X CALL bnk190dd LEAS 2,S RTS addr9928 CLR $0400 LDD $24 SUBD $28 IF EQ CALL bnk1975a,#-1 STD $24 CALL- LOOP LDD ,S BEQ addr9af6 ADDD #-1 STD ,S CLRA LDB [3,S] STB 5,S LDD 3,S ADDD #1 ST- addr98d3 fdb addr9928 fdb addr98d8 addr996c fdb bnk1904c fdb addr9908 fdb addr990c fdb addr990c fdb addr990c fdb addr990c fdb addr990c fdb addr990c -DD #-2 STD 3,S addr9adb LDB 5,S UNTIL NE CLRA LDB 2,S STB [3,S] LDD 3,S ADDD #1 STD 3,S CLRA LDB 5,S ADDD #-1 STB 5,S- CLR 3,S LOOP CLRA LDB 3,S ADDD #1 STB 3,S CMPB #$1f QUIF CC LDB [,S] CMPB 2,S QUIF NE - ,S ADDD 9,S STD 2,S SUBD $a0 IF LS LDD 2,S SUBD ,S BCC addr9b38 ENDIF CALL $b003 addr9b38 LDD ,S SUBD 5,S PSHS D LDD 7. LEAS -4,S LDD $28 LDX $28 ADDB ,X ADCA #0 STD 2,S LDD 4,S ADDD 8,S STD ,S LDD 2,S SUBD 4,S PSHS D CALLN $b04b,(4,S),(6,S- CALL $b045,#$0400 PSHS D LDD 2,S ADDB 5,S ADCA #0 SUBD #$0400 PSHS D LDD 2,S SUBD ,S PULS X PULS X ADDD #1 PSHS D LD-8eb LDB #$01 STB $b7 RTS addr98f0 CLR $b7 addr98f2 RTS addr98f3 LDX #addr98f2 ADDD #$ff7e BLT addr9920 CMPB #$09 BHI addr9920 LDX #addr9958 BRA addr991c ad- CALL $b04b,#$0400 LEAS 4,S LDD $24 ADDB 3,S ADCA #0 STD ,S CLRA LDB 3,S STB [,S] LEAS 4,S RTS bnk19a6c LEAS -6,S CLRA - bnk190dd ENDIF CALL bnk1915d CALL bnk197d9 JMP bnk1919b addr9945 LDD $24 SUBD $26 IF NE LDD $24 SUBD $28 IF NE CALL bnk196b5 -D 3,S LDB 5,S CMPB #' ' UNTIL CS LDD ,S ADDD #-1 STD ,S CLRA LDB [3,S] STB 2,S LDD 3,S ADDD #1 - fdb addr990c fdb addr9361 fdb addr931b fdb bnk1904c fdb addr9361 bnk19986 LEAS -4,S LDD #$0400 STD ,S LOOP addr998d CLRA LDX ,S LDB ,X - BRA addr9adb addr9af6 CLR [3,S] LEAS 6,S RTS addr9afc PSHS D LOOP LDD 4,S QUIF EQ LDB #' ' STB [,S] LDD ,S ADDD #1 . Errors 0 $0221 ; Length Import BNK1904C 463(both) Import BNK197A1 454(both) Import BNK19119 382(both) Import BNK09ADA 473(both),370(both) Import BNK09604 410(both),360(both) Import BNK09B50 333(both) Import BNK09A81 301(both) Import BNK191BD 375(both),27. ) LEAS 4,S LDD $28 SUBD 8,S STD $28 LDD $30 SUBD 8,S STD $30 LEAS 6,S RTS bnk19b8e LEAS -3,S CLR 2,S LDD #bnk19852 LOOP . port BNK093AF 173(both) Import BNK0939E 171(both) Import BNK0937E 169(both) Import BNK09378 167(both) Import BNK09371 165(both) Import BNK09355 163(both) Import BNK0935B 159(both) Import BNK290C3 157(both) Import BNK29000 155(both) Import BNK0934F 153(bo. Errors 0 $0281 ; Length Import BNK09CC3 610(both) Import BNK09B50 594(both) Import ___MUL 583(both) Import ___NEG 557(both) Import BNK09A81 580(both),554(both),542(both) Export BNK0983B=$0237 Import SUICIDE_ 459(both) Import BNK19B8E 454(both) Import BNK.232609c604e7e4bd0000202fd6 adc101260d4fe661c30001e761bd000020ede66127114f3406ec643406cc0000bd00003264e7e4e6 e42603bd00004fe6e4326439327ebd0000bd0000cc0000ede4e6f42724cc04003406ec62bd000032 62cc0400bd0000ece43406ec62bd0000e3e43510c3000120d6bd0000326239000.20(both) Import BNK09C0F 37(both) Import BNK1980D 21(both) Export BNK09604=$0000 Object 3406327c4f5fed62dc249326277adc2493282774bd0000cc0400ede40fb6dca83406ec62bd000032 622611ece43406c30001ed623510e684273920e0e665270fece48d49ede4ec62c30001ed6220cdec 6883.6234064fe666bd00003262e3e43510ed63cc0001bd0000dd2420d4ec633406ec6234064fe6 668d673262e3e43510ed63ec65bd0000dd24ec632703bd0000ec633406cc000ebd00003262326739 327edca6ede4d6acc12f272ac125260dbd0000d6acc1262604c680d7acd6ac2715ece43406c30001 ed624fd6ac3510e78.e4a3642710ece4c3ffffede4ec62c3ffffed6220e4326639bd0000 d6acc12a2610bd0000cc0001bd0000dd2ebd000020418d4edd2ed6acc12c260bdcb2dd24bd00008d 3d202cc15e2613bd0000dc2edd30dd24ccffecbd0000dd2e2017c126260fbd0000dc2edd24cc0014 bd00002002dc2edd30dcb2dd24bd000027037x00202fd6acc12f2627bd0000dc24a364 270cece4bd0000dd24bd000027eedc24a3642613dcb2dd24cc0006bd00002007ece4bd0000dd2432 6239 dcb2dd24bd00008d 3d202cc15e2613bd0000dc2edd30dd24ccffecbd0000dd2e2017c126260fbd0000dc2edd24cc0014 bd00002002dc2edd30dcb2dd24bd000027037.Errors 0 $0546 ; Length Import BNK19743 1344(both) Export BNK09DAF=$0529 Import BNK1904C 1318(both) Import BNK196BE 1313(both) Import BNK1919D 1304(both) Import BNK196B5 1301(both) Export BNK09D83=$04fd Import BNK198C7 1272(both) Import BNK1917C 1265(bot.2(both) Import BNK197D9 267(both) Import BNK19743 424(both),262(both) Import BNK196B5 256(both) Import BNK191C3 244(both) Import BNK190DD 350(both),224(both) Import BNK09ABF 330(both),217(both) Import BNK290CB 199(both) Import BNK09DAF 197(both) Import B. STD ,S LDX ,S LDB ,X CMPB #$39 QUIF EQ CLRA LDB 2,S ADDB ,X ADCA #0 STB 2,S LDD ,S ADDD #1 E.th) Export BNK09479=$0097 Import BNK190C1 146(both) Import LENGTH_ 134(both) Import BNK19081 125(both) Import COPYSTR_ 117(both) Import BNK19076 98(both) Import BNK09AB6 339(both),151(both),95(both) Import BNK09990 84(both) Import TABLELOO_ 73(both) Impo.197C0 525(both),378(both) Import BNK197A1 373(both) Import BNK09995 551(both),539(both),530(both),501(both),485(both),431(both), 408(both),397(both),367(both) Import BNK09981 358(both) Export BNK09769=$0165 Import BNK09ABF 628(both),324(both) Import BNK1.000000000000000 0000c9000000000000000000000000000000000000000000000000000000000000005c0000000000 00d6ac2702204adc2e93302706cc0004bd0000dc2edd24bd0000dc2493262706dc24932826013932 7e0fb7bd0000ede42c1883fffd2710bd0000ccffffbd0000dd24bd00002003bd0000c601d7b7.0001260dece48d33ec62c30001ed622010ece4c30001ede4ec68c3ffffed6820a9ec622711bd 0000ccffffbd0000dd24bd0000bd0000ec623266393406327cdca6ede4aee4e6842738c180262dcc 0078d3a634064fd6b6c3ffff3406ec648d5732644fd6b63406ec623406ec68bd00003264ece4dbb6 890020c7ece4c30%4bd000020d06ff4c12f2603bd0000326239 dc1032607bd0000ede4200dd6acc12a2607bd0000c6ffe762 d6acc12f2706cc0007bd0000bd0000bd01e0bd0000dc2edd249330261ebd0000ece434064fe664bd 000032622608cc000dbd00002067bd00002062dcb2bd0000ed65dc2493282726dc2493302720ec63 3406ec.e000039d6adc1032706d6acc12f2606dc26dd242007 c12b260cbd0000dc283406cc0001200ec12d2610bd0000dc263406ccffff8d3732622010c12e2709 c1242608bd0000dd24bd0000d6acc12b2608bd0000bd0000200dc12d2609bd0000bd0000bd0000bd 0000dd24dc24393406d6adc103260cece43406bd0000bd00.04ab Import BNK19852 1170(both) Import BNK09050 1140(both) Export BNK09CF7=$0471 Import BNK1980D 1091(both) Export BNK09CC3=$043d Export BNK09C0F=$0389 Import LENGTH_ 866(both) Export BNK09B50=$02ca Export BNK09B36=$02b0 Import COPYSTR_ 696(both),670(bot.h) Import BNK1919B 1253(both) Import BNK197D9 1250(both) Import STREQ_ 1243(both) Import ___NEG 1225(both) Import BNK191C3 1218(both) Import BNK1915D 1215(both) Import BNK190DD 1326(both),1286(both),1212(both) Import BNK1975A 1207(both) Export BNK09D31=$.NK093C5 195(both) Import BNK2974D 191(both) Import BNK093C0 189(both) Import BNK093BB 187(both) Import BNK293E1 185(both) Import BNK29630 183(both) Import BNK29663 181(both) Import BNK2970D 179(both) Import BNK29179 177(both) Import BNK291BB 175(both) ImNDLOOP CLRA LDB 2,S ADDD #$ff03 STB 2,S CLRA LDB 2,S LEAS 3,S RTS ,S RTS bnk19b8e LEAS -3,S CLR 2,S LDD #bnk19852 LOOP .rt BNK0918F 101(both),70(both) Import BNK09995 541(both),530(both),497(both),314(both),54(both),35(both) Import BNK09981 3(both) Export BNK093E2=$0000 Reloc 0,336(both),0,193(both),0,161(both) Object 327cbd00006fe4dcaac3ffffed626f61d6ac2606c616e7e4203cc1.904C 318(both) Import COPYSTR_ 282(both) Import LENGTH_ 301(both),214(both) Import COPY_ 255(both),192(both) Import BNK197D9 134(both) Import BNK09990 131(both) Import BNK19743 635(both),605(both),560(both),441(both),420(both),126(both) Import BNK196B5 1.3262 3932794f5fed63cc0001ede46f62d6adc1032607bd0000ede4200dd6acc12a2607bd0000c6ffe762 d6acc12f2706cc0007bd0000bd0000bd01e0bd0000dc2edd249330261ebd0000ece434064fe664bd 000032622608cc000dbd00002067bd00002062dcb2bd0000ed65dc2493282726dc2493302720ec63 3406ec.00120c0dca6bd0000ed62cc0078c304003406ec64d0b682003406ec68dbb68900 8d173264ec623406ec663406dca6bd00003264ec64e36220593406327cec682c0fec64e3683406ec 66bd000032622042ec682602203cec643406ec66bd0000e3e43510ede4e368ed62a36a2309bd0000 cc0011bd00004fe6f4e7f802ec/h) Export BNK09B1C=$0296 Import PUTNL_ 657(both) Import PRINTF_ 652(both) Import BNK193CE 635(both) Import SUICIDE_ 591(both) Export BNK09ADA=$0254 Export BNK09ABD=$0237 Export BNK09AB6=$0230 Import ___MUL 536(both) Export BNK09A81=$01fb Import COPY_ 488/ 06572616e64002100496c6c6567616c206c696e65 2072616e676500496c6c6567616c2073656172636820737472696e67005365617263682073747269 6e67206e6f7420666f756e640053656172636820737472696e67207265717569726564004e6f2073 656172636820737472696e6720646566696e6564004e6f2066/ Errors 0 $0831 ; Length Import PUTNL_ 2073(both) Import TABGET_ 1872(both) Export BNK2974D=$074d Import SCRATCHF_ 1851(both) Export BNK2970D=$070d Import RENAMEF_ 1785(both) Export BNK29663=$0663 Import MOUNT_ 1630(both) Export BNK29630=$0630 Import BNK1/ 032605bd 010f20314fe684c30001e78420d93406aee4ec01ddaa201a3406aee4ec01eb848900ddaae603270a 9eaae184260430019faabd010f20673406327e4fe6f802ede48300282f05cc0028ede4ece43406ec 683406ae66ec01bd00003264ece4e36634064f5f3510e784326439327ed6adc1032709dcb2dd24cc 00/ 3E1=$03e1 Import ERRORMSG_ 884(both) Import ERRORF_ 1272(both),1239(both),875(both) Import BNK190C1 825(both) Import DIRCLOSEF_ 818(both) Import BNK19081 809(both) Import FPUTREC_ 784(both) Import LENGTH_ 772(both) Import DIRREADF_ 753(both) Import BNK19/2a263cec6193a82606cc0005bd0239ec61c3ffffed614fe6f801e763 ec613406c30001ed63cc00dd3510e784ec613406c30001ed634fe6653510e784c6de214fe763ec61 3406c30001ed634fe6653510e7847e02d5ec6193a8260fdca8bd00002617cc0008bd0239200fec61 3406c30001ed634f5f3510e784d6ace1e42/h),1597(both),1112(both),705(both),404(both) Import BNK099CC 1890(both),1339(both),563(both),462(both),401(both) Export BNK29179=$0179 Import BNK09ABD 861(both),387(both),372(both) Import SUFFIXST_ 921(both),351(both) Import CLOSEF_ 1318(both),1313(both)/71fece43406c30001ed6235 10e684c1bd26e9ecf4830000270bece4c3000220d96f622004c6ffe7624fe662326339327edc2493 282608ccffffbd0000dd24bd0000bd0000bd0000ede42c05bd0000ede4830003271ecc05453406cc 0400bd00003262260fbd0000bd0000ece483000d260720cebd00002005ece4bd0000/8(both),0,1863(both),0,1799(both),0,1711(both),0,1633(both),0,1575(both), 0,1548(both),0,1532(both),0,1306(both),0,1288(both),0,1207(both),0,1177(both), 0,1166(both),0,1136(both),0,1075(both),0,918(both),0,905(both),0,702(both), 0,693(both),0,663(both),0/(both) Export BNK09A4D=$01c7 Export BNK09A2E=$01a8 Export BNK09A24=$019e Export BNK09ABF=$0239 Export BNK099CC=$0146 Export BNK099BA=$0134 Import ISDIGIT_ 295(both) Import ISALPHA_ 283(both) Export BNK09990=$010a Export BNK09995=$010f Export BNK09981=$00/03a52015ece48d33261fbd0000d73f270fcc04003406cc03a7bd000032622009 dcb4c30001ddb420c8ece4bd0146ec62bd0000dd24bd00003264393406327b4f5fed61cc0400ddaa ec65bd0000e7e4ec65bd0000262ce6e4c10d271fc10a271b9eaa341030019faa4fe6623510e784ec 61c30001ed618300782dcdec65b/696c65206e616d6500257300257320 2d202573202564002564004e6f7420666f756e64002564206f6363757272656e636573206368616e 676564002573202d202573004d656d6f72792066756c6c005265706c6163696e6720737472696e67 20746f6f206c6f6e670000d6acc1202704c10926048d0820f239cc0400dda/9814 1565(both) Import PRINTF_ 2051(both),1578(both),1551(both) Import GETDATE_ 1543(both) Import BNK193CE 2030(both),1535(both) Import BNK09A2E 2019(both),1529(both) Import SETDATE_ 1512(both) Import COPY_ 1472(both) Import SETTIME_ 1431(both) Import BN/018d2d4f5fede4ece43406cc000abd0000dbac8900c3ffd0ede4bd010fd6adc10327e4ece42021 d6ac2704cc000121393406ec683406ec683406ec6834064fe6678d083266bd00003262393406327e cc0000ede44fe663c3ffffe7632713ece43406c30001ed623510e68426f1e6f426e3bd0000ec6a34 06ec6a3406ec6/076 743(both) Import DIROPENF_ 717(both) Import BNK099BA 1815(both),1742(both),1675(both),1645(both),1594(both),1109(both), 1039(both),1006(both),639(both) Import STREQ_ 1725(both),1089(both),619(both),539(both) Import ZUPSTR_ 1708(both),1072(both),602(b/603bd010f3264393406327c6f61ec683406c30001ed6a 35104fe684e7e42740c1da2607ec648304002007c1db2609e6f8041026008020d6c1dd2610e6f808 c1de27cbec68c30001ed6820f0c1de2634d6b6ed62ec683406ec668dac32622706c6ffe7612050ec 62d7b6ec68c3ffffed6834063510e684c1dd26efec68c3/,832(both),331(both) Import OPENF_ 1191(both),1150(both),677(both),305(both) Import FPRINTF_ 252(both) Import BNK1980D 237(both) Export BNK290CB=$00cb Export BNK290C3=$00c3 Import BNK09990 188(both) Import EOF_ 1225(both),760(both),130(both) Import FGETC326239dc2edd 2493302615bd0000dc249328271adc2493262714bd00007e0000dc303406dc2ebd000032627e0000 39dc2edd24bd0000dc249330270edc2493282708cc0001bd000020e7392e00 406ec62bd03893262e762260fece43406c30001 ed623510e68426e2bd02b04fe662326339327dcc0000ede4e6f4c1392/ ,605(both),0,525(both),0,348(both),0,318(both), 0,259(both),0,245(both),0,206(both),0,174(both),0,92(both),0,71(both), 0,48(both),0,6(both),0,3(both) Object 327ccc03a3bd011eede42759dc24bd0000ed62dc2493282608ccffffbd0000dd24bd0000270ec602 d73fcc04003406cc/fb Reloc 0,1235(both),0,1129(both),0,1105(both),0,1088(both),0,1077(both),0,900(both), 0,874(both),0,855(both),0,785(both),0,743(both),0,726(both),0,601(both), 0,548(both),0,451(both),0,400(both),0,322(both) Object 53617920776861743f004d697373696e67206f7/d03642003cc0002ed639eaa6f84bd0000ec63326739dc26dd2edc 28dd30327ecc03b48d4cede42746dc2edd2493262608cc0001bd0000dd24dc2493282728bd0000cc 04003406cc03b63406ec64bd00003264ece4bd0364260ddcb4c30001ddb4dc24933026cadcb2dd24 ece48d2a20673406327e4f5fddb40f3f8d5eec/a4f9eaae684d7ac3001 9faabd00002704c601200e4fd6acbd00002704c6032002c602d7ad393406ece48d0ce6f42654cc00 02bd0239207f34064f5faee4ed016f846f03d6ac276f8da3dcaac3ffffaee4ed01d6acc1272704c1 22260eec01c30001ed014fd6ace7038d96d6ac2748c1202606aee4e603273ed6acaee4e1/K09995 1403(both) Import BNK09A81 1917(both),1382(both) Import GETTIME_ 1371(both) Import BNK09A24 1908(both),1445(both),1357(both) Export BNK2952C=$052c Import FPUTCHAR_ 1258(both) Import FPUTNL_ 1246(both) Import EOR_ 1265(both),1232(both) Export BNK29/a3406ec66bd00003266bd0000326439dca43406cc0400bd000032624fd6acd7b0d6 add7b1dcaaddae39cc04003406dca4bd000032624fd6b0d7acd6b1d7addcaeddaa39327c4fd6ace7 e4dca8ed61bd010fd6ace1e4277bd6ac2777c125265dbd010fd6acc15e2604c6da204fc1242604c6 db2047c12e2604c6dc203fc1/oth),522(both) Export BNK291BB=$01bb Import BNK09ABF 438(both) Import BNK09A4D 1837(both),1764(both),1694(both),1664(both),1616(both),1131(both), 1058(both),1025(both),658(both),588(both),508(both),481(both), 424(both) Import BNK09AB6 1818(both),1745(bot/0001ed68208ae6f8042602202be6e4c1dc 2609ec64c30001ed642011ec643406c30001ed663510e6e4e184260b4fd6b6c30001d7b67e038f4f e661326639327dbd0296bd0000cc0400ede4dca83406ec62bd03893262e762260fece43406c30001 ed623510e68426e2bd02b04fe662326339327dcc0000ede4e6f4c1392/HAR_ 1218(both),123(both) Import BNK1904C 102(both) Import BNK197A1 97(both) Import COPYSTR_ 908(both),74(both) Import BNK197E4 59(both) Import TBREAK_ 34(both) Import BNK1975A 226(both),29(both) Import BNK19719 15(both) Export BNK29000=$0000 Reloc 0,2040623406dca2bd00003262ede4dca23406ec62bd0346 3262ece420723406ece4bd0000d63f26058e04006f84cc04003406cc03bbbd00003262dcb43406cc 04003406dca23406cc000bbd00003268398d0ddca23406cc000abd0000326239327c1f4134103506 bd0000bd0000e6e42712dca234061f41c6023a34103506bd00 6bd000032 62ed621f41c6313a3410ec64bd03463262ec6226037e0342bd00001f41c6083a34103506bd0000ed e41f41c6083a3410ec628d6a3262ece42759ec622603bd0000cc04003406ec62bd00003262ece4bd 00002633ec622725cc0400bd00003406cc04003406ec66bd000032641f41c6313a3410ec648d2732 60 Bank 0 edit1.b09 = 9000 - 914a . 014b edit2.b09 = 914b - 93e1 . 0297 edit3.b09 = 93e2 - 9603 . 0222 edit4.b09 = 9604 - 9885 . 0282 edit5.b09 = 9886 - 9dcc . 0547 44 Auto Load Vectors 9dcd - 9ed4 . 0108 Length of Module = 0ed5 Bank 1 0 73a34103506bd000032621f41c6323a34103506bd0000cc081e34061f 41c6343a34103506bd000032622710e668260c1f41c6053a34103506bd0000bd00001f41c6323a34 101f41c6073a34103506bd00003262cc082134061f41c60b3a34103506bd00003262ed611f41c609 3a3410ec63bd03463262ec6110270090cc0 EXPORT BNK29000 = $9000 - 2 EXPORT BNK290C3 = $90c3 - 2 EXPORT BNK290CB = $90cb - 2 EXPORT BNK29179 = $9179 - 2 EXPORT BNK291BB = $91bb - 2 EXPORT BNK293E1 = $93e1 - 2 EXPORT BNK2952C = $952c - 2 EXPORT BNK29630 = $9630 - 2 EXPORT BNK29663 = $9663 - 2 EX03506bd000020541f41c6043a 34103506bd00004fe664e763c10b2304c60be76334061f41c60e3a3410ec69bd000032644fe66334 061f41c60e3a34103506e3e4351034064f5f3510e7841f41c60c3a34103506bd0000c6ffe7e8191f 41c6043a34103506bd00007e0531bd0000e6e819270dbd00003406cc0825bd000030 BNK191C9 = $91c9 - 1 EXPORT BNK1975A = $975a - 1 EXPORT BNK193AC = $93ac - 1 EXPORT BNK193CE = $93ce - 1 EXPORT BNK1980D = $980d - 1 EXPORT BNK196B5 = $96b5 - 1 EXPORT BNK196BE = $96be - 1 EXPORT BNK19852 = $9852 - 1 EXPORT BNK19743 = $9743 - 1 EXPORT B03932e8d31f4134103506bd0000bd00001f41c6043a34101f41c6023a34103506bd000032 621f41c6043a34103506bd00001f41c6043a34104f5fbd034632e82f393277bd0000ede46f646f62 1f41c6053a34103506bd0000e665102700831f41c6053a34103506bd0000d6adc103265dbd0000e7 63c15023026f63e16420A2E = $9a2e - 0 EXPORT BNK09A4D = $9a4d - 0 EXPORT BNK09A81 = $9a81 - 0 EXPORT BNK09AB6 = $9ab6 - 0 EXPORT BNK09ABD = $9abd - 0 EXPORT BNK09ADA = $9ada - 0 EXPORT BNK09B1C = $9b1c - 0 EXPORT BNK09B36 = $9b36 - 0 EXPORT BNK09B50 = $9b50 - 0 EXPORT BNK09C0000032629ea2e6842606cc0009bd0000 32643932e8a64f5fed620f3f1f41c6043a34103506bd00001f41c6083a34101f41c6063a34103506 bd00003262e664102700d51f41c6313a34101f41c6063a34103506bd000032621f41c6313a341035 06bd0000cc03d034061f41c6333a34103506bd000032622708e66726046f0= $93e2 - 0 EXPORT BNK09479 = $9479 - 0 EXPORT BNK0914B = $914b - 0 EXPORT BNK0918F = $918f - 0 EXPORT BNK0934F = $934f - 0 EXPORT BNK09355 = $9355 - 0 EXPORT BNK0935B = $935b - 0 EXPORT BNK09371 = $9371 - 0 EXPORT BNK09378 = $9378 - 0 EXPORT BNK0937E = 02d63f2006cc0400bd0000260220baece4bd0000ec622603bd0000ec622703bd000032e85a393406 ece48d18d63f2711cc04003406ec663406cc000fbd000032643262393406327eec62bd0000d73f27 2cec62bd0000ede42709cc04003406ec622008cc04003406cc03d5bd00003262cc04003406cc03df bd000032624f bank1.b09 = 9000 - 9bbc . 0bbd 3 Auto Load Vectors 9bbd - 9bce . 0012 Length of Module = 0bcf Bank 2 bank2.b09 = 9000 - 9831 . 0832 22 Auto Load Vectors 9832 - 98b5 . 0084 Length of Module = 08b6 zhA-:4A:45n2bA-:4A:450082334061f41c6343a34103506bd00003262ed631f41c6 323a3410ec65bd03463262ec632764ec61bd0000e7e4ec61bd00002651ec61bd0000270eec61bd00 002623ec63bd0000200c4fe6e43406ec65bd00003262ec61bd000027caec63bd0000260220c11f41 c6093a3410ec63bd03463262d63f260e1f41c6323a3410PORT BNK2970D = $970d - 2 EXPORT BNK2974D = $974d - 2 EXPORT BNK19000 = $9000 - 1 EXPORT BNK19021 = $9021 - 1 EXPORT BNK1904C = $904c - 1 EXPORT BNK1905C = $905c - 1 EXPORT BNK19076 = $9076 - 1 EXPORT BNK19081 = $9081 - 1 EXPORT BNK190C1 = $90c1 - 1 EXPO02621f41c60c3a 34103506bd00001f41c60c3a3410cc0829bd000032e81c3932e8d31f4134103506bd0000bd00001f 41c6043a34101f41c6023a34103506bd000032621f41c6043a34103506bd00007e073d32e8aa1f41 34103506bd00001f41c6043a34101f41c6023a34103506bd000032621f4134103506bd00001f410NK197A1 = $97a1 - 1 EXPORT BNK197C0 = $97c0 - 1 EXPORT BNK197D9 = $97d9 - 1 EXPORT BNK197E4 = $97e4 - 1 EXPORT BNK19814 = $9814 - 1 EXPORT BNK198C7 = $98c7 - 1 EXPORT BNK19986 = $9986 - 1 EXPORT BNK19B19 = $9b19 - 1 EXPORT BNK19A6C = $9a6c - 1 EXPORT BNK03224fe6625849e3e434064fe665c3ffff3510ed844fe662c30001e7624fe6 63e764202c4fe662e763c10924234f5849e3e434064fe665c300015849e36234063510ec843510ed 844fe663c3000120d71f41c6053a34103506bd0000e662c1091023ff6bbd00006f62e662c1092220 ecf4c300013406cc082ebd000032620 F = $9c0f - 0 EXPORT BNK09CC3 = $9cc3 - 0 EXPORT BNK09CF7 = $9cf7 - 0 EXPORT BNK09D31 = $9d31 - 0 EXPORT BNK09D83 = $9d83 - 0 EXPORT BNK09DAF = $9daf - 0 EXPORT BNK09604 = $9604 - 0 EXPORT BNK09769 = $9769 - 0 EXPORT BNK0983B = $983b - 0 EXPORT BNK093E2 068204c1f41c6043a3410 3506bd0000e664102700851f41c6313a34101f41c6063a34103506bd000032621f41c6313a341035 06bd0000cc03d034061f41c6333a34103506bd000032622710e667260c1f41c6043a34103506bd00 001f41c6313a34101f41c6063a34103506bd00003262cc03d334061f41c6333a3410350$937e - 0 EXPORT BNK0939E = $939e - 0 EXPORT BNK093AF = $93af - 0 EXPORT BNK093BB = $93bb - 0 EXPORT BNK093C0 = $93c0 - 0 EXPORT BNK093C5 = $93c5 - 0 EXPORT BNK09050 = $9050 - 0 - 0 EXPORT BNK09769 = $9769 - 0 EXPORT BNK0983B = $983b - 0 EXPORT BNK093E2 0d63f326439720021004d656d6f72792066756c6c2e0077002573256e00204c696e65 73207472616e73666572726564203d00544f005700692f6f206572726f72002e0032e8a51f41c605 3a34103506bd00001f41c6093a34101f41c6073a34103506bd000032621f41c6053a34103506bd00 001f41c6323a34101f41c607"dir" include "disk/1.watlib.exp" org $1000 "dir.b09" bank1.b09!/bank2.b09edit.mod$0edit.map0edit.exp 00ec65bd03463262ec63bd0000ec61bd0000 32e85b39340632e8e81f41c6043a34103506bd0000e664102700bb1f41c6043a34103506bd00001f 41c6083a34103506ede4bd00006f63d6adc1032624bd0000e7624fe7f4ece4c30001ede4d6acc13a 260fbd00004fe663c30001e763c10425d6e663270e1f41c6083a34100RT BNK190DD = $90dd - 1 EXPORT BNK19719 = $9719 - 1 EXPORT BNK19119 = $9119 - 1 EXPORT BNK1915D = $915d - 1 EXPORT BNK1917C = $917c - 1 EXPORT BNK1919B = $919b - 1 EXPORT BNK1919D = $919d - 1 EXPORT BNK191BD = $91bd - 1 EXPORT BNK191C3 = $91c3 - 1 EXPORT0c6 2d3a34101f41c6023a34103506bd000032621f41c62d3a34103506bd0000cc081e34061f41c62f3a 34103506bd00003262270de66326091f4134103506bd0000bd00001f41c62d3a34101f41c6023a34 103506bd000032621f41c62d3a34101f41c6063a34103506bd000032621f41c6043a34104f5fbd03 4632e858019B5A = $9b5a - 1 EXPORT BNK19B8E = $9b8e - 1 EXPORT BNK09981 = $9981 - 0 EXPORT BNK09995 = $9995 - 0 EXPORT BNK09990 = $9990 - 0 EXPORT BNK099BA = $99ba - 0 EXPORT BNK099CC = $99cc - 0 EXPORT BNK09ABF = $9abf - 0 EXPORT BNK09A24 = $9a24 - 0 EXPORT BNK09Yece4c30002ede44fe662c30001e76220dabd0000326939544f 0052005700257320002573256e0025642000 03506bd00001f41c6043a34104f5fbd034632e82f393277bd0000ede46f646f62 1f41c6053a34103506bd0000e665102700831f41c6053a34103506bd0000d6adc103265dbd0000e7 63c15023026f63e16421 Errors 0 $0175 ; Length Import PUTREC_ Import DIRCLOSE_ 177(both) Import CLOSEF_ 171(both) Import FGETCHAR_ 161(both),137(both),127(both) Import EOF_ 119(both) Import PUTNL_ 113(both) Import DIRREADF_ 102(both) Import OPENF_ 86(both) Import DIROPENF_ 541 voO42bOo'&1!  4 2b5 & 4ー2b is42bq4s2bs&q &q' &&ֽq &qso?29Enter specs for directory:Press to continueUnable to1 d 3406cc0114bd00003262fd0171cc011f3406fc0173bd00003262cc011fbd0000bd0000fc0173bd00 00261cfc0171bd0000c120260efc0171bd0000c1032704c12026f2c10326c6cc00d6bd0000fc0171 bd0000c10d26f6fc0171bd0000fc0173bd000010fe016f3f0f3239456e7465722073706563732066 6f7220646ERoot : dir.b09 = 1000 - 1175 . 0176 Length of Module = 0176 ir.mod oot : dir.b09 = 1000 - 1175 . 0176 Length of Module = 0176 ir.mod1;newterm - routine to emulate a terminal with ability to send & recieve files ; ; modified by John A. Toebes - 8 Sept 1983 ; 145 C Jones Franklin Rd ; Raleign N.C. 27606 ; Phone - (919) 851 STD ysto clr control ; loop looptop LDB $eff1 ANDB #$10 ;is the transmit register full? if ne call $dd82 ;get a character from the keyboard tstb if 1o keys act correctly ; on the terminal but can still be translated on output. ;******************************************************************************* ;INCLUDE xref setup_ xref sendfile,getfile,dis1 ;adjust for a word lookup ldx #jmptable jmp [b,x] ;and call the appropriate routine endif else ;not a special key, see if we tran1 else guess ;translate lower case to uppercase if necessary tst alfalock quif eq ;not alpha lock on cmpb #'a' quif lt 1(both) Import GETREC_ 19(both) Import PRINTF_ 155(both),110(both),68(both),8(both) Reloc 0,181(both),0,174(both),0,168(both),0,158(both),0,152(both),0,134(both), 0,124(both),0,116(both),0,107(both),0,99(both),0,94(both),0,91(both), 0,83(both),0,78(both), open directory file '%s'%nKEYBOARDRirectory file '%s'%nKEYBOARDRpen directory file '%s'%nkeyboardRrectory file '%s'9026f2c10326c6cc00d6bd0000fc0171 bd0000c10d26f6fc0171bd0000fc0173bd000010fe016f3f0f3239456e7465722073706563732066 6f722064619726563746f72793a00507265737320d2c5d4d5d2ce20746f20636f6e74696e75650055 6e61626c6520746f206f70656e206469726563746f72792066696c652027257327256e004b455942 4f41524400520069726563746f72792066696c652027257327256e004b4559424f41524400520070 656e206469726563746f1 ne ;control key modifys this character andb #$1f ;so make it a control character endif pshs b ;patch v2.3 endif ST1 STD last endif endif endif endif checkin guess LDB $eff1 ;get the prot status ANDB #$08 ;is there a character qui11-4095 ; v2.0 - added control keys ; added break key ; moved the command keys to the function keypad ; added the alpha lock ; added keyboard translation ; added terminal output 1 ne ;did we get a character if lt ;is it the control key or a function key? clr control ;assume no control key cmpb #$ff ;is it the control key? if 1play,saveterm xdef next,last,ysto,newterm ;******************************************************************************* newterm LDS #$0fff LDD #$0400 STD next STD last clra clrb 1 slate it cmpb #13 if le pshs b ;patch v2.3 ldx #intrnstb ;locate the translate table ldb b,x 1 ;char not lower case cmpb #'z' quif gt andb #$df ;convert to uppercase endguess tst control if 10,75(both),0,65(both),0,35(both),0,32(both), 0,28(both),0,16(both),0,5(both),0,2(both) Object 10ff016fcc00bbbd0000cc004f3406cc011fbd000032624f1f026fa9011f108e011f8e00bba6a427 08a1802604312120f41f203420bd000032623520260c3410cc00efbd000032622069fd0173cc0112e translated character endif tstb quif eq STB [last] call $e1c7,last STD last endguess call display lbra looptop quitloop SWI [72792066696c652027257327256e006b6579626f61726400520072656374 6f72792066696c65202725732739 c0171bd0000c120260efc0171bd0000c1032704c12026f2c10326c6cc00d6bd0000fc0171 bd0000c10d26f6fc0171bd0000fc0173bd000010fe016f3f0f3239456e7465722073706563732066 6f72206461B $eff0 puls b ;patch v2.3 clr control tst duplex if ne STB [last] call $e1c7,last 1f eq LDB $eff0 ;get the character quif eq cmpb #' ' ;do we translate it? if lt ldx #trnstbl ;point to the translate table ldb b,x ;get th1translation ; added full/half duplex selection ; v2.1 - added setup invocation directly ; v2.2 - added ability to save configured terminal ; v2.3 - fixed setup bug ; added non translation for half duplex s1 eq inc control ;set the control key flag else ;it is a function key andb #$0f decb ;normalize for a lookup lslb 2 Errors 0 $0148 ; Length Import SAVETERM 245(both) Import SETUP_ 233(both) Import SENDFILE 184(both) Import GETFILE 178(both) Import DISPLAY 160(both) Export YSTO=$0147 Export LAST=$0143 Export NEXT=$0141 Export NEWTERM=$0000 Reloc 0,270(both),0,268(both)2 Errors 0 $0156 ; Length Import TBREAK_ Import GETCHAR_ Import PUTCHAR_ 159(both) Import DIRCLOSE_ 132(both) Import ERRORF_ 120(both) Import DIRREADF_ 103(both) Import DIROPENF_ 51(both) Import PUTNL_ 179(both),167(both),114(both),26(both) Import GETREC2 f013ef6eff1c410275ebddd825d27582c177f013ec1 ff26057c013e2009c40f5a588e00fa6e95203fc10d2e0934048e0130e68520187d013f270ac1612d 06c17a2e02c4df7d013e2702c41f3404f7eff035047f013e7d0140270de79f0143fc0143bde1c7fd 0143f6eff1c408271ef6eff02719c1202c058e0110e6855d2 end ;turn on/off the local echo swapecho ldb duplex eorb #$01 stb duplex jmp checkin ;receive a file doget jsr getfile jmp checkin ;send a file dosend jsr sendfile jmp checkin 2093410bd00 00351020f339bd0000cc011dbd00967e0086bd0000cc0134bd0096cc01047e00090c446972656374 6f72792070726f6772616d0d46726f6d20436f6d6d6f646f726520427573696e657373204d616368 696e65730d42792045726963204272616e646f6e0d0d4472697665203f20006469736b2f30006469 2 jmp checkin dosave call saveterm jmp checkin ;this table determines what functions each of the function keys will do jmptable fdb checkin ;shift 1 fdb checkin ;shift 2 fdb checkin ;shift 3 fdb KRoot : directory.b09 = 1000 - 1156 . 0157 Length of Module = 0157 206472 697665206e756d6265722e205573652030206f72203100 104cc20003406fc3100bd00003506cc2000bd0096bd0000fc3100bd 00001083000226bcfc3100bd0000cc00013406cc2000bd000035067eff801f01e680272,$0c,$0d,$0e,$0f fcb $10,$11,$12,$13,$14,$15,$16,$17,$18,$19,$1a,$1b,$1c,$1d,$1e,$1f ;this is the keyboard translate table for all the special keys. intrnstb fcb $00,$01,$02,$03,$04,$05,$06,$07,$08,$09,$0a,$0b,$0c,$0d control rmb 1 alfa oot : directory.b09 = 1000 - 1156 . 0157 Length of Module = 0157 206472 697665206e756d6265722e205573652030206f72203100 104cc20003406fc3100bd00003506cc2000bd0096bd0000fc3100bd 00001083000226bcfc3100bd0000cc00013406cc2000bd000035067eff801f01e680272W1 40500&~21&'m111&4 51 415 1&14 5~' 45 9~4~ Directory program From Commodore Business Machines By 2,0,266(both),0,264(both),0,262(both),0,260(both), 0,258(both),0,256(both),0,254(both),0,252(both),0,250(both),0,248(both), 0,242(both),0,221(both),0,198(both),0,195(both),0,190(both),0,187(both), 0,181(both),0,175(both),0,172(both),0,167(both),0,157(both2_ 143(both),84(both),21(both) Reloc 0,191(both),0,188(both),0,185(both),0,182(both),0,176(both),0,173(both), 0,170(both),0,111(both),0,48(both),0,39(both),0,36(both),0,10(both), 0,7(both) Object cc0000fd3104cc00c1bd0096cc00093406cc3000bd00003506bd0000fc32270de79f0143fc0143bde1c7fd0143bd 000016ff703ff60140c801f701407e007abd00007e007abd00007e007af6013fc801f7013f7e007a f6eff21f98ca0cf7eff28e3000301f26fcb7eff27e007a9ea0dca23416cc0001bd00003516dda29f a07e007abd00007e007a007a007a007a00f400df00c800a600b100b700b2;turn on/off the alpha lock swapalfa ldb alfalock eorb #$01 stb alfalock jmp checkin ;transmit a break for approximately 300 ms. dobreak ldb $eff2 tfr b,a orb #$0c stb $eff2 736b2f310043616e6e6f74206f70656e206469726563746f72790d00496e636f7272656374206472 697665206e756d6265722e205573652030206f72203100 104cc20003406fc3100bd00003506cc2000bd0096bd0000fc3100bd 00001083000226bcfc3100bd0000cc00013406cc2000bd000035067eff801f01e680272 dosave ;shift 4 fdb dosetup ;shift 5 fdb dobreak ;shift 6 fdb swapecho ;shift 7 fdb doget ;shift 8 fdb dosend ;shift 9 fdb swapalfa ;shift 0 fdb quitloop ;shift . ;t2 October 1, 1983 Note to John: The dir.mod you put on disk crashes for me whenever used. I don't remember which of two directory-from-menu programs I sent you (I suspect a Canadian one which doesn't stop scrolling)clock fcb 0 duplex fcb 1 next rmb 2 last rmb 2 temp rmb 2 ysto rmb 2 the terminal screen ;note line feed after carriage return is done by making the entry a zero. trnstbl fcb $00,$01,$02,$03,$04,$05,$06,$07,$08,$09,$00,$0b2oth my SuperpPETs--old three-board and new two-board. Only one thing to remember: you scroll it with only. The STOP key screws things up. Brandon (whoever he is) did a nice job. Since this one is up and running, I haven't horsed around with yofEric Brandon Drive ? disk/0disk/1Cannot open directory Incorrect drive number. Use 0 or 1rectory.b092directory.map2directory.exp2),0,151(both), 0,148(both),0,139(both),0,120(both),0,114(both),0,111(both),0,105(both), 0,102(both),0,88(both),0,73(both),0,66(both),0,53(both),0,44(both), 0,37(both),0,19(both),0,16(both),0,11(both),0,8(both) Object 10ce0fffcc0400fd0141fd01434f5ffd01477200881302606cc010f7e00 32813110260083cc0116bd00001027006dfd3100fc3104c30001fd3104108300182613cc00013406 cc2000bd00003506cc0000fd3104cc20003406fc3100bd00003506cc2000bd0096bd0000fc3100bd 00001083000226bcfc3100bd0000cc00013406cc2000bd000035067eff801f01e68027{d00a50001020304050607 0809000b0c0d0e0f101112131415161718191a1b1c1d1e1f000102030405060708090a0b0c0ddd00 01e48d2a2067340632 2d 06c17a2e02c4df7d013e2702c41f3404f7eff035047f013e7d0140270de79f0143fc0143bde1c7fd 0143f6eff1c408271ef6eff02719c1202c058e0110e6855d2ldx #$3000 loop leax -1,x until eq sta $eff2 jmp checkin dosetup ldx $a0 ldd $a2 pshs d,x call setup_,#1 puls d,x std $a2 stx $a0 _ur version. Thanks for the kind thought anyway. Dick orks, and which scrolls only a screenful at a time. I also enclosed the .asm and .cmd files (and the stuff they generate) for your reference. It works fine on b2his is the translate table for all input characters comming in from ;the serial port and going to the terminal screen ;note line feed after carriage return is done by making the entry a zero. trnstbl fcb $00,$01,$02,$03,$04,$05,$06,$07,$08,$09,$00,$0b2. In any event, there's one on the returned disk (directory.mod) written at Commodore which works, and which scrolls only a screenful at a time. I also enclosed the .asm and .cmd files (and the stuff they generate) for your reference. It works fine on b"newterm2.4" org $7000 include "disk/1.watlib.exp" export setup_ = $ad48 "newterm2.4.b09" "openfile.b09" "sendfile.b09" "getfile.b09" "scrolls.b09" "display.b09" "saveterm.b09" ;this must be the last file sm2newterm2.3.b093 1 ;newterm - routine to emulate a terminal with ability to send & recieve files 2 ; 3 ; modified by John A. Toebes - 8 Sept 1983 4 3 endc 21 jsr \0 22 ifne pcount__ 23 leas pcount__,s 24 endc 3 ; added keyboard translation 12 ; added terminal output translation 13 ; added full/half duplex selection 14 3 LDD #$0400 30 0007 FD 01 45 STD next 31 000A FD 01 47 STD last 32 000D 4F clra 33 000E 5F clrb 34 000F FD 01 4B 3mitted. 20 ;******************************************************************************* 21 ;INCLUDE 1 call macr ;call a system procedure 23 jsr $dd82 41 001F 5D tstb 42 0020 27 5C if ne ;did we get a character 43 0022 2C 17 if lt ;is it the control key or a funct34 11 pshs d 12 endc 13 ldd \3 14 pshs d 15 3 50 0032 5A decb ;normalize for a lookup 51 0033 58 lslb ;adjust for a word lookup 52 0034 8E 00 FE ldx 3 ;not a special key, see if we translate it 57 003B C1 0D cmpb #13 58 003D 2E 09 if le 59 003F 34 04 ps3 else 63 guess ;translate lower case to uppercase if necessary 64 0048 7D 01 43 tst alfalock 65 004B 27 0A quif 3 ; 145 C Jones Franklin Rd 5 ; Raleign N.C. 27606 6 ; Phone - (919) 851-4095 7 ; v2.0 - added c3 25 endm 22 23 xref setup_ 24 xref sendfile,getfile,display,saveterm 25 3 ; v2.1 - added setup invocation directly 15 ; v2.2 - added ability to save configured terminal 16 ; v2.3 - fixed setup bug 17 ; add3 STD ysto 35 0012 7F 01 42 clr control 36 ; loop 37 0015 F6 EF F1 looptop LDB $eff1 38 0018 C4 10 ANDB #$10 ;is the transmit 3 pcount__ set 0 3 ifnc .,\1. 4 ifnc .,\2. 5 pcount__ set 2 6 3ion key? 44 0024 7F 01 42 clr control ;assume no control key 45 0027 C1 FF cmpb #$ff ;is it the control key? 46 0029 26 05 if eq 3 endc 16 ldd \2 17 pshs d 18 endc 19 ldd \1 20 3 #jmptable 53 0037 6E 95 jmp [b,x] ;and call the appropriate routine 54 endif 55 0039 20 43 else 56 3 hs b ;patch v2.3 60 0041 8E 01 34 ldx #intrnstb ;locate the translate table 61 0044 E6 85 ldb b,x 62 0046 20 18 4 eq ;not alpha lock on 66 004D C1 61 cmpb #'a' 67 004F 2D 06 quif lt ;char not lower case 68 0051 C1 7A cmpb #'z' 3ontrol keys 8 ; added break key 9 ; moved the command keys to the function keypad 10 ; added the alpha lock 11 3 xdef next,last,ysto,newterm 26 27 ;******************************************************************************* 28 0000 10 CE 0F FF newterm LDS #$0fff 29 0004 CC 04 003ed non translation for half duplex so keys act correctly 18 ; on the terminal but can still be translated on output. 19 ; v2.4 - mod to not EOL on screen when ESC key is trans3register full? 39 001A 27 62 if ne 40 call $dd82 ;get a character from the keyboard 0000 +pcount__ set 0 001C BD DD 82 + 3 ifnc .,\3. 7 pcount__ set 4 8 ifnc .,\4. 9 pcount__ set 6 10 ldd \3 47 002B 7C 01 42 inc control ;set the control key flag 48 002E 20 09 else ;it is a function key 49 0030 C4 0F andb #$0f 4 07 call $e1c7,last 0000 +pcount__ set 0 009A FC 01 47 + ldd last 009D BD E1 C7 + jsr $e1c7 108 00A0 FD 01 47 4 9F A0 stx $a0 154 00F5 7E 00 7E jmp checkin 155 156 dosave call saveterm 0000 +pcount__ set 0 00F8 BD 004 69 0053 2E 02 quif gt 70 0055 C4 DF andb #$df ;convert to uppercase 71 endguess 72 0057 7D 01 42 4 4 swapecho ldb duplex 117 00AD C8 01 eorb #$01 118 00AF F7 01 44 stb duplex 119 00B2 7E 00 7E jmp checkin 120 121 4 STB $eff0 79 0063 35 04 puls b ;patch v2.3 80 0065 7F 01 42 clr control 81 guess 82 0068 7D 01 4eorb #$01 132 00C6 F7 01 43 stb alfalock 133 00C9 7E 00 7E jmp checkin 134 135 ;transmit a break for approximately 300 ms. 136 00CC F6 EF F4 + jsr $e1c7 88 007B FD 01 47 STD last 89 endguess 90 endif 91 4 147 00E3 9E A0 dosetup ldx $a0 148 00E5 DC A2 ldd $a2 149 00E7 34 16 pshs d,x 150 call setup_,#1 0000 4 cmpb #' ' ;do we translate it? 100 008C 2C 05 if lt 101 008E 8E 01 14 ldx #trnstbl ;point to the translate table 102 0091 E6 85 ldb b,x 4E3 fdb dosetup ;shift 5 165 0108 00 CC fdb dobreak ;shift 6 166 010A 00 AA fdb swapecho ;shift 7 167 010C 00 B5 fdb doget ;shift 8 168 010E 4 STD last 109 endguess 110 call display 0000 +pcount__ set 0 00A3 BD 00 00 + jsr display 111 004 00 + jsr saveterm 157 00FB 7E 00 7E jmp checkin 158 159 ;this table determines what functions each of the function keys will do 160 00FE 00 7E 4 tst control 73 005A 27 02 if ne ;control key modifys this character 74 005C C4 1F andb #$1f ;so make it a control character 75 4 ;receive a file 122 00B5 BD 00 00 doget jsr getfile 123 00B8 7E 00 7E jmp checkin 124 125 ;send a file 126 00BB BD 00 00 dosend jsr 444 tst duplex 83 006B 27 11 quif eq 84 006D C1 06 CMPB #$6 85 006F 27 0D quif eq 86 0071 E7 942 dobreak ldb $eff2 137 00CF 1F 98 tfr b,a 138 00D1 CA 0C orb #$0c 139 00D3 F7 EF F2 stb $eff2 140 00D6 8E 30 00 ldx #$3000 141 4 endif 92 endif 93 checkin guess 94 007E F6 EF F1 LDB $eff1 ;get the prot status 95 0081 C4 08 ANDB #$08 4 +pcount__ set 0 00E9 CC 00 01 + ldd #1 00EC BD 00 00 + jsr setup_ 151 00EF 35 16 puls d,x 152 00F1 DD A2 std $a2 153 00F3 4 ;get the translated character 103 endif 104 0093 5D tstb 105 0094 27 0D quif eq 106 0096 E7 9F 01 47 STB [last] 15 00 BB fdb dosend ;shift 9 169 0110 00 C1 fdb swapalfa ;shift 0 170 0112 00 A9 fdb quitloop ;shift . 171 172 ;this4A6 16 FF 6C lbra looptop 112 00A9 3F quitloop SWI 113 end 114 115 ;turn on/off the local echo 116 00AA F6 01 44 jmptable fdb checkin ;shift 1 161 0100 00 7E fdb checkin ;shift 2 162 0102 00 7E fdb checkin ;shift 3 163 0104 00 F8 fdb dosave ;shift 4 164 0106 00 4 endif 76 005E 34 04 pshs b ;patch v2.3 77 endif 78 0060 F7 EF F0 4sendfile 127 00BE 7E 00 7E jmp checkin 128 129 ;turn on/off the alpha lock 130 00C1 F6 01 43 swapalfa ldb alfalock 131 00C4 C8 01 4F 01 47 STB [last] 87 call $e1c7,last 0000 +pcount__ set 0 0075 FC 01 47 + ldd last 0078 BD E1 C7 4 loop 142 00D9 30 1F leax -1,x 143 00DB 26 FC until eq 144 00DD B7 EF F2 sta $eff2 145 00E0 7E 00 7E jmp checkin 146 4 ;is there a character 96 0083 27 1E quif eq 97 0085 F6 EF F0 LDB $eff0 ;get the character 98 0088 27 19 quif eq 99 008A C1 20 5 Using macros in the SuperPET mDevelopment system ------------------------------------------------ The macro capabilities of the SuperPET 6809 assembler are very extensive, allowing very complex function to be done as macros, making your code much more r5 is the translate table for all input characters comming in from 173 ;the serial port and going to the terminal screen 174 ;note line feed after carriage return is done by making the entry a zero. 5 terized macro that always produces the same series of machine language statements but with different operands based on the parameters to the macro. 3) A complex macro that produces different code based on its parameters. 5 control rmb 1 182 0143 00 alfalock fcb 0 183 0144 01 duplex fcb 1 184 0145 next rmb 2 185 0147 last rmb 2 186 0149 5then some strange loads and stores to unfamiliar addresses. So to put the macro together you take the code, put a MACR and an ENDM statement around them and Voila, readability: COMMODORE MACR ;information from Appendix C in System Overv5;setabs: Three different tab settings from menu. Loads in bank 15, high up ;at $9f00. You may leave any language, return to menu and reset tabs, and ;retrieve the language with reset0. xref tabset_, getchar_, putchar_, putnl_ service_ eq5bler manual when they define a string "hello" and put a null after it with a FCB statement. With a parameterized macro FCS we do the same thing but easier to read: FCS MACR ;Parameter: string to define fcc \0 5 guess quif ne ldd #pstops admit cmpb #'d ; want document tabstops? quif ne ldd #dstops admit ldd #sstops ; if not, use Waterloo default stops endguess j52, and so on. That way, any statement in the macro that uses the \0 (or \1 ... ) would appear to the assembler as if the parameter (in this case "hello") were actually there. In this case, the second line of the macro would produce a 5db 01,09,17,25,33,41,49,57,65,73 ; Standard Waterloo stops pstops fdb 07,09,11,13,15,17,19,21,41,80 ; Program-writing stops dstops fdb 01,05,10,15,20,25,30,41,61,80 ; Document stops end ; tabs are set at scre5eadable. Taking advantage of these facilities will make it much easier to write machine language code and to later understand it easier. With the macro facility you can add sume high level constructs to the assembler. A macro is really a shorthand no5175 0114 00 01 02 03 trnstbl fcb $00,$01,$02,$03,$04,$05,$06,$07,$08,$09,$00,$0b,$0c,$0d,$0e,$0f 176 0124 10 11 12 13 fcb $10,$11,$12,$13,$14,$15,$16,$17,$18,$19,$1a,$1b,$1c,$1d,$1e,$1f 177 5 4) A utility macro that produces little or no code and is always called by another macro as a subroutine. These tend to be very specialized so I will not talk about them. Straight line macros are used when you want to always | temp rmb 2 187 014B ysto rmb 2 014D bytes of object code (ASM6809 V1.1 01:32:48) 03 intrnstb fcb $00,$01,$02,$03,$04,$05,$06,$07,$08,$09,$0a,$0b,$0c,$0d 180 181 0142 5iew lda #$0c sta $e880 lda #$10 sta $e881 ENDM You would use this type for any thing of a similar nature that you find yourself constantly doing. For thin5u $32 ldx #instruct ; load address of instruction string loop ldb ,x+ ; load address next char of string quif eq ; quit on end-string 0 pshs x ; push contents of x onto stack j5 fcb 0 ENDM It looks simple enough, but it is extremely powerful. You can now use FCS the same way that you use FCC with one exception. You'll understand when we look at how a macro works. When you invoke the FCS 5 sr tabset_ ; go to subroutine to set them ldb #0 stb service_ ; return to menu rts instruct fcc "Enter 'p' for program tabs; 'd' for document tabs; " fcc "RETURN for default tabs." fcb 0 sstops f8 fcc "hello" Now here is where strange problems can creep in. Since the macro processor breaks our parameter string down into the pseudo-variables by looking for commas, how do we pass a parameter that contains a comma? The macro processor lets you en columns listed above. broutine to set them ldb #0 stb service_ ; return to menu rts instruct fcc "Enter 'p' for program tabs; 'd' for document tabs; " fcc "RETURN for default tabs." fcb 0 sstops f5tation for writing large chunks of code that you normally code by hand. Essentially there are four types of macros: 1) A straight line macro that takes no parameters and always produces the same code when invoked. 2) A parame5 178 ;this is the keyboard translate table for all the special keys. 179 0134 00 01 02 03 intrnstb fcb $00,$01,$02,$03,$04,$05,$06,$07,$08,$09,$0a,$0b,$0c,$0d 180 181 0142 5perform a specific function or task. for example, I have a series of macros for selecting the Commodore character fonts. Normally this is only four machine language statements, but it is clearer to look at the code and see a COMMODORE statement rather E"setabs" bank 15 include "disk/1.watlib.exp" org $9f00 "setabs.b09" stb service_ ; return to menu rts instruct fcc "Enter 'p' for program tabs; 'd' for document tabs; " fcc "RETURN for default tabs." fcb 0 sstops f5gs that you do a lot, the straight line macro isn't good enough, so you have to add parameters. One thing that I do often is to define a string terminates with a null so I can pass it to a system routine. You can see this in example 3 of the 6809 Assem5sr putchar_ ; display the character puls x ; recover x endloop jsr putnl_ ; get a clear line jsr getchar_ ; read character from keyboard (hit RETURN) cmpb #'p ; want program tabstops? 5macro by a statement in your code like (to draw from example 3): FCS "hello" the string "hello" is assigned to the pseudo-variable \0 by the macro processor. Any subsequent parameters (separated by commas) would be assigned to \1, \6 1 ;setabs: Three different tab settings from menu. Loads in bank 15, high up 2 ;at $9f00. You may leave any language, return to menu and reset tabs, and 3 ;retrieveHBank 15 setabs.b09 = 9f00 - 9fba . 00bb Length of Module = 00bb bs.lst 6 b #0 31 0030 D7 32 stb service_ ; return to menu 32 0032 39 rts 33 34 0033 45 6E 74 65 instruct fcc "Enter 'p' for program tabs; 'd' for document tabs; ȟ3' 45 p&̟ d&̟ ̟29Enter 'p' for program tabs; 'd' for document tabs; RETURN for default tabs. !)19AI )P )=P6q ; quit on end-string 0 12 0007 34 10 pshs x ; push contents of x onto stack 13 0009 BD 00 00 jsr putchar_ ; display the character 14 000C 35 10 puls x 6 Using macros in the SuperPET mDevelopment system ------------------------------------------------ The macro capabilities of the SuperPET 6809 assembler are very extensive, allowing very complex function to be done as macros, making your code much more r,30,41,61,80 ; Document stops 43 end ; tabs are set at screen columns listed above. 00BB bytes of object code (ASM6809 V1.1 00:43:49) stops fdb 01,09,17,25,33,41,49,57,65,73 ; Standard Water6 4) A utility macro that produces little or no code and is always called by another macro as a subroutine. These tend to be very specialized so I will not talk about them. Straight line macros are used when you want to always 6dmit 23 001F C1 64 cmpb #'d ; want document tabstops? 24 0021 26 05 quif ne 25 0023 CC 00 A7 ldd #dstops 26 0026 20 03 admit 27 0028 CC 6iew lda #$0c sta $e880 lda #$10 sta $e881 ENDM You would use this type for any thing of a similar nature that you find yourself constantly doing. For thin6 the language with reset0. 4 5 xref tabset_, getchar_, putchar_, putnl_ 6 0032 service_ equ $32 7 8 0000 8E 00 36eadable. Taking advantage of these facilities will make it much easier to write machine language code and to later understand it easier. With the macro facility you can add sume high level constructs to the assembler. A macro is really a shorthand no6" 35 0066 52 45 54 55 fcc "RETURN for default tabs." 36 007E 00 fcb 0 37 38 007F 00 01 00 09 sstops fdb 01,09,17,25,33,41,49,57,65,73 ; Standard Water6perform a specific function or task. for example, I have a series of macros for selecting the Commodore character fonts. Normally this is only four machine language statements, but it is clearer to look at the code and see a COMMODORE statement rather 6 ; recover x 15 000E 20 F3 endloop 16 0010 BD 00 00 jsr putnl_ ; get a clear line 17 0013 BD 00 00 jsr getchar_ ; read character from keyboard (hit RETURN) 18 0016 C1 76gs that you do a lot, the straight line macro isn't good enough, so you have to add parameters. One thing that I do often is to define a string terminates with a null so I can pass it to a system routine. You can see this in example 3 of the 6809 Assem6tation for writing large chunks of code that you normally code by hand. Essentially there are four types of macros: 1) A straight line macro that takes no parameters and always produces the same code when invoked. 2) A parame7 fcb 0 ENDM It looks simple enough, but it is extremely powerful. You can now use FCS the same way that you use FCC with one exception. You'll understand when we look at how a macro works. When you invoke the FCS 600 7F ldd #sstops ; if not, use Waterloo default stops 28 endguess 29 002B BD 00 00 jsr tabset_ ; go to subroutine to set them 30 002E C6 00 ld6 then some strange loads and stores to unfamiliar addresses. So to put the macro together you take the code, put a MACR and an ENDM statement around them and Voila, readability: COMMODORE MACR ;information from Appendix C in System Overv63 ldx #instruct ; load address of instruction string 9 loop 10 0003 E6 80 ldb ,x+ ; load address next char of string 11 0005 27 09 quif e6terized macro that always produces the same series of machine language statements but with different operands based on the parameters to the macro. 3) A complex macro that produces different code based on its parameters. 6loo stops 39 40 0093 00 07 00 09 pstops fdb 07,09,11,13,15,17,19,21,41,80 ; Program-writing stops 41 42 00A7 00 01 00 05 dstops fdb 01,05,10,15,20,256bler manual when they define a string "hello" and put a null after it with a FCB statement. With a parameterized macro FCS we do the same thing but easier to read: FCS MACR ;Parameter: string to define fcc \0 60 cmpb #'p ; want program tabstops? 19 guess 20 0018 26 05 quif ne 21 001A CC 00 93 ldd #pstops 22 001D 20 0C a7y have any number of parameters, and it must figure out exactly how much space to take from the stack. This is a slight problem because the macro processor doesn't tell you how many parameters there are. You get around this by simply testing each param72, and so on. That way, any statement in the macro that uses the \0 (or \1 ... ) would appear to the assembler as if the parameter (in this case "hello") were actually there. In this case, the second line of the macro would produce a 7ma. To illustrate, if a parameter to a macro is (5,X) and we are testing to see if it is the string TEST, then IFC TEST,\1 would be seen as IFC TEST,5,X which cause the correct result of comparing "TEST" to "5,X". On the ot7tional parameter, the first IFNC test {3} is passed, but the second test {4} fails so it drops down to its corresponding ENDC {31} and emits the LDD \1 {32} which is substituted for by the #' ' that was passed. It then emits the JSR {34}, and as before 7 Here, all is the same except that was one more parameter so PCOUNT__ is set twice {5} {7}. This is ok because only the last setting counts. Also note that there is no limit to the complexity of the parameters that you have, it just spits them out with 7 eter to see if it is not null. When you find a null parameter, then you know how many parameters there were. To test for a null parameter, you can use the IFNC macro statement. The IFNC (and IFC) macro conditionals both takes two operands - the string7 fcc "hello" Now here is where strange problems can creep in. Since the macro processor breaks our parameter string down into the pseudo-variables by looking for commas, how do we pass a parameter that contains a comma? The macro processor lets you 7 her hand IFC \1,TEST would be seen as IFC 5,X,TEST and would be in error because it would compare "5" to "X,TEST". My CALL macro only handles up to six parameters to speed it up and because none of the system routines need m7 does not emit the LEAS because PCOUNT__ is zero. CALL OPENF_,#FILENAME,#FILEMODE +PCOUNT__ SET 2 + LDD #FILEMODE + PSHS D + LDD #FILENAME + JSR OPENF_ 7a LDD in front of them. One warning, if any of them reference things already on the stack, remember that the stack is adjusted by the PSHS in the macro so you will have to give the stack offsets accordingly. {1} CALL MACR ;parameters routin7s to compare. If they are not exactly alike then the code between the IFNC and its corresponding ENDC is processed by the macro processor, otherwise it is skipped. Note: there is no else handling, you have to simulate by putting an IFC after the ENDC f7do that if you put parenthesis around the entire parameter. So to pass the string "hello, how are you?" to the FCS macro we would write: FCS ("hello, how are you") If for some reason you have to pass a parameter that has parenthesi7ore. If you need more then it can be easily expanded. To see how it works, lets take some examples. CALL PUTNL_ + JSR PUTNL_ ('+' indicates code generated by the macro ) This the first thing that happens in th7 + LEAS 2,S For this call, the first two comparison tests are passed which causes PCOUNT__ to be set to 2 {5}. Since the third test {6} fails, it drops down to its corresponding ENDC {28} and emits the LDD {29} and the PSHS D {30} to put the pa7e,parameters... {2} pcount__ set 0 ;set stack space to release {3} ifnc ,\1 ;test for first parameter {4} ifnc ,\2 ;test for second parameter {5} pcoun7or the IFNC with the same parameters. Since the compare is for exactness, you test for a null parameter by comparing it to a null string as you see in the CALL macro. It is very important that we put the comma on the left to prevent the macro processor7s around it already, throw on an extra set. The macro processor will only strip off the outermost pair. The most advanced and probably the most useful of the macros will be the complex ones. These can be constructed to do almost anything, including so7e macro is PCOUNT__ is set to 0 {2}. This is used to keep track of how many bytes are to be released from the stack after the call. Next, \1 is tested and found to be null, so it skips to its ENDC {33} with PCOUNT__ still 0. The JSR instruction is gene7rameter on the stack. It then emits the LDD for the first parameter {32} and the JSR {34}. This time, it tests PCOUNT__ and finds it not to be null {35} so it emits the LEAS to adjust the stack {36}. CALL FPRINTF_,([3,X]),#STRING,(TEM8t__ set 2 ;stack space for two parameters {6} ifnc ,\3 ;test for third {7} pcount__ set 4 ;stack space for three {8} ifnc ,\4 ; 7 from trying to use any commas in the string as the comparison separator. In general, always put a constant string on the left of the comparison and a substituted string on the right if there is any possibility of the substituted string containing a com7me very high level language constructs. One that I find to be very useful is a CALL macro to automatically load the parameters, call a routine and clean up the stack afterwords. It has to be able to take any number of parameters because a subroutine ma7macro by a statement in your code like (to draw from example 3): FCS "hello" the string "hello" is assigned to the pseudo-variable \0 by the macro processor. Any subsequent parameters (separated by commas) would be assigned to \1, \7rated {34} and PCOUNT__ is checked {35}. Because it is zero, no LEAS instruction is generated. CALL PUTCHAR_,#' ' + LDD #' ' + JSR PUTCHAR_ Again, PCOUNT__ is set to zero. Since the there is an addi7P+80,Y) +PCOUNT__ SET 2 +PCOUNT__ SET 4 + LDD TEMP+80,Y + PSHS D + LDD #STRING + PSHS D + LDD [3,X] + JSR FPRINTF_ + LEAS 4,S 8 me very high level language constructs. One that I find to be very useful is a CALL macro to automatically load the parameters, call a routine and clean up the stack afterwords. It has to be able to take any number of parameters because a subroutine ma8 from trying to use any commas in the string as the comparison separator. In general, always put a constant string on the left of the comparison and a substituted string on the right if there is any possibility of the substituted string containing a com8lease? {36} leas pcount__,s ;yes, remove it {37} endc {38} endm Beware that macros tend to be slow. The first time that I assembled some code that consisted heavily of macros, I became very scared when8 " {13} pcount__ set 10 ; " {14} ifnc ,\7 ;see if they gave too many parms {15} fail ;yes, warn them {16} en8do that if you put parenthesis around the entire parameter. So to pass the string "hello, how are you?" to the FCS macro we would write: FCS ("hello, how are you") If for some reason you have to pass a parameter that has parenthesi8s to compare. If they are not exactly alike then the code between the IFNC and its corresponding ENDC is processed by the macro processor, otherwise it is skipped. Note: there is no else handling, you have to simulate by putting an IFC after the ENDC f8failing by comparing two null strings eventhough there really was a non null parameter. To fix this, we put periods surrounding the strings as in IFNC .,\1. which would be seen as IFNC .,,S. and would result in the correct determi8 my disk drive stopped spinning in the middle of assembly. It is just because it takes a long time to process the macros. You may rewrite a macro several times before you feel that it runs fast enough to suit you. The current CALL macro is my sixth to8 dc {17} ldd \6 ;load sixth parameter {18} pshs d ;and put it on the stack {19} endc {20} ldd \5 ;load fifth parameter {8ter started with the string ".,". This situation is highly unlikely, but if you hava a need for that particular parameter to be pased, change the periods of the comparison statement to any other character that you are not using. My CALL macro only hand8y have any number of parameters, and it must figure out exactly how much space to take from the stack. This is a slight problem because the macro processor doesn't tell you how many parameters there are. You get around this by simply testing each param8ma. To illustrate, if a parameter to a macro is (5,X) and we are testing to see if it is the string TEST, then IFC TEST,\1 would be seen as IFC TEST,5, which causes the correct result of comparing "TEST" to "5". Note that ttal revision to try and speed it up. After using macros, you may find that assembly language program isn't as difficult as it seems. tend to be slow. The first time that I assembled some code that consisted heavily of macros, I became very scared when821} pshs d ; " {22} endc {23} ldd \4 ; " {24} pshs d ; " {25} endc {26} 8s around it already, throw on an extra set. The macro processor will only strip off the outermost pair. The most advanced and probably the most useful of the macros will be the complex ones. These can be constructed to do almost anything, including so8or the IFNC with the same parameters. Since the compare is for exactness, you test for a null parameter by comparing it to a null string as you see in the CALL macro. It is very important that we put the comma on the left to prevent the macro processor8 nation by the test. If the parameter had indeed been null then the comparison of the two periods would pass and the condition would fail signifying a null parameter as we would expect. The only case in which the test would be incorrect is if the parame8 ('+' indicates code generated by the macro ) This the first thing that happens in the macro is PCOUNT__ is set to 0 {2}. This is used to keep track of how many bytes are to be released from the stack after the call. Next, \1 is tested and found to be 8 ldd \3 ; " {27} pshs d ; " {28} endc {29} ldd \2 ; " {30} pshs d ; " {318les up to six parameters to speed it up and because none of the system routines need more. If you need more then it can be easily expanded. To see how it works, lets take some examples. CALL PUTNL_ + JSR PUTNL_ 8eter to see if it is not null. When you find a null parameter, then you know how many parameters there were. To test for a null parameter, you can use the IFNC macro statement. The IFNC (and IFC) macro conditionals both takes two operands - the string8he ",X" is not used in the comparison because it is after the second comma. This is ok in this case, but for a test for null when the parameter is (,S) as in IFNC ,\1 would be seen as IFNC ,,S and would result in the test 9null, so it skips to its ENDC {33} with PCOUNT__ still 0. The JSR instruction is generated {34} and PCOUNT__ is checked {35}. Because it is zero, no LEAS instruction is generated. CALL PUTCHAR_,#' ' + LDD #' ' 8} endc {32} ldd \1 ;put first parameter in D {33} endc {34} jsr \0 ;call the routine {35} ifne pcount__ ;any stack space to re8 " {9} pcount__ set 6 ; " {10} ifnc ,\5 ; " {11} pcount__ set 8 ; " {12} ifnc ,\6 ; 9 PSHS D + LDD #FILENAME + JSR OPENF_ + LEAS 2,S For this call, the first two comparison tests are passed which causes PCOUNT__ to be set to 2 {5}. Since the third test {6} fails, it drops down t9 l the routine {35} ifne pcount__ ;any stack space to release? {36} leas pcount__,s ;yes, remove it {37} endc {38} endm Beware that macros tend to be slow. The first time th9 set 8 ; " {12} ifnc .,\6. ; " {13} pcount__ set 10 ; " {14} ifnc .,\7. ;see if given too many parms {15} 9 + LDD [3,X] + JSR FPRINTF_ + LEAS 4,S Here, all is the same except that was one more parameter so PCOUNT__ is set twice {5} {7}. This is ok because only the last setting counts. Also note that there is no9 + JSR PUTCHAR_ Again, PCOUNT__ is set to zero. Since the there is an additional parameter, the first IFNC test {3} is passed, but the second test {4} fails so it drops down to its corresponding ENDC {31} and emits the LDD \1 {32} which is su9 pshs d ; " {25} endc {26} ldd \3 ; " {27} pshs d ; " {28} endc {29} ldd \2 9} ifnc .,\2. ;test for second parameter {5} pcount__ set 2 ;stack space for two parameters {6} ifnc .,\3. ;test for third {7} pcount__ set 4 9o its corresponding ENDC {28} and emits the LDD {29} and the PSHS D {30} to put the parameter on the stack. It then emits the LDD for the first parameter {32} and the JSR {34}. This time, it tests PCOUNT__ and finds it not to be null {35} so it emits t9at I assembled some code that consisted heavily of macros, I became very scared when my disk drive stopped spinning in the middle of assembly. It is just because it takes a long time to process the macros. You may rewrite a macro several times before y9 fail ;yes, warn them {16} endc {17} ldd \6 ;load sixth parameter {18} pshs d ;and put it on the stack {19} 9 limit to the complexity of the parameters that you have, it just spits them out with a LDD in front of them. One warning, if any of them reference things already on the stack, remember that the stack is adjusted by the PSHS in the macro so you will hav9bstituted for by the #' ' that was passed. It then emits the JSR {34}, and as before does not emit the LEAS because PCOUNT__ is zero. CALL OPENF_,#FILENAME,#FILEMODE +PCOUNT__ SET 2 + LDD #FILEMODE +9 ; " {30} pshs d ; " {31} endc {32} ldd \1 ;put first parameter in D {33} endc {34} jsr \0 ;cal9 ;stack space for three {8} ifnc .,\4. ; " {9} pcount__ set 6 ; " {10} ifnc .,\5. ; " {11} pcount__ 9he LEAS to adjust the stack {36}. CALL FPRINTF_,([3,X]),#STRING,(TEMP+80,Y) +PCOUNT__ SET 2 +PCOUNT__ SET 4 + LDD TEMP+80,Y + PSHS D + LDD #STRING + PSHS D ou feel that it runs fast enough to suit you. The current CALL macro is my sixth total revision to try and speed it up. After using macros, you may find that assembly language program isn't as difficult as it seems. tend to be slow. The first time th9 endc {20} ldd \5 ;load fifth parameter {21} pshs d ; " {22} endc {23} ldd \4 ; " {24} 9e to give the stack offsets accordingly. {1} CALL MACR ;parameters routine,parameters... {2} pcount__ set 0 ;set stack space to release {3} ifnc .,\1. ;test for first parameter {4