6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Sat Nov 23, 2024 12:27 pm

All times are UTC




Post new topic Reply to topic  [ 15 posts ] 
Author Message
PostPosted: Tue Oct 27, 2009 1:08 pm 
Offline

Joined: Tue Oct 27, 2009 12:56 pm
Posts: 9
Hello all... First post here. Great place!

I used to do Atari programming, converting C64 source code to the Atari 7800. I did Impossible Mission, Summer/Winter games, and One-on-One.

I used the 2500AD compiler, under DOS. This was back in 1986 through 1988 or so. I have no idea what version anymore, but it was definitely 2500AD x6502

I have recently gotten my source code for these Atari games back from floppies, and have access to the 2500AD cross-compiler, version 5.05g

It complains when I have a label in front of an ORG directive, like this:

Testlabel (tab)Org $+4

The above would define "testlabel" and reserve 4 bytes for it.

It complains with "A LABEL IS ILLEGAL ON THIS INSTRUCTION"

Now, of course, I can do:

Testlabel
(tab) Org $+4

And it doesn't complain, so the error is really dumb, but somewhat understandable.

My question, first, is there some way to make it not do this, like a compatibility mode? I doubt it, but worth a shot.

ALSO - is there any cross-compiler out there that will take 2500AD source code, and might possibly be able to deal with a label in front of an ORG? Or a freeware one that I can hack to make the label work correctly?

It's not a HUGE deal to write a quick AWK or SED script to stuff a carriage-return/tab in front of the ORG if there's a label in front of it, but ... what a hassle.

Thanks!

And yes, Impossible Mission is really impossible, at least the original released by Atari. At the last minute, they asked me to crunch the RAM footprint down to 128Kbits instead of 256, and in doing so, I introduced the "impossible" bug. Of course, Atari signed off on it after they were SUPPOSED to test it, so I am somewhat absolved of any responsibility ... ok, NOT ;)


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Tue Oct 27, 2009 7:14 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8545
Location: Southern California
You say "compiler" but it sounds like you're talking about the assembler. Is that true?

For variable space in the 2500AD assembler from the 1980's, use BLKB to reserve a block of bytes. For example:

Code:
.PAGE0
SA:   BLKB  5
SB:   BLKB  5
SC:   BLKB  5

.CODE
.ORG  0200H
SD:   BLKB  5
SE:   BLKB  5
SF:   BLKB  5

makes three varialbles of five bytes each in zero page and three more in page 2.

.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Tue Oct 27, 2009 9:17 pm 
Offline

Joined: Tue Oct 27, 2009 12:56 pm
Posts: 9
You are correct, I meant "assembler". I'll try to be a little clearer.

I am currently using the NEWEST 2500AD assembler for the 6502, version 5.05g

I USED to have the DOS based version from the 80's, and currently have a pile of code written using it.

Almost everything compiles perfectly.

The only thing I've come across so far is that one place where I used to use "ORG" directives, with a label in front of it. The new assembler doesn't like the label there, which doesn't really make any sense.

I did it that way so it didn't generate actual data (padded with zeros?), but just symbols. If I recall correctly. These ORG directives are in a file, with no other data, except an initial ORG to the beginning of static RAM, and a lot of ORG statements using $+whatever, and a bunch of PUBLIC statements for the linker to find them. Not the most elegant solution, I know, but it worked, and was the only way I found at the time to get public symbols working without the linker trying to generate data for those locations.

After 20 years, I'm not sure why I did it that way, but to change it would not only be a bit of work, but also introduce changes I didn't want to make upfront.

PS: If I had access to the 2500AD compiler from the 80's, I'd use it in a heartbeat, but can't find it anywhere online, to purchase, or in any of my backups. We had a license for it, but that's long gone. From the MAP files I have, here's the LINK version:

2500 A.D. 6502 LINKER FOR INTEL HEX OUTPUT - VERSION 3.01d

_________________
Atari 7800 developer for Impossible Mission, Summer/Winter Games, and One-on-One


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Tue Oct 27, 2009 10:03 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8545
Location: Southern California
Quote:
Almost everything compiles perfectly.

Say, "Almost everything assembles perfectly."

When I was using that assembler in the late 1980's, I did a 10,000-line program, and I'm not sure I ever used the $ to get the current address. I used it in macros years later with the C32 assembler for the Forth kernel I wrote. BLKB does not try to generate any data. All it does is advance the pointer the specified number of addresses.

Are you missing the manual for both the new and the old versions of the assembler? I wonder if there would be anything unethical about making a copy for you of the old one. It sure won't be today though! If you want me to look up anything else that wouldn't take too much time, I can do that.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed Oct 28, 2009 2:35 am 
Offline

Joined: Tue Oct 27, 2009 12:56 pm
Posts: 9
OK, OK, ASSEMBLES perfectly. ;) I've been out of the assembly business way too long. It doesn't help that at the age of 14 I started working on a PDP-10 using MACRO-10 (and as a consultant at age 17) and using the command COMPIL to "compile" the assembly language files, nor that the two terms were used interchangably by DEC. To me, anything that supported macros was a "compiler".

I dug up a version 4.00e of the assembler (x6502) and it doesn't give any errors for the ORG with a label in front of it. So that's good.

Now it just complains about the "ABSOLUTE" directive being an illegal mnemonic. Meanwhile, version 5.05g doesn't. I just love it when something goes away in one version, then comes back later ;)

Before I did all this Atari 7800 work, I did a lot of coding for C64. And didn't have the manual for the AD2500 assembler, it was already on the IBM-AT I used at work. I did what I could to figure out what it needed, DEBUG was a good way to find out. Something in my memory is telling me I did a lot of finagling to keep it from making relocatable code for some reason. I still think BLKB was a problem at the time, maybe it was a bug in the assembler, or I was just lazy.

