Beginners cc65
Re: Beginners cc65
Any bad aspect of the first scenario?
Re: Beginners cc65
The first scenario when everything is in ram, it all works perfectly...
Re: Beginners cc65
Sounds good to me! If it's also what you see for other platforms, there may be a reason.
Re: Beginners cc65
I tried to move the ram to the rom range, and it works...
But still everything is in ram.
But still everything is in ram.
Re: Beginners cc65
I found the source of the problem. It is the DATA segment.
In this scenario it works.
But when i send the DATA segment in ram, it sets the jmp instructions to 0000
In this scenario it works.
Code: Select all
MEMORY {
HEADER: start = $C000, size = $0004, type = ro;
ZP: start = $0000, size = $00D0, type = rw, define = yes;
RAM: start = $0200, size = $1E00, file = %O, define = yes;
ROM: start = $C200, size = $3CFF, file = %O, define = yes;
}
SEGMENTS {
EXEHDR: load = HEADER, type = ro;
STARTUP: load = ROM, type = ro;
LOWCODE: load = ROM, type = ro, optional = yes;
INIT: load = ROM, type = ro, define = yes, optional = yes;
CODE: load = ROM, type = ro;
RODATA: load = ROM, type = ro;
DATA: load = ROM, type = rw;
BSS: load = RAM, type = bss, define = yes;
HEAP: load = RAM, type = bss, optional = yes; # must sit just below stack
ZEROPAGE: load = ZP, type = zp;
}Code: Select all
MEMORY {
HEADER: start = $C000, size = $0004, type = ro;
ZP: start = $0000, size = $00D0, type = rw, define = yes;
RAM: start = $0200, size = $1E00, file = %O, define = yes;
ROM: start = $C200, size = $3CFF, file = %O, define = yes;
}
SEGMENTS {
EXEHDR: load = HEADER, type = ro;
STARTUP: load = ROM, type = ro;
LOWCODE: load = ROM, type = ro, optional = yes;
INIT: load = ROM, type = ro, define = yes, optional = yes;
CODE: load = ROM, type = ro;
RODATA: load = ROM, type = ro;
DATA: load = RAM, type = rw;
BSS: load = RAM, type = bss, define = yes;
HEAP: load = RAM, type = bss, optional = yes; # must sit just below stack
ZEROPAGE: load = ZP, type = zp;
}- GARTHWILSON
- Forum Moderator
- Posts: 8773
- Joined: 30 Aug 2002
- Location: Southern California
- Contact:
Re: Beginners cc65
I just found, by accident, that Wikipedia has an article on cc65, and http://en.wikipedia.org/wiki/Cc65 .
Edit, 2/14/21: I just came across this page about benchmarking the various C compilers for the 6502. CC65 produced much slower, more bloated code than the other C options, although it was more solid.
Edit, 2/14/21: I just came across this page about benchmarking the various C compilers for the 6502. CC65 produced much slower, more bloated code than the other C options, although it was more solid.
http://WilsonMinesCo.com/ lots of 6502 resources
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?
Re: Beginners cc65
I've finally found the documentation what i was looking for. Here it is, and it explains how to boot the code from rom.
http://www.cc65.org/doc/customizing-2.html
http://www.cc65.org/doc/customizing-2.html
-
White Flame
- Posts: 704
- Joined: 24 Jul 2012
Re: Beginners cc65
Dajgoro wrote:
Where are the document that describe the configuration files, i can't find them...
Re: Beginners cc65
You might find some help at http://www.fririki.net/6502/cc65_sbc.html
Re: Beginners cc65
Thanks for the link.
Re: Beginners cc65
I tried setting up the cc65 with the sim.cfg from the link, and when i tried to load it in the simulator it won't work. So i checked the disassembled code and the first thing on the address C000 is a loop that writes something to zero page. I tried setting up the start vector, but the simulator doesn't check it, and it just starts executing at the point where i loaded the binary code.
Re: Beginners cc65
Hey Dajgoro,
Did you ever get the ROM code to work the way you wanted?
I spent some time with cc65 tonight and think I have a better handle on it now. Will experiment more tomorrow to confirm but I am getting code to load to ROM with the crt0.s code at the starting address. I still need to be sure the DATA segment is being copied to RAM correctly. I should have a working demo ready soon.
Daryl
Did you ever get the ROM code to work the way you wanted?
I spent some time with cc65 tonight and think I have a better handle on it now. Will experiment more tomorrow to confirm but I am getting code to load to ROM with the crt0.s code at the starting address. I still need to be sure the DATA segment is being copied to RAM correctly. I should have a working demo ready soon.
Daryl
Please visit my website -> https://sbc.rictor.org/
Re: Beginners cc65
I tried to get it working when i discovered that links, and how to make it boot from rom. But whatever i tried it never worked, and when i would step it in the simulator it seems as if it would never set the reset vector right, so i never managed to boot anything.
If you manage to get it working in the Kowalski simulator like that last example, i would be really grateful.
Also i was thinking since my new cpu board will have the mmu, i could kinda switch programs on the fly, and add sorta of os that would allow to boot other programs into ram. Also i could implement Petit FAT so i can read/write from memory cards as well.
If you manage to get it working in the Kowalski simulator like that last example, i would be really grateful.
Also i was thinking since my new cpu board will have the mmu, i could kinda switch programs on the fly, and add sorta of os that would allow to boot other programs into ram. Also i could implement Petit FAT so i can read/write from memory cards as well.
Re: Beginners cc65
I did get the "hello1" demo file to load into ROM and run successfully. I think I have the vectors (IRQ,RST,NMI) working too. I end up with a 32768 byte image when I tell it to start at $8000. A smaller ROM would be easy to adjust for.
I need to test it a little more and then will try to document the steps so others can repeat them. Hope to have something ready by the weekend.
My goal is to connect an ENC28J60 Ethernet module to the AVR Emulator and try to serve up a simple web page. I want to include the 8 channel ADC data in web page along with some digital I/O points. That would make a cool remote monitoring system.
Daryl
I need to test it a little more and then will try to document the steps so others can repeat them. Hope to have something ready by the weekend.
My goal is to connect an ENC28J60 Ethernet module to the AVR Emulator and try to serve up a simple web page. I want to include the 8 channel ADC data in web page along with some digital I/O points. That would make a cool remote monitoring system.
Daryl
Please visit my website -> https://sbc.rictor.org/
Re: Beginners cc65
Great!
As for spi ethernet module, any good tutorials on how set up and communicate with it(or how to deal with multiple sessions if they exist).
As for spi ethernet module, any good tutorials on how set up and communicate with it(or how to deal with multiple sessions if they exist).