6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Sun Nov 24, 2024 4:29 am

All times are UTC




Post new topic Reply to topic  [ 6 posts ] 
Author Message
PostPosted: Wed Jan 25, 2006 11:24 pm 
Offline

Joined: Wed Jan 25, 2006 11:04 pm
Posts: 3
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


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed Jan 25, 2006 11:32 pm 
Offline

Joined: Wed Jan 25, 2006 11:04 pm
Posts: 3
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


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu Jan 26, 2006 2:48 am 
Offline

Joined: Sat Jan 04, 2003 10:03 pm
Posts: 1706
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. :)


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu Jan 26, 2006 2:10 pm 
Offline

Joined: Wed Jan 25, 2006 11:04 pm
Posts: 3
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"


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Mon May 01, 2006 4:56 pm 
Offline

Joined: Sun Aug 24, 2003 7:17 pm
Posts: 111
How can your client want this code to be altered if he does not know on what machine to run the code????


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Tue May 02, 2006 4:46 am 
Offline

Joined: Mon Mar 27, 2006 10:54 pm
Posts: 13
Location: Sydney
Presumably he's cross-compiling.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 7 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron