From owner-freebsd-questions@freebsd.org Tue Aug 1 01:00:55 2017 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7F716DC1D90 for ; Tue, 1 Aug 2017 01:00:55 +0000 (UTC) (envelope-from cpghost@cordula.ws) Received: from mail-wm0-x243.google.com (mail-wm0-x243.google.com [IPv6:2a00:1450:400c:c09::243]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DEA9570000 for ; Tue, 1 Aug 2017 01:00:54 +0000 (UTC) (envelope-from cpghost@cordula.ws) Received: by mail-wm0-x243.google.com with SMTP id q189so847146wmd.0 for ; Mon, 31 Jul 2017 18:00:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cordula-ws.20150623.gappssmtp.com; s=20150623; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=oDbpLI6fxP+ZORm97PDAUBP+ubYbcu70u83MrMEKzmk=; b=0VS0Gzl5p6+hZA0XA53jEFPpgKtSWp0P2U8lpWJhw9xdxTBNnrsdLlYjUpC8FPARC8 iuTLLEaaZTo+oMMSwMJN7nDQGAA6qvJpXFrSf8A5NlcOC5yCtEpyB8P/Z27XxwhLxsoH UbmyAy/zvqpxcvDLX8z/9NgSD6vlTjRj5T8xp4dsYfs2iNpCjo7iYEcA59YUl93RXxnu yIdEb+rJTa08oQLs4ebu5ByQF7w5YcgPZZiaA88Ly604ag8KWLibl9YIC40k7F+TSuhx W04zFXnMvPYlgizRKg72NoCfvG/CQwcqADODrcyC/3nZO0ZcmSFxlPjumNS0oSWyYJJJ TR7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=oDbpLI6fxP+ZORm97PDAUBP+ubYbcu70u83MrMEKzmk=; b=YoxfSwJ5JibHUoH9bvETI3s6whRdZIFqcvWjqcZDgzCuVDhWP6aW5Dzaf8kFf0ly8T f6z8wzgpdyrfaUGsQtWG6q8wbzK06c6owS/szHVjH1I02zVNn1CJMjEElVATn3E8MGwV QJ13x5D4lsPohdJLd4e+1b2MFOkwJrgVsivIIOaXQXfn9oYqsqgBlvjS4wFpBjAC9Xvz OrAJdZi5ic0Q5feCyEZdkLlncxwolO1g9oL1l3fLRLFdbqU2wj4tFZLUbFygilCErLp0 BytOOejQPihLJPziF7bIyLDgJbK1OtZVlo4JLILVKtrPeC+/6YgDDdz8qg5TpoT0E+2f V1eQ== X-Gm-Message-State: AIVw112YpcGq1bl0HWAcTfizTeyNU+qmH474C/V/9rRvEujI758qLPyp RRQnbqlxQx8oD8+ykNU= X-Received: by 10.80.157.77 with SMTP id j13mr5215578edk.178.1501549252240; Mon, 31 Jul 2017 18:00:52 -0700 (PDT) Received: from phenom.fritz.box ([174.128.236.101]) by smtp.gmail.com with ESMTPSA id j18sm8210859edh.44.2017.07.31.18.00.40 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 31 Jul 2017 18:00:51 -0700 (PDT) Subject: Re: FreeBSD System Calls in Assembly To: freebsd-questions@freebsd.org References: From: cpghost Message-ID: <92ddcdcb-5033-73ec-0551-3bc26e5680f2@cordula.ws> Date: Tue, 1 Aug 2017 03:00:42 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Aug 2017 01:00:55 -0000 On 07/31/17 21:59, Makketron wrote: > Hello, > It seems that the documentation here doesn't apply for 64-bits. > > https://www.freebsd.org/doc/en/books/developers-handbook/x86.html > > I asked a question on stackoverflow. I thought I should ask it here too > https://stackoverflow.com/questions/45423987/freebsd-64bits-convention-call-documentation > > I am running FreeBSD 11.0. > > The following from the FreeBSD manual does NOT print the "Hello, World!" > message: [snip] https://farid.hajji.org/en/blog/29-hello-world-in-freebsd-assembly https://farid.hajji.org/en/blog/32-return-values-of-freebsd-syscalls-in-assembly Basically, in i386, you pass function values on the stack, and on amd64 via registers. The amd64 ABI calling convention, shared by common Unices: https://en.wikipedia.org/wiki/X86_calling_conventions#System_V_AMD64_ABI Just remember that the list of syscalls and therefore the syscall ID differs across the various Unix variants... -cpghost. > Thank you. > _______________________________________________ > freebsd-questions@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org" >