flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
revolution 08 Sep 2015, 08:01
Do you mean the x86 IN and OUT instructions?
Because these would be up to the programmer to define. Or do you mean some sort of interaction with the user by reading keystrokes and printing to the console? But this is not usually the purpose of an assembler/compiler. Adding such a thing would make it something else. Or are you suggesting something else? |
|||
![]() |
|
Kane 08 Sep 2015, 08:22
I meant "something" is:
Code: char data[20]; FILE *f = fopen("file.txt", "w"); fprintf(stdout, "data"); // write console fscanf(stdin, "%s", data); // read console // -------------------------------- fprintf(f, "data"); // write file fscanf(f, "%s", data); // read file only through macros. Work with stream (I/O) through macros. |
|||
![]() |
|
revolution 08 Sep 2015, 08:41
Using file I/O is OS dependant. I wonder if you are confusing fasmg with some sort of HLL.
But anyway, firstly you have to define which CPU you are targeting so that the binary output code can run on the CPU (X86 or ARM etc.). Then you need to define which OS you are targeting so you can interact with the I/O APIs ("int 0x80" or "invoke function" etc.), and to format the output binary accordingly (PE or ELF etc.). |
|||
![]() |
|
Kane 08 Sep 2015, 09:09
True say. I did not thought of the zoo processor
![]() Thank you for your attention to the topic. |
|||
![]() |
|
revolution 08 Sep 2015, 09:14
From your comment I suspect that fasmg is not going to be suitable for what you want. Instead you can look at the example code included in the download of fasm (without the 'g').
|
|||
![]() |
|
l_inc 08 Sep 2015, 19:26
Not sure what you guys are talking about, but both fasm and fasmg support reading files at compile time via the file directive and doing output (to the console for console versions) via the display directive. file is also able to read from the console input, but an interactive compilation session done this way is limited to blind batch input during the compilation and batch output flush done after the compilation is finished.
_________________ Faith is a superposition of knowledge and fallacy |
|||
![]() |
|
revolution 09 Sep 2015, 01:41
But files are not stream I/O from stdin and stdout as the OP requested. I think the OP just misunderstood the purpose of fasmg.
|
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.