Hello World assembly language
Andrew Duane
aduane at juniper.net
Wed Sep 28 21:17:42 UTC 2011
Add a 0x0d to the end of the string (0xa = LF, 0xd = CR)
...................................
Andrew Duane
Juniper Networks
o +1 978 589 0551
m +1 603-770-7088
aduane at juniper.net
> -----Original Message-----
> From: owner-freebsd-hackers at freebsd.org [mailto:owner-freebsd-
> hackers at freebsd.org] On Behalf Of Colin Barnabas
> Sent: Wednesday, September 28, 2011 1:27 PM
> To: freebsd-hackers at freebsd.org
> Subject: Hello World assembly language
>
> 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
>
> _______________________________________________
> freebsd-hackers at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
> To unsubscribe, send any mail to "freebsd-hackers-
> unsubscribe at freebsd.org"
More information about the freebsd-hackers
mailing list