0

im currently trying to load values of an array, push them onto the stack but im having some issues.

I have the following code (Using EASY68K:

    ORG $8000
START:
    LEA $9100,sp
    MOVE #array,-(sp)

    ORG $9000
array DC.B '1,2,3,4,5,6',0
sum DS.L 1

When I try to move the the top of my stack, with

MOVE.B (sp),D1

I get 60, but shouldnt it be 06? Another issue is when I do

MOVE.B 2(sp),D1

I get FF, instead of the next number, which I expect to be 05.

  • 1
    `MOVE #array,-(sp)` You realize that what you're doing here is store the value $9000 _in memory_ at address $90FE, right? – Michael Nov 26 '15 at 20:50
  • 1
    Also, having quotes around the array looks like a mistake. '6' != 6. – Michael Nov 26 '15 at 20:55
  • 1
    Your definition of `array` looks like the string `"1,2,3,4,5,6"`, null terminated. Is that what you intended? When you say, *I get 60* how are you observing 60? Are you using a debugger? – lurker Nov 26 '15 at 21:11

0 Answers0