Benutzeranleitung / Produktwartung ii des Produzenten Apple
Zur Seite of 257
Apple II Original ROM Information Source http://members.buckeye-express.com/marksm/6502/ 27 June 2004 The 6502 Firmware Page This site is mostly about the firmware -- software in ROM -- that came with the original Apple II, not the II+, IIe, IIc, or IIgs.
+------------------------------------------------------------------------ | TOPIC -- Apple II -- Apple II ROM (12 KB binary) +------------------------------------------------------------------------ File ............. "a2rom.bin" Fork ......
D/0002E0: 0320D9D0 CAD0E5A5 514A4A4A D0D3E61A [........QJJJ....] D/0002F0: D002E61B A11AD0C9 602090D3 8D240320 [........`....$..] D/000300: AFD34820 9AD36820 2ED0AE23 036020F9 [..H...h....#.`..] D/000310: D24C7DD0 AD25034A 2090D320 75D0209A [.L}..%.J.
D/000660: 20DAFDA5 0A208AD6 A501910A 208AD668 [...............h] D/000670: 4CCB02A5 0920DAFD A508208A D6A50220 [L...............] D/000680: 8AD6202D FFA98D4C EDFD20DA FDA9A04C [...-...L.......L] D/000690: EDFD840F 850E208A D6202DFF A500450E [.........
D/0009E0: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF [................] D/0009F0: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF [................] D/000A00: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF [................] D/000A10: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF [.........
D/000D60: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF [................] D/000D70: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF [................] D/000D80: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF [................] D/000D90: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF [.........
D/0010E0: 85E41869 A020EDFD 88E0C090 EC200CE0 [...i............] D/0010F0: 68C95DF0 A4C928D0 8AF09E20 18E19550 [h.]...(........P] D/001100: D5789011 A02B4CE0 E32034EE D55090F4 [.x...+L...4..P..] D/001110: 20E4EF95 784C23E8 2034EEF0 E738E901 [....xL#..
D/001460: FA88B038 0A3035B4 5884FFB4 80E810DA [...8.05.X.......] D/001470: F0B3C97E B022CA10 04A00610 299480A4 [...~."......)...] D/001480: FF9458A4 C894A8A4 F194D129 1FA8B997 [..X........)....] D/001490: F10AA8A9 762A85FF D001C8C8 86FDB1FE [....
D/0017E0: CF602015 E7A5CE85 F6A5CF85 F78884F8 [.`..............] D/0017F0: C8A90A85 F484F560 2015E7A5 CEA4CF10 [.......`........] D/001800: F22015E7 B55085DA B57885DB A5CE91DA [.....P...x......] D/001810: C8A5CF4C 07F26068 6824D510 05208EFD [...L..`hh$.
D/001B60: C5D854D3 D4CFD0D0 C5C4A0C1 D420AAAA [..T.............] D/001B70: AA20A0C5 D2D20DBE B2B535D2 C1CEC745 [..........5....E] D/001B80: C4C94DD3 D4D2A0CF D6C64CDC 0DD2C5D4 [..M.......L.....] D/001B90: D9D0C5A0 CCC9CEC5 8D3F46D9 90034CC3 [.........
D/001EE0: 724C61F1 203FF206 CE26CF30 FAB0DCD0 [rLa..?...&.0....] D/001EF0: 04C5CEB0 D6602015 E7B1CE94 9F4C08E7 [.....`.......L..] D/001F00: 2034EEA5 CE85C860 2015E7A5 C891CE60 [.4.....`.......`] D/001F10: 206CEEA5 CE85E6A5 CF85E74C 44E220E4 [.l...
D/002260: E756504C 36E720C9 EF154F10 0520C9EF [.VPL6.....O.....] D/002270: 354F9550 10ED4CC9 EF2015E7 A4FBA5CE [5O.P..L.........] D/002280: 995F01A5 CF4C66E9 99500188 3051B940 [._...Lf..P..0Q.@] D/002290: 01D550D0 F6B95001 D578D0EF C6FBB941 [..P...P..
D/0025E0: DDB4F9D0 132034F6 DDBAF9F0 0DBDBAF9 [......4.........] D/0025F0: F007C9A4 F003A434 18882644 E003D00D [.......4..&D....] D/002600: 20A7FFA5 3FF001E8 8635A203 88863DCA [....?....5....=.] D/002610: 10C9A544 0A0A0535 C920B006 A635F002 [...D.
D/002960: C8600420 54300D80 04900322 54330D80 [.`..T0....."T3..] D/002970: 04900420 54330D80 04900420 543B0D80 [....T3......T;..] D/002980: 04900022 44330DC8 44001122 44330DC8 [..."D3..D.."D3..] D/002990: 44A90122 44330D80 04900122 44330D80 [D.
D/002CE0: A03288D0 FDAC20C0 A02CCA60 A2084820 [.2.......,.`..H.] D/002CF0: FAFC682A A03ACAD0 F56020FD FC88AD60 [..h*.:...`.....`] D/002D00: C0452F10 F8452F85 2FC08060 A424B128 [.E/..E/./..`.$.(] D/002D10: 48293F09 40912868 6C3800E6 4ED002E6 [H)?.@.(hl8.
+------------------------------------------------------------------------ | TOPIC -- Apple II -- Memory map of the Apple II ROMs +------------------------------------------------------------------------ Memory map of the Apple II ROMs * $F800-$FFFF Monitor.
+------------------------------------------------------------------------ | TOPIC -- Apple II -- Summary of Monitor Commands +------------------------------------------------------------------------ Summary of Apple II Monitor Commands Examining Memory.
* {adrs}T Step infinitely. The TRACE command stops only when it executes a BRK instruction or when you press RESET. (T=trace) * Contrl-E Displays the contents of the 6502's registers. (E=examine) * I Set Inverse display mode. * N Set Normal display mode.
+------------------------------------------------------------------------ | TOPIC -- Apple II -- Red Book Monitor listing +------------------------------------------------------------------------ 1 *************************** 2 * * 3 * APPLE II * 4 * SYSTEM MONITOR * 5 * * 6 * COPYRIGHT 1977 BY * 7 * APPLE COMPUTER, INC.
57 A2L EQU $3E 58 A2H EQU $3F 59 A3L EQU $40 60 A3H EQU $41 61 A4L EQU $42 62 A4H EQU $43 63 A5L EQU $44 64 A5H EQU $45 65 ACC EQU $45 66 XREG EQU $46 67 YREG EQU $47 68 STATUS EQU $48 69 SPNT EQU $49.
F820: C8 119 INY ; NO, INC INDEX (X-COORD) F821: 20 0E F8 120 JSR PLOT1 ;PLOT NEXT SQUARE F824: 90 F6 121 BCC HLINE1 ;ALWAYS TAKEN F826: 69 01 122 VLINEZ ADC #$01 ;NEXT Y-COORD F828: 48 123 VLINE PHA .
F884: A4 3B 181 LDY PCH F886: 20 96 FD 182 JSR PRYX2 F889: 20 48 F9 183 JSR PRBLNK ;FOLLOWED BY A BLANK F88C: A1 3A 184 LDA (PCL,X) ;GET OP CODE F88E: A8 185 INSDS2 TAY F88F: 4A 186 LSR ;EVEN/ODD TEST.
F8F5: A9 00 243 PRMN1 LDA #$00 F8F7: A0 05 244 LDY #$05 F8F9: 06 2D 245 PRMN2 ASL RMNEM ;SHIFT 5 BITS OF F8FB: 26 2C 246 ROL LMNEM ; CHARACTER INTO A F8FD: 2A 247 ROL ; (CLEARS CARRY) F8FE: 88 248 DEY.
F962: 04 20 54 305 FMT1 DFB $04,$20,$54,$30,$0D F965: 30 0D F967: 80 04 90 306 DFB $80,$04,$90,$03,$22 F96A: 03 22 F96C: 54 33 0D 307 DFB $54,$33,$0D,$80,$04 F96F: 80 04 F971: 90 04 20 308 DFB $90,$04.
F9D8: 24 53 1B 347 DFB $24,$53,$1B,$23,$24,$53 F9DB: 23 24 53 F9DE: 19 A1 348 DFB $19,$A1 ;(A) FORMAT ABOVE F9E0: 00 1A 5B 349 DFB $00,$1A,$5B,$5B,$A5,$69 F9E3: 5B A5 69 F9E6: 24 24 350 DFB $24,$24 ;(.
FA70: 29 1F 395 AND #$1F FA72: 49 14 396 EOR #$14 FA74: C9 04 397 CMP #$04 ;COPY USER INST TO XEQ AREA FA76: F0 02 398 BEQ XQ2 ; WITH TRAILING NOPS FA78: B1 3A 399 XQ1 LDA (PCL),Y ;CHANGE REL BRANCH FA7A: 99 3C 00 400 XQ2 STA XQT,Y ; DISP TO 4 FOR FA7D: 88 401 DEY ; JMP TO BRANCH OR FA7E: 10 F8 402 BPL XQ1 ; NBRANCH FROM XEQ.
FADE: A9 00 457 LDA #ACC/256 FAE0: 85 41 458 STA A3H FAE2: A2 FB 459 LDX #$FB FAE4: A9 A0 460 RDSP1 LDA #$A0 FAE6: 20 ED FD 461 JSR COUT FAE9: BD 1E FA 462 LDA RTBL-$FB,X FAEC: 20 ED FD 463 JSR COUT F.
FB59: A9 17 519 LDA #$17 FB5B: 85 25 520 TABV STA CV ;VTABS TO ROW IN A-REG FB5D: 4C 22 FC 521 JMP VTAB FB60: 20 A4 FB 522 MULPM JSR MD1 ;ABS VAL OF AC AUX FB63: A0 10 523 MUL LDY #$10 ;INDEX FOR 16 B.
FBC7: 85 29 581 STA BASH ; BASH=000001CD FBC9: 68 582 PLA ; AND FBCA: 29 18 583 AND #$18 ; BASL=EABAB000 FBCC: 90 02 584 BCC BSCLC2 FBCE: 69 7F 585 ADC #$7F FBD0: 85 28 586 BSCLC2 STA BASL FBD2: 0A 58.
FC3E: 90 5C 643 BCC CLREOL ; E, CLEAR TO END OF LINE FC40: D0 E9 644 BNE RTS4 ; NOT F, RETURN FC42: A4 24 645 CLREOP LDY CH ;CURSOR H TO Y INDEX FC44: A5 25 646 LDA CV ;CURSOR V TO A-REGISTER FC46: 48.
FCB3: 60 705 RTS FCB4: E6 42 706 NXTA4 INC A4L ;INCR 2-BYTE A4 FCB6: D0 02 707 BNE NXTA1 ; AND A1 FCB8: E6 43 708 INC A4H FCBA: A5 3C 709 NXTA1 LDA A1L ;INCR 2-BYTE A1.
FD26: 91 28 767 STA (BASL),Y ;REPLACE FLASHING SCREEN FD28: AD 00 C0 768 LDA KBD ;GET KEYCODE FD2B: 2C 10 C0 769 BIT KBDSTRB ;CLR KEY STROBE FD2E: 60 770 RTS FD2F: 20 0C FD 771 ESC JSR RDKEY ;GET KEYCODE FD32: 20 2C FC 772 JSR ESC1 ; HANDLE ESC FUNC.
FDAD: A5 3C 829 MODSCHK LDA A1L FDAF: 29 07 830 AND #$07 FDB1: D0 03 831 BNE DATAOUT FDB3: 20 92 FD 832 XAM JSR PRA1 FDB6: A9 A0 833 DATAOUT LDA #$A0 FDB8: 20 ED FD 834 JSR COUT ;OUTPUT BLANK FDBB: B1.
FE20: A2 01 891 LT LDX #$01 FE22: B5 3E 892 LT2 LDA A2L,X ;COPY A2 (2 BYTES) TO FE24: 95 42 893 STA A4L,X ; A4 AND A5 FE26: 95 44 894 STA A5L,X FE28: CA 895 DEX FE29: 10 F7 896 BPL LT2 FE2B: 60 897 RT.
FE9B: A5 3E 953 IOPRT LDA A2L ;SET RAM IN/OUT VECTORS FE9D: 29 0F 954 AND #$0F FE9F: F0 06 955 BEQ IOPRT1 FEA1: 09 C0 956 ORA #IOADR/256 FEA3: A0 00 957 LDY #$00 FEA5: F0 02 958 BEQ IOPRT2 FEA7: A9 FD.
FF24: 90 F0 1015 BCC RD3 ;LOOP UNTIL DONE FF26: 20 EC FC 1016 JSR RDBYTE ;READ CHKSUM BYTE FF29: C5 2E 1017 CMP CHKSUM FF2B: F0 0D 1018 BEQ BELL ;GOOD, SOUND BELL AND RETURN FF2D: A9 C5 1019 PRERR LDA.
FFA0: 95 41 1077 STA A3H,X FFA2: E8 1078 NXTBS2 INX FFA3: F0 F3 1079 BEQ NXTBAS FFA5: D0 06 1080 BNE NXTCHR FFA7: A2 00 1081 GETNUM LDX #$00 ;CLEAR A2 FFA9: 86 3E 1082 STX A2L FFAB: 86 3F 1083 STX A2H.
FFF2: 5D 1139 DFB LIST-1 FFF3: CC 1140 DFB WRITE-1 FFF4: B5 1141 DFB GO-1 FFF5: FC 1142 DFB READ-1 FFF6: 17 1143 DFB SETMODE-1 FFF7: 17 1144 DFB SETMODE-1 FFF8: F5 1145 DFB CRMON-1 FFF9: 03 1146 DFB B.
+------------------------------------------------------------------------ | TOPIC -- Apple II -- Red Book Sweet-16 listing +------------------------------------------------------------------------ 1 *.
F6C5: 4A 57 LSR ;PREPARE CARRY FOR BC, BNC. F6C6: 60 58 RTS ;GOTO NON-REG OP ROUTINE F6C7: 68 59 RTNZ PLA ;POP RETURN ADDRESS F6C8: 68 60 PLA F6C9: 20 3F FF 61 JSR RESTORE ;RESTORE 6502 REG CONTENTS F.
F717: A5 00 119 STAT LDA R0L F719: 81 00 120 STAT2 STA (R0L,X) ;STORE BYTE INDIRECT F71B: A0 00 121 LDY #$0 F71D: 84 1D 122 STAT3 STY R14H ;INDICATE R0 IS RESULT NEG F71F: F6 00 123 INR INC R0L,X F721.
F796: 20 19 F7 181 JSR STAT2 ;PUSH LOW PC BYTE VIA R12 F799: A5 1F 182 LDA R15H F79B: 20 19 F7 183 JSR STAT2 ;PUSH HIGH-ORDER PC BYTE F79E: 18 184 BR CLC F79F: B0 0E 185 BNC BCS BNC2 ;NO CARRY TEST F7.
+------------------------------------------------------------------------ | TOPIC -- Apple II -- WOZPAK Sweet-16 article by Steve Wozniak +-------------------------------------------------------------.
30A 41 MLOOP LD @R1 ;R1 holds source 30B 52 ST @R2 ;R2 holds dest. addr. 30C F3 DCR R3 ;Decr. length 30D 07 FB BNZ MLOOP ;Loop until done 30F 00 RTN ;Return to 6502 mode. 310 C9 C5 NOMOVE CMP #"E" ;"E" char? 312 D0 13 BEQ EXIT ;Yes, exit 314 C8 INY ;No, cont.
En INR Rn (Increment) Fn DCR Rn (Decrement) Non-register OPS- 00 RTN (Return to 6502 mode) 01 BR ea (Branch always) 02 BNC ea (Branch if No Carry) 03 BC ea (Branch if Carry) 04 BP ea (Branch if Plus) .
EXAMPLE: 25 LD R5 ;Copy the contents 36 ST R6 ;of R5 to R6 LOAD INDIRECT: LD @Rn [ 4n ] The low-order ACC byte is loaded from the memory location whose address resides in Rn and the high-order ACC byte is cleared. Branch conditions reflect the final ACC contents which will always be positive and never minus 1.
STORE DOUBLE-BYTE INDIRECT: STD @Rn [ 7n ] The low-order ACC byte is stored into memory location whose address resides in Rn, and Rn is the incremented by 1. The high-order ACC byte is stored into the memory location whose address resides in the incremented Rn, and Rn is again incremented by 1.
EXAMPLE: 14 34 A0 SET R4 $A034 ;Init pointers 15 22 90 SET R5 $9022 84 POP @R4 ;Move byte from 95 STP @R5 ;$A033 to $9021 84 POP @R4 ;Move byte from 95 STP @R5 ;$A032 to $9020 ADD: ADD Rn [ An ] The contents of Rn are added to the contents of ACC (R0), and the low-order 16 bits of the sum restored in ACC.
from the memory location whose address now resides in Rn. Rn is again decremented by 1 and the low-order ACC byte is loaded from the corresponding memory location.
DECREMENT: DCR Rn [ Fn ] The contents of Rn are decremented by 1. The carry is cleared and other branch conditions reflect the decremented value. EXAMPLE: (Clear 9 bytes beginning at location A034) 15.
$300: 01 50 BR $352 BRANCH IF NO CARRY: BNC ea [ 02 d ] A branch to the effective address is taken only is the carry is clear, otherwise execution resumes as normal with the next instruction. Branch conditions are not changed. BRANCH IF CARRY SET: BC ea [ 03 d ] A branch is effected only if the carry is set.
BRANCH IF MINUS ONE BM1 ea [ 08 d ] A branch is effected only if the prior 'result' was minus one ($FFFF Hex). Branch conditions are not changed. BRANCH IF NOT MINUS ONE BNM1 ea [ 09 d ] A branch effected only if the prior 'result' was not minus 1.
Theory of Operation: -------------------- SWEET 16 execution mode begins with a subroutine call to SW16. All 6502 registers are saved at this time, to be restored when a SWEET 16 RTN instruction returns control to the 6502. If you can tolerate indefinate 6502 register contents upon exit, approximately 30 usec may be saved by entering at SW16 + 3.
To save code, the subroutine entry address (minus 1) is pushed onto the stack, high-order byte first. A 6502 RTS (return from subroutine) is used to pop the address off the stack and into the 6502 PC (after incrementing by 1).
User Modifications: ------------------- You may wish to add some of your own instructions to this implementation of SWEET 16. If you use the unassigned opcodes $0E and $0F, remember that SWEET 16 treats these as 2-byte instructions.
+------------------------------------------------------------------------ | TOPIC -- Apple II -- WOZPAK Sweet-16 article by Dick Sedgewick +------------------------------------------------------------------------ SWEET 16 - INTRODUCTION by Dick Sedgewick Sweet 16 is probably the least used and least understood seed in the Apple ][.
$301, $302, and $312 respectively). The SWEET 16 subroutine of course performs the move, and is entered at Hex locations $303 to $311 (see listing Number 3). After the move, the screen will display three lines of data, each 8 bytes long, and await entry of a new set of parameters.
studied in the first four SWEET 16 registers. Therefore, the 8 byte display starting at $0000 is large enough for this purpose. These four registers are established as R0, R1, R2, R3: R0 $0000 & 0001 -SWEET 16 accumulator R1 $0002 & 0003 -Source address R2 $0004 & 0005 -Destination address R3 $0006 & 0007 -Number of bytes to move .
| | | | | String VN DSP NVA DATA DATA Terminator The SWEET 16 registers are as shown: low high low high low high low high $0000 1E 00 08 08 08 0A 00 00 ---------- ---------- ---------- ---------- | | .
40 INPUT "ENTER # BYTES " , B 50 IF NOT B THEN 40 : REM AT LEAST 1 60 POKE 778 , B : REM POKE LENGTH 70 INPUT "ENTER DESTINATION " , A 80 IF A > PEEK (203) - 1 THEN 70 90 IF A &.
+------------------------------------------------------------------------ | TOPIC -- Apple II -- Red Book Mini-Assembler listing +------------------------------------------------------------------------ 1 *********************** 2 * * 3 * APPLE-II * 4 * MINI-ASSEMBLER * 5 * * 6 * COPYRIGHT 1977 BY * 7 * APPLE COMPUTER INC.
F50D: 8A 57 TXA F50E: 18 58 CLC F50F: E5 3A 59 SBC PCL ;FORM ADDR-PC-2 F511: 85 3E 60 STA A2L F513: 10 01 61 BPL REL3 F515: C8 62 INY F516: 98 63 REL3 TYA F517: E5 3B 64 SBC PCH F519: D0 6B 65 ERR3 BN.
F58F: 20 ED FD 119 JSR COUT ;POSITION. F592: 20 3A FF 120 RESETZ JSR BELL F595: A9 A1 121 NXTLINE LDA #$A1 ;'!' F597: 85 33 122 STA PROMPT ;INITIALIZE PROMPT F599: 20 67 FD 123 JSR GETLNZ ;GET LINE.
F60D: 86 3D 181 FORM7 STX A1H ;SAVE INDEX F60F: CA 182 DEX ;DONE WITH FORMAT CHECK? F610: 10 C9 183 BPL FORM2 ;NO. F612: A5 44 184 LDA FMT ;YES, PUT LENGTH F614: 0A 185 ASL ;IN LOW BITS F615: 0A 186 A.
+------------------------------------------------------------------------ | TOPIC -- Apple II -- Red Book Floating point listing +------------------------------------------------------------------------ Apple II Reference Manual (Red Book), January 1978, pages 94-95.
F461: 26 F9 ROL M1 F463: A5 F8 NORM LDA X1 EXP1 ZERO? F465: D0 EE BNE NORM1 NO, CONTINUE NORMALIZING. F467: 60 RTS1 RTS RETURN. F468: 20 A4 F4 FSUB JSR FCOMPL CMPL MANT1,CLEARS CARRY UNLESS 0 F46B: 20 7B F4 SWPALGN JSR ALGNSWP RIGHT SHIFT MANT1 OR SWAP WITH F46E: A5 F4 FADD LDA X2 F470: C5 F8 CMP X1 COMPARE EXP1 WITH EXP2.
F4D7: 26 F6 ROL M2+1 SHIFT DIVIDEND LEFT F4D9: 26 F5 ROL M2 F4DB: B0 1C BCS OVFL OVFL IS DUE TO UNNORMED DIVISOR F4DD: 88 DEY NEXT DIVIDE ITERATION. F4DE: D0 DA BNE DIV1 LOOP UNTIL DONE 23 ITERATIONS. F4E0: F0 BE BEQ MDEND NORM. QUOTIENT AND CORRECT SIGN.
+------------------------------------------------------------------------ | TOPIC -- Apple II -- WOZPAK Floating point routines description +------------------------------------------------------------------------ Wozpak ][, November 1979, pages 109-115.
The exponent is a binary scaling factor (power of two) which is applied to the mantissa. Ranging from -128 to +127, the exponent is stored in standard two's complement representation except for the sign bit which is complemented. This representation allows direct comparison of exponents, since they are stored in increasing numerical sequence.
- 3 81 A0 00 00 - 4 81 80 00 00 - 5 82 B0 00 00 - 7 82 90 00 00 -12 83 A0 00 00 -15 83 88 00 00 -17 84 BC 00 00 -20 84 B0 00 00 -60 85 88 00 00 FLOATING POINT SUBROUTINE DESCRIPTIONS FCOMPL subroutine (address $F4A4) Purpose: FCOMPL is used to negate floating point numbers.
FADD subroutine (address $F46E) Purpose: To add two numbers in floating point form. Entry: The two addends are in FP1 and FP2 respectively. For maximum precision, both should be normalized. Uses: SWPALGN, ADD, NORM, RTLOG. Exit: The normalized sum is left in FP1.
FSUB subroutine (address $F468) Purpose: To subtract two floating point numbers. Entry: The minuend is in FP1 and the subtrahend is in FP2. Both should be normalized to retain maximum precision prior to calling FSUB. Uses: FCOMPL, ALGNSWP, FADD, ADD, NORM, RTLOG.
truncated to contain the 24 most significant mantissa bits (including sign). The absolute value of the multiplier mantissa (M2) is left in FP2. E, SIGN, and SCR are altered. The A- and X-REGs are altered and the Y-REG contains $FF upon exit. Cautions: An exit to location $3F5 is taken if the product is less than -2^128 or greater than +2^128-1.
altered. The A- and X-REGs are altered and the Y-REG is cleared. Uses: MD1, MD2, MDEND. Cautions: An exit to location $3F5 is taken if the quotient is less than -2^128 or greater than +2^128-1 Notes: MD2 contains the remainder mantissa (equivalent to the MOD function).
M1+2 prior to calling FLOAT. FLOAT takes approximately 3 msec. lonqer to convert zero to floating point form than other arguments. The user may check for zero prior to calling FLOAT and increase throughput.
Exit: The two-byte signed two's complement representation of the integer portion is left in M1 (high-order byte) and M1+1 (low-order byte). The floating point values +24.63 and -61.2 are converted to the integers +24 and -61 respectively. FP1 and E are altered but FP2, E, SIGN, and SCR are not.
|_____| |_____| |_____| |_____| X1 M1 NORM1 subroutine (address $F455) Purpose: To normalize a floating point value in FP1 when it is known the exponent is not -128 (X1=0) upon entry. Entry: An unnormalized number is in FP1. The exponent byte should not be 0 for normal use.
ABSWAP Subroutine (address $F437) Purpose: To take the absolute value of FP1 and then swap FP1 with FP2. Note that two sequential calls to ABSWAP will take the absolute values of both FP1 and FP2 in preparation for a multiply or divide. Entry: FP1 and FP2 contain floating point values.
Note: M1 sign bit is unchanged. RTLOG subroutine (address $F480) Purpose: To shift the 6-byte field MANT1 and E one bit to the right (toward the least significant bit). The 6502 carry bit is shifted into the high-order M1 bit. This is useful in correcting binary sum overflows.
MD2 subroutine (address $F4E2) Purpose: To clear the 3-byte MANT1 field for FMUL and FDIV, check for inital result exponent overflow (and underflow), and initialize the X-REG to $17 for loop counting. Entry: the X-REG is cleared by the user since it is placed in the 3 bytes of MANT1.
+------------------------------------------------------------------------ | TOPIC -- Apple II -- DDJ Floating point article +------------------------------------------------------------------------ Dr.
exit used in the event of a non-positive log argument. OVFLW (1E3B) is the error exit for overflow occuring during calculation of e to some power. OVFL (1FE4) is the error exit for overflow in all of the floating point routines. There is no trap for underflow; in such cases, the result is set to 0.
* WHEN THE NUMBER IS LESS THAN 2**(-128). * * EXPONENT: THE EXPONENT REPRESENTS POWERS OF TWO. THE * REPRESENTATION IS 2'S COMPLIMENT EXCEPT THAT THE SIGN * BIT (BIT 7) IS COMPLIMENTED.
1D3D 95 04 STA X2,X 1D3F CA DEX 1D40 10 F0 BPL SAVET 1D42 20 50 1F JSR FADD Z+SQRT(2) 1D45 A2 03 LDX =3 4 BYTE TRANSFER 1D47 B5 14 TM2 LDA T,X 1D49 95 04 STA X2,X LOAD T INTO EXP/MANT2 1D4B CA DEX 1D4.
* COMMON LOG OF MANT/EXP1 RESULT IN MANT/EXP1 * 1DBC 20 00 1D LOG10 JSR LOG COMPUTE NATURAL LOG 1DBF A2 03 LDX =3 1DC1 BD CD 1D L10 LDA LN10,X 1DC4 95 04 STA X2,X LOAD EXP/MANT2 WITH 1/LN(10) 1DC6 CA DEX 1DC7 10 F8 BPL L10 1DC9 20 77 1F JSR FMUL LOG10(X)=LN(X)/LN(10) 1DCC 60 RTS * 1DCD 7E 6F LN10 DCM 0.
1E3B 00 OVFLW BRK OVERFLOW * 1E3C 20 2C 1F CONTIN JSR FLOAT FLOAT INT 1E3F A2 03 LDX =3 1E41 B5 10 ENTD LDA Z,X 1E43 95 04 STA X2,X LOAD EXP/MANT2 WITH Z 1E45 CA DEX 1E46 10 F9 BPL ENTD 1E48 20 4A 1F .
1EBB 95 04 STA X2,X LOAD EXP/MANT2 WITH Z 1EBD CA DEX 1EBE 10 F9 BPL LF3 1EC0 20 9D 1F JSR FDIV Z/(**** ) 1EC3 A2 03 LDX =3 4 BYTE TRANSFER 1EC5 BD E5 1D LD12 LDA MHLF,X 1EC8 95 04 STA X2,X LOAD EXP/MANT2 WITH .5 1ECA CA DEX 1ECB 10 F8 BPL LD12 1ECD 20 50 1F JSR FADD +Z/(***)+.
* * 1F2C A9 8E FLOAT LDA =$8E 1F2E 85 08 STA X1 SET EXPN TO 14 DEC 1F30 A9 00 LDA =0 CLEAR LOW ORDER BYTE 1F32 85 0B STA M1+2 1F34 F0 08 BEQ NORM NORMALIZE RESULT 1F36 C6 08 NORM1 DEC X1 DECREMENT EXP.
1F8D 90 AF NORMX BCC NORM IF EXEN, NORMALIZE PRODUCT, ELSE COMPLEMENT 1F8F 38 FCOMPL SEC SET CARRY FOR SUBTRACT 1F90 A2 03 LDX =$03 INDEX FOR 3 BYTE SUBTRACTION 1F92 A9 00 COMPL1 LDA =$00 CLEAR A 1F94.
1FEE 60 RTRN RTS RETURN END *************************************************************************** Dr. Dobb's Journal, November/December 1976, page 57. ERRATA FOR RANKIN'S 6502 FLOATING POINT ROUTINES Sept. 22, 1976 Dear Jim, Subsequent to the publication of "Floating Point Routines for the 6502" (Vol.
+------------------------------------------------------------------------ | TOPIC -- Apple II -- IA Floating point article +------------------------------------------------------------------------ Interface Age, November 1976, pages 103-111.
|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_| |7 6 5 4 3 2 1 0|7 6.5 4 3 2 1 0|7 6 5 4 3 2 1 0|7 6 5 4 3 2 1 0| | | | | | | BYTE N | BYTE N+1 | BYTE N+2 | BYTE N+3 | | | | | | | | .
mant1 and act as floating point registers. On entry to the subroutines these registers contain the numbers to be operated upon and contain the result on return, The function of the registers is given before each entry point in the source listing. There are three error traps which will cause a software interrupts.
39 0003 EA SIGN NOP 40 0004 EA X2 NOP EXPONENT 2 41 0005 00 00 00 M2 BSS 3 MANTISSA 2 42 0008 EA X1 NOP EXPONENT 1 43 0009 00 00 00 M1 BSS 3 MANTISSA 1 44 000C E BSS 4 SCRATCH 45 0010 Z BSS 4 46 0014 .
101 1D5D 10 F7 BPL MIT 102 1D5F 20 77 1F JSR FMUL T*T 103 1D62 20 1C 1F JSR SWAP MOVE T*T TO EXP/MANT2 104 1D65 A2 03 LDX =3 4 BYTE TRANSFER 105 1D67 BD E4 1D MIC LDA C,X 106 1D6A 95 08 STA X1,X LOAD .
161 1DD8 7F 58 LE2 DCM 0.69314718 LOG BASE E OF 2 B9 0C 162 1DDC 80 52 A1 DCM 1.2920074 B0 40 163 1DE0 81 AB MB DCM -2.6398577 86 49 164 1DE4 80 6A C DCM 1.
218 1E56 20 77 1F JSR FMUL Z*Z 219 1E59 A2 03 LDX =3 4 BYTE MOVE 220 1E5B BD DC 1E LA2 LDA A2,X 221 1E5E 95 04 STA X2,X LOAD EXP/MANT2 WITH A2 222 1E60 B5 08 LDA X1,X 223 1E62 95 18 STA SEXP,X SAVE EX.
279 1ED7 60 RTS RETURN ANS=(.5+Z/(-Z+D+C2*Z*Z- B2/(Z*Z+A2))*2**(INT+1) 280 1ED8 80 5C L2E DCM 1.4426950409 LOG BASE 2 OF E 55 1E 281 1EDC 86 57 A2 DCM 87.417497202 6A E1 282 1EE0 89 4D B2 DCM 617.9722695 3F 1D 283 1EE4 7B 46 C2 DCM .03465735903 4A 70 284 1EE8 83 4F D DCM 9.
335 1F41 45 09 EOR M1 336 1F43 30 04 BMI RTS1 YES,RETURN WITH MANT1 NORMALIZED 337 1F45 A5 08 LDA X1 EXP1 ZERO? 338 1F47 D0 ED BNE NORM1 NO, CONTINUE NORMALIZING 339 1F49 60 RTS1 RTS RETURN 340 * 341 .
396 * 397 1F9D 20 0D 1F FDIV JSR MD1 TAKE ABS VAL OF MANT1, MANT2 398 1FA0 E5 08 SBC X1 SUBTRACT EXP1 FROM EXP2 399 1FA2 20 CD 1F JSR MD2 SAVE AS QUOTIENT EXP 400 1FA5 38 DIV1 SEC SET CARRY FOR SUBTRA.
1D60 77 1F 20 1C 1F A2 03 BD E4 1D 95 08 CA 10 F8 20 1D70 4A 1F A2 03 BD E0 1D 95 04 CA 10 F8 20 9D 1F A2 1D80 03 BD DC 1D 95 04 CA 10 F8 20 50 1F A2 03 B5 14 1D90 95 04 CA 10 F9 20 77 1F A2 03 BD E8 .
+------------------------------------------------------------------------ | TOPIC -- SYM Computer -- SYM Monitor listing +------------------------------------------------------------------------ SYM-1 SUPERMON AND AUDIO CASSETTE INTERFACE SOURCES COMBINED AND CONVERTED TO TELEMARK ASSEMBLER (TASM) V3.
0055 A659 PCLR .BLOCK 1 ;PROG CTR 0056 A65A PCHR .BLOCK 1 0057 A65B SR .BLOCK 1 ;STACK 0058 A65C FR .BLOCK 1 ;FLAGS 0059 A65D AR .BLOCK 1 ;AREG 0060 A65E XR .BLOCK 1 ;XREG 0061 A65F YR .BLOCK 1 ;YREG 0062 A660 ; 0063 A660 ; I/O VECTORS FOLLOW 0064 A660 ; 0065 A660 INVEC .
0117 801F 6C F6 FF JMP ($FFF6) 0118 8022 68 DETIRQ PLA ;IRQ (NON BRK) 0119 8023 AA TAX 0120 8024 68 PLA 0121 8025 28 PLP 0122 8026 6C F8 FF JMP ($FFF8) 0123 8029 20 86 8B SVIRQ JSR ACCESS ;SAVE REGS A.
0179 809F 20 64 80 JSR SAVINT 0180 80A2 20 D3 80 JSR DBOFF ;STOP NMI'S 0181 80A5 AD 56 A6 LDA TV 0182 80A8 D0 05 BNE TVNZ 0183 80AA A9 32 LDA #'2' 0184 80AC 4C 53 80 JMP IDISP 0185 80AF.
0241 8131 10 02 BPL HASHUS+2 0242 8133 0A HASHUS ASL A ;HASH 'USER' CMDS TO ONE BYTE A 0243 8134 0A ASL A ;U0 = $14 THRU U17 =$1B 0244 8135 8D 57 A6 STA LSTCOM 0245 8138 20 1B 8A JSR INCHR ;.
0303 81A0 9D 07 01 STA $0107,X 0304 81A3 BD 08 01 LDA $0108,X 0305 81A6 9D 04 01 STA $0104,X 0306 81A9 BD 06 01 LDA $0106,X 0307 81AC 9D 08 01 STA $0108,X 0308 81AF 98 TYA 0309 81B0 9D 06 01 STA $0106.
0365 8206 38 SEC 0366 8207 60 RTS 0367 8208 A2 10 PSHOVE LDX #$10 ;PUSH PARMS DOWN 0368 820A 0E 4A A6 PRM10 ASL P3L 0369 820D 2E 4B A6 ROL P3H 0370 8210 2E 4C A6 ROL P2L 0371 8213 2E 4D A6 ROL P2H 037.
0427 8291 18 CLC 0428 8292 60 M29 RTS 0429 8293 EE 4A A6 INCP3 INC P3L ;INCREMENT P3 (16 BITS) 0430 8296 D0 03 BNE *+5 0431 8298 EE 4B A6 INC P3H 0432 829B 60 RTS 0433 829C AE 4D A6 P2SCR LDX P2H ;MOV.
0489 8308 60 RTS 0490 8309 29 0F NIBASC AND #$0F ;NIBBLE IN A TO ASCII IN A 0491 830B C9 0A CMP #$0A ;LINE FEED 0492 830D B0 04 BCS NIBALF 0493 830F 69 30 ADC #$30 0494 8311 90 02 BCC EXITNB 0495 8313.
0551 838E B0 FB BCS INST1 0552 8390 38 SEC 0553 8391 60 INST2 RTS 0554 8392 6C 67 A6 INJISV JMP (INSVEC+1) 0555 8395 ; 0556 8395 ; 0557 8395 ; *** EXECUTE BLOCKS BEGIN HERE 0558 8395 ; 0559 8395 BZPAR.
0613 840C 48 PHA 0614 840D AC 5F A6 LDY YR 0615 8410 AE 5E A6 LDX XR 0616 8413 AD 5D A6 LDA AR 0617 8416 40 RTI 0618 8417 C9 11 LPZB CMP #$11 ;LOAD PAPER TAPE 0619 8419 F0 03 BEQ *+5 0620 841B 4C A7 8.
0675 84A1 20 D9 81 LDBYTE JSR INBYTE 0676 84A4 4C DD 82 JMP CHKSAD 0677 84A7 C9 44 DEPZ CMP #'D' ;DEPOSIT, 0 PARM - USE (OLD) 0678 84A9 D0 03 BNE MEMZ 0679 84AB 4C E1 84 JMP NEWLN 0680 84AE .
0737 8526 A0 00 LDY #$00 0738 8528 91 FE STA ($FE),Y 0739 852A D1 FE CMP ($FE),Y ;VERIFY MEM 0740 852C F0 03 BEQ NXTLOC 0741 852E 20 20 83 JSR OUTQM ;TYPE ? AND CONTINUE 0742 8531 20 B2 82 NXTLOC JSR .
0799 859D 8D 4C A6 STA P2L 0800 85A0 18 CLC 0801 85A1 69 07 ADC #$07 0802 85A3 8D 4A A6 STA P3L 0803 85A6 AD 4B A6 LDA P3H 0804 85A9 8D 4D A6 STA P2H 0805 85AC 69 00 ADC #0 0806 85AE 8D 4B A6 STA P3H .
0861 8619 ; 0862 8619 C9 10 STD2 CMP #$10 ;STORE DOUBLE BYTE 0863 861B D0 12 BNE MEM2 0864 861D 20 A7 82 JSR P3SCR 0865 8620 AD 4D A6 LDA P2H 0866 8623 A0 01 LDY #1 0867 8625 91 FE STA ($FE),Y 0868 86.
0923 86A3 20 FA 86 SP2C JSR DIFFZ 0924 86A6 B0 03 BCS SP2D 0925 86A8 4C C4 81 SPEXIT JMP RESALL 0926 86AB 20 4D 83 SP2D JSR CRLF 0927 86AE CD 58 A6 CMP MAXRC 0928 86B1 90 05 BCC SP2E 0929 86B3 AD 58 A.
0985 872B 20 C1 87 JSR BRTT ;INC ERCNT (UP TO FF) 0986 872E 20 B2 82 F3 JSR INCCMP 0987 8731 70 7C BVS B1 0988 8733 F0 EE BEQ F1 0989 8735 90 EC BCC F1 0990 8737 B0 76 F2 BCS B1 ;(ALWAYS) 0991 8739 C9.
1047 87B6 60 RTS 1048 87B7 A0 00 BMOVE LDY #0 ;MOVE 1 BYT + VER 1049 87B9 B1 FE LDA ($FE),Y 1050 87BB 91 FC STA ($FC),Y 1051 87BD D1 FC CMP ($FC),Y 1052 87BF F0 0B BEQ BRT 1053 87C1 AC 52 A6 BRTT LDY .
1109 8835 6D 4C A6 ADC P2L 1110 8838 A8 TAY 1111 8839 AD 4F A6 LDA P1H 1112 883C 6D 4D A6 ADC P2H 1113 883F AA TAX 1114 8840 38 SEC 1115 8841 98 TYA 1116 8842 ED 4A A6 SBC P3L 1117 8845 A8 TAY 1118 88.
1171 88B7 D0 13 BNE EXITGK 1172 88B9 20 CF 88 JSR GK 1173 88BC 8A TXA 1174 88BD 0A ASL A 1175 88BE 0A ASL A 1176 88BF 0A ASL A 1177 88C0 0A ASL A 1178 88C1 8D 3E A6 STA SCRE 1179 88C4 20 CF 88 JSR GK .
1233 893B 49 07 EOR #$07 1234 893D D0 05 BNE LK1 1235 893F 2C 00 A4 BIT PADA 1236 8942 30 1A BMI NOKEY 1237 8944 C9 04 LK1 CMP #$04 1238 8946 90 02 BCC LK2 1239 8948 A9 03 LDA #$03 1240 894A 0A LK2 AS.
1295 89B7 CA DEX 1296 89B8 88 DEY 1297 89B9 10 F0 BPL CON1 1298 89BB 4C C4 81 JMP RESALL 1299 89BE 20 AF 88 HKEY JSR GETKEY ;GET KEY FROM KB AND ECHO ON KB 1300 89C1 20 88 81 OUTDSP JSR SAVER ;DISPLAY.
1357 8A2F D0 0B BNE INRT2 1358 8A31 AD 53 A6 LDA TECHO 1359 8A34 49 40 EOR #$40 ;TOGGLE CTL O BIT 1360 8A36 8D 53 A6 STA TECHO 1361 8A39 18 CLC 1362 8A3A 90 E2 BCC INCHR+3 ;GET GET ANOTHER CHAR 1363 8.
1419 8ABD D0 FD BNE PHAKE 1420 8ABF EA NOP 1421 8AC0 4A LSR A 1422 8AC1 CA DEX 1423 8AC2 D0 F0 BNE OUTC 1424 8AC4 A5 F9 LDA $F9 1425 8AC6 C9 0D CMP #$0D ;CARRIAGE RETURN? 1426 8AC8 F0 04 BEQ GOPAD ;YE.
1481 8B2D AD 02 A4 LDA PBDA 1482 8B30 0A ASL A 1483 8B31 60 RTS 1484 8B32 AE 50 A6 PAD LDX PADBIT ;PAD CARRIAGE RETURN OR LF 1485 8B35 20 E6 8A PAD1 JSR DLYF ;WITH EXTRA STOP BITS 1486 8B38 CA DEX 148.
1543 8BAF AD 54 A6 LDA TOUTFL 1544 8BB2 09 40 ORA #$40 1545 8BB4 8D 54 A6 STA TOUTFL 1546 8BB7 20 86 8B VECSW JSR ACCESS ;UN WRITE PROT RAM 1547 8BBA A2 08 LDX #$8 1548 8BBC BD 6F 8C SWLP2 LDA TRMTBL,.
1605 8BFD 45 .DB $45 ;E 1606 8BFE 46 .DB $46 ;F 1607 8BFF 0D .DB $0D ;CR 1608 8C00 2D .DB $2D ;DASH 1609 8C01 3E .DB $3E ;> 1610 8C02 FF .DB $FF ;SHIFT 1611 8C03 47 .DB $47 ;G 1612 8C04 52 .DB $52 ;R 1613 8C05 4D .DB $4D ;M 1614 8C06 13 .DB $13 ;L2 1615 8C07 1E .
1667 8C38 71 .DB $71 ;F 1668 8C39 F0 .DB $F0 ;CR 1669 8C3A 40 .DB $40 ;DASH 1670 8C3B 70 .DB $70 ;> 1671 8C3C 00 .DB $00 ;SHIFT 1672 8C3D 6F .DB $6F ;G 1673 8C3E 50 .DB $50 ;R 1674 8C3F 54 .DB $54 ;M 1675 8C40 38 .DB $38 ;L2 1676 8C41 6D .DB $6D ;S2 1677 8C42 01 .
1729 8C78 BUFADH =$FF 1730 8C78 ;TAPDEL =$A630 ;HI SPEED TAPE DELAY 1731 8C78 ;KMBDRY =$A631 ;KIM READ BDRY 1732 8C78 ;HSBDRY =$A632 ;HS READ BDRY 1733 8C78 ;TAPET1 =$A635 ;HS FIRST 1/2 BIT 1734 8C78 .
1791 8C8E 85 FD STA MODE 1792 8C90 20 26 8E JSR RDBYTX ;READ ID BYTE ON TAPE 1793 8C93 8D 00 A4 STA DIG ;DISPLAY ON LED (NOT DECODED) 1794 8C96 CD 4E A6 CMP ID ;COMPARE WITH REQUESTED ID 1795 8C99 F0 .
1853 8D03 C9 2F LT7HB CMP #'/' ;EA, MUST BE "/" 1854 8D05 D0 29 BNE LCERR ;LAST CHAR NOT '/' 1855 8D07 F0 15 BEQ LT8A ;(ALWAYS) 1856 8D09 1857 8D09 ; READ KIM DATA 1858 8.
1915 8D69 85 F8 SY100 STA BDRY 1916 8D6B A9 6D LDA #$6D 1917 8D6D 8D 00 A4 STA DIG ;INDICATE NO SYNC ON LEDS 1918 8D70 A5 FD LDA MODE ;TURN ON OUT OF SYNC MODE 1919 8D72 09 40 ORA #$40 ;BIT6 1920 8D74.
1977 8DDE 65 F8 ADC BDRY 1978 8DE0 60 RTS 1979 8DE1 1980 8DE1 24 FD RDCHTX BIT MODE ;READ HS OR KIM CHARACTER 1981 8DE3 10 7A BPL RDCHT ;KIM 1982 8DE5 1983 8DE5 ; RDBYTH - READ HS BYTE 1984 8DE5 ; Y D.
2039 8E3C C9 30 PACKT CMP #$30 ;LT "0"? 2040 8E3E 90 1D BCC PACKT3 2041 8E40 C9 47 CMP #$47 ;GT "F" ? 2042 8E42 B0 19 BCS PACKT3 2043 8E44 C9 40 CMP #$40 ;A-F? 2044 8E46 F0 15 BEQ .
2101 8E87 20 A9 8D DUMPT JSR START ;INIT VIA & CKSUM, SA TO BUFAD & START 2102 8E8A A9 07 LDA #7 ;CODE FOR TAPE OUT 2103 8E8C 8D 02 A4 STA TAPOUT ;BIT 3 USED FOR HI/LO 2104 8E8F A2 01 LDX #1 ;.
2163 8F01 E6 FE INC BUFADL ;BUMP BUFFER ADDR 2164 8F03 D0 C9 BNE DUMPT2 2165 8F05 E6 FF INC BUFADH ;CARRY 2166 8F07 4C CE 8E JMP DUMPT2 2167 8F0A 24 FD OUTCTX BIT MODE ;HS OR KIM? 2168 8F0C 10 48 BPL .
2225 8F56 8E 38 A6 OUTCHT STX SCR8 ;PRESERVE X 2226 8F59 8C 39 A6 STY SCR9 ;DITTO Y 2227 8F5C 85 FC STA CHAR 2228 8F5E A9 FF LDA #$FF ;USE FF W/SHIFTS TO COUNT BITS 2229 8F60 48 KIMBIT PHA ;SAVE BIT C.
2287 8FB2 46 .DB $46 ;HS TAPE BOUNDARY 2288 8FB3 00 00 .DB $00,$00 ;SCR3,SCR4 2289 8FB5 33 .DB $33 ;HS TAPE FIRST 1/2 BIT 2290 8FB6 00 00 .DB $00,$00 ;SCR6,SCR7 2291 8FB8 00 00 00 00 .DB $00,$00,$00,$00 ;SCR8-SCRB 2292 8FBC 5A .DB $5A ;HS TAPE SECOND 1/2 BIT 2293 8FBD 00 00 00 .
+------------------------------------------------------------------------ | TOPIC -- AIM Computer -- AIM Monitor listing +------------------------------------------------------------------------ 0001 0000 ;TELEMARK CROSS ASSEMBLER (TASM) http://www.halcyon.
0057 00E5 END .BLOCK 2 ;LIMITS OF BUFFER (END) 0058 00E7 SAVE .BLOCK 2 ;USED BY REPLACE 0059 00E9 OLDLEN .BLOCK 1 ;ORIG LENGTH 0060 00EA LENGTH .BLOCK 1 ;NEW LENGTH 0061 00EB STRING .BLOCK 20 ;FIND STRING 0062 00FF 0063 0100 *=$0100 0064 0100 ;BREAKPOINTS AND USER I/O HANDLERS 0065 0100 BKS .
0119 A416 CURPOS .BLOCK 1 ;PRINTER POINTER 0120 A417 CNTH30 .BLOCK 1 ;BAUD RATE &... 0121 A418 CNTL30 .BLOCK 1 ;DELAY FOR TTY 0122 A419 COUNT .BLOCK 1 ;# OF LINES (0-99) 0123 A41A S1 .BLOCK 2 ;START ADDRESS 0124 A41C ADDR .BLOCK 2 ;END ADDRESS 0125 A41E CKSUM .
0181 A484 ; WRITE EDGE DETECT CONTROL (NOT USED BECAUSE KB) 0182 A484 *=$A484 0183 A484 DNPA7 .BLOCK 1 ;DISABLE PA7 INT ,NEG EDGE DET 0184 A485 DPPA7 .BLOCK 1 ;DIS PA7 INT ,POS EDGE DETE 0185 A486 ENPA7 .BLOCK 1 ;ENA PA7 INT ,NEG EDG DET 0186 A487 EPPA7 .
0243 A810 ; ****************************** 0244 A810 ; REGISTERS FOR DISPLAY (6520) 0245 AC00 *=$AC00 0246 AC00 RA .BLOCK 1 ;REGISTER A 0247 AC01 CRA .
0305 E000 46524F4DBD M1 .DB "FROM",EQS 0306 E005 54 4F BD M3 .DB "TO",EQS 0307 E008 202A2A2A2A20M4 .DB " **** PS AA XX YY S",$D3 0307 E00E 50532041412058582059592053D3 0308 E01C 4D4F5245BF M5 .DB "MORE",$BF 0309 E021 4F 4E A0 M6 .
0363 E0C0 78 SEI ;DISABLE INTERRUPT 0364 E0C1 A2 FF LDX #$FF ;INIT STACK PTR 0365 E0C3 9A TXS 0366 E0C4 8E 24 A4 STX SAVS ;ALSO INIT SAVED STACK PTR 0367 E0C7 ;INITIALIZE 6522 0368 E0C7 A2 0E LDX #14 .
0425 E13E 20 13 EA RS6 JSR CRLOW ;CLEAR DISPLAY 0426 E141 4C 72 FF JMP PAT21 0427 E144 A2 13 RS7 LDX #19 ;CLEAR HARDWARE CURSORS 0428 E146 8A RS8 TXA 0429 E147 48 PHA 0430 E148 A9 00 LDA #0 0431 E14A .
0487 E1AC ;HAVE VALID COMMAND 0488 E1AC 8A MCM3 TXA ;CONVERT TO WORD (MULT BY 2) 0489 E1AD 0A ASL A ;2 BYTES (ADDR) 0490 E1AE AA TAX 0491 E1AF BD E5 E1 LDA MONCOM,X ;GET ADDRESS OF COMMAND PROCESSOR 0.
0542 E261 ;***** G COMMAND-RESTART PROCESSOR ***** 0543 E261 20 37 E8 GO JSR PSL1 ;"/" 0544 E264 20 85 E7 JSR GCNT ;GET COUNT 0545 E267 20 F0 E9 JSR CRLF 0546 E26A 4C 86 E2 JMP GOBK1 ;RESUME.
0604 E2E0 BE 1C A4 LDX ADDR,Y 0605 E2E3 4C 42 EA JMP WRAX 0606 E2E6 0607 E2E6 ;***** L COMMAND-GENERAL LOAD ***** 0608 E2E6 ;LOAD OBJECT FROM TTY,USER,TYPE OR TAPE IN KIM-1 FORMAT 0609 E2E6 20 48 E8 L.
0666 E35F 20 BD ED JSR ADDBK1 ;JUST OUTPUT BLK CNT 0667 E362 A2 01 LDX #1 ;RESTORE X 0668 E364 ;CHECK IF FILE IS CORRECT 0669 E364 BD 16 01 LOADT2 LDA TABUFF,X ;NOW CHCK FILE NAME 0670 E367 DD 2D A4 C.
0728 E3E5 4C D1 E3 JMP LOADK5 ;NEXT 0729 E3E8 20 FD E3 LOADK7 JSR RBYTE ;END OF DATA CMP CKSUM 0730 E3EB CD 1E A4 CMP CKSUM ;LOW 0731 E3EE D0 95 BNE CKERR 0732 E3F0 20 FD E3 JSR RBYTE 0733 E3F3 CD 1F .
0790 E46A EE 10 A4 INC BKFLG ;SET FLG 0791 E46D ;CHCK OUTPUT DEV 0792 E46D AD 13 A4 DU1A LDA OUTFLG 0793 E470 C9 4B CMP #'K' ;TAPE FOR KIM? 0794 E472 D0 04 BNE *+6 0795 E474 68 PLA ;PULL FLG.
0852 E4EE 20 BA E9 JSR SEMI ;OUTPUT ';' 0853 E4F1 A2 02 LDX #2 0854 E4F3 A9 00 LDA #0 ;OUTPUT # OF BYTES (0-LAST RECORD) 0855 E4F5 20 3B E5 JSR OUTCK1 0856 E4F8 AD 07 01 DU10A LDA S2+1 ;OUTP.
0914 E569 D0 03 BNE *+5 0915 E56B EE 07 01 INC S2+1 0916 E56E 60 RTS 0917 E56F 0918 E56F ;OPEN A FILE FOR OUTPUT TO TAPE BY BLOCKS 0919 E56F ;OUTPUT FILENAME GIVEN BY JSR WHEREO TO TAPE BUFF 0920 E56F.
0976 E5E9 60 RTS 0977 E5EA 0978 E5EA ;***** P COMMAND-ALTER PROCESSOR STATUS ***** 0979 E5EA A2 00 CGPS LDX #0 0980 E5EC F0 0E BEQ CGALL 0981 E5EE 0982 E5EE ;***** A COMMAND-ALTER ACCUMULATOR ***** 09.
1038 E64F 20 13 EA JSR CRLOW 1039 E652 20 3E E8 SH1 JSR BLANK 1040 E655 BE 00 01 LDX BKS,Y ;ADDRESS OF NEXT BREAKPOINT 1041 E658 B9 01 01 LDA BKS+1,Y 1042 E65B 20 42 EA JSR WRAX ;SHOW BREAKPOINT ADDRE.
1100 E6C9 D0 2F BNE BRK4 ;IF $10 TAPE CNTRL IS OFF 1101 E6CB 1102 E6CB ;***** 2 COMMAND-TOGGLE TAPE 2 CONTROL ***** 1103 E6CB AD 00 A8 TOGTA2 LDA DRB 1104 E6CE 49 20 EOR #$20 ;INVERT PB5 1105 E6D0 8D .
1162 E732 65 EA ADC LENGTH 1163 E734 8D 25 A4 STA SAVPC 1164 E737 90 03 BCC JD3 1165 E739 EE 26 A4 INC SAVPC+1 1166 E73C 20 24 EA JD3 JSR CRCK ;<CR> 1167 E73F 4C 23 E7 JMP JD1 1168 E742 60 JD4 RTS 1169 E743 1170 E743 ;INITIALIZATION TABLE FOR 6522 1171 E743 340037FF25FFINTAB1 .
1221 E7A9 20 AF E7 TO1 JSR KEP 1222 E7AC 4C B1 EA JMP ADDNE ;GET ADDRESS 1223 E7AF 1224 E7AF ;PRINT MSG POINTED TO BY Y REG 1225 E7AF B9 00 E0 KEP LDA M1,Y 1226 E7B2 48 PHA 1227 E7B3 29 7F AND #$7F ;S.
1283 E81E 8D 16 A4 PSL0C STA CURPOS 1284 E821 A2 00 LDX #0 1285 E823 B9 38 A4 PSL0D LDA DIBUFF,Y ;TRANSFER THEM 1286 E826 9D 60 A4 STA IBUFM,X 1287 E829 E8 INX 1288 E82A C8 INY 1289 E82B EC 16 A4 CPX .
1345 E892 A9 0D LDA #CR ;OUTPUT LAST LINE IF ON 1346 E894 4C 00 F0 JMP OUTPRI ;& CLEAR PRINTER PTR 1347 E897 ;USER SET UP 1348 E897 C9 55 WHRO3 CMP #'U' ;USR RTN? 1349 E899 D0 04 BNE WHR.
1407 E901 A9 0D OUTLOW LDA #CR 1408 E903 8D 13 A4 STA OUTFLG 1409 E906 60 OUTL1 RTS 1410 E907 1411 E907 ;ON <ESCAPE> STOPS EXECUTION & BACK TO MONITOR 1412 E907 ;ON <SPACE> STOPS EXECU.
1469 E973 ;READ AND ECHO A CHAR FROM KB OR TTY 1470 E973 20 83 FE REDOUT JSR CUREAD 1471 E976 C9 0D RED2 CMP #CR 1472 E978 F0 C1 BEQ RCHT1 ;DO NOT ECHO <CR> 1473 E97A 1474 E97A ;OUTPUTS A CHAR T.
1531 E9DE 2E 11 A4 ROL PRIFLG ;RESTORE FLG 1532 E9E1 60 RTS 1533 E9E2 ;USER DEFINED 1534 E9E2 C9 55 OUTA3 CMP #'U' ;USER ROUTINE? 1535 E9E4 D0 04 BNE OUTA4 1536 E9E6 38 SEC ;SET FLG FOR NORM.
1593 EA42 20 46 EA WRAX JSR NUMA 1594 EA45 8A TXA 1595 EA46 1596 EA46 ;PRINT ONE BYTE=TWO ASCII CHARS TO OUTPUT DEVICE 1597 EA46 48 NUMA PHA 1598 EA47 4A LSR A 1599 EA48 4A LSR A 1600 EA49 4A LSR A 16.
1655 EAA3 CA DEX 1656 EAA4 D0 F9 BNE PAK2 1657 EAA6 AE 2D A4 LDX CPIY+3 ;REST X 1658 EAA9 AD 29 A4 LDA STIY+2 1659 EAAC 18 CLC 1660 EAAD 60 RTS 1661 EAAE 1662 EAAE ;GET FOUR BYTE ADDR ,TAKE LAST FOUR CHR TO.
1717 EB15 C8 INY 1718 EB16 B9 1C A4 LDA ADDR,Y 1719 EB19 C8 INY 1720 EB1A 20 84 EA JSR PACK ;PACK TWO CHRS INTO 1 BYTE 1721 EB1D B0 0C BCS ADDN8 ;BRCNH IF ERROR 1722 EB1F 9D 1C A4 STA ADDR,X 1723 EB22.
1779 EB85 8D 29 A4 STA STIY+2 1780 EB88 8D 2C A4 STA CPIY+2 1781 EB8B A9 99 LDA #$99 ;STA INSTR 1782 EB8D 8D 27 A4 STA STIY 1783 EB90 A9 D9 LDA #$D9 ;CMP INSTR 1784 EB92 8D 2A A4 STA CPIY 1785 EB95 A9.
1841 EBEA 20 23 EC JSR DEHALF ;DELAY 1/2 BIT TIME 1842 EBED AD 00 A8 GET3 LDA DRB ;GET 8 BITS 1843 EBF0 29 40 AND #$40 ;MASK OFF OTHER BITS,ONLY PB6 1844 EBF2 4E 2A A4 LSR CPIY ;SHIFT RIGHT CHARACTER .
1903 EC5E 4A LSR A ;ONLY ROW 1 1904 EC5F 90 06 BCC GETK00 ;GOT YOU 1905 EC61 68 PLA 1906 EC62 CA DEX 1907 EC63 D0 F0 BNE GETK0 1908 EC65 F0 DC BEQ GETKY ;THERE IS A MISTAKE CHECK AGAIN 1909 EC67 68 GE.
1965 ECC3 E0 00 CPX #0 ;IF SHIFT IS NOT ADV PAPER 1966 ECC5 F0 25 BEQ GETK10 ;NO SHIFT ,SO ADVPAPER 1967 ECC7 29 4F AND #$4F ;CONVRT TO "@" 1968 ECC9 C9 1C GETK11 CMP #$1C ;SEE IF TOGGL PRIF.
2027 ED3B ;GET A CHAR FROM TAPE SUBROUTINE 2028 ED3B ;A BUFFER IS USED TO GET BLOCKS OF DATA 2029 ED3B ;FROM TAPE ,EXCEPT WHEN FORMAT EQUAL TO 2030 ED3B ;KIM-1 (THE WHOLE FILE IS LOADED AT ONE TIME) 2.
2089 EDB7 4C A1 E1 JMP COMIN 2090 EDBA 2091 EDBA ;ADD 1 TO BLK COUNT AND OUTPUT IT 2092 EDBA EE 15 01 ADDBLK INC BLK ;INCR BLK CNT 2093 EDBD EE 11 A4 ADDBK1 INC PRIFLG ;SO DONT OUTPUT TO PRINTR 2094 E.
2151 EE2E 4E 2A A4 LSR CPIY ;MAKE ROOM FOR MSB 2152 EE31 0D 2A A4 ORA CPIY ;OR IN SIGN BIT 2153 EE34 8D 2A A4 STA CPIY ;REPLACE CHAR 2154 EE37 88 DEY 2155 EE38 D0 F1 BNE GETA1 2156 EE3A 60 RTS 2157 EE.
2213 EEA4 30 FB BMI CKF4 2214 EEA6 10 D9 BPL CKF2 ;GO GET TIMING 2215 EEA8 2216 EEA8 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2217 EEA8 ;OUTPUT ACC TO TTY SUBROUTINE 2218 EEA8 ;X,Y ARE P.
2275 EF17 E0 3C OUTD1A CPX #60 ;LAST CHAR FOR DISP? 2276 EF19 90 05 BCC OUTD2 2277 EF1B 20 AC EB JSR PLXY ;GO BACK 2278 EF1E 68 PLA ;DO NOT STORE 2279 EF1F 60 RTS 2280 EF20 9D 38 A4 OUTD2 STA DIBUFF,X.
2337 EF81 A9 04 LDA #4 ;FIRST CHIP SELECT 2338 EF83 E0 00 CPX #0 ;FIRST CHIP ? 2339 EF85 F0 04 BEQ OUTDD3 2340 EF87 0A OUTDD2 ASL A 2341 EF88 CA DEX 2342 EF89 D0 FC BNE OUTDD2 ;BACK TILL RIGH CS 2343 .
2399 F036 68 PLA 2400 F037 60 RTS 2401 F038 A9 20 OUTPR LDA #' ' ;FILL REST OF BUFF WITH BLANKS 2402 F03A E0 14 OUTPR1 CPX #20 ;SEE IF END OF BUFF 2403 F03C F0 06 BEQ OUTPR2 2404 F03E 9D 60 .
2461 F0B2 A9 06 LDA #PRTIME/256 ;START T2 FOR 1.7 MSEC 2462 F0B4 8D 09 A8 STA T2H 2463 F0B7 20 E3 F0 JSR IPSU ;SET NEXT PATTERN WHILE WAITING 2464 F0BA 20 1B EC JSR DE2 ;WAIT TILL TIME OUT 2465 F0BD A.
2523 F0F0 20 58 EB JSR LDAY 2524 F0F3 2C 7C A4 BIT IMASK ;SEE IF DOT IS SET 2525 F0F6 F0 16 BEQ IPS2 ;NO SO GO ON TO NEXT CHAR 2526 F0F8 AD 7A A4 LDA IBITL ;DOT ON SO SET THE CURR SOLENOID 2527 F0FB F.
2585 F15D DE 74 A4 OP06 DEC IDIR,X ;DIRECTION <= $FF (-) 2586 F160 2587 F160 ;START OF NEW PRINT ROW 2588 F160 1E 7C A4 NEWROW ASL IMASK,X ;UPDATE ROW MASK FOR DOT PATTERNS 2589 F163 ;START OF NEW .
2647 F1D2 ;CHCK ACTIVE BUFFER AND LOAD A CHR 2648 F1D2 ;CARRY=0 IF ONLY 1 BUFFER ,C=1 IF 2 BUFFERS 2649 F1D2 AD 12 A4 CKBUFF LDA INFLG 2650 F1D5 CD 13 A4 CMP OUTFLG 2651 F1D8 D0 08 BNE CBUFF1 2652 F1D.
2709 F24A ;OUTPUT ACC TO TAPE 2710 F24A 8E 2D A4 OUTTAP STX CPIY+3 ;SAVE X 2711 F24D A0 07 LDY #$07 ;FOR THE 8 BITS 2712 F24F 8C 27 A4 STY STIY 2713 F252 AE 08 A4 LDX TSPEED 2714 F255 30 39 BMI OUTTA1.
2771 F2C4 A9 0C LDA #12 2772 F2C6 90 02 BCC SETSP1 2773 F2C8 A9 04 LDA #4 2774 F2CA 8D 0A A4 SETSP1 STA NPUL 2775 F2CD A9 12 LDA #18 2776 F2CF 90 02 BCC SETSP2 2777 F2D1 A9 06 LDA #6 2778 F2D3 8D 0C A4 SETSP2 STA TIMG+1 2779 F2D6 60 RTS 2780 F2D7 ;.
2813 F379 087849410841 .DB $08,$78,$49,$41,$08,$41,$01,$40 ;X -- ( 2813 F37F 0140 2814 F381 004F00147F08 .DB $00,$4F,$00,$14,$7F,$08,$59,$02 ; -- ' 2814 F387 5902 2815 F389 22223E3E0008 .DB $22,$22,$3E,$3E,$00,$08,$00,$08 ;( -- / 2815 F38F 0008 2816 F391 497F51491245 .
2846 F45F 5D5B 2847 F461 2848 F461 ;DISASSEMBLE INSTRUCTIONS AND SHOW REGS IS REGF SET 2849 F461 AD 0E A4 REGQ LDA REGF ;GET FLAG 2850 F464 F0 06 BEQ DISASM 2851 F466 20 32 E2 JSR REG1 ;SHOW THE SIX R.
2908 F4CC 8D 17 01 STA LMNEM 2909 F4CF B9 F9 F5 LDA MNEMR,Y 2910 F4D2 8D 18 01 STA RMNEM 2911 F4D5 A2 03 LDX #3 ;MUST BE 2912 F4D7 A9 00 PRMN1 LDA #0 2913 F4D9 A0 05 LDY #5 2914 F4DB 0E 18 01 PRMN2 AS.
2970 F550 AA TAX 2971 F551 10 01 BPL PCADJ4 2972 F553 88 DEY 2973 F554 6D 25 A4 PCADJ4 ADC SAVPC ;PROG CNTR LOW 2974 F557 90 01 BCC RTS1 2975 F559 C8 INY 2976 F55A 60 RTS1 RTS 2977 F55B 2978 F55B 40024503D008MODE .DB $40,2,$45,3,$D0,8,$40,9 2978 F561 4009 2979 F563 30224533D008 .
3011 F621 4468B232B200 .DB $44,$68,$B2,$32,$B2,0,$22,0 3011 F627 2200 3012 F629 1A1A26267272 .DB $1A,$1A,$26,$26,$72,$72,$88,$C8 3012 F62F 88C8 3013 F631 C4CA26484444 .
3070 F692 A5 E6 LDA END+1 ;CMP WITH END 3071 F694 CD 1D A4 CMP ADDR+1 3072 F697 F0 11 BEQ EDI7 3073 F699 B0 13 BCS EDI8 3074 F69B 20 BC F8 EDI6 JSR TOPNO ;RESTORE NOWLN 3075 F69E A9 00 LDA #0 3076 F6A.
3132 F706 4C AF E7 JMP KEP 3133 F709 A0 00 UPNO LDY #0 3134 F70B 20 E9 F8 JSR ATBOT 3135 F70E 90 03 BCC UP1 3136 F710 4C 5C FA JMP ENDERR 3137 F713 B1 DF UP1 LDA (NOWLN),Y 3138 F715 F0 09 BEQ UP4 3139.
3194 F780 C9 7F CMP #$7F ;RUB 3195 F782 4C 2A FF JMP PATC17 ;NO ZEROS IN CASE OF PAPER TAPE 3196 F785 C9 0A IN02A CMP #LF 3197 F787 F0 F1 BEQ IN02 3198 F789 C9 0D CMP #CR 3199 F78B F0 1B BEQ IN03 3200.
3256 F80C ;***** F COMMAND-FIND STRING ***** 3257 F80C ;FIND STRING AND PRINT LINE TO TERMINAL 3258 F80C 20 1E F8 FCHAR JSR FCH 3259 F80F AD 15 A4 FCHA1 LDA CURPO2 ;SAVE BUFFER PNTR 3260 F812 48 PHA 3.
3318 F889 4C 7C F8 JMP CHN1 3319 F88C AD 29 A4 CHN2 LDA STIY+2 ;GET CHAR COUNT 3320 F88F 85 E9 STA OLDLEN ;GET READY FOR REPLAC 3321 F891 AD 15 A4 LDA CURPO2 ;PNTR TO BEGINNING OF STRING 3322 F894 48 .
3380 F8F6 60 RTS 3381 F8F7 18 AT01 CLC 3382 F8F8 60 RTS 3383 F8F9 3384 F8F9 ;SEE IF WE RAN PAST END OF BUFFER LIMIT 3385 F8F9 A5 E1 ATEND LDA BOTLN 3386 F8FB A6 E2 LDX BOTLN+1 3387 F8FD E4 E6 CPX END+.
3442 F951 F0 EB BEQ REP2 3443 F953 B9 38 A4 R88 LDA DIBUFF,Y 3444 F956 91 DF STA (NOWLN),Y 3445 F958 20 4A FA JSR GOGO 3446 F95B 88 DEY 3447 F95C 10 F5 BPL R88 3448 F95E 60 RTS 3449 F95F B0 6E R2W BCS.
3504 F9D1 38 SEC 3505 F9D2 E5 E9 SBC OLDLEN 3506 F9D4 A4 E9 LDY OLDLEN 3507 F9D6 D0 02 BNE R101 ;ALREADY HAVE ROOM FOR CR 3508 F9D8 69 00 ADC #0 ;ADD ONE TO DIFFERENCE 3509 F9DA 48 R101 PHA 3510 F9DB .
3566 FA55 8D 1D A4 STA ADDR+1 3567 FA58 4C 33 EB JMP MEMERR 3568 FA5B 60 GOGO1 RTS ;OK 3569 FA5C 3570 FA5C 20 44 EB ENDERR JSR CLR ;CLEAR PNTR 3571 FA5F A0 72 LDY #EMSG2-M1 ;PRINT "END" 3572.
3625 FAE2 3626 FAE2 ;ROM TABLE LOCATIONS: 3627 FAE2 00020008F2FFTYPTR1 .DB 00,02,00,08,$F2,$FF,$80,01 3627 FAE8 8001 3628 FAEA C0E2C0C0FF00 .DB $C0,$E2,$C0,$C0,$FF,00,00 3628 FAF0 00 3629 FAF1 0800108040C0TYPTR2 .DB 08,00,$10,$80,$40,$C0,00,$C0 3629 FAF7 00C0 3630 FAF9 00400000E420 .
3663 FBB8 20 3B E8 JSR BLANK2 3664 FBBB 20 3B E8 JSR BLANK2 3665 FBBE 4C 06 FE JMP MNEM ;JUMP TO INPUT MNEMONIC OPCODE 3666 FBC1 A9 00 MODEM LDA #00 ;SET UP TO FORM MODE MATCH 3667 FBC3 8D 26 01 STA T.
3725 FC3A 4C CB FC JMP OPCOMP 3726 FC3D 4C B6 FC HATCJ JMP HATCH 3727 FC40 A9 04 TRY34 LDA #04 ;CHECK FOR ABSOLUTE OR ZP,X ORZP,` 3728 FC42 CD 31 A4 CMP TEMPX 3729 FC45 90 15 BCC ABSIND 3730 FC47 A2 0.
3787 FCC3 D0 06 BNE OPCOMP 3788 FCC5 20 94 E3 ERRORM JSR CKER00 ;OUTPUT ERROR MESSAGE 3789 FCC8 4C AA FB JMP STARTM 3790 FCCB 3791 FCCB ;COMPUTE FINAL OP CODE FOR DEFINED ADDRESING MODE 3792 FCCB BD E.
3849 FD38 F0 0B BEQ FORMDS 3850 FD3A 88 DEY 3851 FD3B B8 CLV 3852 FD3C 50 F2 BVC STSHLP ;REPEAT TILL THRU 3853 FD3E 3854 FD3E A9 01 ONEBYT LDA #01 ;SET BYTES = 1 3855 FD40 8D 2F A4 STA BYTESM 3856 FD4.
3911 FDBB 38 CMPBR1 SEC ;COMPUTE BRANCH RELATIVE ADDRESS 3912 FDBC AD 35 A4 LDA OPCODE+1 3913 FDBF ED 26 01 SBC MOVAD 3914 FDC2 8D 35 A4 STA OPCODE+1 3915 FDC5 AD 36 A4 LDA OPCODE+2 3916 FDC8 ED 27 01.
3973 FE33 A2 05 LDX #05 ;SET UP INNER LOOP 3974 FE35 4A INLUP LSR A ;SHIFT 5 BITS ACC TO MOVAD,MOVAD+1 3975 FE36 6E 26 01 ROR MOVAD 3976 FE39 6E 27 01 ROR MOVAD+1 3977 FE3C CA DEX 3978 FE3D D0 F6 BNE .
4035 FE9C AE 15 A4 PATCH4 LDX CURPO2 ;DONT DO ANYTHING IF "8D" 4036 FE9F C9 8D CMP #CR+$80 ;SO <CR> FOR TV & NOT FOR DISP 4037 FEA1 D0 0B BNE PAT4A 4038 FEA3 A9 A0 LDA #' &apo.
4097 FF14 4C 0A E5 JMP DU11 4098 FF17 4099 FF17 20 F0 E9 PATC15 JSR CRLF ;DECODE COMMAND 4100 FF1A 8A TXA ;SAVE INDEX 4101 FF1B 0A ASL A 4102 FF1C AA TAX 4103 FF1D BD B8 FA LDA JTBL,X ;PART OF ENTRY 4.
4158 FF99 00 .DB 0 4159 FF9A 4160 FF9A EE 68 01 PAT22 INC BLKO 4161 FF9D 4C BD ED JMP ADDBK1 4162 FFA0 4163 FFA0 A9 FF PAT23 LDA #$FF ;START TIMER 4164 FFA2 8D 97 A4 STA DI1024 4165 FFA5 AD 85 A4 PAT2.
COUNT A419 CKSUM A41E CPIY A42A CRA AC01 CRB AC03 CR 000D COMIN E1A1 COMB E1C4 CHNGG E2A0 CHNG1 E2A6 CH2 E2B8 CH4 E2C0 CH3 E2C5 CKERR E385 CKER0 E38E CKER00 E394 CKER1 E396 CKER2 E3A3 CHEKAR E54B CHEK.
GID1 E427 GOERR E608 GCNT E785 GCN1 E78C GETTTY EBDB GET1 EBE2 GET3 EBED GETKD0 EC38 GETKEY EC40 GETKY EC43 GETK0 EC55 GETK00 EC67 GETK1 EC71 GETK1B EC80 GETK2 EC82 GETK3 EC8D GETK4 EC93 GETK5 ECA4 GE.
NHIS E688 NH1 E690 NAMO E8CF NAMO1 E8D6 NAMO2 E8E9 NAMO3 E8EB NAMO4 E8F5 NUMA EA46 NOUT EA51 NEWROW F160 NEWCOL F163 NOWS1 F909 OLDLEN 00E9 OPCODE A434 OUTFLG A413 OUTCKS E531 OUTCK E538 OUTCK1 E53B O.
READ2 E94D REA1 E956 RB2 E95C RDRUP E95F RDR1 E96A REDOUT E973 RED2 E976 RD2 EA5D RD1 EA70 RSPAC EA7B ROONEK ECEF ROO1 ED00 RDBIT EE3B RDBIT1 EE43 RDBIT2 EE51 RDBIT4 EE67 ROUT F286 ROUT1 F28B ROW1 F42.
UT1LH A007 UT2L A008 UT2H A009 USR A00A UACR A00B UPCR A00C UIFR A00D UIER A00E UDRA A00F UIN 0108 UOUT 010A UP F6F9 UPNO F709 UP1 F713 UP4 F720 VECKSM E694 VECK1 E69E VECK2 E6AC VALID FCDD VECK5 FF66.
+------------------------------------------------------------------------ | TOPIC -- AIM Computer -- AIM BASIC Language Reference Manual +--------------------------------------------------------------.
problems. 100 INSTALLING BASIC IN THE AIM 65 ROM INSTALLATION PROCEDURE Before handling the BASIC ROM circuits, be sure to observe the precautions outlined in Section 1.4 of the AIM 65 User's Guide. To install the ROMs, turn off power to the AIM 65.
memory to be initialized with AA (hex) in all bytes, starting with address 532. This, of course, destroys any previous BASIC programs, data in the AIM 65 Editor Text Buffer, or machine level routines that may have been stored in this portion of memory.
PRINT commands will be directed to the display only. If the printer is turned on, all commands and data from PRINT commands will be directed to both the printer and display. With the printer off, data can still be directed to the printer by using the PRINT) command (see Subject 305).
* Although the ATN function is not included in AIM 65 BASIC, the ATN command is recognized (see Appendix H). 202 DIRECT AND INDIRECT COMMANDS DIRECT COMMANDS Try typing in the following: PRINT 10-4 (end with RETURN) BASIC will immediately print: 6 The print statement you typed in was executed as soon as you hit the RETURN key.
BASIC will reply with: 10 PRINT 2+3 20 PRINT 2-3 DELETING A LINE Sometimes it is desirable to delete a line of a program altogether. This is accomplished by typing the Line Number of the line so be deleted, followed by a carriage return. Type in the following: 10 LIST BASIC will reply with: 20 PRINT 2-3 We have now deleted line 10 from the program.
If we use a ";" instead of a comma, the next value will be printed immediately following the previous value. NOTE Numbers are always printed with at least one trailing space. Any text to be printed must always be enclosed in double quotes. Try the following examples: 1.
+1 1 -1 -1 6523 6523 -23.460 -23.46 1E20 1E+20 -12.3456E-7 -1.23456E-06 1.234567E-10 1.23457E-10 1000000000 1E+09 999999999 999999999 .1 .1 .01 .01 .000123 1.
Z1 ZIABCD (variable name too long) TP TO (variable names cannot be reserved words) PSTG$ RGOTO (variable names cannot contain reserved words) COUNT ASSIGNING VARIABLES WITH A LET OR ASSIGNMENT STATEMENT Besides having values assigned to variables with an input statement, you can also set the value of a variable with a LET or assignment statement.
REMARKS The REM (short for "remark") statement is used to insert comments or notes into a program. When BASIC encounters a REM statement, the rest of the line is ignored. This serves mainly as an aid for the programmer and serves no useful function as far as the operation of the program in solving a particular problem.
At line 20, if A is smaller than B, A<=B is true so we goto line 50. At line 50, A<B will be true so we then go to line 80. "B IS BIGGER" is then printed and again we go back to the beginning. Try running the last two programs several times.
The output of the program listed above will be exactly the same as the previous two programs. At line 10, N is set to equal 1. Line 20 causes the value of N and the square root of N so be printed.
10 FOR I=1 TO 5 20 FOR J=1 TO 3 30 PRINT I,J 40 NEXT I 50 NEXT J It does not work because when the "NEXT I" is encountered, all knowledge of the J-loop is lost. This happens because the J-loop is "inside" the I-loop. 209 MATRIX OPERATIONS It is often convenient to be able to select any element in a table of numbers.
100 INPUT N 110 IF N=INT(N) THEN 140 120 PRINT "MUST BE INTEGER." 130 GOTO 100 140 RETURN This program asks for two numbers (which must be integers), and then prints their sum. The subroutine in this program is lines 100 to 140. The subroutine asks for a number, and if it is not an integer, asks for a new number.
If more values are read than there are numbers in the DATA statements, an out of data (OD) error occurs. That is why in line 40 we check to see if -999999 was read. This is not one of the numbers to be matched, but is used as a flag to indicate that all of the data (possible correct guesses) has been read.
ROCKW ROCKWE ROCKWEL ROCKWELL ROCKWELL R ROCKWELL R6 ROCKWELL R65 ROCKWELL R650 ROCKWELL R6500 Since A$ has 14 characters this loop will be executed with N=1,2,3,...,13,14. The first time through only the first character will be printed, the second time the first two characters will be printed, etc.
B$="BASIC FOR"+" "+A$ PRINT B$ BASIC FOR ROCKWELL R6500 Concatenation is especially useful if you wish to take a string apart and then put it back together with slight modifications.
ADDITIONAL STRING CONSIDERATIONS 1. A string may contain from 0 to 255 characters. All string variable names end in a dollar sign ($); for example, A$, B9$, K$, HELLO$.
command level and OK is typed. Prints "BREAK IN LINE XXXX," where XXXX is the line number of the next statement to be executed. There is no F1 key on a TTY. However, when TTY is being used, the AIM 65's F1 key is operational and can be used.
(5 plus 3/4). The precedence of operators used in evaluating expressions is as follows, in order beginning with the highest precedence : NOTE Operators listed on the same line have the same precedence.
NOT IF NOT Q3 THEN 4 If expression "NOT Q3" is true (Because Q3 is false), then branch to line 4 Note: NOT -1=0 (NOT true=false) AND, OR, and NOT can be used for bit manipulation, and for performing boolean operations.
For instance, suppose bit 1 of location 40963 is 0 when the door to Room X is closed, and 1 if the door is open. The following program will print "Intruder Alert" if the door is opened: 10 IF NOT (PEEK(40963) AND 2) THEN 10 This line will execute over and over until bit 1 (masked or selected by the 2) becomes a 1.
values you may become satisfied that your program is functioning correctly. You should then type in CONT to Continue executing your program where it left off, or type a direct GOTO statement to resume execution of the program at a different line. You could also use assignment statements to set some of your variables to different values.
POKE POKE location, byte 357 POKE I,J The POKE statement stores the byte specified by its second argument (J) into the location given by its first argument (I). The byte to be stored must be =>0 and <=255, or an FC error will occur. The address (I) must be =>0 and <=65535, or an FC error result.
FNJ7, FNKO, FNR2. User defined func- tions are restricted to one line. A function may be defined to be any expression, but may only have one argument. In the example, B and C are variables that are used in the program. Executing the DEF state- ment defines the function.
is => the final value, then the first state- ment following the FOR statement is executed. Otherwise, the statement following the NEXT statement is executed. All FOR loops execute the statements between the FOR and the NEXT at least once, even in cases like FOR V=1 TO 0.
In this example, if X is less than 0, the 26 IF X<0 THEN PRINT PRINT statement will be executed and "ERROR, X NEGATIVE": then the GOTO statement will branch to GOTO 350 line 350. If the X was 0 or positive, BASIC will proceed to execute the lines after line 26.
In this case V=0 will be executed, 505 V=0: REM SET V=0 STATEMENT SYNTAX/FUNCTION EXAMPLE RESTORE RESTORE 510 RESTORE Allows the re-reading of DATA statements, After a RESTORE, the next piece of data read will be the first piece listed in the first DATA statement of the program.
commas (,), you must enclose the string in double quotes. It is illegal so have a double quote within string data or a string literal. (""BASIC"" is illegal.) STATEMENT SYNTAX/FUNCTION EXAMPLE INPUT INPUT [!] ["prompt string literal";] 3 INPUT V,W,W2 variable [, variable] .
then a carriage return/line feed is executed. "VALUE IS" will be displayed and printed. 410 PRINT ! "VALUE IS";A String expressions may be printed. 420 PRINT MID$(A$,2); STATEMENT SYNTAX/FUNCTION EXAMPLE READ READ variable [, variable] 490 READ V,W Read data into specified variables from a DATA statement.
Inputs a single character from the keyboard. If data is at the keyboard, it is put in the variable specified in the GET statement. If no data is available, the BASIC program will continue execution.
307 ARITHMETIC FUNCTIONS STATEMENT SYNTAX/FUNCTION EXAMPLE ABS ABS (expression) 120 PRINT ABS(X) Gives the absolute value of the expression X. ABS returns X if X>=0, -X otherwise. STATEMENT SYNTAX/FUNCTION EXAMPLE ATN ATN (expression) 210 PRINT ATN(X) Gives the arcTangent of the expression X.
Note that (B-A)*RND(1)+A will generate a random number between A and B. STATEMENT SYNTAX/FUNCTION EXAMPLE SGN SGN (expression) 230 PRINT SGN(X) Gives 1. If X>0, 0 if X=0, and -1 if X<0. STATEMENT SYNTAX/FUNCTION EXAMPLE SIN SIN (expression) 190 PRINT SIN(X) Gives the sine of the expression X.
FUNCTION FUNCTION EXPRESSED IN TERMS OF BASIC FUNCTIONS INVERSE HYPERBOLIC SINE ARGSINH(X) = LOG(X+SQR(X*X+1)) INVERSE HYPERBOLIC COSINE ARGCOSH(X) = LOG(X+SQR(X*X-1)) INVERSE HYPERBOLIC TANGENT ARGTA.
subroutine has been patched in 7. Calls to MID$, LEFT$, RIGHT$, WAIT, PEEK, POKE, TAB, SPC or ON...GOTO with an improper argument. ID Illegal Direct. You cannot use an INPUT, DEF or GET statement as a direct command. LS Long String. Attempt was made by use of the concantenation operator to create a string more than 255 characters long.
3. Delete all REM statements. Each REM statement uses at least one byte plus the number in the comment text. For instance, the statement 130 REM THIS IS A COMMENT uses 24 bytes of memory. In the statement 140 X=X+Y: REM UPDATE SUM, the REM uses 14 bytes of memory including the colon before the REM.
2. THIS IS PROBABLY THE MOST IMPORTANT SPEED HINT. Use variables instead of constants. It takes more time to convert a constant to its floating point representation than it does to fetch the value of a simple or matrix variable. This is especially important within FOR.
5. Programs which use the MAT functions available in some BASICs will have to be re-written using FOR...NEXT loops to perform the appropriate operations. 6. A PRINT statement with no arguments will not cause a paper feed on the printer. To generate a paper feed (blank line), use PRINT "space" E ASCII CHARACTER CODES DECIMAL CHAR.
Parameter (W), passed to a subroutine by USR(W), will be converted to floating-point accumulator located at $A9. The floating-point accumulator has the following format: ADDRESS CONTENT $A9 Exponent + $81 ($80 if mantissa = 00) $AA-$AD Mantissa, normalized so that Bit 7 of MSB is set.
* The program then swaps the bytes of the integer. * Finally, the program converts the result to floating point and returns to BASIC (JMP C0D3). Address $C0D3 was found in locations $B008, $B009. (Address $C0D3 may vary with different versions of BASIC.
position. Be sure to initialise the counter at the start of the tape. Note: Since remote control must be used to retrieve a BASIC program, observe the tape gap CAUTION in Section 9.1.5 (Step 1) of the AIM 65 User's Guide. 2. While in BASIC, type in SAVE.
observed: When BASIC stores a program on cassette, it inserts a CTRL/Z after the last line. The AIM 65 Editor will strip off the CTRL/Z when it retrieves the program. Therefore, before storing a BASIC program from the Editor, the user must insert a CTRL/Z following the last line of the program.
address of the ATN function instructions. This can be done using BASIC initialization, as follows: <5> MEMORY SIZE? 3968 Limit BASIC to F80 WIDTH? 16 3438 BYTES FREE AIM 65 BASIC V1.1 POKE 188,189 Change ATN function vector low to $BD POKE 189,15 Change ATN function vector high to $0F ?ATN (TAN(.
Ein wichtiger Punkt beim Kauf des Geräts Apple ii (oder sogar vor seinem Kauf) ist das durchlesen seiner Bedienungsanleitung. Dies sollten wir wegen ein paar einfacher Gründe machen:
Wenn Sie Apple ii noch nicht gekauft haben, ist jetzt ein guter Moment, um sich mit den grundliegenden Daten des Produkts bekannt zu machen. Schauen Sie zuerst die ersten Seiten der Anleitung durch, die Sie oben finden. Dort finden Sie die wichtigsten technischen Daten für Apple ii - auf diese Weise prüfen Sie, ob das Gerät Ihren Wünschen entspricht. Wenn Sie tiefer in die Benutzeranleitung von Apple ii reinschauen, lernen Sie alle zugänglichen Produktfunktionen kennen, sowie erhalten Informationen über die Nutzung. Die Informationen, die Sie über Apple ii erhalten, werden Ihnen bestimmt bei der Kaufentscheidung helfen.
Wenn Sie aber schon Apple ii besitzen, und noch keine Gelegenheit dazu hatten, die Bedienungsanleitung zu lesen, sollten Sie es aufgrund der oben beschriebenen Gründe machen. Sie erfahren dann, ob Sie die zugänglichen Funktionen richtig genutzt haben, aber auch, ob Sie keine Fehler begangen haben, die den Nutzungszeitraum von Apple ii verkürzen könnten.
Jedoch ist die eine der wichtigsten Rollen, die eine Bedienungsanleitung für den Nutzer spielt, die Hilfe bei der Lösung von Problemen mit Apple ii. Sie finden dort fast immer Troubleshooting, also die am häufigsten auftauchenden Störungen und Mängel bei Apple ii gemeinsam mit Hinweisen bezüglich der Arten ihrer Lösung. Sogar wenn es Ihnen nicht gelingen sollte das Problem alleine zu bewältigen, die Anleitung zeigt Ihnen die weitere Vorgehensweise – den Kontakt zur Kundenberatung oder dem naheliegenden Service.