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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
02/20/10 14:37
Read: times


 
#173354 - even simpler
Responding to: ???'s previous message
GETCMD:
	MOV A,#0
	ACALL CHAR_IN ;WAIT FOR PC TO SENT A CHARACTER
		      ;NOW PROCESS
      CJNE A,#'1',NOT1 ;IF ITS NOT 1 THEN CHECK NEXT POSSIBILITY
SUB1: MOV A, #01h
      sjmp sub1234             
;;       sjmp ENDCHK ; avoid undefined ACC behavior of other subroutines
       
NOT1: CJNE A,#'2',NOT2 ;IF ITS NOT 2 THEN CHECK NEXT POSSIBILITY
SUB2: MOV A, #02h                        sjmp SUB2 ;ELSE ITS 2
      sjmp sub1234             
;;      sjmp ENDCHK ; avoid undefined ACC behavior of other subroutines

NOT2: CJNE A,#'3',NOT3 ;IF ITS NOT 3 THEN CHECK NEXT POSSIBILITY
SUB3: MOV A, #04h
      sjmp sub1234                 
;;      sjmp ENDCHK ; avoid undefined ACC behavior of other subroutines

NOT3: CJNE A,#'4',NOT4 ;IF ITS NOT 4 THEN CHECK NEXT POSSIBILITY
SUB4: MOV A, #08h                        
      sjmp sub1234                 NOT4:
ENDCHK:
RET

                  
sub1234:
      MOV P2, A ;TURN ON PORT2 PIN 0
      ACALL DELAY
      MOV P2, #00h
      sjmp endck


superfluous labels left, ignore possibble misspellingd, "instruction explanation" in lieu of comments not fixed '4' setting pin 0 changed to pin 3

Erik


List of 16 messages in thread
TopicAuthorDate
Question on asm code            01/01/70 00:00      
   2 things            01/01/70 00:00      
   some change            01/01/70 00:00      
      even simpler            01/01/70 00:00      
         thanks for the simplified            01/01/70 00:00      
            yes, and even simpler            01/01/70 00:00      
               code and comments            01/01/70 00:00      
                  ;; ??            01/01/70 00:00      
                     thanks for the explanation            01/01/70 00:00      
   Short?            01/01/70 00:00      
      need some helps            01/01/70 00:00      
         Your circuit should work            01/01/70 00:00      
            Getting Rid Of Power On Relay Energize            01/01/70 00:00      
               Thank You All            01/01/70 00:00      
   document what happens to ACC.            01/01/70 00:00      
      noticed and questions            01/01/70 00:00      

Back to Subject List