![]() |
|
[Assembly] Intel x86 NASM Using fgets - Printable Version +- Hack Forums (https://hackforums.net) +-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444) +--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151) +---- Forum: Coders Lounge (https://hackforums.net/forumdisplay.php?fid=5) +---- Thread: [Assembly] Intel x86 NASM Using fgets (/showthread.php?tid=4860009) |
Intel x86 NASM Using fgets - splutter - Jun 11, 2015 So I have a piece of code and I'm attempting to scan in a string with a call to fgets. It's not reading anything in and the return value is NULL. May someone tell me how I could check my error value or teach me how I should approach this? My code goes something like this: Code ...* - Only3 - Jun 11, 2015 char fgets ( char str, int num, FILE * stream ); http://www.cplusplus.com/reference/cstdio/fgets push stream push num push str call fgets * - Mr. Dr. Prof. Patrick - Jun 11, 2015 STDIN is not 0, STDIN is a maco and there is a function you can use to find the address of STDIN Code push eax* - Masm4ever - Jun 12, 2015 Shorter (but you need a modern assembler): invoke crt_fgets, addr buffer, sizeof buffer, rv(crt___p__iob) |