;;; ; Simple memory test ;;; ;;; assembler directives list P=PIC18F452, F=INHX32, C=160, X=ON #include P18F452.INC __CONFIG _CONFIG1H, _HS_OSC_1H ;HS oscillator __CONFIG _CONFIG2L, _PWRT_ON_2L & _BOR_ON_2L & _BORV_42_2L ;Reset __CONFIG _CONFIG2H, _WDT_OFF_2H ;Watchdog timer disabled __CONFIG _CONFIG3H, _CCP2MX_ON_3H ;CCP2 to RC1 (rather than to RB3) __CONFIG _CONFIG4L, _LVP_OFF_4L ;RB5 enabled for I/O ;;; variables cblock 0x000 ;address of variable space num1 num2 result endc ;;; vectors org 0x0000 ;reset vector goto main ;start of program org 0x0008 ;high priority interrupt vector goto $ ;... tight loop for now org 0x0018 ;low priority interrupt vector goto $ ;... tight loop for now ;;; main program main movlw b'00001111' ;store initial value movwf num1 ; in num1 movlw b'00000001' ;store initial value movwf num2 ; in num2 addwf num1,w ;add num1 and num2 movwf result ; and store result goto $ ;stop end