From: adekoya a. <ade...@gm...> - 2011-09-19 23:56:48
|
hi, am new to nasm. I have installed it on my machine. i would love to adapt the code below to read say two numbers from the console and then print the sum of the numbers to the console. i urgently need to learn nasm on windows so that I could use in my compiler. I am developing a compiler for my msc project. the compiler would generate NASM code . The NASM code would then b assembled and later be linked by GCC. So for now , I need to quickly work on my NASM knowlegdge. I would appreciate your kind help. ; ---------------------------------------------------------------------------- ; helloworld.asm ; ; This is a Win32 console program that writes "Hello, World" on one line and ; then exits. It needs to be linked with a C library. ; ---------------------------------------------------------------------------- global _main extern _printf extern _scanf section .text _main: push message call _printf add esp, 4 ret message: db 'Hello World!', 10, 0 |