Looking for m68k (or derivative) asm examples.
category: general [glöplog]
Hi yall,
I'm looking for m68k assembler sources so I can figure out the addressing modes by example -- the datasheet I have is completely unreadable.
Can anyone point me to some m68k asm stuff?
Tnx!
I'm looking for m68k assembler sources so I can figure out the addressing modes by example -- the datasheet I have is completely unreadable.
Can anyone point me to some m68k asm stuff?
Tnx!
so you can't read the notation out of the normal normal reference manual: http://www.freescale.com/files/archives/doc/ref_manual/M68000PRM.pdf?
Don't know where you find sources utilizing each and very addressing mode ;)
Don't know where you find sources utilizing each and very addressing mode ;)
I'm trying to compile:
bset.b #7,($80000).W
which should be allowed on a Coldfire V1 MCU (MCF51JM128).
However, GNU AS keeps giving me: operands mismatch. -- rather unhelpful as it almost always generates this error whenever something is wrong. To make matters worse, AS does not implement the Motorola syntax directly but uses the AT&T syntax in odd places.
@Psycho: So no; the normal normal reference manual is not helpful.
@StingRay: tnx, but that syntax doesn't seem to work...
bset.b #7,($80000).W
which should be allowed on a Coldfire V1 MCU (MCF51JM128).
However, GNU AS keeps giving me: operands mismatch. -- rather unhelpful as it almost always generates this error whenever something is wrong. To make matters worse, AS does not implement the Motorola syntax directly but uses the AT&T syntax in odd places.
@Psycho: So no; the normal normal reference manual is not helpful.
@StingRay: tnx, but that syntax doesn't seem to work...
Then it's not really m68k asm, although it may be some assembly language for m68k ;)
<more than 16 bits>.W looks wrong btw..
<more than 16 bits>.W looks wrong btw..
coldfire has no .b
actually * as far as I remember *, coldfire's asm lacks a looot of 68k instructions and adressing mode ( can't run 68k code, needs re-compilation of it, the reason why it was never used as accelerators on amiga & st ).
I know this french site: http://coldfire.zewan.com/cf/
where it is told how to translate most incompatible 68k ops for coldfire:
kind of:
add.b <ea>,Dn
becomes...
[1] move.l Dn,temp
[2] clr.l temp+4
[3] move.l <ea>,Dn
[4] add.l Dn,temp+3
[5] move.w ccr,Dn
[6] move.w Dn,ccr_temp
[7] move.l temp,Dn
[8] move.w ccr_temp,ccr
... because cf can only manage 32bits arithmetics.
where it is told how to translate most incompatible 68k ops for coldfire:
kind of:
add.b <ea>,Dn
becomes...
[1] move.l Dn,temp
[2] clr.l temp+4
[3] move.l <ea>,Dn
[4] add.l Dn,temp+3
[5] move.w ccr,Dn
[6] move.w Dn,ccr_temp
[7] move.l temp,Dn
[8] move.w ccr_temp,ccr
... because cf can only manage 32bits arithmetics.
oh yeah, and the CCR acts differently on cf and 68k.
Quote:
allmodesnew.asm
damn, there's a lot of modes in there that I didn't know/use back in the day where I coded m68k asm.
Ok, found the reason:
"For BTST, BSET, BCLR and BCHG, if the source operand is a static bit number, the destination cannot be Indexed or Absolute memory."
Although, IMO, this is not clear from the Coldfire instruction reference.
"For BTST, BSET, BCLR and BCHG, if the source operand is a static bit number, the destination cannot be Indexed or Absolute memory."
Although, IMO, this is not clear from the Coldfire instruction reference.
PortAsm/68K did a great job to help me fixing m68k code for Coldfire.