Help finding the correct compiler

Programming the 6502 microprocessor and its relatives in assembly and other languages.
Post Reply
juanmlesquivel
Posts: 3
Joined: 25 Jan 2006

Help finding the correct compiler

Post by juanmlesquivel »

I'm currently trying to perform maintenance on a bunch of code that to me was completely unknow until a few days ago. While looking around I think the code corresponds to a 65816 machine (which is part of the 6502 family right).
The code was developed by a third party company which has been dissolved and my client is asking me to alter some parts of that code. I have been unable to locate the developers in order to determine what specific platform and compiler they were using,
I compared the assembler instructions in my code against the instructions provided in the 6502 family and I'm pretty sure that this is the correct processor (besides, there are a few C files called XXX65816.c, that gives you a hint :)).
So far so good now the problem becomes how do I compile the code? The original developers used a lot of assembler code inside C files, for instance:

.asm

INCLUDE 4205ADD.ASM
INCLUDE 4205RAM.ASM



EXTERNAL SMALLCHARMAP,MEDIUMCHARMAP,LARGECHARMAP

EXTERNAL TILES,ICONS,PALTABLE


external c65816rt_startup
external _deltatotalin

; some more code

;********************************************************
;Macros section
;********************************************************
MEM16 EQU $20
IND16 EQU $10
;----------------------------------------------------------------
16BIT_ACCA .MACRO
LONGA ON
REP #BIT_5
ENDM
8BIT_ACCA .MACRO
LONGA OFF
SEP #BIT_5
ENDM
;----------------------------------------------------------------
ON16MEM .MACRO

; some more code

INIT_CLK:
8BIT_ACCA
LDA #1 ;TEST=0,24/12=0,STOP=0,RESET=1
STA CLKF
LDA #7 ;T1 T0=1 (1SECOND), INTRPT/STND=0 (INT)
STA CLKE ;MASK=1 (IRQ OUTPUT)
LDA #0 ;30S=0,IRQF=X,BUSY=X,HOLD=0
STA CLKD
STA SHCLKCD ;STORE SHADOW OF CLKCD
LDA #4 ;TURN RESET OFF
STA CLKF
stz SETCLFLAG
16BIT_ACCA
RTS

I also found several references to "4205"; they had a file called 4205kern.c I don't if it could be related to a specific machine that uses a 65816.

Any hints about the possible compilers are appreciated
juanmlesquivel
Posts: 3
Joined: 25 Jan 2006

Post by juanmlesquivel »

I almost forgot (maybe you noticed). I'm looking for a C compiler not an assembler. The code that I wrote in the previous code is in C files. I guess (almost obvious) ".asm" is a compiler directive of "that compiler" I'm looking for
kc5tja
Posts: 1706
Joined: 04 Jan 2003

Post by kc5tja »

juanmlesquivel wrote:
I almost forgot (maybe you noticed). I'm looking for a C compiler not an assembler. The code that I wrote in the previous code is in C files. I guess (almost obvious) ".asm" is a compiler directive of "that compiler" I'm looking for
I have to admit that I have never, ever seen inline assembly language that looked like that before. However, that being said, I've also never used the cc65 compiler. And from what I can compare between what you've given in the above examples, and what I can find from a cursory Google search, it looks like the compiler used is cc65. No guarantees though. :)
juanmlesquivel
Posts: 3
Joined: 25 Jan 2006

Post by juanmlesquivel »

I already tried that :( That's what I thought first so I downloaded the compiler but it doesn't recognize the inline assembly part.
There is also another "hint" that maybe somebody recongnizes.
Sometimes the makefiles are related to the development tool used. I noticed the use of "!if" and "!endif", for instance

!if $d(CCSRCS)
$(CCOBJS): $(CCSRCS)
$(CC) -I$(INCLUDE) $(DEFINES) -ap_7E $*
!endif

Another hint the parameters passed to "the compiler" are "-C -ml -d"
Mats
Posts: 111
Joined: 24 Aug 2003

Post by Mats »

How can your client want this code to be altered if he does not know on what machine to run the code????
Kallikak
Posts: 13
Joined: 27 Mar 2006
Location: Sydney

Post by Kallikak »

Presumably he's cross-compiling.
Post Reply