hi Jan,
The modifications I made to the source code to support the Simulator IO caused some of the IO addresses to change.
The address of the ECHO routine is now at $FFF2 vs $FFEF.
Try this code:
Code:
0000: A9 00 AA 20 F2 FF E8 8A
0008: 4C 02 00
Here is a listing of the new source file
Code:
00001 ; Written by Steve Wozniak in 1976
00002
00003
00004 ; Page 0 Variables
00005
00006 0024 XAML = $24 ; Last "opened" location Low
00007 0025 XAMH = $25 ; Last "opened" location High
00008 0026 STL = $26 ; Store address Low
00009 0027 STH = $27 ; Store address High
00010 0028 L = $28 ; Hex value parsing Low
00011 0029 H = $29 ; Hex value parsing High
00012 002A YSAV = $2A ; Used to see if hex value is given
00013 002B MODE = $2B ; $00=XAM, $7F=STOR, $AE=BLOCK XAM
00014
00015
00016 ; Other Variables
00017
00018 0200 IN = $0200 ; Input buffer to $027F
00019 D004 KBD = $D004 ; PIA.A keyboard input
00020 D011 KBDCR = $D011 ; PIA.A keyboard control register
00021 D001 DSP = $D001 ; PIA.B display output register
00022 D013 DSPCR = $D013 ; PIA.B display control register
00023
00024 00FF00 *= $FF00
00025
00026 00FF00 D8 RESET: CLD ; Clear decimal arithmetic mode.
00027 00FF01 58 CLI
00028 00FF02 A9 A7 LDA #$A7 ; KBD and DSP control register mask.
00029 00FF04 C9 DF NOTCR: CMP #'_'+$80 ; "_"?
00030 00FF06 F0 18 BEQ BACKSPACE ; Yes.
00031 00FF08 C9 9B CMP #$9B ; ESC?
00032 00FF0A F0 03 BEQ ESCAPE ; Yes.
00033 00FF0C C8 INY ; Advance text index.
00034 00FF0D 10 14 BPL NEXTCHAR ; Auto ESC if > 127.
00035 00FF0F A9 DC ESCAPE: LDA #'\'+$80 ; "\".
00036 00FF11 20 F2 FF JSR ECHO ; Output it.
00037 00FF14 A9 8D GETLINE: LDA #$8D ; CR.
00038 00FF16 20 F2 FF JSR ECHO ; Output it.
00039 00FF19 A9 8A LDA #$8A ; LF print (modified)
00040 00FF1B 20 F2 FF JSR ECHO ; (modified)
00041 00FF1E A0 01 LDY #$01 ; Initialize text index.
00042 00FF20 88 BACKSPACE: DEY ; Back up text index.
00043 00FF21 30 F1 BMI GETLINE ; Beyond start of line, reinitialize.
00044 00FF23 AD 04 D0 NEXTCHAR: LDA KBD ; Key ready?
00045 00FF26 F0 FB BEQ NEXTCHAR ; Loop until ready.
00046 00FF28 09 80 ORA #$80 ; Load character. B7 should be ‘1’. (modified)
00047 00FF2A 99 00 02 STA IN,Y ; Add to text buffer.
00048 00FF2D 20 F2 FF JSR ECHO ; Display character.
00049 00FF30 C9 8D CMP #$8D ; CR?
00050 00FF32 D0 D0 BNE NOTCR ; No.
00051 00FF34 A9 8A LDA #$8A ; LF print (modified)
00052 00FF36 20 F2 FF jsr ECHO ; (modified)
00053 00FF39 A0 FF LDY #$FF ; Reset text index.
00054 00FF3B A9 00 LDA #$00 ; For XAM mode.
00055 00FF3D AA TAX ; 0->X.
00056 00FF3E 0A SETSTOR: ASL ; Leaves $7B if setting STOR mode.
00057 00FF3F 85 2B SETMODE: STA MODE ; $00=XAM, $7B=STOR, $AE=BLOCK XAM.
00058 00FF41 C8 BLSKIP: INY ; Advance text index.
00059 00FF42 B9 00 02 NEXTITEM: LDA IN,Y ; Get character.
00060 00FF45 C9 8D CMP #$8D ; CR?
00061 00FF47 F0 CB BEQ GETLINE ; Yes, done this line.
00062 00FF49 C9 AE CMP #'.'+$80 ; "."?
00063 00FF4B 90 F4 BCC BLSKIP ; Skip delimiter.
00064 00FF4D F0 F0 BEQ SETMODE ; Set BLOCK XAM mode.
00065 00FF4F C9 BA CMP #':'+$80 ; ":"?
00066 00FF51 F0 EB BEQ SETSTOR ; Yes. Set STOR mode.
00067 00FF53 C9 D2 CMP #'R'+$80 ; "R"?
00068 00FF55 F0 3B BEQ RUN ; Yes. Run user program.
00069 00FF57 86 28 STX L ; $00->L.
00070 00FF59 86 29 STX H ; and H.
00071 00FF5B 84 2A STY YSAV ; Save Y for comparison.
00072 00FF5D B9 00 02 NEXTHEX: LDA IN,Y ; Get character for hex test.
00073 00FF60 49 B0 EOR #$B0 ; Map digits to $0-9.
00074 00FF62 C9 0A CMP #$0A ; Digit?
00075 00FF64 90 06 BCC DIG ; Yes.
00076 00FF66 69 88 ADC #$88 ; Map letter "A"-"F" to $FA-FF.
00077 00FF68 C9 FA CMP #$FA ; Hex letter?
00078 00FF6A 90 11 BCC NOTHEX ; No, character not hex.
00079 00FF6C 0A DIG: ASL
00080 00FF6D 0A ASL ; Hex digit to MSD of A.
00081 00FF6E 0A ASL
00082 00FF6F 0A ASL
00083 00FF70 A2 04 LDX #$04 ; Shift count.
00084 00FF72 0A HEXSHIFT: ASL ; Hex digit left, MSB to carry.
00085 00FF73 26 28 ROL L ; Rotate into LSD.
00086 00FF75 26 29 ROL H ; Rotate into MSD’s.
00087 00FF77 CA DEX ; Done 4 shifts?
00088 00FF78 D0 F8 BNE HEXSHIFT ; No, loop.
00089 00FF7A C8 INY ; Advance text index.
00090 00FF7B D0 E0 BNE NEXTHEX ; Always taken. Check next character for hex.
00091 00FF7D C4 2A NOTHEX: CPY YSAV ; Check if L, H empty (no hex digits).
00092 00FF7F F0 8E BEQ ESCAPE ; Yes, generate ESC sequence.
00093 00FF81 24 2B BIT MODE ; Test MODE byte.
00094 00FF83 50 10 BVC NOTSTOR ; B6=0 STOR, 1 for XAM and BLOCK XAM
00095 00FF85 A5 28 LDA L ; LSD’s of hex data.
00096 00FF87 81 26 STA (STL,X) ; Store at current ‘store index’.
00097 00FF89 E6 26 INC STL ; Increment store index.
00098 00FF8B D0 B5 BNE NEXTITEM ; Get next item. (no carry).
00099 00FF8D E6 27 INC STH ; Add carry to ‘store index’ high order.
00100 00FF8F 4C 42 FF TONEXTITEM: JMP NEXTITEM ; Get next command item.
00101 00FF92 6C 24 00 RUN: JMP (XAML) ; Run at current XAM index.
00102 00FF95 30 30 NOTSTOR: BMI XAMNEXT ; B7=0 for XAM, 1 for BLOCK XAM.
00103 00FF97 A2 02 LDX #$02 ; Byte count.
00104 00FF99 B5 27 SETADR: LDA L-1,X ; Copy hex data to
00105 00FF9B 95 25 STA STL-1,X ; ‘store index’.
00106 00FF9D 95 23 STA XAML-1,X ; And to ‘XAM index’.
00107 00FF9F CA DEX ; Next of 2 bytes.
00108 00FFA0 D0 F7 BNE SETADR ; Loop unless X=0.
00109 00FFA2 D0 19 NXTPRNT: BNE PRDATA ; NE means no address to print.
00110 00FFA4 A9 8D LDA #$8D ; CR.
00111 00FFA6 20 F2 FF JSR ECHO ; Output it.
00112 00FFA9 A9 8A LDA #$8A ; LF print (modified)
00113 00FFAB 20 F2 FF JSR ECHO ; (modified)
00114 00FFAE A5 25 LDA XAMH ; ‘Examine index’ high-order byte.
00115 00FFB0 20 DF FF JSR PRBYTE ; Output it in hex format.
00116 00FFB3 A5 24 LDA XAML ; Low-order ‘examine index’ byte.
00117 00FFB5 20 DF FF JSR PRBYTE ; Output it in hex format.
00118 00FFB8 A9 BA LDA #':'+$80 ; ":".
00119 00FFBA 20 F2 FF JSR ECHO ; Output it.
00120 00FFBD A9 A0 PRDATA: LDA #$A0 ; Blank.
00121 00FFBF 20 F2 FF JSR ECHO ; Output it.
00122 00FFC2 A1 24 LDA (XAML,X) ; Get data byte at ‘examine index’.
00123 00FFC4 20 DF FF JSR PRBYTE ; Output it in hex format.
00124 00FFC7 86 2B XAMNEXT: STX MODE ; 0->MODE (XAM mode).
00125 00FFC9 A5 24 LDA XAML
00126 00FFCB C5 28 CMP L ; Compare ‘examine index’ to hex data.
00127 00FFCD A5 25 LDA XAMH
00128 00FFCF E5 29 SBC H
00129 00FFD1 B0 BC BCS TONEXTITEM ; Not less, so no more data to output.
00130 00FFD3 E6 24 INC XAML
00131 00FFD5 D0 02 BNE MOD8CHK ; Increment ‘examine index’.
00132 00FFD7 E6 25 INC XAMH
00133 00FFD9 A5 24 MOD8CHK: LDA XAML ; Check low-order ‘examine index’ byte
00134 00FFDB 29 07 AND #$07 ; For MOD 8=0
00135 00FFDD 10 C3 BPL NXTPRNT ; Always taken.
00136 00FFDF 48 PRBYTE: PHA ; Save A for LSD.
00137 00FFE0 4A LSR
00138 00FFE1 4A LSR
00139 00FFE2 4A LSR ; MSD to LSD position.
00140 00FFE3 4A LSR
00141 00FFE4 20 E8 FF JSR PRHEX ; Output hex digit.
00142 00FFE7 68 PLA ; Restore A.
00143 00FFE8 29 0F PRHEX: AND #$0F ; Mask LSD for hex print.
00144 00FFEA 09 B0 ORA #'0'+$80 ; Add "0".
00145 00FFEC C9 BA CMP #$BA ; Digit?
00146 00FFEE 90 02 BCC ECHO ; Yes, output it.
00147 00FFF0 69 06 ADC #$06 ; Add offset for letter.
00148 00FFF2 29 7F ECHO: AND #$7F ; No, wait for display.
00149 00FFF4 8D 01 D0 STA DSP ; Output character. Sets DA.
00150 00FFF7 09 80 ORA #$80
00151 00FFF9 60 RTS ; Return.
00152
00153 ; BRK ; unused
00154 ; BRK ; unused
00155
00156 ; Interrupt Vectors
00157
00158 .WORD $0F00 ; NMI
00159 .WORD RESET ; RESET
00160 .WORD $0000 ; BRK/IRQ
00161
After you start the Wozmon (RST button and Run button), typing FF00R should return a / prompt. It did for me. It will not work if you do not first start the Wozmon running.
Have fun!
Daryl
_________________
Please visit my website ->
https://sbc.rictor.org/