Re: A86: Quick question...


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

Re: A86: Quick question...




What does 'daa' do?

Glen
tutorial1.cjb.net

In a message dated Sat, 22 Jan 2000  4:48:46 PM Eastern Standard Time, ComAsYuAre@aol.com writes:

> 
> Wow it's pretty lucky that the ascii characters arrange themselves that way.  
> I wonder who came up with that method.
> 
> 
> In a message dated 1/22/00 4:45:53 PM Eastern Standard Time, 
> rabidcow@juno.com writes:
> 
> > 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'
> 
> 
> 
> ----
> Jonah Cohen
> <ComAsYuAre@aol.com>
> http://linux.hypnotic.org/~jonah/ (down)




Follow-Ups: