RE: A85: BCD?


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

RE: A85: BCD?



a) using BCD is very simple. After performing a normal add/sub/inc/dec, just do a DAA which will correct anything to BCD again. Example:
	ld	A, $18	;18
	add	A, $23	;+23
	daa		; correct it

b) I suggest making the following for displaying A:
	ld	H, 0
	ld	L, A
	call	DM_HL_DECI

	Andreas

----------
From: 	Terry Peng[SMTP:tpeng@geocities.com]
Sent: 	Tuesday, August 12, 1997 10:18 PM
To: 	assembly-85@lists.ticalc.org
Subject: 	Re: A85: BCD?

Dines Christy Justesen wrote:
> 
> It depends on what you want to use it for. Try to give some more
> information about what
> you want to do, and maybe someone will be able to help you.
> 
> Dines
> 
> _______________________________________
> 
> Dines Justesen
> Email: dines@post1.com or
>        c958362@student.dtu.dk
> WWW  : http://www.gbar.dtu.dk/~c958362/
> _______________________________________

Well, I just want to know how to do arithmatic functions like add,inc,sub,dec 
to BCD numbers. I can make my own routine to display them.

BTW, Andi, this has nothing to do with BCD, but is there a routine in Usgard 
that will display reg A in decimal without using a lib? If not I think the 
next version should have one.

-- 
Terry Peng
email-	tpeng@geocities.com
web-	http://www.geocities.com/SiliconValley/Bay/5104/index.html
Warning
Could not process part with given Content-Type: application/ms-tnef