Re: LF: programming stuff


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

Re: LF: programming stuff




"Taylor polynomials"

On Thu, 26 Jun 1997 Hmlacage@aol.com wrote:

> Sorry to disturb....
> I am working on a trig lib which would really calculate sine and cosine
> values. ( the one which is available just stores values in an array... ) I am
> using " limited developpements" ( ?... ) ( am not sure about the spelling and
> the expression itself. ) U know: cos(x) = x + x^2 / 2 + ...
> So: the prog i wrote just can' t be compiled...
> here is what' s wrong: 
> exerpt from " list.txt "
> 
> >000018	33FC 0001 000000BC	    134    move.w  #1,K     
> >000020	33FC 0001 000000BD	    135    move.w  #1,nume         ;  
> >Alignment error.			                                             ^ lib.asm
> line 10>000028	3200
> 
> and "K" and "nume" are 	defined as
> 
> >0000BC	00			    186 K:      dc.b 0
> >0000BD	00			    187 nume:   dc.b 0
> 
> nume and K are thus defined exactly in the same way and are used exactly in
> the same way: what is wrong ?

K, nume are only bytes.  Yet you are trying to store words in them.
Though this is not exactly the problem, making this change might help
 
> For more detail, i have attached the source file ( lib.asm )  to this Email
> 
> One more thing: i have had many " adressing mode not allowed here": this
> means that i cannot use a certain data with the specified instruction ? 

Well, yes.  That is, for many instructions you cannot give, say, Value(PC)
as an operand.  The solution is to allocate an address register, say a5,
throughout your program to temporarily store addresses in.

For instance, I don't remember if you can do this...

	move.l d0,Value(PC)

but you could do this:

	lea	Value(PC),a5
	move.l	d0,(a5)

If you are familiar with ASM, you will see that they do the same thing.

> 
> One thing more: in the 68k guide ( really great ! thanks jimmy mardel ! ) ,
> there are some "#" and "$" symbols used. "#" stands for "immediate" and "$"
> for "adress" ?

If this is just dealing with asm, # means "immediate," that is there is a
number given here, not just a register of memory location.  $ means
"hexadecimal," that is, the number given is in base 16 (hex)

> 
> Thanks for answering...
> Mathieu, <hm lacage@aol.com>      
> 

-- Shawn Walker (swalker@earthling.net)


References: