Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Please explain the below assembly language code in pic

Status
Not open for further replies.

rangerskm

Full Member level 4
Full Member level 4
Joined
Jan 23, 2013
Messages
199
Helped
0
Reputation
2
Reaction score
0
Trophy points
1,296
Visit site
Activity points
2,663
Code:
 #include"p16f73.inc"
      cblock 0x20
      r0
      r1
      r2
      r3
      r4
      r5
      index1
      index2
      index3
      index4 
      endc
      org 0x00
l10:  Clrf index1
      bsf rcsta,spen
      movlw 0x90
      movwf rcsta
      bsf status,rp0
      movlw 0x24
      movwf txsta
      movlw 0x19
      movwf spbrg
l2:   Bcf status,rp0
      call table1
      movwf r0
      movf r0,0
      xorlw 0x00
      btfsc status,2
      goto l3
      movf r0,w    
      movwf txreg
  l1: Btfss pir1,4
       goto l1
 	   goto l2  

l3:    Movlw 0x05
       movwf r1
       movlw 0x60
       movwf fsr
l5:    Btfss pir1,5
       goto $-1
       movf rcreg,0
       movwf indf
       incf fsr,1
       decfsz r1,1
       goto l4
       goto l6

l4:    Movlw '*'
       movwf txreg
       btfss pir1,4
       goto $-1
       goto l5



l6:    Clrf index2
       movlw 0x05
       movwf r1 
       movlw 0x60
       movwf fsr
l8:    Call table2
       movwf r3
       movf indf,w
       xorwf r3
       btfsc status,2
       goto l7
       goto l9

l7:   Incf fsr,1
      decfsz r1,1
      goto l8 
      goto l12
       
l9:   Clrf index3
l11:  Call table3
       movwf r4
       movf r4,0
       xorlw 0x00
       btfsc status,2
       goto l10
       movf r4,w    
       movwf txreg
       btfss pir1,4
       goto $-1
 	   goto l11  
                 
l12:   Clrf index4
l14:   Call table4
       movwf r5
       movf r5,0
       xorlw 0x00
       btfsc status,2
       goto l10
       movf r5,w
       movwf txreg
       btfss pir1,4
       goto $-1
       goto l14      
     
table1:movf index1,w
       incf index1,1
       addwf pcl,1
       dt "enter the password",0

table2:movf index2,w
       incf index2,1
       addwf pcl,1
       dt  "sijil",0
 
 table3:movf index3,w
       incf index3,1
       addwf pcl,1
       dt  "incorrect password",0
       
table4:movf index4,w
       incf index4,1
       addwf pcl,1
       dt  "correct password",0
        
       nop
       end

explain the working of the code
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top