Hello World assembly language

Ryan Stone rysto32 at gmail.com
Wed Sep 28 21:18:02 UTC 2011


On Wed, Sep 28, 2011 at 4:26 PM, Colin Barnabas <axel at 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

Try printing 14 bytes. :)


More information about the freebsd-hackers mailing list