floobydust wrote:
Proxy, Ed, et al,
First, I agree that in general, we're a very friendly and helpful bunch... I guess it's mostly our nature. However, differences will arise from time to time, just that simple. We all have our views and insights based on our experience, which for many of us, goes back 40+ years.
So, I'll address Proxy's last post on files and we can move on... no harm, but I prefer not to be mis-quoted. When I refer to a pure binary file, it has nothing to do with an Intel Hex file or a S-record format, etc.. A pure binary file would be an image which can be directly loaded to (or read from) a ROM chip. As a result, it has NO ability to define any loaded address or offset. Every other format used for loading ROMs has a specific format which are documented.
yes, a binary file that has code at the very start of the file could actually be located at 0x8000 or something but there is no way to indicate that.
but as said there is no problem with that as your hardware handles the offset. since your ROM on the board starts at 0x8000 anything loaded to the start of the ROM (0x0000 in the programmer) will also start at 0x8000 once the ROM is in the board.
my point was just that it would save you a tiny bit of time. for example my Xgpro programmer software asks from what address in the file it's supposed to start load from and where into.
if i take the raw output from WDCTools i would need to tell it to load from 0x8000 since that's where the actual code starts, but if the assembler relocated the code to the start of the file beforehand i could save myself that step when loading it into the program.
there is functionally no other difference, it just saves you typing in a number.
floobydust wrote:
WDC Tools (plain) BIN option simply generates a pure binary file (maybe just my terminology) and as a result, it starts at address $0000 for the 65(C)02 and goes to the end of assembled/linked code. It then becomes up to the end user to determine how to use it going forward. This is why I default to Motorola S-Record S19 format.
My Dataman programmer can use quite a few different formats, but even with S-Record formats, you still need to define an offset for the ROM, i.e., the 32KB EEPROM which is addressed at $8000 in my SBC. Otherwise, the programmer defaults the address of the EEPROM at $0000 and it wouldn't be able to program it, as the code to be loaded defines the address locations in the EEPROM.
i'm confused what you mean with the second part, why do you need to set an offset when loading into a ROM (with S19)? shouldn't it always default to the start of the ROM, ie 0x0000?
anyways... yea this has being going on for too long.
different people have different ways of doing the exact same thing, i use .BIN files because it's what the Logic simulator i use supports, and because i'm not familiar with other formats like S19 or IntelHEX.
floobydust wrote:
On the current status of Proxy's project... of course, happy to help out. Too bad the clock speed of the emulator is that low. There's another thread I started a while back on Basic test programs, and there's quite a good number of them shared there by others. See it here:
viewtopic.php?f=5&t=5184I did download Proxy's code. I'll make a few updates and re-post it. Granted, I can't test it directly, but it should be fairly clear on getting it to work in his emulator. Cheers!
yea i really should convert my Logisim circuit to "Digital", which is a similar logic simulator but can run much faster and also export circuits as Verilog.
I've just been procrastinating that because it's a lot of work.
technically i'm "only" missing the ALU and Control Unit... but both are rather complex so i always pushed it back.
floobydust wrote:
Proxy,
I made a few updates to your Basic.asm file. I changed the top of Ram memory address and the start of assembled code to $C000. The startup routine is also changed and it will fit into a 16KB ROM size. The clear memory routine now checks for top of Ram and stops clearing when it's reached. I also changed your CHRIN_NW code... you don't need to set or clear the carry flag as that's done by the LSR A of the status byte. It also checks for a linefeed character and replaces it with a carriage return, as this seemed to be a problem with the emulator.
Note: the Basic initialization does a simple memory test from ram start to the top address and clears it out. So, doing the same in the startup routine is sorta pre-redundant
, Have fun.
Attachment:
basic.asm
thanks for that, and yea i didn't think about the fact that i can just change the LF to CR in the actual routine without modifying my simulator circuit....
also something about this part:
Code:
ZEROLOOP
STA ($00) ; Write $00 to current address
INC $00 ; Increment address pointer
BNE ZEROLOOP ; Loop back until done
INC $01 ; Increment page
i originally did it like this:
Code:
ZEROLOOP
STA ($00),Y ; Write $00 to current address
INY ; Increment address pointer
BNE ZEROLOOP ; Loop back until done
INC $01 ; Increment page
because i thought it's faster...
as "INY" (2 cycles) takes less time than "INC $00" (5 cycles) while being functionally identical (in this case atleast).
is that somehow wrong?