thanks... guys i've solved it using the code below...
section .data
data:db"i am an assembly programmer!",10
len: equ $-data
newfile:db"newfile.txt"
newdata:resb len
section .text
global _start
_start:
pop ebx
pop ebx
pop ebx
mov eax,5
mov ecx,00644Q
int 80h
test eax,eax
js skipread
call fileread
call createnewfile
call writenewfile
skipread:
mov eax,1
mov ebx,0
int 80h
fileread:
mov ebx,eax
mov eax,3
mov ecx,newdata
mov edx,len
int 80h
ret
createnewfile:
mov eax,8
mov ebx,newfile
mov ecx,00644Q
int 80h
ret
writenewfile:
mov ebx,eax
mov eax,4
mov ecx,newdata
mov edx,len
int 80h
mov eax,6
int 80h
mov eax,1
int 80h
ret
|