A86: Re: Any TASM directive experts???


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

A86: Re: Any TASM directive experts???




If you it will always be a .db of length 4 bytes (i.e. you don't care that
the number 1 is represented by 32 bits), then it's easy.

#define NUM(x) .db (x)&255,(x/256)&255,(x/65536)&255,(x/16777216)&255

I think there might be a drawback... I'm not sure that TASM supports 32-bit
math =/
Your other options is to do BCD: .db $01,$23,$45,$67,$89

----- Original Message -----
From: <JayEll64@aol.com>
To: <assembly-86@lists.ticalc.org>
Sent: Thursday, January 27, 2000 7:26 PM
Subject: A86: Any TASM directive experts???


>
> Anyone here know how you would represent a large decimal number (as long
as 9
> digits) in ".db"s (changing to hexadecimal/binary, of course)?  Like, I'm
> think a macro...for example, something like:
>
>  NUM(123456789)
>
> ...would be compiled by TASM as:
>
> .db $15,$CD,$5B,$07
>
> ...with the least significant byte first ($100^0 * $15 + $100^1 * $CD +
> $100^2 * $5B + $100^3 * $07 = 123456789).  I made that conversion with the
> scientific calculator that comes with Windows (I s'pose it could be done
on
> the TI as well), but I have more than 100 numbers I have to do this to,
and
> I'm thinking it's gonna be a real pain to convert them all "manually"...
>
> Any help is welcome,
>
> JayEll
>



References: