This repository was archived by the owner on Jan 21, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathisu.code-snippets
More file actions
163 lines (163 loc) · 4.17 KB
/
isu.code-snippets
File metadata and controls
163 lines (163 loc) · 4.17 KB
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
{
"ISU BODY": {
"scope": "nasm, asm, asm-collection, asm-markdown-codeblock, asm-intel-x86-generic",
"prefix": "isu",
"description": "ISU template with rw32-2022",
"body": [
"%include \"rw32-2022.inc\"\n",
"section .data",
" ${1:;data}\n",
"section .text\n",
"CMAIN:",
" ENTER 0, 0\n",
" ${2:;body}\n",
" LEAVE",
" RET\n",
]
},
"FUNCTION with enter-leave": {
"scope": "nasm, asm, asm-collection, asm-markdown-codeblock, asm-intel-x86-generic",
"prefix": "function-enter",
"description": "Generic function template with ENTER and LEAVE",
"body": [
"FUNKCE:",
" ENTER 0, 0\n",
" ${1:;body}\n",
" LEAVE",
" RET\n",
],
},
"FUNCTION without enter-leave": {
"scope": "nasm, asm, asm-collection, asm-markdown-codeblock, asm-intel-x86-generic",
"prefix": "function",
"description": "Generic function template",
"body": [
"FUNKCE:",
" PUSH EBP",
" MOV EBP, ESP\n",
" ${1:;body}\n",
" MOV ESP, EBP",
" POP EBP",
" RET\n",
],
},
"IF": {
"scope": "nasm, asm, asm-collection, asm-markdown-codeblock, asm-intel-x86-generic",
"prefix": "if",
"description": "Incomplete IF statement",
"body": [
"${1:;CMP/TEST}",
"JN${2:cc} .false",
" ${3:;true-statement}",
".false:",
" ${4:;false-statement}",
]
},
"IF-ELSE": {
"scope": "nasm, asm, asm-collection, asm-markdown-codeblock, asm-intel-x86-generic",
"prefix": "if-else",
"description": "Complete IF statement",
"body": [
"${1:;CMP/TEST}",
"J${2:cc} .true",
".true:",
" ${3:;true-statement1}",
" JMP .endif",
".false:",
" ${4:;false-statement}",
".endif:",
]
},
"WHILE cycle": {
"scope": "nasm, asm, asm-collection, asm-markdown-codeblock, asm-intel-x86-generic",
"prefix": "while",
"description": "While cycle (condition on start)",
"body": [
".while:",
" ${1:;CMP/TEST}",
" JN${2:cc} .endwhile",
" ${3:;while-statement}",
" JMP .while\n",
".endwhile:\n"
]
},
"DO-WHILE cycle": {
"scope": "nasm, asm, asm-collection, asm-markdown-codeblock, asm-intel-x86-generic",
"prefix": "do-while",
"description": "Do-While cycle (condition on end)",
"body": [
".dowhile:",
" ${1:;do-statement}",
" ${2:;CMP/TEST}",
" J${3:cc} .dowhile"
]
},
"FOR cycle": {
"scope": "nasm, asm, asm-collection, asm-markdown-codeblock, asm-intel-x86-generic",
"prefix": "for",
"description": "For cycle (known number of iterations)",
"body": [
".for:",
" ${1:;CMP/TEST}",
" JN${2:cc} .endfor",
" ${3:;for-statement}",
" ${4:;update (ex. DEC ecx)}",
" JMP .for\n",
".endfor:"
]
},
"float constant to FPU": {
"scope": "nasm, asm, asm-collection, asm-markdown-codeblock, asm-intel-x86-generic",
"prefix": "fpuconst",
"description": "F.Constant to FPU PUSH",
"body": [
"PUSH __FLOAT32__(${0:1.0})"
]
},
"Move from FPU to CPU": {
"scope": "nasm, asm, asm-collection, asm-markdown-codeblock, asm-intel-x86-generic",
"prefix": "fpumove",
"description": "Move FPU value to CPU",
"body": [
";SUB ESP, 4 <- CLEAN YO STACK!",
"FSTP dword [ESP]",
"MOV EAX, [ESP]",
"ADD ESP, 4",
]
},
"Unmask FPU exceptions": {
"scope": "nasm, asm, asm-collection, asm-markdown-codeblock, asm-intel-x86-generic",
"prefix": "fpuunmask",
"description": "Unmask FPU exceptions",
"body": [
"; cw DW 0 <- add to .data section",
"FSTCW [cw]",
"AND [cw], word 0xFFF0",
"FLDCW [cw]",
]
},
"CN to EFLAGS": {
"scope": "nasm, asm, asm-collection, asm-markdown-codeblock, asm-intel-x86-generic",
"prefix": "fpueflags",
"description": "Condition Flags to EFLAGS",
"body": [
";PUSH EAX",
"FSTSW AX",
"SAHF",
";POP EAX"
]
},
"FPU NaNs and infinities": {
"scope": "nasm, asm, asm-collection, asm-markdown-codeblock, asm-intel-x86-generic",
"prefix": "FPU_EQU",
"description": "FPU NaNs/Infinities",
"body": [
"FPU_INF_POS equ 0x7F800000",
"FPU_INF_NEG equ 0xFF800000",
"FPU_SNaN_POS equ 0x7F800001",
"FPU_SNaN_NEG equ 0xFF8004F0",
"FPU_QNaN_POS equ 0x7FC00001",
"FPU_QNaN_NEG equ 0xFFC004F0"
]
}
}