-
Notifications
You must be signed in to change notification settings - Fork 2
/
generic.mac
55 lines (46 loc) · 956 Bytes
/
generic.mac
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
; add - Add without carry
.macro add Arg1, Arg2
clc
.if .paramcount = 2
adc Arg1, Arg2
.else
adc Arg1
.endif
.endmacro
; sub - subtract without borrow
.macro sub Arg1, Arg2
sec
.if .paramcount = 2
sbc Arg1, Arg2
.else
sbc Arg1
.endif
.endmacro
; bge - jump if unsigned greater or equal
.macro bge Arg
bcs Arg
.endmacro
; blt - Jump if unsigned less
.macro blt Arg
bcc Arg
.endmacro
; bgt - jump if unsigned greater
.macro bgt Arg
.local L
beq L
bcs Arg
L:
.endmacro
; ble - jump if unsigned less or equal
.macro ble Arg
beq Arg
bcc Arg
.endmacro
; bnz - jump if not zero
.macro bnz Arg
bne Arg
.endmacro
; bze - jump if zero
.macro bze Arg
beq Arg
.endmacro