The program i'm making prints out a message, creates a file through the syscall (sys_creat) prints out another message and then exits. when compiled through these commands:
nasm -f elf32 -o makefile.o makefile.asm
ld -m elf_i386 -o makefile makefile.o
./makefile
the ./makefile
spits out cryptic weird what appears to be raw binary everything executes to some extent like the file is created messages 1 and 2 are printed to the console. but in a very dirty and unclean way. heres my code for this:
global _start
_start:
; print out mkfile to stdo (msg1)
mov eax, 4
mov ebx, 1
mov ecx, msg1
mov edx, msg1Len
int 0x80
; create file
mov eax, 8 ; (Itworked) eax register (sys_creat)
mov ebx, name ; name of the file to be created
mov ecx, 0777 ; file permissions
int 0x80 ; syscall for sys_creat
mov eax, 4 ; prints out second message (msg2)
mov ebx, 1
mov ecx, msg2
mov edx, msg2Len
int 0x80
mov eax, 1 ; exit syscall for program
int 0x80
.data
msg1 db "Making file" ; msg1
msg1Len equ -$msg1 ; msg1 length in chars
msg2 db "File Made" ; msg2
msg2Len equ -$msg2 ; msg2 length in chars
name db "Itworked" ; file name