In Linux, we used syscalls to manipulate files. In Windows, we have to follow other rules. As mentioned in previous chapters, we use the Windows API.
Listing
43-1 shows the example code.
%include "win32n.inc"
extern printf
extern CreateFileA
extern WriteFile
extern SetFilePointer
extern ReadFile
extern CloseHandle
section .data
msg db 'Hello, Windows World!',0
nNumberOfBytesToWrite equ $-msg
filename db 'mytext.txt',0
nNumberOfBytesToRead equ 30
fmt db "The result of reading the file: %s",10,0
section .bss
fHandle resq 1
lpNumberOfBytesWritten resq 1
lpNumberOfBytesRead resq ...