Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;============================
- ;Adam Naglmuller, 10A
- ;Uloha A3
- ;============================
- INCLUDE "P16F88.INC"
- ZALOHA equ 20h
- ta equ 23h ; definice toho, ze vstupní je 1, 2 a 5 bit 100011
- tb equ 0FCh ; definice vystupnich bitů
- ZALOHA equ 20h ; def. zalohy
- __CONFIG _CONFIG1, _CP_OFF & _CCP1_RB0 & _DEBUG_OFF & _MCLR_OFF & _PWRTE_ON & _WDT_OFF & _INTRC_IO & _WRT_PROTECT_OFF & _CPD_OFF & _LVP_OFF & _BODEN_ON
- __CONFIG _CONFIG2, _IESO_OFF & _FCMEN_OFF
- org 00h
- goto setup
- org 02h
- setup
- bcf INTCON,7 ; standardni klasickej setup
- bcf STATUS,6
- bsf STATUS,5
- movlw 07h
- movwf CMCON
- movlw 00h
- movwf ANSEL
- movlw 62H
- movwf OSCCON ; pocud standard, porad opakujeme pouze OSCCON menime
- movlw ta ; VLASTNI NASTAVENE KONSTANTY NAHORE
- movwf TRISA
- movlw tb ; nastavovani vstup/vystup PORTA, PORTB
- movwf TRISB
- bcf STATUS,5 ; menim stranku
- bcf ADCON0,0
- start
- movf PORTA,0
- movwf ZALOHA
- andlw 0F0h
- movwf 21h
- swapf 21h
- RRF 21h,1
- movwf ZALOHA
- andlw 0Eh
- movwf 22h
- RRF 22h,1
- movf ZALOHA,0
- andlw 01h
- addwf 21h,0
- addwf 22h,0
- movwf PORTB
- goto start
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement