News: 11 March 2016 - Forum Rules

Author Topic: Strange 68000 effective address  (Read 2422 times)

tryphon

  • Hero Member
  • *****
  • Posts: 736
    • View Profile
Strange 68000 effective address
« on: August 22, 2013, 10:20:48 am »
Hello,

I'm not much used to 68000 assembler,and here's an instruction I can't figure out :

At address $B6A2, my disassembler shows :

Code: [Select]
MOVE.b *+$B654(PC, D2.w), D2
Could someone explain me where it reads the byte to put in D2 ?
When I traced the code, I had D2 = 0, PC = $B6A2, and D2 got the value $06, which is located at $B654. But I don't understand why, neither can I predict what would happen for different values of D2.

Ti_

  • Jr. Member
  • **
  • Posts: 55
    • View Profile
Re: Strange 68000 effective address
« Reply #1 on: August 22, 2013, 11:53:47 am »
It's works like:
Code: [Select]
lea data,a0
 lea (a0,d2.w),d2
....
.....

data:
 dc.b 0,1,2,3,4,5
adress = a0+d2.


Code: [Select]
move.b table(pc,d2.w),d2
....
....
table
dc.b $11,$56,$89,$30
if d2=0, new d2 is $11
 if d2=1, new d2 is $56


In hex value of 'table' in command itself from +127/-128.  It's applies to PC like beq's, bcc's e.t.c.

tryphon

  • Hero Member
  • *****
  • Posts: 736
    • View Profile
Re: Strange 68000 effective address
« Reply #2 on: August 22, 2013, 04:22:49 pm »
Thank you :)