rendered paste body$ cat ./hd_sync.asm
; Filename : hd_sync.asm
; Syntax : none
; Description : ia32 linux app: to sync hd
; Author : Bain
; Notes ; To build:$ nasm -f elf ./hd_sync.asm ; ld -o ./hd_sync ./hd_sync.o ; rm ./hd_sync.o
section .text
global _start ; required for linker
_start:
; sync() is syscall 36
; see: /usr/include/asm/unistd.h
xor eax,eax ; clear eax
mov eax,0x24 ; make syscall to sync()
int 0x80 ; interrupt (make call)
xor eax,eax ; clear out eax
mov eax,0x01 ; syscall 1 (0x01) is exit()
int 0x80 ; interrupt (make call)