Remove rarely used assembly snippets

This commit is contained in:
Yannick Reiß 2024-09-15 10:20:09 +02:00
parent e1a5e7f825
commit 04369588f6
1 changed files with 4 additions and 34 deletions

View File

@ -1,14 +1,10 @@
snippet string "Assembler string definition"
snippet string86 "Assembler string definition"
${1:Name} db ${2:"Hello World!"} ; string $1 = $2
len_$1 equ $ - $1 ; length of string $1
$0
endsnippet
snippet \n "Zeilenumbruch" A
", 0x0a, "
endsnippet
snippet write "write sys_call"
snippet write86 "write sys_call"
mov eax, 4 ; write sys_call
mov ebx, 1 ; write to stdout
mov ecx, ${1:string} ; string to write
@ -17,7 +13,7 @@ int 0x80 ; system interrupt
$0
endsnippet
snippet exit "exit sys_call"
snippet exit86 "exit sys_call"
mov eax, 1 ; exit sys_call
mov ebx, ${1:0} ; exit Code
int 0x80 ; system interrupt$0
@ -40,33 +36,7 @@ $1:
$0
endsnippet
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
snippet functionGCC "GCC conform function implementation" b
$1:
push %ebp
mov %esp, %ebp