Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
1から16まで足し上げるアセンブリを、動かしやすいようにした。実機での動作確認。
#include "p16f1579.inc"
; CONFIG1
; __config 0xFFA4
__CONFIG _CONFIG1, _FOSC_INTOSC & _WDTE_OFF & _PWRTE_OFF & _MCLRE_OFF & _CP_OFF & _BOREN_ON & _CLKOUTEN_OFF
; CONFIG2
; __config 0xDEFF
__CONFIG _CONFIG2, _WRT_OFF & _PPS1WAY_ON & _PLLEN_OFF & _STVREN_ON & _BORV_LO & _LPBOREN_OFF & _LVP_OFF
ORG 0
RAMTOP
MOVLB 0x1
MOVLW b'00010010'
MOVWF OSCCON
CLRF TRISC
MOVLB 0x3
CLRF ANSELC
MOVLB 0x0
CLRF PORTC
CLRF 0x20
CLRW
CALC
INCF 0x20
ADDWF 0x20, 0
MOVWF PORTC
BTFSS 0x20, 4
GOTO CALC
LAST
GOTO LAST
END
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.