Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
06/18/03 13:24
Read: times


 
#48702 - RE: Converting Hex to Decimal in Hex
Responding to: ???'s previous message
Bob Watlake wrote:
-------------------------------
MOV A, #numberH
PUSH A
ANL A, #0FH
DA A < does not make any sense
MOV R3, A
POP A
ANL A, #0F0H
SWAP A
MOV B, #16H
XCH A, B
DA A < this also
XCH A, B
MUL AB
ADD A, R3
DA A <this is ok


anl instruction never sets the C and AC flags so 'da a' after this instructions not make any senseyou


ANL A,#data

Function: Logical-AND accumulator with immediate data

Description: ANL performs the bitwise logical-AND operation between the values contained in the accumulator and the second byte of the instruction and stores the result in the accumulator. No flags are affected.


while

Operation: DA
-contents of Accumulator are BCD
IF [(A3-0) > 9] / [(AC) = 1]] THEN
(A3-0) ß (A3-0) + 6
AND
IF [(A7-4) > 9] / [(C) = 1]] THEN
(A7-4) ß (A7-4) + 6


modify your routine.



abhishek




List of 14 messages in thread
TopicAuthorDate
Converting Hex to Decimal in Hex            01/01/70 00:00      
   RE: Converting Hex to Decimal in Hex            01/01/70 00:00      
   RE: Converting Hex to Decimal in Hex            01/01/70 00:00      
      RE: Converting Hex to Decimal in Hex            01/01/70 00:00      
         RE: Converting Hex to Decimal in Hex            01/01/70 00:00      
            RE: Converting Hex to Decimal in Hex            01/01/70 00:00      
   RE: Converting Hex to Decimal in Hex            01/01/70 00:00      
   RE: Converting Hex to Decimal in Hex            01/01/70 00:00      
      RE: Converting Hex to Decimal in Hex            01/01/70 00:00      
      RE: Converting Hex to Decimal in Hex            01/01/70 00:00      
   RE: Converting Hex to Decimal in Hex            01/01/70 00:00      
   RE: Converting Hex to Decimal in Hex            01/01/70 00:00      
      RE: Converting Hex to Decimal in Hex            01/01/70 00:00      
   RE: Converting Hex to Decimal in Hex            01/01/70 00:00      

Back to Subject List