Anyway, off to figure out what ABSOLUTE has become in this particular version. Any quick ideas?

And THANKS for the help!

_________________
Atari 7800 developer for Impossible Mission, Summer/Winter Games, and One-on-One


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed Oct 28, 2009 4:07 am 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8545
Location: Southern California
Quote:
Anyway, off to figure out what ABSOLUTE has become in this particular version. Any quick ideas?

When I found the little maroon manual, I was reminded this is the short-form, and I don't have the full manual (which I seem to remember being in a 3-ring binder). Anyway, for ABSOLUTE, it just says on page 28 under "Assembly Mode" in the "Assembler Directives" section: "Useful for defining templates. It also maintains compatibility with Series 3.0 assemblers. Always assemble executable instructions in Relative mode, which is the default." I don't know if that's enough to be of any value at all. On the cover, it says, "2500ADsoftwareinc. Series 4.0 and 5.0 Cross Assemblers", and the address: One 2500AD Parkway, Buena Vista, CO 81211-2500 (800)843-8144, and under it:
Sales (719) 395-8683
Technical Support (719)395-2475
Telex Number (remember those?) 752659/AD
FAX (719)395-8206

At my job before that one, I remeber the secretary using paper tape with the telex machine.

In the folder with this manual there's a catalog page that also lists compilers which we didn't buy, starting at $650-- Yowee! It was bad enough that the assemblers were $250!


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed Oct 28, 2009 6:50 pm 
Offline

Joined: Tue Oct 27, 2009 12:56 pm
Posts: 9
And that's exactly what I use it for, "templates".

Is there a version 3 compatibility mode that I can turn on somehow?

I have successfully (almost) recompiled (gak, reASSEMBLED) the entire source for Impossible Mission and have verified checksums for 3 of the 6 eprom banks match. It's a step in the right direction ;)

The absolute/relocatable thing is byteing me in the butt (pun intended)

_________________
Atari 7800 developer for Impossible Mission, Summer/Winter Games, and One-on-One


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed Oct 28, 2009 10:57 pm 
Offline

Joined: Tue Oct 27, 2009 12:56 pm
Posts: 9
So without the ABSOLUTE and RELATIVE directives, what's the appropriate analog if the assembler doesn't have them?

_________________
Atari 7800 developer for Impossible Mission, Summer/Winter Games, and One-on-One


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu Oct 29, 2009 4:51 am 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8545
Location: Southern California
I don't know the answer to your question; but with a little web search, I found that one of the founders of 2500AD died in his 40's of a stroke, and 2500AD was bought by Avocet Systems. See if you can get the needed support at http://www.avocetsystems.com/ .


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu Oct 29, 2009 4:49 pm 
Offline

Joined: Tue Oct 27, 2009 12:56 pm
Posts: 9
Garth, thanks for all your help.

I've decided to bull my way through using version 5.02a of x6502, so ABSOLUTE and RELATIVE work correctly.

I have one or two issues with syntax that need to be addressed, but they are surmountable.

For instance, the following does not work whatsoever:

Radix H
Org $+ANYNUMBER

The "$" can't be used in Radix H no matter what to reference the current PC.

Go figure. I use this in only a few places when I need Radix H, so I either have to preceded every hex number with a "$" and leave it in Radix D, or surround each Org with Radix D/Radix H.

Ho hum...

Again, Garth, thanks for all the help!

_________________
Atari 7800 developer for Impossible Mission, Summer/Winter Games, and One-on-One


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu Oct 29, 2009 7:01 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8545
Location: Southern California
I haven't tried BLKB for anything but variables, but it seems like it should work even for leaving space in the program area, which is what I understand you to be wanting to do. Have you tried it? Otherwise a macro will hide the ugly details and make your code easier to look at and maintain.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu Oct 29, 2009 8:23 pm 
Offline

Joined: Tue Oct 27, 2009 12:56 pm
Posts: 9
Problem is, with the Atari 7800 Maria chip making what amounts to sprites, you bounce back and forth, so not only are there areas I want to reserve, but I also want to ORG backwards, as in "ORG $-$1000".

One more question:

I used CALL in my source code, and the 2500AD assembler says "ILLEGAL MNEMONIC FOR THE CURRENT SYNTAX". JSR works just fine. Not entirely sure what 2500AD thinks "CALL" is it should just be a "JSR". Anything in that manual about that?

_________________
Atari 7800 developer for Impossible Mission, Summer/Winter Games, and One-on-One


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu Oct 29, 2009 8:49 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8545
Location: Southern California
I don't find anything about a CALL in the little manual. JSR is the standard mnemonic; but if you really want to re-name it "CALL", you could make it a macro, and if it still complains because there is some kind of CALL directive, do MACFIRST ON.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu Oct 29, 2009 9:13 pm 
Offline

Joined: Tue Oct 27, 2009 12:56 pm
Posts: 9
That's a keeper. I tried making it a MACRO, but needed the MACFIRST ON.

Excellent.

Anything about RADIX in that manual ?

_________________
Atari 7800 developer for Impossible Mission, Summer/Winter Games, and One-on-One


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed Nov 04, 2009 4:08 am 
Offline

Joined: Tue Oct 27, 2009 12:56 pm
Posts: 9
OK, finally got everything assembled, compared to the original binaries I had, and it checks out perfectly.

From a bug in decoding macro arguments, to that pesky "$" issue when RADIX H is on, to a couple of other things, I finally got through it all and I can actually play the game on an emulator.

Thanks Garth, for helping out.

Just wanted to close the loop on this batch of issues.

_________________
Atari 7800 developer for Impossible Mission, Summer/Winter Games, and One-on-One


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

All times are UTC


Who is online

Users browsing this forum: No registered users and 13 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: