LF: 68K ASM Programming


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

LF: 68K ASM Programming



Well, I finished my Landscape Generator routine for Bombardment and 
it is very fast.  While I was making it, I came up with a few tips 
for others learning and programming in 68K assembly language:


1.  To reset your calculator after it freezes, press and hold [ON] 
while you remove and reinstall one of the batteries.


2.  When you get an address error, your program most likely tries to 
access a word or longword at an uneven address.  To access a word, 
the address must be evenly divisible by 2 and for a longword, I think 
the address has to be evenly divisible by 4 (maybe 2?)  To fix this, 
try changing the line to read or write a single byte instead of a 
word.


3.  The address register, a7, is a pointer to the stack.


4.  Make sure that when you push bytes onto the stack (by moving them 
to the address pointed to by a7), you decrement the stack before the 
move (example:  move.b  #1,-(a7) ).  If you don't pop the bytes from 
the stack, be sure to increment the stack pointer (a7) using a + 
instead of a -.  If you push bytes to the stack and then call a 
subroutine, after the call, be sure to increment the stack the number 
of bytes pushed onto it before the subroutine was called.


That's all I came up with so far, but if I come up with any more tips 
or things that may help other programmers, I'll post them.


-Ed