[TI-H] Re: MC68k, OP-codes, etc


[Prev][Next][Index][Thread]

[TI-H] Re: MC68k, OP-codes, etc




At 13:43 2001-09-22, you wrote:
>1.) which is EXACTLY the processor type of a TI92+, HW2

probably the same as the ti89 hw2, that is MC68SEC000


>2.)
>How does the MC68k handle the parameters for the assembly commands?
>E.g. when I do a
>move.w        d0,#60000F
>
>how is this stored in the binary program file?
>
>OP-Code, first parameter,second parameter
>?

like that. but parameters like d0 is stored inside the opcode, only 
parameters that is numbers or adresses is stored after. Always aligned at a 
word boundary, that is, no parameter can be only one byte.


>I've downloaded the 68kpm.pdf from ticalc.org but I did not found any OP
>codes?

They are there.
Check section 4, the instruction list. Under each instruction is a 
"Instruction Format" that is the opcode.
It is more advanced then your idea that move is 1, rte is 2 and so on, they 
are bitpatterns, where the first few bits (different number of bits for 
each instruction) says what kind of instruction it is, then areas of bits 
that says like in your example above, what adressing mode to use, and if 
that adressing mode is something with registers, wich register to store in 
or use (for offsets like 42(a0)).  the adressing mode also tells if there 
is more arguments stored after the opcode to read.
You get it when you study those instruction formats a bit more.

>3.) How does a disassembler/assembler work?
>Do grad the binary code, look which OP code and then look for parameters?

something like that. chose a starting point on an even adress, read a word, 
check (parts of) the bitpattern in it to deside what kind of instruction it 
is, maybe pass it to a handler of that kind of instruction (or be done if 
it was a simple instruction) that checks for adressing modes and maybe 
extra paramters, if there is, read those too, and then start over again at 
the new adress.

///Olle





Follow-Ups: References: