Greetings everyone
I am moving from my most recent post to discuss a new block in the standard library code. There is an apparent deficiency in regards to the afore mentioned read and write calls. Here I have a simple boot and two different instances (from distinct sources) both not yielding any effect.
section .data
; pathname dd "/home/Documents/Platforms/Programs/Sources/referenceA2023/Concepts/Codec/DesignII/Test/Base/new.text"
; pathname dd "/home/chris-deb-auth/Documents/Platforms/Programs/Sources/A2024/small_rebuild/new.txt"
; toWrite dd "test text here",0AH,0DH,"$"
; length equ $ - toWrite
filename db "new.txt", 0 ; filename with null terminator
toWrite dd "test text here",10
; message db "Hello, world!", 10 ; message with newline
; msglen equ $ - message ; length of message
length equ $ - toWrite
section .text
global Filer
Filer:
; open the file
mov eax, 2 ; sys_open
; mov ebx, pathname ; pointer to filename
mov ebx, filename ; pointer to filename
mov ecx, 0x201 ; O_WRONLY|O_CREAT
mov edx, 0x1b6 ; 0644
int 0x80 ; call kernel
mov esi, eax ; save file descriptor
; write to the file
mov eax, 4 ; sys_write
mov ebx, esi ; file descriptor
mov ecx, toWrite ; pointer to message
mov edx, length ; length of message
int 0x80 ; call kernel
; close the file
mov eax, 6 ; sys_close
mov ebx, esi ; file descriptor
int 0x80 ; call kernel
; exit the program
mov eax, 1 ; sys_exit
mov ebx, 0 ; exit code
int 0x80 ; call kernel
jmp $
times 510 - ($-($$)) db 0
db 0x55,0xaa
section .data
; pathname dd "~/.../new.text"
pathname dd "new.txt"
toWrite dd "test text here",0AH,0DH,"$"
length equ $ - toWrite
section .text
global Filer
Filer:
;section .data
; pathname dd "/home/Documents/Platforms/Programs/Sources/referenceA2023/Concepts/Codec/DesignII/Test/Base/new.text"
; toWrite dd "test text here",0AH,0DH,"$"
mov eax,5
mov ebx,pathname
mov ecx,101o
mov edx,700o
int 80h
mov ebx,eax
mov eax,4
mov ecx,toWrite
mov edx,17
; mov edx,length
int 80h
jmp $
times 510 - ($-($$)) db 0
db 0x55,0xaa
I''m trying to understand each of these instances but if I can't get a yield I really don't have any clue. If anyone else has been through this library I could really use whatever can get through this.
Cheers and Regards