Re: A92: Constants and immediate values + movem


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

Re: A92: Constants and immediate values + movem



At 12:52 1997-08-17 -0500, you wrote:
>On Sun, 17 Aug 1997 Slabbe <gu95masl@dd.chalmers.se> writes:
>
>>hmm.. is it not like that the first one adds the content of address
>>CONSTANT to A1 and second one adds CONSTANT to A1 ?
>>i.e. say CONSTANT=$4
>>add.l $4,a1    ; will load longword from address $4 and add it to a1
>>add.l #$4,a1   ; = lea $4(a1),a1 (but lea is a bit faster i think)
>>;however those could be simplified with
>>add.l $4.w,a1  ; and you save 2 bytes (on the Motorola 6510 there is a
>>	       ; special addressing mode for accessing the first
>>	       ; 256 bytes :) (commodore 64 processor)  ) but can only
>>	       ; be used for the first 65536 bytes	
>
>Oh no it can't!  Only the first 32768 bytes can be referenced by
>absolute short addressing.  If the high bit is set, the address is
>sign-extended so that it references the very last memory addresses.  

So there's no point in using this in Fargo?

>>addq.l #4,a1   ; i guess this is even faster then the lea but addq can
>>	       ; only add values between 1 and 7 (i think)	
>
>Actually, ADDQ can add values from 1 to 8.  Using ADDQ can speed up
>additions to data registers, but when adding to an address register
>it is not any faster than an LEA.  It does save 2 bytes though.

No it doesn't. Then again, A68K may substitute LEA when the addition
is 1-8, it substitutes ADD for ADDQ or ADDI...

My .92p-file didn't get any shorter. I didn't compare sizes on the
calc - the .92p:s file header is constant size, or is it?


Niklas Brunlid
PQF Quote follows:

The Patrician relaxed, in a way which only then drew gentle attention to
the foregoing moment of tension.
        -- (Terry Pratchett, Men At Arms)


Follow-Ups: References: