View Full Version : Motorola 68000 opcodes
shangt
March 16th, 2006, 18:15
I must emulate the 16-bit m68k for my project. Where can I find data on the opcodes' byte values and not the opcodes' names? for example, the value of MOVE, ADD, LEA, etc... I have a reference but it doesn't contain that information.
Lordus
March 16th, 2006, 20:30
You can try this, it helped me a lot...
http://oldwww.nvg.ntnu.no/amiga/MC680x0_Sections/index.HTML
shangt
March 17th, 2006, 01:19
Well that doc is useful to clarify each opcode's function (I saved it) but it doesn't help. I need to know how "PEA" and "LINK" and etc. are represented numerically in memory, and the size of the instructions.
for instance:
CLR <ea>
this instruction will clear the operand to zero. I know how to determine the particular operand from the status register. BUT I can't parse "CLR" out of an array of bytes since I don't know its (CLR) value. CLR is an alias for a byte or 2 bytes??
example, assuming CLR is E24F:
E24F 0756 means:
CLR 0756
^ that formatting is probably not correct but I hope you understand.
Lordus
March 17th, 2006, 01:44
If i understand you right, then that doc shows you exactly what you want to know.
On the M68000 every opcode can have many different versions, depending on the operation size, effective address of the operands and other things.
Each opcode is basically word (2bytes) in size, but depending on the address mode, or opcode, immediate data, or addresses can follow the opcode. All that you can see in the doc.
For the CLR it shows something like this for example:
| 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | SIZE | MODE | REGISTER
that means the hex representation of CLR is 0x42xx
where xx specify the operation size, and the address mode. Those you can find too in the doc.
So 0x4280 for example would be a CLR , Long size, with the Register D[0] as operand.
0x4239 a CLR on a byte specified by the Long Word address following after the CLR opcode.
I hope you understand ;)
shangt
March 17th, 2006, 22:59
hmm okay I now understand. thank you. I will use this doc.
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.