Compare commits
No commits in common. "06cbad6b5303f3e80b130afc406cb5b703743823" and "e1a5e7f825a095d1fcbded3d57fd61e33e1d88bd" have entirely different histories.
06cbad6b53
...
e1a5e7f825
|
@ -1,10 +1,14 @@
|
||||||
snippet string86 "Assembler string definition"
|
snippet string "Assembler string definition"
|
||||||
${1:Name} db ${2:"Hello World!"} ; string $1 = $2
|
${1:Name} db ${2:"Hello World!"} ; string $1 = $2
|
||||||
len_$1 equ $ - $1 ; length of string $1
|
len_$1 equ $ - $1 ; length of string $1
|
||||||
$0
|
$0
|
||||||
endsnippet
|
endsnippet
|
||||||
|
|
||||||
snippet write86 "write sys_call"
|
snippet \n "Zeilenumbruch" A
|
||||||
|
", 0x0a, "
|
||||||
|
endsnippet
|
||||||
|
|
||||||
|
snippet write "write sys_call"
|
||||||
mov eax, 4 ; write sys_call
|
mov eax, 4 ; write sys_call
|
||||||
mov ebx, 1 ; write to stdout
|
mov ebx, 1 ; write to stdout
|
||||||
mov ecx, ${1:string} ; string to write
|
mov ecx, ${1:string} ; string to write
|
||||||
|
@ -13,7 +17,7 @@ int 0x80 ; system interrupt
|
||||||
$0
|
$0
|
||||||
endsnippet
|
endsnippet
|
||||||
|
|
||||||
snippet exit86 "exit sys_call"
|
snippet exit "exit sys_call"
|
||||||
mov eax, 1 ; exit sys_call
|
mov eax, 1 ; exit sys_call
|
||||||
mov ebx, ${1:0} ; exit Code
|
mov ebx, ${1:0} ; exit Code
|
||||||
int 0x80 ; system interrupt$0
|
int 0x80 ; system interrupt$0
|
||||||
|
@ -36,7 +40,33 @@ $1:
|
||||||
$0
|
$0
|
||||||
endsnippet
|
endsnippet
|
||||||
|
|
||||||
snippet functionGCC "GCC conform function implementation" b
|
snippet read "read sys call"
|
||||||
|
mov eax, 3 ; read sys call
|
||||||
|
mov ebx, 2 ; stdin file descriptor
|
||||||
|
mov ecx, ${1: variable} ; read input value in $1
|
||||||
|
mov edx, ${2:5} ; read $2 bytes of data
|
||||||
|
int 0x80 ; system interrupt
|
||||||
|
endsnippet
|
||||||
|
|
||||||
|
snippet aprstore "Store all purpose register on stack"
|
||||||
|
; store ap-register
|
||||||
|
push eax
|
||||||
|
push ebx
|
||||||
|
push ecx
|
||||||
|
push edx
|
||||||
|
$0
|
||||||
|
endsnippet
|
||||||
|
|
||||||
|
snippet aprload "Load all purpose register from stack"
|
||||||
|
; load ap-register
|
||||||
|
pop eax
|
||||||
|
pop ebx
|
||||||
|
pop ecx
|
||||||
|
pop edx
|
||||||
|
$0
|
||||||
|
endsnippet
|
||||||
|
|
||||||
|
snippet gcc_function "GCC conform function implementation" b
|
||||||
$1:
|
$1:
|
||||||
push %ebp
|
push %ebp
|
||||||
mov %esp, %ebp
|
mov %esp, %ebp
|
||||||
|
|
|
@ -1,12 +1,3 @@
|
||||||
global !p
|
|
||||||
def complete(t, opts):
|
|
||||||
if t:
|
|
||||||
opts = [m[len(t):] for m in opts if m.startswith(t)]
|
|
||||||
if len(opts) == 1:
|
|
||||||
return opts[0]
|
|
||||||
return '(' + '|'.join(opts) + ')'
|
|
||||||
endglobal
|
|
||||||
|
|
||||||
snippet template "template for new program" A
|
snippet template "template for new program" A
|
||||||
*-----------------------------------------------------------------
|
*-----------------------------------------------------------------
|
||||||
IDENTIFICATION DIVISION.
|
IDENTIFICATION DIVISION.
|
||||||
|
@ -22,9 +13,9 @@ snippet template "template for new program" A
|
||||||
|
|
||||||
*-------------------------
|
*-------------------------
|
||||||
WORKING-STORAGE SECTION.
|
WORKING-STORAGE SECTION.
|
||||||
$4
|
$4
|
||||||
*-----------------------------------------------------------------
|
*-----------------------------------------------------------------
|
||||||
|
|
||||||
*-----------------------------------------------------------------
|
*-----------------------------------------------------------------
|
||||||
PROCEDURE DIVISION.
|
PROCEDURE DIVISION.
|
||||||
$0
|
$0
|
||||||
|
@ -32,7 +23,70 @@ snippet template "template for new program" A
|
||||||
*-----------------------------------------------------------------
|
*-----------------------------------------------------------------
|
||||||
endsnippet
|
endsnippet
|
||||||
|
|
||||||
|
snippet let "Add new Variable" A
|
||||||
|
${1:01} ${2:Name} PIC ${3:999}${4:(8) }${5:VALUE }.
|
||||||
|
$0
|
||||||
|
endsnippet
|
||||||
|
|
||||||
|
snippet compute "Insert a computation" A
|
||||||
|
COMPUTE ${1:Expression}.
|
||||||
|
endsnippet
|
||||||
|
|
||||||
|
global !p
|
||||||
|
def complete(t, opts):
|
||||||
|
if t:
|
||||||
|
opts = [m[len(t):] for m in opts if m.startswith(t)]
|
||||||
|
if len(opts) == 1:
|
||||||
|
return opts[0]
|
||||||
|
return '(' + '|'.join(opts) + ')'
|
||||||
|
endglobal
|
||||||
|
|
||||||
|
snippet calc "Add a Calculation with autocomplete" A
|
||||||
|
$1`!p snip.rv = complete(t[1], ['ADD', 'DIVIDE', 'MULTIPLY', 'SUBTRACT'])` ${2:Var1} `!p
|
||||||
|
try:
|
||||||
|
snip.rv = {'ADD': 'TO', 'DIVIDE': 'INTO', 'MULTIPLY': 'BY', 'SUBTRACT': 'FROM'}[t[1] + complete(t[1], ['ADD', 'DIVIDE', 'MULTIPLY', 'SUBTRACT'])]
|
||||||
|
except KeyError:
|
||||||
|
snip.rv = '---'
|
||||||
|
` ${3:Var2} GIVING ${4:VarResult}.
|
||||||
|
$0
|
||||||
|
endsnippet
|
||||||
|
|
||||||
|
snippet move "Move value to another value" A
|
||||||
|
MOVE ${1:Const/Var} TO ${2:Var}.
|
||||||
|
$0
|
||||||
|
endsnippet
|
||||||
|
|
||||||
snippet display "Display a contant or Variable" A
|
snippet display "Display a contant or Variable" A
|
||||||
DISPLAY ${1:"Hello World!"}.
|
DISPLAY ${1:"Hello World!"}.
|
||||||
$0
|
$0
|
||||||
endsnippet
|
endsnippet
|
||||||
|
|
||||||
|
snippet accept "Accept a Value to an uninitialized Variable" A
|
||||||
|
ACCEPT ${1:Variable}.
|
||||||
|
$0
|
||||||
|
endsnippet
|
||||||
|
|
||||||
|
snippet strinit "Initialize an empty String" A
|
||||||
|
INITIALIZE ${1:Stringvariable}.
|
||||||
|
$0
|
||||||
|
endsnippet
|
||||||
|
|
||||||
|
snippet init "Inizialize a numerical Value" A
|
||||||
|
INITIALIZE ${1:Numerical variable} REPLACING NUMERIC DATA BY ${2:ZEROS}.
|
||||||
|
$0
|
||||||
|
endsnippet
|
||||||
|
|
||||||
|
snippet ifthen "If-then-else Clause" A
|
||||||
|
IF ${1:Condition} THEN
|
||||||
|
${2:Do this}
|
||||||
|
ELSE
|
||||||
|
${3:Do that}
|
||||||
|
END-IF.
|
||||||
|
$0
|
||||||
|
endsnippet
|
||||||
|
|
||||||
|
snippet ifis "IF-Condition 'is' POS/NEG" A
|
||||||
|
IS $1`!p snip.rv = complete(t[1], ['POSITIVE', 'NEGATIVE'])` $0
|
||||||
|
endsnippet
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -487,6 +487,27 @@ snippet \0 "Add another Backslash" iA
|
||||||
\\\\
|
\\\\
|
||||||
endsnippet
|
endsnippet
|
||||||
|
|
||||||
|
snippet bibbook "Add a new book/journal/paper reference" b
|
||||||
|
\\bibitem{${1:Reference_name}}
|
||||||
|
${2:Author}. (${3:2023}) \`${4:Title}'. ${5:Extension} `!p
|
||||||
|
if t[6] == "":
|
||||||
|
snip.rv = ""
|
||||||
|
elif "-" in t[6]:
|
||||||
|
snip.rv = "Seiten "
|
||||||
|
else:
|
||||||
|
snip.rv = "Seite"
|
||||||
|
`$6`!p
|
||||||
|
if t[6] == "":
|
||||||
|
snip.rv = ""
|
||||||
|
else:
|
||||||
|
snip.rv = "."`
|
||||||
|
$0
|
||||||
|
endsnippet
|
||||||
|
|
||||||
|
snippet cc "Cite" i
|
||||||
|
\\cite{$1}$0
|
||||||
|
endsnippet
|
||||||
|
|
||||||
snippet setenv "Set Environment around Text" b
|
snippet setenv "Set Environment around Text" b
|
||||||
\\begin{$1}
|
\\begin{$1}
|
||||||
${VISUAL}
|
${VISUAL}
|
||||||
|
|
Loading…
Reference in New Issue