6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Thu May 09, 2024 5:36 am

All times are UTC




Post new topic Reply to topic  [ 1 post ] 
Author Message
PostPosted: Sun Mar 14, 2021 7:54 pm 
Offline

Joined: Fri Feb 12, 2021 10:17 pm
Posts: 34
Update 3
The Ewoz 1.0 works fine, the issue I faced related only to ensuring that the hex code uploaded, if it includes jsr's and so on, must have a reset vector, for example if you upload code to execute at say RAM address $0300, ensure the last bits of the hex represent the reset vector 00 03 .... else the execution will appear to hang, i.e. give no output.

As EWoz 1.0 executes code from RAM via a jsr, it is possible to execute code in RAM with no reset vector, however I don't think that code can have additional jsr's and so on, but can only work smoothly as a single subroutine, however it is nice in that a graceful return to wozmon works with simply ending your ram subroutine with a simple jsr.


UPDATE 2
I have successfully written some assembly code to simply print Hello World to the LCD screen, and at the end of that code I perform a RTS which return control to the WOZ monitor. I am still not clear on why some code I have tried does not print back to the serial port, but instead appears to hang whereas I must reset. I did notice if I perform a txs (Transfer stack pointer to index register) with code I want to paste in and run from RAM, this "Lock up with no result issue" seems to occur. Thinking I am trashing the stack then trying to return to the monitor, I attempted to save it off first, then restore before my final RTS, but thus far this hasn't proven itself out. Still working on it and will appreciate any pointers. I used the following method in attempt to save the stack, run my code, then restore the stack.

;Save the stack
PHA
TXA
PHA
TYA
PHA
; Run some code
;Restore the stack and return gracefully to EWoz, only loosing original A along the way.
PLA
TAY
PLA
TAX
PLA
RTS


Update 1

My reset is at address 8000. From the WOz Monitor I can issue a 8000R and the monitor restarts. I thus tried and was successful compiling, extracting the hex, pasting into the terminal and running via. R the following:

Program: jmp8000.s > source of > reset: jmp $8000 > compiled to HEX of 4c 00 80

Welcome to EWOZ 1.0.
EHBasic at B000R
MicroChess at 8400R
\
MINICOM2.7.1MINICOM2.7.1
\
300

0300: 00
:4C 00 80

300R

0300: 4C
Welcome to EWOZ 1.0.
EHBasic at B000R
MicroChess at 8400R
\
MINICOM2.7.1MINICOM2.7.1
\

With the above test, #6, it thus does appears I can execute code from RAM, as this example call is to address 400 (RAM) and 400 holds a jump instruction to the reset vector of the Woz Monitor, i.e. $8000, however I am still at a loss why it appears other code I attempt to call from RAM just hangs and gives no output. I am sure I am missing something. I will keep digging but any insight will be much appreciated...



Hello Everyone,

I'm hoping someone can shed some light on an issue I am facing. I built a 6502 breadboard computer following the Ben Eater 6502 series, then added a 6551 for serial communications.

Thus far I have EWOZ 1.0 and EHBasic running with output to the LCD along with input/output thru the serial port.

Calling and using a program from the Woz Monitor, as long as the program is located in ROM works fine, for example I have EHBasic at ROM address B000, at the Woz monitor I can issue command B000R and EHBasic executes, from which I can load Basic code and run with no problems.

Back in the WOZ monitor, I can view memory locations, change their contents, go back and view again verifying my changes, etc, all that is well.

The issue is, I want to load and execute programs from RAM. I can load thru (L) intel hex or I can paste into the terminal, and either way going back to
view the loaded hex appears fine, but when I call the program, nothing "apparent" happens, other than execution control is loss and I must reset the computer.

To test I have written snippets of code to output to the serial port, and another to simply write Hello World to the LCD, but in both cases nothing occurs when I try to
execute from RAM. Further I tried the example from the apple 1 manual which I think should print a continuous stream of characters, and get the same "nothing happens" result, i.e. below is the attempt:

Welcome to EWOZ 1.0.
EHBasic at B000R
MicroChess at 8400R
\
MINICOM2.7.1MINICOM2.7.1
\
280:A9 0 AA 20 EF FF E8 8A 4C 2 0

0280: 00
280.A

0280: A9
R

At this point nothing occurs and I can only reset.

Attached is the wozmon2.asm, slightly modified so as to compile with CC65, my Serial and LCD setup.
Attached is one attempt ramtest.asm - I would expect it to write to the LCD - HEX is commented at the top
Attached is test_wozmon.s - Short example modified to call expected to write back to my serial port.
Attached is firmware.cfg_x - The config file for cc65 - Memory locations and segments.

* The code works but do not use it as an example of how this should be done, I am new to this and my code hacked together from other examples, I am in the learning stage. :-)

Things I have tried:
1) Load hex for asm code to write to LCD (Only works from a ROM start address)
2) Load hex for asm code to output to the serial port (Only works from a ROM start address)
3) Call any program that starts at a ROM start address (Works fine)
4) Swapped memory chip for a new one (No change)
5) Compared my source (wozman2.asm) with many other example - have not spotted a code issue
5) Lot's of reading thinking, trying... no fruitful outcome :-)

Thanks,

My config file - Seems this can not be uploaded so sharing here. Again so not think of this as a proper example.

MEMORY
{
ZP: start=$0000, size=$0100, type=rw, define=yes, file="";
RAM: start=$0200, size=$3DFF, type=rw, define=yes, file="";
USER: start=$1000, size=$2FFF, type=rw, define=yes, file="";
ACIA: start=$4000, size=$2000, type=rw, define=yes, file="";
VIA: start=$6000, size=$2000, type=rw, define=yes, file="";
ROM: start=$8000, size=$8000, type=ro, define=yes, fill=yes, file=%O;
}

SEGMENTS
{
ZEROPAGE: load=ZP, type=zp;
RAM: load=RAM, type=rw, start=$0200;
EWOZMON: load=ROM, type=ro, start=$8000;
CHESS: load=ROM, type=ro, start=$8400;
BASIC: load=ROM, type=ro, start=$B000;
BASICMON: load=ROM, type=ro, start=$F000;
VECTORS: load=ROM, type=ro, start=$FFFA;
}


Attachments:
File comment: An short example modified to test calling code to write to my serial port, hex in comments at the top.
test_wozmon.s [2.06 KiB]
Downloaded 136 times
File comment: I would expect it to write to the LCD - HEX is commented at the top
ramtest.asm [2.39 KiB]
Downloaded 126 times
File comment: Slightly modified so as to compile with CC65, my Serial and LCD setup.
wozmon2.asm [15.95 KiB]
Downloaded 154 times

_________________
Shaking out the dirty bits!

https://github.com/DonaldMoran
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


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: