-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathstruct_gas_msp430.S
80 lines (71 loc) · 1.67 KB
/
struct_gas_msp430.S
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
;;; Structured asm macros for gnu assembler
/*
* This section contains cpu-specific definitions that are dependent on the
* particular format of the conditional and unconditional branch instructions
* for the CPU. Change this part for other architectures!
*/
/* This is support for the
* ------------------------
* | TI MSP430 |
* ------------------------
*/
.macro _st_jmp_always target, dir
jmp \target\dir
.endm
/*
* define all of our conditional branches, "true" logic
*/
.irp cond, eq, z, ne, nz, c, nc, n, ge, l, lo
.macro _st_jmp_\cond target
j\cond target
.endm
.endr
/*
* Negative logic conditional jumps.
* For each possible branch condition "x", create a macro _st_jmp_not_x
* that does a jump for "NOT x".
*/
.irp cond, e, z, c
.macro _st_jmp_not_\cond target
jn\cond target
.endm
.endr
.macro _st_jmp_not_nz target, dir
jeq \target\dir
.endm
.macro _st_jmp_not_eq target, dir
jne \target\dir
.endm
.macro _st_jmp_not_z target, dir
jne \target\dir
.endm
.macro _st_jmp_not_ne target, dir
jeq \target\dir
.endm
.macro _st_jmp_not_c target, dir
jnc \target\dir
.endm
.macro _st_jmp_not_lo target, dir
jc \target\dir
.endm
.macro _st_jmp_not_nc target, dir
jc \target\dir
.endm
.macro _st_jmp_not_n target, dir
jge \target\dir
.endm
.macro _st_jmp_not_ge target, dir
jn \target\dir
.endm
.macro _st_jmp_not_l target, dir
jge \target\dir
.endm
;;; Allow _if skip after an instruction (or function call)
;;; that might have skipped.
;;; this assembles to an unconditional jump
.macro _st_jump_not_skip target, dir
jmp \target\dir
.endm
/*
* This is supposed to be the end of CPU-specific support.
*/