I need to make an .asm program to save some values in a .txt file. Using C would be much easier, although I cant use it this time. Any idea how to do it?
Please read the manual: Your compiler Manuals will describe the calling conventions & data representation
Which FM?
You haven't stated what tools you're using - so it's impossible to give a specific answer!
But you can search the manuals yourself for terms like "Calling Convention" and "Parameter Passing", etc...
#include <stdio.h>
FILE *f1;
main()
{ int cont = 00;
int address = 30;
f1 = fopen ("out.txt", "wt");
for (cont = 0;cont <= 10; cont = cont + 1) { fprintf (f1, "%d\t%d\n", cont, address); address = address + 1; } fclose (f1); }
I need this program in assembly, is it possible?
Yes it is.
You really need to consider the question more.
Let the C compiler produce an assembly listing. Wow - so quick to get the code into assembler.
Question is - will it actually fulfill the requirements your teacher expected?
Have you even understood the comments you have receied in this thread?