Re: A86: Quick question...


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

Re: A86: Quick question...




uh, probly not...  i never quite understood it completely myself
might as well give it a shot

umm...
from $40, the numbers are -10 bcd and the letters are +1
the +$90 does the -10 (unless the 1st daa chops it off)
the carry does the +1 (if the 1st daa chops off the $90)
the 2nd daa takes out the bcd "carry" to finish the -10

>>  >   add a,$90
>>  >   daa
>>  >   adc a,$40
>>  >   daa

$04 + $90 = $94
adjusted for decimal = $94
$94 + $40 + nc = $d4
adjusted for decimal = $34 '4'

$09 + $99 = $99
adjusted for decimal = $99
$99 + $40 + nc = $d9
adjusted for decimal = $39 '9'

$0a + $90 = $9a
adjusted for decimal = $a0 = $100
$00 + $40 + c = $41
adjusted for decimal = $41 'A'

$0f + $90 = $9f
adjusted for decimal = $a5 = $105
$05 + $40 + c = $46
adjusted for decimal = $46 'F'

-josh

On Sat, 22 Jan 2000 15:36:24 EST ComAsYuAre@aol.com writes:
>
>In a message dated 1/22/00 3:22:30 PM Eastern Standard Time, 
>rabidcow@juno.com writes:
>
>> btw, i got the 
>>  bit from some amd documentation for intel 80x86 series processors, 
>but it
>>  works nicely with the z80, too.
>
>Any chance you could explain how that works?  I noticed that the $90 
>wrapped 
>the A-F characters back around and somehow affects the carry flag when 
>it 
>_isn't_ A-F.  Kinda strange...
>
>
>----
>Jonah Cohen
><ComAsYuAre@aol.com>
>http://linux.hypnotic.org/~jonah/ (down)
>

________________________________________________________________
YOU'RE PAYING TOO MUCH FOR THE INTERNET!
Juno now offers FREE Internet Access!
Try it today - there's no risk!  For your FREE software, visit:
http://dl.www.juno.com/get/tagj.