From owner-freebsd-hackers@FreeBSD.ORG Wed Sep 28 20:36:27 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 633A0106566B for ; Wed, 28 Sep 2011 20:36:27 +0000 (UTC) (envelope-from axel@ucs.com) Received: from exchange.ranch.com (ranch.com [184.183.2.50]) by mx1.freebsd.org (Postfix) with ESMTP id 44FEB8FC1C for ; Wed, 28 Sep 2011 20:36:27 +0000 (UTC) Received: from localhost (70.176.122.205) by exchange.ranch.com (10.1.1.64) with Microsoft SMTP Server id 8.1.436.0; Wed, 28 Sep 2011 13:26:16 -0700 Date: Wed, 28 Sep 2011 13:26:47 -0700 From: Colin Barnabas To: Message-ID: <20110928202647.GA8284@hs1.VERBENA> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline User-Agent: Mutt/1.4.2.3i X-Mailman-Approved-At: Wed, 28 Sep 2011 20:52:24 +0000 Subject: Hello World assembly language X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Sep 2011 20:36:27 -0000 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