From: Tyler L. <ty...@ty...> - 2008-11-09 16:17:56
|
Hello, I'm going to try to write a "guess the number." tyep program. First, I wrote this, so I could link to it: #include <cmath> #include <ctime> #include <cstdlib> int rnum(); int rnum() { srand(time(NULL)); return (rand()%10); } I'm also going to have to write a rapper for itoa. next, my asm program so far is as follows: global _start section .text welcome db "Welcome to guess the number!",10,"Written by Tyler Littlefield <ty...@ty...>",10,10 welcomelen equ $-welcome texta db "I am thinking of a number between 1 and 10.",10,"Can you guess it in three tries?",10 textalen equ $-texta section .data nop _start: nop mov eax,4 mov ebx,1 mov ecx,welcome mov edx,welcomelen int 80h mov eax,4 mov ebx,1 mov ecx,texta mov edx,textalen int 80h when I compile with nasm, that works great. but when I gcc ns.o rand.o it gives errors about _start, and then says it can't find time and srand and rand. Ideas? Thanks, Tyler Littlefield email: ty...@ty... web: tysdomain-com Visit for quality software and web design. skype: st8amnd2005 |