Page 1 of 1

Help finding the correct compiler

Posted: Wed Jan 25, 2006 11:24 pm
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

Posted: Wed Jan 25, 2006 11:32 pm
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

Posted: Thu Jan 26, 2006 2:48 am
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. :)

Posted: Thu Jan 26, 2006 2:10 pm
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"

Posted: Mon May 01, 2006 4:56 pm
by Mats
How can your client want this code to be altered if he does not know on what machine to run the code????

Posted: Tue May 02, 2006 4:46 am
by Kallikak
Presumably he's cross-compiling.