Strotmann.de

Thursday Jan 17, 2013

FireBee Diary 2: from MC68000 to ColdFire

To get volksForth running on the FireBee, the machine code instructions that are available on the MC68000, but not in the ColdFire CPU need to be replaced with a series of instructions that perform the same action.

I found the "Digger V8" dissassembler on Heenk Robbers webpage along with the AHCC C-Compiler. The Digger is able to disassemble both ColdFire and MC68000, and it can switch between the two CPU types with a simple switch. Finding instructions that cannot be executed on the ColdFire is now only a matter of switching the CPU type and watching the assembler code change.

The Digger package also contains a list of all M68000 assembler instructions, with information on the instructions available on each CPU type (MC68000, MC68020, MC68030, ColdFire …).

I made the table below as a quick look-up tool to find MC68000 instructions that need replacement on the ColdFire (this table is still work in progress, the column "workaround" will be filled while I work on the ColdFire porting project):

Opcodepossible workaroundDescription
ori -> ccrOR immediate to CCR
ori -> srOR immediate to Status Register
andi -> ccrAND immediate to CCR
andi -> srAND immediate to Status Register
eori -> ccrEOR immediate to CCR
eori -> srEOR immediate to Status Register
movepMove peripheral data
trapvTrap on Overflow
rtrReturn and restore condition codes
chk.wCheck register against bounds
dbccTest condition, decrement and branch
sbcd Dx,DySubtract decimal with extend
sbcd -(Ax),-(Ay)Subtract decimal with extend
suba.wSubtract address
subx -(Ax),-(Ay)Subtract extended
lineaLINE-A access
abcd Dx,DyAdd decimal with extend
abcd -(Ax),-(Ay)Exchange registers
exg Dx,DyExchange registers
exg Ax,AyExchange registers
exg Dx,AyExchange registers
adda.wAdd address
addx -(Ax),-(Ay)Add extended
roxlRotate left with extend
roxrRotate right with extend
rolRotate left
rorRotate right
aslArithmetic shift left
asrArithmetic shift right
lslLogical shift left
lsrLogical shoft right

Comments:

Post a Comment:
  • HTML Syntax: Allowed

Calendar

Feeds

Search

Links

Navigation

Info