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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
01/27/05 14:14
Read: times


 
#85934 - Hex 2 Bin problem with program 8051
Below i present program which should convert Hex 2 Bin and print rulest on lcd but he print only 01 and i don't know why. Could You show me error and explain> Thank You.

JLMP START
ORG 100H
START:
MOV R1,#67H
MOV A,R1
JB ACC.0,SKOK
MOV 00H,#0
LJMP DALEJ
SKOK:
MOV 08H,#1
DALEJ:
JB ACC.1,SKOK1
MOV 01H,#0
LJMP DALEJ1
SKOK1:
MOV 02H,#1
DALEJ1:
JB ACC.2,SKOK2
MOV 0AH,#0
LJMP DALEJ2
SKOK2:
MOV 0AH,#1
DALEJ2:
JB ACC.3,SKOK3
MOV 0BH,#0
LJMP DALEJ3
SKOK3:
MOV 0BH,#1
DALEJ3:
JB ACC.4,SKOK4
MOV 0CH,#0
LJMP DALEJ4

SKOK4:
MOV 0CH,#1
DALEJ4:
JB ACC.5,SKOK5
MOV 0DH,#0
LJMP DALEJ5
SKOK5:
MOV 0DH,#1
DALEJ5:
JB ACC.6,SKOK6
MOV 0EH,#0
LJMP DALEJ6
SKOK6:
MOV 0EH,#1
DALEJ6:
JB ACC.7,SKOK7
MOV 0FH,#0
LJMP DALEJ7
SKOK7:
MOV 0FH,#1
DALEJ7:
MOV R1,#0FH
DALEJ8:
MOV A,@R1
ADD A,#30H
MOV @R1,A
DEC R1
CJNE R1,#07H,DALEJ8
MOV R0,#LCDRC
BUSY1:
MOVX A,@R0
JB ACC.7,BUSY1
MOV R0,#0FH
MOV R1,#LCDWD
DALEJ9:
MOV A,@R0
MOVX @R1,A

DEC R0
CJNE R0,#07H,DALEJ9

List of 10 messages in thread
TopicAuthorDate
Hex 2 Bin problem with program 8051            01/01/70 00:00      
   you do it first            01/01/70 00:00      
      hex to bin            01/01/70 00:00      
         Re: hex to bin            01/01/70 00:00      
         Surely: BCD to bin (hex is bin?)            01/01/70 00:00      
            like this            01/01/70 00:00      
               brackets            01/01/70 00:00      
   Posting            01/01/70 00:00      
   better code            01/01/70 00:00      
      if you can't explain            01/01/70 00:00      

Back to Subject List