C code to 6502 assembly code

You need an actual VIC.

Moderator: Moderators

Post Reply
terry
Vic 20 Newbie
Posts: 10
Joined: Sun Dec 30, 2007 5:21 am

C code to 6502 assembly code

Post by terry »

I have some C code that I want to convert to 6502 assembly code but as a text file.

I have been told this requires a cross assembler, would CC65 be a cross assembler, or would something like this only exits with a PC or Linux.

I found Quazalcoat that was written in the early 80's for the Vic-20 will almost code in C but not sure if this software will cross assemble, which is what I need.

-Terry
Last edited by terry on Wed Jan 02, 2008 5:44 pm, edited 1 time in total.
WillKemp
Vic 20 Drifter
Posts: 25
Joined: Thu Dec 27, 2007 4:19 pm

Re: C code to 6502 assembly code

Post by WillKemp »

terry wrote:I have some C code that I want to convert to 6502 assembly code but as a text extension.
Do you mean machine code or assembly language?

I'm not sure if this will do what you wan to do, but have you had a look at http://www.cc65.org/? It should compile C code to assembly language and then assemble that to get machine code.
terry
Vic 20 Newbie
Posts: 10
Joined: Sun Dec 30, 2007 5:21 am

Re: C code to 6502 assembly code

Post by terry »

WillKemp wrote:
terry wrote:I have some C code that I want to convert to 6502 assembly code but as a text extension.
Do you mean machine code or assembly language?

I'm not sure if this will do what you wan to do, but have you had a look at http://www.cc65.org/? It should compile C code to assembly language and then assemble that to get machine code.

Schema responded to this message also: you can assemble back to Binary and then assemble to text, which is what I need.

terry
terry
Vic 20 Newbie
Posts: 10
Joined: Sun Dec 30, 2007 5:21 am

Re: C code to 6502 assembly code

Post by terry »

terry wrote:
WillKemp wrote:
terry wrote:I have some C code that I want to convert to 6502 assembly code but as a text extension.
Do you mean machine code or assembly language?

I'm not sure if this will do what you wan to do, but have you had a look at http://www.cc65.org/? It should compile C code to assembly language and then assemble that to get machine code.

Schema responded to this message also: you can assemble back to Binary and then assemble to text, which is what I need.

terry
I found out I need a cross assembler, not sure if cc65 will do this. I also found Quazalcoat which was written in early 1980 sometime then in 1996 was updated, I tried to email this guy but cannot reach him.
I have another programmer that might be able to help me.
www.ffd2.com Steve is a good coder.

Thanks all.

-Terry R.
carlsson
Class of '6502
Posts: 5516
Joined: Wed Mar 10, 2004 1:41 am

Post by carlsson »

The CC65 package contains a cross assembler called ca65 (or if it is as65, I can't recall). It is considered one of the most powerful cross assemblers for 6502 processors, but also rumoured to be very complex to use for others than the cc65 compiler itself. Us others tend to stick with DASM, XA or any of the other cross assemblers, which all have slightly different syntax.
Anders Carlsson

Image Image Image Image Image
WillKemp
Vic 20 Drifter
Posts: 25
Joined: Thu Dec 27, 2007 4:19 pm

Post by WillKemp »

I've been using ca65 recently (via cl65 - which, according to the docs, "...was designed as a smart frontend [for the C compiler, the assembler, etc]") and i don't find it at all complex. Before the other day, i hadn't used an assembler of any sort for over 25 years.

The documentation's very good and i can certainly recommend the cc65 package. I'm sure it's just what you're looking for.
Post Reply