c - Scanf in MIPS assembler language? -
i understand basic functions of mips, not understand how declare variables , not understand how write equivalent of scanf()/printf() in mips (can't find them online when search). here code trying translate now:
#include <stdio> int main(int argc, char* argv[]) { unsigned long int n; scanf("%d", &n); printf("%lu",fact(n)); }
any guidance?
you not want re-implement scanf in assembly. more productive implement in c or other high-level language. better grab open source implementation, in glibc.
here source code scanf() in glibc: http://fossies.org/dox/glibc-2.19/scanf_8c_source.html
here gpl-like implementation: http://mirror.fsf.org/pmon2000/3.x/src/lib/libc/scanf.c
Comments
Post a Comment