Closed ProxyPlayerHD closed 4 years ago
After a lot of fighting the borrow checker, I was finally able to make it accept tokendefs right next to other tokens, without whitespace between, so your code should work as expected now!
About your question, you can use #bankdef
to set a starting address, like so:
#bankdef "main"
{
#addr 0x8000
#size 0x8000
#outp 0
}
You can also check the example NES project contained here in the repository.
thanks man, i knew i was missing something with the addresses...
speaking of NES, i polished my 6502 CPU file and even made one for the 65c02. 6502_CS 65C02_CS also redid them with a more "modern" or Z80-like Syntax. which can make it easier to read the code. 6502_NS 65C02_NS
They should all work, you can improve them and/or use as example, since i don't think the NES example CPU file is complete.
I feel like i've done this already.... anyways, I'm currently writing the CPU file for the 68k (a painful project to be honest) and it has an conditional Branch instruction where the condition used in the instruction is defined by the 2 letters following the instruction name (without space between them).
so the base instruction is:
Bcc
wherecc
is condition. soBGE
for example would be aBranch on Greater or Equal
so i thought i could just use tokens for that instead of having to write each instruction indivitually:
but for this doesn't seem work when i try it, for example with:
BVS 0xF3
but it does works when i useB VS 0xF3
instead... which is a problemon a completely unrelated note, Is it somehow possible to have a program start at a specific address without everything before being filled with 0's? like when you write code for the 6502 your Program is likely going to be at the end of the address range, so you need to start it quite far down. using "#addr" though is a problem as when you then generate the .BIN file it's filled with 0's until the coee starts, which is annoying as it has to be edited out manually in order to be used.
Basically i'm asking for something like the ORG statement from a lot of other assemblers that tells the assembler that the code starts at that address but doesn't fill the rest of the address space from 0 to there.