Upload files to "src"

This commit is contained in:
2026-03-25 19:29:57 +00:00
commit a8ca687718
2 changed files with 101 additions and 0 deletions

32
src/fstatStruct.asm Normal file
View File

@@ -0,0 +1,32 @@
// this code is licenced under Wrathmark licence
// © 2026 wullie wulliestudio.com
// please see attached licence for full usage and rights
// if file name and lable aint fucking clear enough
// this is the struct used for the fstat syscall
fdatstruct:
.set set_dev dw ?
.set pad1 dw ?
.set st_ino dd ?
.set st_mode dw ?
.set st_nlink dw ?
.set st_uid dw ?
.set st_gid dw ?
.set st_rdev dw ?
.set pad2 dw ?
.set st_size dd ?
.set st_blksize dd ?
.set st_block dd ?
.set st_atime dd ?
.set unused1 dd ?
.set st_mtime dd ?
.set unused2 dd ?
.set st_ctime dd ?
.set unused3 dd ?
.set unused4 dd ?
.set unused5 dd ?

69
src/main.asm Normal file
View File

@@ -0,0 +1,69 @@
// this code is licenced under Wrathmark licence
// © 2026 wullie wulliestudio.com
// please see attached licence for full usage and rights
.data
fd:
buf:
FsPoint:
//temp
count: 1024
// entry point for wcc
.global _start
_start:
// gets args
pop %rax
mov %rax, %rbp
// moves args into the file desciptor
movq %rbp, $fd
// removes value form registers
pop %rbp
pop %rax
call _exit
// exit function
_exit:
mov $60, %rax
mov $0, %rdi
syscall
// idk fucking read
_GetFileSize:
mov $5, %rax
mov $fd, %rdi
syscall
// open a file
_Open:
mov $2, %rax
mov $fd , %rdi
mov $1, %rsi
syscall
// closes the file
_Close:
mov $3, %rax
mov $fd , %rdi
syscall
ret
// reads a file
_Read:
mov $0, %rax
mov $fd, %rdi
mov $buf, %rsi
//tmp
mov $count, %rdx
syscall