#Amiga cross-asm
25 messages in this thread
I've heard of a 6502 cross assembler for the Amiga called DASM. I've not
been able to get info about it, though (like if it's PD or commercial, etc.
or WHERE to get it….).
Has anyone heard of it, or another 6502 cross assembler? Any info greatly
appreciated, thanks.
DAsm is a freeware PD program by Matt Dillon, it is located on Fish disk
#287 and supports :
6502
68705
6803
HD6303
6811 It is not a cross assembler as far as I define
one (takes 68000 and converts to 6502). It is, a multi-pass macro
assembler which takes 6502 source code and makes 6502 object code.
I haven't had a chance to use it yet, so I don't know how well it works, I
should have a chance very soon to use it with 6811 code for a class I'm
taking.
Judging by the author's reputation, I would guess that it does it's job
very well.
-Greg.
A cross assembler differs from a 'normal' assembler in that the code which
it assembles is different from the processor on which the assembler itself
runs on. For example, an assembler which runs on a PC and takes 8086
assembly is a 'normal' assembler. An assembler which runs on an Amiga and
takes 8086 assembly is a cross assembler.
I'm not sure what you'd call something which converted from 68K->6502
(probably a compiler considering the complexity of the job!!).
-Mike
How about "assembly code translator"??
I don't think I've ever heard of a common name for such beasts, either…
not that there are a lot of them anyway <grin>.
Well, I'd call 68K assembler a high level language compared to 6502
assembly (try doing move.l (a2)+,(a3)+ in 6502!) – as such compiler seemed
an appropriate term 😎
-Mike
I imagine that the amount of memory needed on the 6502 system just to
simulate the 68000's registers and much larger stack would make it
impossible to translate anything other than small programs, not to mention
all the extra steps needed to actually calculate the addresses of operands
(a simple 8 byte MOVE.B D1,([PTRLST,PC,D0*4),$10) might take the better
part of a day to execute on a 6502)
-Greg.
A generic 6502 only accesses 64K & has a 256 byte stack (although my C128
has two of 16 MMU controlled banks of 64K and a 512K ram expansion with DMA
that allows transfering 1 byte per cycle). Additionally, memory locations
00-FF are called zero page & can be addressed in lots of interesting ways
that make for speedier & more efficient programs. I believe if one were to
attempt to create a 68K->6502 "translater" one wouldn't attempt to simulate
a 68000, but rather convert the code to take advantage of the 6502's
strengths. For instance, the data and address register are easily simulated
by using zero page as pseudo-registers, we end up with 128 of them.
Calculating the addresses of operands might not take as much code as you
believe, but since most 6502 systems don't multitask & usually load
programs at a fixed address, calculating addresses is not difficult at all,
and good programmers aren't scared by your example. Yes they have to be
done by hand, but won't take days… or even seconds.
The 6502 has a small instruction set (sort of an unintentional RISC
processor, eh?) and doesn't have a built in division or multiplication, but
6502 are used to inventing ways around its limitations. I submit, that
given the same clock speeds and comparable addressing space, that the 6502
can do anything a 68000 can do. Not as quickly nor efficiently, but it will
reach the finish line. Remember, the 6502 is the 68000's father (or is it
step-father? Uncle? Grandfather?) You should respect your [procesor's]
elders… :^)
I could go on and on, but this isn't the place for it. Now if you want to
talk about some nightmarish processors, let's look at some Intel chips….
😉
Yes, you can do anything with a 6502 that can be done with a 68000,
neglecting speed and size constraints. However, this is like saying you
can go anywhere on Earth on foot (or swimming) that you can go by plane.
Sure, both methods will get you where you're going, but its orders of
magnitude faster to do it by plane, and this opens up whole new
opportunities.
As for the relationship between the 68000 and 6502, I've never heard of
_any_. Perhaps you're confusing the 6800 with the 6502? The 6502 would
have been bearable if it had more than 1 general purpose register. As it
was, 95% of your code ended up pushing or popping the accumulator!!!!!!
-Mike
Mike,
Yes, and in addition, it doesn't even have 1 16 bit address register, it
would be SO much easier to move or clear any more than 256 bytes of data if
it had one. Instead of:
sta,x $c000
sta,x $c100
sta,x $c200
…
Greg
Well, my point was that the differences were more like walking & driving,
but not as great as walking & using a SST. A 68000 would be dozens of
hundreds of times faster, but not thousands. Of course, I'm still a novice
at 68K asm, maybe I'm wrong. Can anyone think of a simple way to compare
them? Like how many cycles it would take to perform a variety of common
operations….
Actually, I know much more about the 6502 than I do about the 68000 (can
tell you that lda #$00 sta $d020 translates to a9 00 8d 20 d0, off the top
of my head). And on my way home from work I was thinking of ways that 68000
asm could be made to run on 6502. Like using a zero page indexed
addressing, but since I'm not very adept I didn't get very far.(even after
a 30 min. drive 🙂
It would be an interesting project though, then you could write a C
program (on a real compiler) and compile it into 68000 asm and convert it
onto a 6502/6510. (I bought a C compiler for the 64 once, and returned it
when I read in the instructions that a function couldn't call itself- among
other things)
/~
\] reg.
As Mike mentioned, you may be thinking of the 6800 as being more related to
the 68000, altho the 6502 is also related because of HUMAN parentage…
The Motorola 6800 came out in 1974. Part of the 6800 design team left to
join MOS Technology, which then brought out the 6501/2 in 1975. Because of
this human factor, the 6502 bore more than a passing resemblance to the
6800.
In any case, the 68000 design team wasn't out to make a better 6800 (The
6809 design team, working independently, was. If the 68000 hadn't panned
out, the original intention was to eventually extend the 6809 into a 32-bit
cpu by stages)… the 68000 guys were to start from scratch. To quote
Motorola, "earlier designs were to be used as examples, not models".
Even so, the basic command set ended up looking similar to the 6800's (and
by the above-explained parentage, the 6502). But the addressing mode
philosophy (PIC/reentrant/orthagonal) paralleled the 6809 in many ways
because of common basic Motorola research in that area.
So I'd say the 6502 was a bastard cousin to the 68000, at most ;-).
Yes, I was thinking of HUMAN parentage & some similarities of the
instruction set. Thanks for clarifying a few areas in microprocessor
history, though. (I'd forgotten all about the 6800)
I'll accept bastard cousin, I think it fits well. A new term of endearment
to me… ;^) (cynical: what do you call a bastard cousin's cousin?)
<blink> Forgot about the 6800??! <grin>
If memory serves me, the Apple I had a jumper to use either the 6800 or the
6502. The 6800 had a lot of followers at the time, but the 6502 got a
foothold in the cpu market mainly by being inexpensive…. the 8080 was
over $100 apiece, the 6800 around $80 I think, and then here comes the 6502
at $25!
The rest is typical price-oriented consumer electronics history ;-).
I suppose the 6502 helped stop the Intel crowd for a while. Its mass usage
in the US also delayed movement to the 6809 and 68000 chips, tho. Someone
correct me if I'm wrong, but I don't think I ever heard of a Japanese
computer in all those years which used the 6502, btw. They skipped all the
low-life chips and went straight to the Z80 and 6809 and on up stuff.
The Soviets fairly quickly copied the 8080 and 6502 tho, if that tells you
anything <grin>. best – kev
Kev,
Price was only part of the reason for the success of the 6502 over the
6800. The other factor was speed. Even with its two accumulators, the 6800
was just a bit of a dog when compared to the 6502. Never did figure out why
_anyone_ ever went with the 8080 or its slow cousin, the Z80. Expensive and
underpowered; sort of the Lotus Europa of CPU chips.
-larry
Thanks for clearing that up for me, I wasn't quite sure what cross
compiler meant, and didn't think that taking 6502 source and generating
6502 obj. could be cross compiling just because you happen to be running
the assembler on a different CPU – guess I expected more from computer
jargon than I should have. (hehe)
-Greg.
Greg – not to worry… the term "cross compiler" has confused people for
years, and still does all the time. Someone should change the name <grin>.
Maybe it would be called a Transexual Cross compiler? <grin> By the way I'm
still looking for an 68000 -> 8086 translator.
Greg,
Yes, Matt Dillon writes great stuff. If his name is associated with it,
then I pay attention.
Hmmm, I always thought a cross assembler was something that allowed you
to write object code for a machine on another ("higher powered")
platform….
Thanks,
–fran
DASM is Matt Dillon's cross assembler, and it is freely distributable. It
has been in our libraries in the past, but I did not locate it here this
morning. I think I have it around here somewhere, and could upload it for
you.
.Betty
Betty,
Thanks, yes, could you please upload it? I haven't written an 6502
assembly since I got my A2000 & have gotten spoiled 🙂 …
I've volunteered to write a few utilities for the 8-bit CBM machines and
dug out my my old 6502 tools. They work fine, but after a year of
multitasking & using DME to edit source (another great tool by Matt Dillon)
I find the old programs painful to use. Funny how an 80 by 25 line display
now seems small & waiting 10 minutes for a program to compile seems too
long.
Incidentally, I believe it was you who wrote a few articles for the
Transactor about Disk Encoding Schemes, correct? I'm wondering if you've
done anymore exploration in this direction, and if so, have you published
it?
–fran
I have not worked much on the file format lately. Without Transactor,
there aren't many magazines interested in such, and I had learned most of
what I wanted for my own curiosity. Nothing like a writing deadline to
spur my curiosity, though! TRANSACTOR kept me studying all the time. Now,
I'm getting terribly lazy. 🙂
I've written myself a note to look up DASM and upload it. Should be here
in 2-3 days.
.Betty
That's a pity, I'd hoped you had written more since I have a back-burner
plan to do some explorations of file formats and found your articles
helpful. Also, why reinvent the wheel.
I know exactly what you mean about gettting lazy without a deadline, I'd
written a number of articles for the old Transactor & found that a 'plex
from the Editor saying "I need that article by Friday!" a great motivator.
Plus, knowing that a lot of people were going to look at your work closely
made me be V E R Y careful about what I was saying, dont want to give the
experts something to harp about, and yet, also want to make sure that the
novice doesn't get lost. I really miss the T, I still cant figure out why
Croftward killed it….
I'll keep an eye out for DASM, again, thanks!
–fran
If you don't have DAsm I know I do, I was referring to the doc file when
replying.
Let me know if you need it.
-Greg.
Thanks, Greg, but I do have it. Matter of locating it.
.Betty