Page 2 of 2

Re: 6502 Assembler

Posted: Fri Apr 08, 2016 3:32 pm
by cbmeeks
I've never used Cross-32 so I can't comment on how good it is. But I have to admit I got a little chuckle when I read this on their site:
Quote:
35,000 lines/min of 68HC05 source code on a 75 MHz Pentium
Funny part is, I'm actually trying to get together a low-end DOS machine (386/486) to play some DOS games.

Re: 6502 Assembler

Posted: Sat Apr 09, 2016 12:47 am
by Disgruntled0wll
BigEd wrote:
It would certainly be better to use a tool which the NES community use, if your objective is to write NES code.
cool, ill do that thanks man
cbmeeks wrote:
I've never used Cross-32 so I can't comment on how good it is.
iv'e downloaded the demo for it but I'm going to try and find a good free assembler and in the event I cant I'll get that but its looking like the free ones could be just as good from what I've read its just finding one and getting it setup lol

Re: 6502 Assembler

Posted: Sat Apr 09, 2016 7:57 am
by cbscpe
I use 64tass and I'm quite happy with it. It's free and the documentation is good.

Re: 6502 Assembler

Posted: Sat Apr 09, 2016 4:25 pm
by Disgruntled0wll
cbscpe wrote:
I use 64tass and I'm quite happy with it. It's free and the documentation is good.
Is this nes specific? ive managed to get a couple of assemblers open in the command prompt etc. but how do I know if its nes specific or setup properly?

Re: 6502 Assembler

Posted: Sat Apr 09, 2016 5:43 pm
by BigDumbDinosaur
Disgruntled0wll wrote:
cbscpe wrote:
I use 64tass and I'm quite happy with it. It's free and the documentation is good.
Is this nes specific? ive managed to get a couple of assemblers open in the command prompt etc. but how do I know if its nes specific or setup properly?
What is an "nes (sic) specific" assembler? Traditionally, assemblers are "specific" to the microprocessor for which they assemble code. The machine architecture itself is not a part of the assembly language, as the MPU could be used in widely varying architectures, as was the case with the 65xx family.

The Nintendo Entertainment System is built around the Ricoh RP2A03 or RP2A07 processor, both of which are fundamentally a 6502 without the BCD instructions. Any 6502 assembler is usable with the RP2A03/7, as long as the CLD and SED instructions are not used in the source code. You can add your own source code references to the memory mapped I/O registers and other NES architectural features and Voila! you have an "NES specific" assembler.

Re: 6502 Assembler

Posted: Sat Apr 09, 2016 6:23 pm
by BigEd
(I believe I read that Nintendo cartridges do use CLD at reset time - perhaps for safety, perhaps to help on some development environment.)

I think the point here is that a console is a platform, not just a micro, so a NES-specific tool will know how to build a correct cartridge image, and might well know things about the video, the audio, the game controllers and so on. It's not that any old assembler won't work, but it would put more burden on the person doing the programming.

Re: 6502 Assembler

Posted: Sun Apr 10, 2016 4:31 pm
by Disgruntled0wll
okay so Ive decided Im going to stick with ca65 for now, but when I open the cmd prompt and type in ca65 or cc65 it literally just says no input files. Im assuming that means its found it but somethings missing? lost here lol

Re: 6502 Assembler

Posted: Sun Apr 10, 2016 4:37 pm
by BigEd
These are command line programs, not interactive environments. When you invoke the tool, you tell it what you want it to do, and how. I think there's a guide somewhere, but meantime see
viewtopic.php?f=2&t=2455

Re: 6502 Assembler

Posted: Mon Apr 11, 2016 1:57 pm
by Disgruntled0wll
BigEd wrote:
These are command line programs, not interactive environments.
Okay got that managed to get ASM6 and NESASM open in the command prompt by changing the path directory in the environment variables but not ca65. I dont know what Im doing wrong but apparently it is a bit of a nightmare to set up (so Ive read). you also said in that link you shared you can use any convenient text editor, do you mean like notepad++? if so how do i set that up? and do you code in notepad then copy/assemble in ca65 for example?
thanks

Re: 6502 Assembler

Posted: Mon Apr 11, 2016 5:57 pm
by BigEd
Yes, Notepad++ is a popular choice. You edit a file - let's say hello.a65 - in your editor, save it, then run something like

Code: Select all

ca65 -l hello.a65
cl65 hello.o --target none --start-addr 0x0600 -o hello.bin
and that will write a file called - in this case - hello.bin and you then find a way to load that bin file into your emulator of choice.

Re: 6502 Assembler

Posted: Tue Apr 12, 2016 11:00 pm
by Disgruntled0wll
Okay I'll try that out, cheers mate