From owner-freebsd-hackers@FreeBSD.ORG Wed Sep 28 21:38:06 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 07629106566B for ; Wed, 28 Sep 2011 21:38:06 +0000 (UTC) (envelope-from duihi77@gmail.com) Received: from mail-iy0-f182.google.com (mail-iy0-f182.google.com [209.85.210.182]) by mx1.freebsd.org (Postfix) with ESMTP id C93128FC14 for ; Wed, 28 Sep 2011 21:38:05 +0000 (UTC) Received: by iadk27 with SMTP id k27so11669588iad.13 for ; Wed, 28 Sep 2011 14:38:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=eP7XtFWz7XZzvXD7mD4AmJ65NtUKyHHhXM5PytZ6N9I=; b=KeQH0XiYM1il18Zc3x49bop18Hd+sIwLPyLVL3yFLyudqvEmwkI5p4LpFJRiv6/Ats lkZH5QUlLsdgspNHCEA/T6iRpa7lkpFqrrzDmRCZegSNcb2b7RQYDv4kJYU2OyY5jcZD eJ1XH8MLJKK7iCUlhidxOKOz4vDh03t4NyR1A= MIME-Version: 1.0 Received: by 10.231.25.229 with SMTP id a37mr13780424ibc.8.1317244215782; Wed, 28 Sep 2011 14:10:15 -0700 (PDT) Received: by 10.231.34.9 with HTTP; Wed, 28 Sep 2011 14:10:15 -0700 (PDT) In-Reply-To: <20110928202647.GA8284@hs1.VERBENA> References: <20110928202647.GA8284@hs1.VERBENA> Date: Wed, 28 Sep 2011 21:10:15 +0000 Message-ID: From: Duane Hill To: freebsd-hackers@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: Re: 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 21:38:06 -0000 On Wed, Sep 28, 2011 at 8:26 PM, Colin Barnabas 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