Re: A89: dumb question


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

Re: A89: dumb question




>" to take another example.. the compiled code for
> move.w d0,d1
> rts
> is
> $32004e75"
>i know you took a random address, but which part of this ($32004e75) is the
>hex opcode for move???and how would you distinguish what you are talking
>about (b/w/lw) when doing hex???
ok.  it is like this:
32004e75 is hex, but in binary, it is:
00110010 00000000 01001110 01110101 in binary
now, each instruction (without any extension words, of course) is 32 bits
(it is a 32 bit machine!!)
so:
00110010 00000000 is move.w d0,d1
and
01001110 01110101 is the rts

breaking down the move.w d0,d1 section, we find out even more:
00 11 001 000 000 000
the first two bits, 00, tells us this is the move instruction
next, 11, tells us that it is a word operation
001 000 tells us that for the destination (d1)  to use the 1st register of
the data regs (its backwords, i know)
and the
000 000 tells us that for the source (d0) we should use the 0th register of
the data regs (now this is
    opposite.  if it were 001 000 in this case, it would mean to use the 0th
address register)  pretty weird.

Jonathan Kaus




Follow-Ups: