public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* 64-bit write() system call
@ 2008-03-20  0:19 Bob Plantz
  2008-03-20  2:00 ` Brian Dessent
  0 siblings, 1 reply; 3+ messages in thread
From: Bob Plantz @ 2008-03-20  0:19 UTC (permalink / raw)
  To: gcc-help

First, I have also posted this on ubuntuforums.org. I know that's bad
form, but I don't think there will be many cross-readers here.

The default address size is 64 bits in 64-bit mode. But when I look at
the assembly language for the write() syscall, gcc uses only 32 bits of
the address:

	.file	"oneChar.c"
	.data
	.type	aLetter, @object
	.size	aLetter, 1
aLetter:
	.byte	65
	.text
.globl main
	.type	main, @function
main:
	pushq	%rbp             // <== 64-bit addresses
	movq	%rsp, %rbp       // <==
	movl	$1, %edx
	movl	$aLetter, %esi   // <== 32-bit address
	movl	$1, %edi
	call	write
	movl	$0, %eax
	leave
	ret
	.size	main, .-main
	.ident	"GCC: (GNU) 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)"
	.section	.note.GNU-stack,"",@progbits

Can anyone point me to discussions of what is going on here?

Bob


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-03-20  6:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-03-20  0:19 64-bit write() system call Bob Plantz
2008-03-20  2:00 ` Brian Dessent
2008-03-20  6:11   ` Bob Plantz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).