A83: Re: Displaying hex.


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

A83: Re: Displaying hex.




Oh, we don't really like those ". . .", do we? =) Having to repeat the same
code 8 times isn't very economic, so I'd suggest doing a
rotate-right-accumulator (rra) instruction and then djnz'ing.

Oh, and by the way, your code would print the number backwards. (And so would
mine, better use a rlca instead, and then check the carry flag instead of
doing a bit 0 and checking the zero flag.)

Linus

On 05-May-98, Trey Jazz wrote:

>i assume in asm since its on this list. for a binary number you will have to
>do some bit testing and output the correct value to the screen as you go

>ex:
> ld a,(number)
> push af
> bit 0,a
> call z,one
> call nz,zero
> pop af
> bit 1,a
> call z,one
> call nz,zero
>.
>.
>.
>zero:
> ld a,'0'
> call _putc (not sure what its called for the 83 inc files but u know the
>one that puts the character in a)
>one
> ret
>one:
> ld a,'1'
> call _putc
> ret

>if you want to store the number in a string then do the same but use hl to
>load the numbers into the string+offset

>>What do you mean? In ASM, or are you just wanting a program?
>>Please Xplain? (sorry Australian Joke)
>>
>>-----Original Message-----
>>From: James Matthews <matthews@tkb.att.ne.jp>
>>To: Asm Help <assembly-83@lists.ticalc.org>
>>Date: Sunday, 3 May 1998 19:43
>>Subject: A83: Displaying hex.
>>
>>
>>>
>>>How can you display a number in its hex or bin form?
>>>
>>>James.
>>>
>>>____________________
>>>
>>>James Matthews.
>>>E-mail (family):    matthews@tkb.att.ne.jp
>>>E-mail (private):  james_matthews@hotmail.com
>>>
>>>Homepage:  http://home.att.ne.jp/gold/tomcat21/index2.html
>>>ICQ:  7413754
>>>____________________________________
>>




References: