File: special.inc

package info (click to toggle)
gpasm 0.0.7-5
  • links: PTS
  • area: main
  • in suites: potato
  • size: 536 kB
  • ctags: 310
  • sloc: ansic: 2,011; perl: 1,330; yacc: 368; lex: 331; sh: 152; makefile: 34
file content (169 lines) | stat: -rw-r--r-- 2,212 bytes parent folder | download
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
; Implements special instruction mnemonics
;  Copyright (C) 1998 James Bowman
; 
; This file is part of gpasm.
; 
; gpasm is free software; you can redistribute it and/or modify
; it under the terms of the GNU General Public License as published by
; the Free Software Foundation; either version 2, or (at your option)
; any later version.
; 
; gpasm is distributed in the hope that it will be useful,
; but WITHOUT ANY WARRANTY; without even the implied warranty of
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
; GNU General Public License for more details.
; 
; You should have received a copy of the GNU General Public License
; along with gpasm; see the file COPYING.  If not, write to
; the Free Software Foundation, 59 Temple Place - Suite 330,
; Boston, MA 02111-1307, USA.

; Add carry to file
addcf	macro	f,d
	btfsc	3,0
	incf	f,d
	endm

; Add digit carry to file
adddcf	macro	f,d
	btfsc	3,1
	incf	f,d
	endm

; Branch
b	macro	k
	goto	k
	endm

; Branch on carry
bc	macro	k
	btfsc	3,0
	goto	k
	endm

; Branch on digit carry
bdc	macro	k
	btfsc	3,1
	goto	k
	endm

; Branch on zero
bz	macro	k
	btfsc	3,2
	goto	k
	endm

; Branch on no carry
bnc	macro	k
	btfss	3,0
	goto	k
	endm

; Branch on no digit carry
bndc	macro	k
	btfss	3,1
	goto	k
	endm

; Branch on no zero
bnz	macro	k
	btfss	3,2
	goto	k
	endm

; Clear carry
clrc	macro
	bcf	3,0
	endm

; Clear digit carry
clrdc	macro
	bcf	3,1
	endm

; Clear z
clrz	macro
	bcf	3,2
	endm

; Set carry
setc	macro
	bsf	3,0
	endm

; Set digit carry
setdc	macro
	bsf	3,1
	endm

; Set z
setz	macro
	bsf	3,2
	endm

lcall	macro	k
	call	k
	endm

lgoto	macro	k
	goto	k
	endm

; Move file to w
movfw	macro	f
	movf	f,0
	endm

; Negate
negf	macro	f,d
	comf	f,1
	incf	f,d
	endm

; Skip on carry
skpc	macro
	btfss	3,0
	endm

; Skip on digit carry
skpdc	macro
	btfss	3,1
	endm

; Skip on zero
skpz	macro
	btfss	3,2
	endm

; Skip on no carry
skpnc	macro
	btfsc	3,0
	endm

; Skip on no digit carry
skpndc	macro
	btfsc	3,1
	endm

; Skip on no zero
skpnz	macro
	btfsc	3,2
	endm

; Subtract carry from file
subcf	macro	f,d
	btfsc	3,0
	decf	f,d
	endm

; Subtract digit carry from file
subdcf	macro	f,d
	btfsc	3,1
	decf	f,d
	endm

; Test file
tstf	macro	f
	movf	f,1
	endm