- #1
zouzanda
- 8
- 0
1. INPUT DATA (porta) A3 A2 A1 A0
L1 0 0 0 0x01 0 0 0 0 1
L2 0 0 0 0x03 0 0 0 1 1
L3 0 0 0 0x07 0 0 1 1 1
offM 0 0 0 0x0f 0 1 1 1 1
Output data(portb)B7 B6 B5 B4 B3 B2 B1 B0
L1 0xf9 1 1 1 1 1 0 0 1
L2 0xa4 1 0 1 0 0 1 0 0
L3 0xb2 1 0 1 1 0 0 1 0
offM (L2) 0xa4 1 0 1 0 0 1 0 0
2. i can't find where the problem is i tried implementing it on proteus its not working
3. Cblock 0x0c
L1,L2,L3,offM
endc
lev2 equ 0x03
porta equ 0x05
portb equ 0x06
org 0x000
movlw 0xff
tris porta
movlw 0x00
tris portb
movlw 0x01
movwf L1
movlw 0x03
movwf L2
movlw 0x07
movwf L3
movlw 0x0f
movwf offM
start movf porta,w
subwf L1,w
btfss lev2,2
goto start
movlw 0xf9
movf portb
L22 movf porta,w
subwf L2,w
btfss lev2,2
goto L22
movlw 0xa4
movf portb
L33 movf porta,w
subwf L3,w
btfss lev2,2
goto L33
movlw 0xb2
movf portb
offMM movf porta,w
subwf offM,w
btfss lev2,2
goto offMM
movlw 0xa4
movf portb
goto start
end
L1 0 0 0 0x01 0 0 0 0 1
L2 0 0 0 0x03 0 0 0 1 1
L3 0 0 0 0x07 0 0 1 1 1
offM 0 0 0 0x0f 0 1 1 1 1
Output data(portb)B7 B6 B5 B4 B3 B2 B1 B0
L1 0xf9 1 1 1 1 1 0 0 1
L2 0xa4 1 0 1 0 0 1 0 0
L3 0xb2 1 0 1 1 0 0 1 0
offM (L2) 0xa4 1 0 1 0 0 1 0 0
2. i can't find where the problem is i tried implementing it on proteus its not working
3. Cblock 0x0c
L1,L2,L3,offM
endc
lev2 equ 0x03
porta equ 0x05
portb equ 0x06
org 0x000
movlw 0xff
tris porta
movlw 0x00
tris portb
movlw 0x01
movwf L1
movlw 0x03
movwf L2
movlw 0x07
movwf L3
movlw 0x0f
movwf offM
start movf porta,w
subwf L1,w
btfss lev2,2
goto start
movlw 0xf9
movf portb
L22 movf porta,w
subwf L2,w
btfss lev2,2
goto L22
movlw 0xa4
movf portb
L33 movf porta,w
subwf L3,w
btfss lev2,2
goto L33
movlw 0xb2
movf portb
offMM movf porta,w
subwf offM,w
btfss lev2,2
goto offMM
movlw 0xa4
movf portb
goto start
end