From owner-freebsd-alpha Tue Nov 13 14:30:27 2001 Delivered-To: freebsd-alpha@freebsd.org Received: from fantasy.telia.net (fantasy.telia.net [194.22.190.201]) by hub.freebsd.org (Postfix) with ESMTP id 7DDAF37B405 for ; Tue, 13 Nov 2001 14:30:22 -0800 (PST) Received: from localhost (elite@localhost) by fantasy.telia.net (8.11.6/8.11.3) with ESMTP id fADMUKe98046 for ; Tue, 13 Nov 2001 23:30:21 +0100 (CET) (envelope-from khaled@w-arts.com) X-Authentication-Warning: fantasy.telia.net: elite owned process doing -bs Date: Tue, 13 Nov 2001 23:30:20 +0100 (CET) From: Khaled Daham X-X-Sender: To: Subject: Alpha assembler programming. Message-ID: <20011113231429.W97694-100000@fantasy.telia.net> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-alpha@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org Hello! I have convinced myself to do some assembly coding on alpha for some reason. I have almost managed to do a simple hello world involving write(2). main: lda $16, 1 lda $17, msg lda $18, len jsr write lda $16, 0 jsr exit which bombs out on 45328 a.out CALL write(0x1,0x1200107a0,0xc) 45328 a.out GIO fd 1 wrote 12 bytes "Hello World!" 45328 a.out RET write 12/0xc 45328 a.out PSIG SIGSEGV SIG_DFL I am note sure why I get the SIGSEGV, anyone ? Another thing I noted in /usr/src/sys/alpha/alpha/support.s is the line lda a0, longjmp_botchmsg where longjmp_botchmsg is a string just like my lda $16, msg ( $16 == a0 ) but I cannot get gcc to compile if I use lda a0, msg gcc returns "Error: inappropriate arguments for opcode `lda'" I cannot really see why it does not accept it, except that in the alpha assembler guide's I have seen a0-a5 is used for passing integers, but howcome the mapping between $16-$21 to a0-a5. Does anyone know a good site with some alpha assembly examples using C calling convention ? 680x0 was alot easier :) /Khaled Daham, w.arts Mail: khaled@w-arts.com Cell: +46-70-6785492 FreeBSD: The Power to Serve! http://www.FreeBSD.org/ This isn't rocket science -- but it _is_ computer science. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-alpha" in the body of the message