Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 06 Jun 2000 22:11:24 -0400
From:      James Howard <howardjp@wam.umd.edu>
To:        freebsd-alpha@freebsd.org
Subject:   Alpha Assembly
Message-ID:  <200006070211.WAA27864@rac5.wam.umd.edu>

next in thread | raw e-mail | index | archive | help
After reading Konstantin Boldyshev introduction to assembly programming
with NASM, I became curious and started playing.  Eventually (and with the
help of his document on Linux assembly), I got it assemblable under
GCC.  Needless to say, I felt that was cool.

But now I am really curious, how would I write a simple "Hello,
world!\n" under Alpha?  This is partly academic since I do not have an
Alpha (let alone a FreeBSD/Alpha) to test on.  Donated processor cycles
appreciated :)

Reading through the Alpha libc code offered me some insight but not enough
to make it understandable.  As near as I can tell, the only code that
actually does the system call is this from sys/alpha/SYS.h:

	#define CALLSYS_ERROR(name)                                     \
	        CALLSYS_NOERROR(name);                                  \
	        br      gp, LLABEL(name,0);                             \
	LLABEL(name,0):                                                 \
	        LDGP(gp);                                               \
	        beq     a3, LLABEL(name,1);                             \
	        jmp     zero, .cerror;                                  \
	LLABEL(name,1):

How does this relate to the similar(?) code of sys/i386/SYS.h:

	#define KERNCALL        int $0x80       /* Faster */

Having done real-mode C and Assembly programming under DOS, it is obvious
to me how the x86 code works.  You simply push the arguments onto the
stack and call interrupt 0x80.  But the Alpha code here is killing me.  
Please forgive me if I am totally out to lunch here.

Jamie


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-alpha" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200006070211.WAA27864>