;============================================================================== ; ; PIC16F84 用テンプレート ; ; 0x04 への割り込みを使用しない場合は、Interrupt サブルーチンと ; 変数定義 w_temp, status_temp を削除してください。 ; ;============================================================================== ; ; File : f84_temp.asm ; Author: ; Update: ; ;============================================================================== LIST P=PIC16F84 INCLUDE "P16F84.INC" __CONFIG _HS_OSC & _WDT_OFF ; ウォッチドッグ・タイマ OFF ; ;****************************************************************************** ; 変数定義 ;****************************************************************************** CBLOCK H'0C' w_temp ; variable used for context saving status_temp ; variable used for context saving ENDC ;****************************************************************************** ; エントリ・ポイント ;****************************************************************************** ORG 0 clrf PCLATH goto Start ORG 4 goto Interrupt ;****************************************************************************** ; メインルーチン ;****************************************************************************** Start ;ここにメイン処理を記述します goto Start ;とりあえず無限ループ ;****************************************************************************** ; 割り込みルーチン ;****************************************************************************** Interrupt movwf w_temp movf STATUS, w bcf STATUS, RP0 movwf status_temp ;ここに割り込み処理を記述します bcf STATUS, RP0 movf status_temp, w movwf STATUS swapf w_temp, f swapf w_temp, w retfie ;****************************************************************************** ; Directive 'End of Program' ;****************************************************************************** END