Professional Documents
Culture Documents
#include "p16f84a.inc"
ERRORLEVEL -224, -302
__CONFIG _CP_OFF & _XT_OSC & _PWRTE_ON & _WDT_OFF
org 0x0
;POJEDNOSTAVLJENO RJEŠENJE
; goto main
;
;
; AdrI equ 10h
; AdrJ equ AdrI + 1
; AdrK equ AdrJ + 1
; I = 0xA2
; J = 0x00
; K = 0x1E
;
;waitX: movlw I
; movwf AdrI
; movlw K
; movwf AdrK
; movlw J
;
;outloop: movwf AdrJ
;
;inloop: decfsz AdrJ, F
; goto inloop
;
; decfsz AdrI, F
; goto outloop
;
;addloop: decfsz AdrK, F
; goto addloop
;
; nop
;
;
; return
;
;main: bsf STATUS, RP0 ;banka 1
; movlw b'00011111'
; movwf TRISA
; movlw b'00000111'
; movwf TRISB
; bcf OPTION_REG, NOT_RBPU
;
; bcf STATUS, RP0 ;banka 0
;
;
; clrf PORTA
; clrf PORTB
;
;
;loop: btfsc PORTB, 2
; goto loop
; goto sw1p
;
;sw1p: btfsc PORTB,0
; goto loop
; goto s1c
;
;s1c: bsf PORTB, 3
; call waitX
; call waitX
; call waitX
; call waitX
; bcf PORTB, 3
;
; goto loop
;
;
; end
goto main
waitX: movlw I
movwf AdrI
movlw K
movwf AdrK
movlw J
decfsz AdrI, F
goto outloop
nop
return
clrf PORTA
clrf PORTB
loop: btfsc PORTB, 2
goto loop
goto s1t
goto loop
goto loop
end