File: macro_test.asm

package info (click to toggle)
gpsim 0.22.0-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 7,536 kB
  • ctags: 12,443
  • sloc: cpp: 69,959; sh: 8,626; asm: 7,706; ansic: 4,101; lex: 1,125; makefile: 1,094; yacc: 760
file content (50 lines) | stat: -rw-r--r-- 1,515 bytes parent folder | download | duplicates (7)
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