What instruction did you use to push the sum? Was it PEA? I'm looking in the reference I have for the 68000 instruction set and I don't see PUSH or POP instructions, which is what I would use on x86 machines.i have the sum of D0,D1 and pushed it at SP and i want to recall the most significant word of this sum from SP in the register D4.
how i do this ?
i work with 68000 motorola microcotroller
MOVE.L D1,-(SP)
MOVE.L (SP)+,D2
Mike,if u wanna move something to SP you write this MOVE.L D1,-(SP)
If u wanna recall something from SP you write this
MOVE.L (SP)+,D2
Now my problem was that the sum assigned into register D1 was Longword and the excercise was asking to recall the most signifficant word of D1 from SP and i wrote this
MOVE.W (SP)+,D1
and it worked
MOVE.W -(A0), (A1)+
CLR.L D2
MOVE.L #$12345,D1
MOVE.L D1,-(SP) ; push value in D1 on stack
MOVE.W (SP)+,D2 ; pop MSW word at SP to D2
Thread starter | Similar threads | Forum | Replies | Date |
---|---|---|---|---|
Y | problem controlling variable DC-DC LTC1261LCS8-4 | PCB Layout , EDA & Simulations | 10 | |
G | A Theremin sound problem | General Electronics Chat | 26 | |
K | Convert powerchair to RC vehicle - Problem with Sabertooth 2x32 | General Electronics Chat | 1 | |
J | (SOLVED) Problem Writing to Stack (TOSL) | Microcontrollers | 21 | |
S | stack overflow problem | Microcontrollers | 10 |
by Jake Hertz
by Duane Benson
by Jake Hertz
by Duane Benson