A89: Need some help with an error


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

A89: Need some help with an error



Hey guys. im new to the list, and fairly new to asm programming.
been learning alot, but just started trying things out.
im getting a memory violation when i run one of my programs...
and as far as i can see, i have no idea why. im not putting anything where it shouldnt go. (i dont think)
 
maybe you guys can help me out and tell me whats wrong... heres my source. all it does is make a ball go back and forth (nothing special, just practice) ive taken out parts of code to see if the problem persists, and it does. ive taken out alot of it, such as the put sprite line and everything relating to it, also i took out the delay and stuff... i just have no idea what it could be since im new. please help me out! thanks.
 
delay:
 move.w  #0,d0
 
delay_repeat:
    add.w   #1,d0
    cmp     delay_len,d0
    bne     delay_repeat
    rts
 
_main:
 jsr graphlib::clr_scr  ; clear the screen
loop:
 
    move.w  numx,d0   
 move.w  #20,d1   
 move.l  #ball_sprite,a0
    jsr     graphlib::put_sprite
 cmp #0,dir
 beq right
 cmp #1,dir
 beq left
 bsr loop
moveleft:
 move #1,dir
 bsr loop
moveright:
 move #0,dir
 bsr loop
right:
 add.w #1,numx
 cmp  #100,numx
 beq moveleft
 bsr loop
left:
 sub.w #1,numx
 cmp  #1,numx
 beq moveright
 bsr loop
end:
 clr.l d0
 clr.l d1
 clr.w numx
 clr.w temp
 rts     ; end of program
 
 
 
there it is :P
 
~Neticule
 
 

Follow-Ups: