flat assembler
Message board for the users of flat assembler.
Index
> Linux > How to include a text file? |
Author |
|
bitshifter 27 Jul 2023, 10:33
'file' is reserved keyword in fasm to place object inline with no preprocessing or assembling.
i cant test this code but this part is obvious Code: filename file 'test.txt' ; null-terminated string try Code: filename db 'test.txt',0 ; null-terminated string _________________ Coding a 3D game engine with fasm is like trying to eat an elephant, you just have to keep focused and take it one 'byte' at a time. |
|||
27 Jul 2023, 10:33 |
|
revolution 27 Jul 2023, 13:49
If you want to include the file as part of the output binary.
Code: section '.data' file 'test.txt' |
|||
27 Jul 2023, 13:49 |
|
ntos 27 Jul 2023, 21:56
@bitshifter. It worked. Thanks.
@revolution. So the file directive is to include some file as part of the output binary, nothing more nothing less, right? Like some license or readme file? |
|||
27 Jul 2023, 21:56 |
|
revolution 27 Jul 2023, 22:03
ntos wrote: @revolution. So the file directive is to include some file as part of the output binary, nothing more nothing less, right? Like some license or readme file? |
|||
27 Jul 2023, 22:03 |
|
ntos 28 Jul 2023, 13:39
revolution wrote:
Then how do you access the file defined with File from fasm code? |
|||
28 Jul 2023, 13:39 |
|
revolution 28 Jul 2023, 14:05
Put a label.
Code: my_data: file 'test.txt' ;... lea rax,[my_data] mov bl,[rax] |
|||
28 Jul 2023, 14:05 |
|
ntos 28 Jul 2023, 22:10
revolution wrote: Put a label. Thank you very much. |
|||
28 Jul 2023, 22:10 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.