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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
10/21/09 02:54
Read: times


 
#169921 - Program with comments
Responding to: ???'s previous message
Sorry i didnt placed comments on my code but now they are

The main program which gave me the basic idea of trasmitting data to the pc serially is



ORG 000H
        JMP     MAIN
ORG 023H
        JMP     SERIAL ; label where to jump to transmit the next bit
ORG 030H
MAIN:
        MOV     SCON,#50H
        MOV     TMOD,#20H
        MOV     TH1,#-24
        SETB    TR1
        SETB    EA
        SETB    ES
        MOV     A,#'A'  ; moving the intial ASCII code after which increament will take place of this intial value
        MOV     SBUF,A ; as this ASCII code is now present in A, moving it in the Serial Buffer
        JMP     $ ; waiting for the interupt to occour

SERIAL:
        CLR     TI ; when jumped to the label after the interpt, clearing the flag
        INC     A  ; increamented it to get the next ASCII code
        CJNE    A,#'Z'+1,SKIP ; deciding whether the last code has arrived 
        MOV     A,#'A' ; if it is arrived than moving the initial code again
SKIP:
        MOV     SBUF,A
RETI

END



 




List of 26 messages in thread
TopicAuthorDate
Is this Code Correct for 16 Bit Serial Transmission            01/01/70 00:00      
   No.            01/01/70 00:00      
      Sir            01/01/70 00:00      
         Insert program code            01/01/70 00:00      
            How to post legible source code            01/01/70 00:00      
            Who would bother to read uncommented code?            01/01/70 00:00      
               Worse than that            01/01/70 00:00      
         So you will understand            01/01/70 00:00      
   what code?            01/01/70 00:00      
      Program with comments            01/01/70 00:00      
         The first after it            01/01/70 00:00      
            Second after it.......            01/01/70 00:00      
               Simulators            01/01/70 00:00      
               Remove all the silly code lines!            01/01/70 00:00      
                  Comments first, then discussing intention/reality            01/01/70 00:00      
                     Careful Commenting Catches Cruddy Coding!            01/01/70 00:00      
            So where did all the comments go?!            01/01/70 00:00      
               To achieve 16 bit communication            01/01/70 00:00      
                  Exactly what was your "target"?            01/01/70 00:00      
                  How?            01/01/70 00:00      
            Return from interrupt            01/01/70 00:00      
               Of course not            01/01/70 00:00      
                  But how it could be different            01/01/70 00:00      
                     Any more information required            01/01/70 00:00      
                        As previously stated            01/01/70 00:00      
                           and summarised...            01/01/70 00:00      

Back to Subject List