NASM - The Netwide Assembler
NASM Forum => Programming with NASM => Topic started by: assistech on May 15, 2020, 08:50:38 PM
-
How to write string in a file ("mystring_inside.txt") with NASM ?
-
What have you tried? Foolish question, I suppose...
https://stackoverflow.com/questions/40003885/win32-assembly-writefile-to-console-dont-s
You might be better off linking with GoLink or some other(?)...
Best,
Frank
-
Golink ???
http://www.godevtool.com ??????
-
Hi,
I would like to write a string after "_scanf" at my MS-DOS screen and write this string on a file ".txt", i could recovery this information and use it with another langage like C.
Because i don't know how to insert assembler code in a C program with CODELITE, but i find a method to call my assembler code file ".exe", by calling the executable file with system("c:/.......");
Thanks,
-
Why do you want to involve assembly language at all?
Best,
Frank
-
Hi,
Because like it. And want to write hard code, not easy for someone would like copy my code for my futur software.
-
Hey, have you ever read this :
https://www.tutorialspoint.com/assembly_programming/assembly_file_management.htm
I will try it on Windows
-
Okay. That's for Linux. Windows will be different, but same general idea. First, you'll have to open the file. to get a file "descriptor" or "handle". This will want a pointer to a filename (obviously), whether it's read/write or both, maybe some "permissions"... ownership... etc. MicroSoft has a;; this pretty well documented. Search for "OpenFile", "WriteFile", etc. It will not be in assembly language. Where they do "foo", we have to do "call foo". You'll figure it out. If you have trouble, post what you've got... You might even get someone running Windows to help...
Best,
Frank