This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

project #52b

any body knows how to generate microsecond delay
plz post all the code

Parents
  • 
    DELAY:
    
      PUSH B          ;push regista b
      PUSH R0         ;push regista r0
    
    LOOP:
    
      MOV A, # 1000   ;load regista a with 100
    
      DEC A           ; decrament regista a
    
      CJNE A, # 0, LOOP  ; goto loop if regista a is zero
    
      POP R1          ; pop regista ?
      RTS             ; return to the code
    
    

    Note
    The above code definitely does not work. I'm sure it was intended as a joke.

Reply
  • 
    DELAY:
    
      PUSH B          ;push regista b
      PUSH R0         ;push regista r0
    
    LOOP:
    
      MOV A, # 1000   ;load regista a with 100
    
      DEC A           ; decrament regista a
    
      CJNE A, # 0, LOOP  ; goto loop if regista a is zero
    
      POP R1          ; pop regista ?
      RTS             ; return to the code
    
    

    Note
    The above code definitely does not work. I'm sure it was intended as a joke.

Children