flat assembler
Message board for the users of flat assembler.

Index > Windows > Work with files in win32 fasm

Author
Thread Post new topic Reply to topic
assemblyad



Joined: 10 Sep 2024
Posts: 1
assemblyad 10 Sep 2024, 05:09
Hello! I don't find instructions about work with files in win32 fasm. I want make program with analog function php:
1. file_get_contents and explode in array by line
2. file_put_contents (implode string line in array, and write to file)
3. multithreading in FASM
4. for, foreach, while in FASM

Thank you.
Post 10 Sep 2024, 05:09
View user's profile Send private message Reply with quote
uu



Joined: 20 Jul 2024
Posts: 44
uu 10 Sep 2024, 06:41
I think you will need to use Win32 API?

CreateFileA, ReadFile, WriteFile....

https://learn.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-createfilea
Post 10 Sep 2024, 06:41
View user's profile Send private message Reply with quote
AsmGuru62



Joined: 28 Jan 2004
Posts: 1708
Location: Toronto, Canada
AsmGuru62 10 Sep 2024, 12:26
FASM has high level macro extensions to make loops, like those below:
Code:
.while
.endw

.repeat
.until
    

I wish that these would also have the "break" and "continue", but OK.
For the multiple threads also API is needed:
https://learn.microsoft.com/en-us/windows/win32/sync/critical-section-objects
Post 10 Sep 2024, 12:26
View user's profile Send private message Send e-mail Reply with quote
Walter



Joined: 26 Jan 2013
Posts: 156
Walter 11 Sep 2024, 00:53
Does this work for "break" and "continue"?

Code:
macro .breakw
{
  jmp __ENDW
}

macro .continuew
{
  jmp __WHILE
}
    
Post 11 Sep 2024, 00:53
View user's profile Send private message Reply with quote
AsmGuru62



Joined: 28 Jan 2004
Posts: 1708
Location: Toronto, Canada
AsmGuru62 11 Sep 2024, 15:05
I will try these. Thanks.

EDITED: "It works OK"
Post 11 Sep 2024, 15:05
View user's profile Send private message Send e-mail Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.