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