Witam,
Mógłby mi ktoś wytłumaczyć co robi instrukcja AAA w języku Assembler? Czytałem dokumentację Intela, ale nadal nie rozumiem co dokładnie ta instrukcja wykonuje.
Witam,
Mógłby mi ktoś wytłumaczyć co robi instrukcja AAA w języku Assembler? Czytałem dokumentację Intela, ale nadal nie rozumiem co dokładnie ta instrukcja wykonuje.
AAA, czyli ASCII adjust after addition, oraz DAA decimal adjust for addition - są instrukcjami wsparcia dla BCD. Zazwyczaj instrukcje AAA stosuje się po add, adc, xadd.
AAA ASCII Adjust after Addition; Intel 80x86; changes the contents of register AL to a valid unpacked decimal number, and zeros the top 4 bits; sets or clears flags
Działa to używając tego algorytmu.Kod:if ( (al and 0Fh) > 9 or (AuxC =1) ) then if (8088 or 8086) then al := al + 6 else ax := ax + 6 endif ah := ah + 1 AuxC := 1 ;Set auxilliary carry Carry := 1 ; and carry flags. else AuxC := 0 ;Clear auxilliary carry Carry := 0 ; and carry flags. endif al := al and 0Fh
// jeśli chcesz przykład to pisz
Ostatnio edytowane przez 0wn3r ; 22-09-2011 o 19:48
Dzięki, ale przydałby się jakiś przykładowy kod.
wynik: ah=01(h) al=02(h)Kod:mov cl,5 mov al,7 add al,cl ; al=0Ch chyli 12 aaa
jesli dodać 30h, to będzie 31h i 32h, chyli "1" i "2" - gotowe do druku liczby "12"
szurik