6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Sat Sep 21, 2024 7:40 am

All times are UTC




Post new topic Reply to topic  [ 18 posts ]  Go to page 1, 2  Next
Author Message
PostPosted: Mon Jun 17, 2024 10:13 am 
Offline

Joined: Thu May 13, 2021 8:56 am
Posts: 31
Location: Hellevoetsluis-NL
I wont to run the woz-monitor in the simulator. But what I trie no succes. Can someone help me out with this, perhaps a running version is very helpful. I struggle withe the in- and output of the simulator in respect to the woz-monitor.

Thanks for any help.
Jan Kromhout - NL


Top
 Profile  
Reply with quote  
PostPosted: Mon Jun 17, 2024 3:25 pm 
Offline
User avatar

Joined: Sun Jun 30, 2013 10:26 pm
Posts: 1948
Location: Sacramento, CA, USA
I don't have time right now to help much, but I would like to make a point that WOZMON expects bit 7 to be set for incoming and outgoing chars and has some subtle dependencies on the same.

Ben Eater made a nice video that may be helpful, perhaps dependent on your personal level of skill.

_________________
Got a kilobyte lying fallow in your 65xx's memory map? Sprinkle some VTL02C on it and see how it grows on you!

Mike B. (about me) (learning how to github)


Top
 Profile  
Reply with quote  
PostPosted: Mon Jun 17, 2024 6:53 pm 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8390
Location: Midwestern USA
Powersoft wrote:
I wont to run the woz-monitor in the simulator. But what I trie no succes. Can someone help me out with this, perhaps a running version is very helpful. I struggle withe the in- and output of the simulator in respect to the woz-monitor.

Thanks for any help.
Jan Kromhout - NL

First, welcome to 6502 land.

Can you be more specific about what is not working?  Perhaps you should write a simple “TV typewriter” to test that the simulator’s I/O window is functioning the way you think it should.  Also, which version of the simulator are you using?

_________________
x86?  We ain't got no x86.  We don't NEED no stinking x86!


Top
 Profile  
Reply with quote  
PostPosted: Mon Jun 17, 2024 10:00 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 9:02 pm
Posts: 1738
Location: Sacramento, CA
Hi Jan,

Here is a working copy. I modified it to run in the Kowalski Simulator. I needed to add some LDA #$8A - JSR ECHO statements to produce line feeds after the carriage returns. I also needed to modify the IO routines to support the high bit 7 used and removed a few initialization statements so it still fits in exactly 256 bytes.

Set up the Simulator with the 6502 or 65C02 processor. The IO page is mapped to $D000. Assemble and start the Simulator. Press the RESET button (far right) and then the RUN button. If the IO page does not open up, open it from the menu. Be sure to select the IO page before entering any keystrokes.

You can get the latest Simulator version from my website: https://sbc.rictor.org/kowalski.html

Have fun!
Daryl


Attachments:
WozMon.zip [2.45 KiB]
Downloaded 26 times

_________________
Please visit my website -> https://sbc.rictor.org/
Top
 Profile  
Reply with quote  
PostPosted: Tue Jun 18, 2024 2:27 pm 
Offline

Joined: Thu May 13, 2021 8:56 am
Posts: 31
Location: Hellevoetsluis-NL
Thanks for the quick respons.
Have set the IO at $D000, compile the code and switch to the debugger.
The IO window is popping up.
Push RST and run in debugger. Notting is comming up in the io window!

Do I sommething wring? Use the latest version of the emulator.

Cheers,

Jan


Top
 Profile  
Reply with quote  
PostPosted: Tue Jun 18, 2024 3:43 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 9:02 pm
Posts: 1738
Location: Sacramento, CA
Sounds like you have everything set right. be sure the disable the memory protection and be sure the address bus is set to 16 bits on the general tab.

Make sure you click inside the output window before you try to type any entries, otherwise your keystrokes will go somewhere else.

Try this test file - it just reads the input and echo's it back to the screen. If it does not work, there's something else happening (international character code compatibility??)

Anyway, one step at a time.

thanks!
Daryl


Attachments:
test.zip [167 Bytes]
Downloaded 17 times

_________________
Please visit my website -> https://sbc.rictor.org/
Top
 Profile  
Reply with quote  
PostPosted: Tue Jun 18, 2024 5:52 pm 
Offline

Joined: Thu May 13, 2021 8:56 am
Posts: 31
Location: Hellevoetsluis-NL
Dear Daryl,

The testfile is working perfect, de wozmonitor all most.
After setting my keyboard to uppercase it was running.

But try to run this simple test program scrolling text on the screen :

0000: A9 00 AA 20 EF FF E8 8A
0008: 4C 02 00

but without results. Run it on my Replica-1 SBC and it runs perfect.

Aso not working is when I try:
FF00R on a clean assembling.
Monitor is also halted.
Can you take a look
Cheers.

Jan


Top
 Profile  
Reply with quote  
PostPosted: Tue Jun 18, 2024 6:23 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 9:02 pm
Posts: 1738
Location: Sacramento, CA
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/


Top
 Profile  
Reply with quote  
PostPosted: Tue Jun 18, 2024 8:07 pm 
Offline

Joined: Thu May 13, 2021 8:56 am
Posts: 31
Location: Hellevoetsluis-NL
Dear Daryl,

Please can you post the asm code for me.

Cheers,

Jan


Top
 Profile  
Reply with quote  
PostPosted: Tue Jun 18, 2024 11:15 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 9:02 pm
Posts: 1738
Location: Sacramento, CA
The asm for the small program is :

Code:
     *= $0
     LDA #$00
LP   TAX
     JSR $FFF2
     INX
     TXA
     JMP LP



The ASM code from the disassembly above is posted in my first reply - WozMon.zip

thanks!
Daryl

_________________
Please visit my website -> https://sbc.rictor.org/


Top
 Profile  
Reply with quote  
PostPosted: Wed Jun 19, 2024 6:01 am 
Offline

Joined: Thu May 13, 2021 8:56 am
Posts: 31
Location: Hellevoetsluis-NL
Thanks, nice work.
Have played with it, but one thing is not going well.
When starting fresh with FF00R the program is hanging.
And always when I send FF00R the program hangs.

Please can you take a look.

Cheers,

Jan


Top
 Profile  
Reply with quote  
PostPosted: Wed Jun 19, 2024 4:11 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 9:02 pm
Posts: 1738
Location: Sacramento, CA
Hi Jan,

I see what you mean now. Sorry for my mistake.

I had to fix part if the initialization at RESET. This made the source more than 256 bytes. To fix that, I added a subroutine to print CR & LF that is needed in 2 places. This allowed me to recover the extra bytes need and even gained back our 2 "spare" bytes at the end.

This did again move some of the internal command addresses, including ECHO, which is now at $FFE6

The attached file has the new ASM file and the listing of the assembler.

It should work now.

thanks!
Daryl


Attachments:
WozMon.zip [5.92 KiB]
Downloaded 18 times

_________________
Please visit my website -> https://sbc.rictor.org/
Top
 Profile  
Reply with quote  
PostPosted: Thu Jun 20, 2024 3:48 pm 
Offline

Joined: Thu May 13, 2021 8:56 am
Posts: 31
Location: Hellevoetsluis-NL
Dear Daryl,

Thanks, it works.
I have another question. Is there an 6502 monitor (simple) that runs on the emulator.
I am verry interested in this, for my esp32 emulator project. Running 6502 code on my emulator is working, but I missing a small monitor. When this works I wont to implement ithis on my Replica sbc, so my board act as a standalone 6502.

Thanks for all your help so far.

Cheers,
Jan


Top
 Profile  
Reply with quote  
PostPosted: Thu Jun 20, 2024 6:07 pm 
Offline
User avatar

Joined: Sun Jun 30, 2013 10:26 pm
Posts: 1948
Location: Sacramento, CA, USA
Powersoft wrote:
Is there an 6502 monitor (simple) that runs on the emulator.

It doesn't get much simpler than WOZMON, and you have a working version directly at your finger tips. How else can we assist?

_________________
Got a kilobyte lying fallow in your 65xx's memory map? Sprinkle some VTL02C on it and see how it grows on you!

Mike B. (about me) (learning how to github)


Top
 Profile  
Reply with quote  
PostPosted: Thu Jun 20, 2024 9:25 pm 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8390
Location: Midwestern USA
What Mike said.  WozMon comes from the days when 1KB was a lot of memory, and an 8KB machine was almost mainframe-grade.  :shock:  There are other, more full-featured monitors out there, but WozMon is more than adequate to do basic debugging, especially inside of the Kowalski simulator.

_________________
x86?  We ain't got no x86.  We don't NEED no stinking x86!


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 18 posts ]  Go to page 1, 2  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 15 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: