Date: Wed, 28 Sep 2011 21:10:15 +0000 From: Duane Hill <duihi77@gmail.com> To: freebsd-hackers@freebsd.org Subject: Re: Hello World assembly language Message-ID: <CAEQVO_JYKdYiaeby%2B-EYMtm8XZRQoYrp1SBECK4a6fJTkwj0Fw@mail.gmail.com> In-Reply-To: <20110928202647.GA8284@hs1.VERBENA> References: <20110928202647.GA8284@hs1.VERBENA>
next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, Sep 28, 2011 at 8:26 PM, Colin Barnabas <axel@ucs.com> wrote: > I found a hello world program written in assembly language which > runs on my amd64 8.2 stable box. However, I can not seem to get > it to print a new line. Any suggestions on how to print a line > feed in assembly? > > Here is the code- > > section .data > > message: > db 'hello, world!', 0x0a > > section .text > > global _start > _start: > mov rax, 4 > mov rdi, 1 > mov rsi, message > mov rdx, 13 > syscall > > mov rax, 1 > xor rdi, rdi > syscall > > Here's the site I used years ago: http://www.int80h.org/bsdasm/ It has a 'Helo, World' example. -- duihi77
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAEQVO_JYKdYiaeby%2B-EYMtm8XZRQoYrp1SBECK4a6fJTkwj0Fw>