1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
|
radix dec
;; The purpose of this program is to test gpsim macros
;;
list p=16f84 ; list directive to define processor
include <p16f84.inc> ; processor specific variable definitions
include <coff.inc> ; Grab some useful macros
GPR_DATA UDATA
failures RES 1
mac_count RES 1
mac_flags RES 1
GLOBAL mac_count, mac_flags, failures
GLOBAL mac_loop
;----------------------------------------------------------------------
; ********************* RESET VECTOR LOCATION ********************
;----------------------------------------------------------------------
RESET_VECTOR CODE 0x000 ; processor reset vector
movlw high start ; load upper byte of 'start' label
movwf PCLATH ; initialize PCLATH
goto start ; go to beginning of program
;----------------------------------------------------------------------
; ******************* MAIN CODE START LOCATION ******************
;----------------------------------------------------------------------
MAIN CODE
start
clrf failures
clrf mac_count ; a counter
clrf mac_flags
mac_loop:
incf mac_count,F
btfss mac_flags,4
goto mac_loop
movf failures,W
skpz
failed:
.assert "\"*** FAILED Macro test\""
goto $
done:
.assert "\"*** PASSED Macro test\""
goto done
end
|