## News:

11 March 2016 - Forum Rules

## My 68000 code newbie questions

Started by lytron, December 13, 2013, 02:50:15 AM

#### lytron

Hi,

I have two questions about some code of a Sega Genesis game; I have no experience with that console and that instruction set, so I expect you can answer them easily. Probably I have a few more questions in future...

... by the way, do you know any good resources for the Genesis Memory Map / Instruction Set, maybe that would spare a lot of you some silly questions. My google inqueries for that were not fruitful until now...

1) What does the line
movem.l d0-a1/a3-a5,-(sp)
do? Shift registers d0-a1 into a3-a5?

2) What does the line
move.b #\$7D+\$80,d0
do?

#### Ti_

1) saves all regs(except a2 and a6) in stack memory. ( sp=a7=stackpointer)
2) there's no such command, it  will be assembled as  "move.b #\$FD,d0"

#### lytron

Quote from: Ti_ on December 13, 2013, 04:03:34 AM
1) saves all regs(except a2 and a6) in stack memory. ( sp=a7=stackpointer)
2) there's no such command, it  will be assembled as  "move.b #\$FD,d0"

Thank you!

2) Okay, this means "#\$7D+
• \$80" is a compiler command that gets calculated before assembling. And again: Thank you.

#### furrykef

I wouldn't call it a "compiler command" (besides, it'd be an assembler, not a compiler), but rather an "expression". An expression is a formula the compiler can reduce to a numeric constant during assembly. I could have something like "move #foobar*5 + 8, d0", and so long as foobar is some constant, the assembler will compute the value for you. For instance, if foobar is 5, the expression will be 5*5 + 8 = 25 + 8 = 33 (decimal), so it'd be equivalent to "move #33, d0".