From owner-freebsd-hackers Tue Jul 14 14:32:33 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id OAA17636 for freebsd-hackers-outgoing; Tue, 14 Jul 1998 14:32:33 -0700 (PDT) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from gatekeeper.alcatel.com.au (gatekeeper.alcatel.com.au [203.17.66.1]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id OAA17630 for ; Tue, 14 Jul 1998 14:32:28 -0700 (PDT) (envelope-from peter.jeremy@alcatel.com.au) Received: from mfg1.cim.alcatel.com.au ("port 2087"@[139.188.23.1]) by gatekeeper.alcatel.com.au (PMDF V5.1-7 #U2695) with ESMTP id <01IZF6RCLHS0000JLD@gatekeeper.alcatel.com.au> for hackers@FreeBSD.ORG; Wed, 15 Jul 1998 07:31:45 +1000 Received: from gsms01.alcatel.com.au by cim.alcatel.com.au (PMDF V5.1-10 #23324) with ESMTP id <01IZF6RB7YW0JIYLIV@cim.alcatel.com.au> for hackers@FreeBSD.ORG; Wed, 15 Jul 1998 07:31:43 +1000 Received: (from jeremyp@localhost) by gsms01.alcatel.com.au (8.8.8/8.7.3) id HAA28406 for hackers@FreeBSD.ORG; Wed, 15 Jul 1998 07:31:41 +1000 (EST) Date: Wed, 15 Jul 1998 07:31:41 +1000 (EST) From: Peter Jeremy Subject: Re: Assembly.. To: hackers@FreeBSD.ORG Message-id: <199807142131.HAA28406@gsms01.alcatel.com.au> Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On: Mon, 13 Jul 1998 17:55:06 -0700 (PDT), Steven Kehlet wrote: > The latest [version of GAS] is 2.8.1. Actually, its 2.9.1 last time I checked. According to the GAS info file (in the section on AT&T Syntax versus Intel Syntax), the correct syntax for lcall is "lcall $SEG,$OFFSET" (ie "lcall $7,$0" for a FreeBSD syscall). This does work in gas 2.9.1, but isn't accepted by the gas 1.92.3 in FreeBSD. The opcode map in gas 1.92.3 suggests "lcall $7,0" might work, but this just generates a core file :-(. >I did however find a way around this... just use .byte and generate >the machine language yourself: > >.byte 0x9a # opcode for lcall >.long 0x0 # this will yield "lcall 0x7,0x0" >.word 0x7 # A check through the system sources will show that this is how it's handled inside the kernel and libraries: #define LCALL(x,y) .byte 0x9a; .long y; .word x #define KERNCALL LCALL(7,0) Peter -- Peter Jeremy (VK2PJ) peter.jeremy@alcatel.com.au Alcatel Australia Limited 41 Mandible St Phone: +61 2 9690 5019 ALEXANDRIA NSW 2015 Fax: +61 2 9690 5247 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message