www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/09/23/23:26:11

Date: Tue, 23 Sep 1997 20:24:20 -0700 (PDT)
Message-Id: <199709240324.UAA02086@adit.ap.net>
Mime-Version: 1.0
To: Alan Poppleton <Alan DOT Poppleton AT wanadoo DOT fr>, DJGPP <djgpp AT delorie DOT com>
From: Nate Eldredge <eldredge AT ap DOT net>
Subject: Re: long longs in assembler?

At 01:51  9/22/1997 +0200, Alan Poppleton wrote:
>Hello everyone,
>
>Is it possible to use the 64 bit long longs in assembler?  If so could 
>you please write some example code demostrating how registers could be 
>used to make 64-bit ints?
Yes of course. It's just a 64-bit value. In keeping with the big-endian
architecture of the 80x86 family the low half is stored first. I'm not sure
what you mean by "using registers to make 64-bit ints", but here's a wild guess:

(assuming n is declared long long in C)

movl n,%eax
movl n+4,%edx
# Now edx:eax contains the number n.
# Do stuff with n here
# Put it back
movl %eax,n
movl %edx,n+4

Nate Eldredge
eldredge AT ap DOT net



- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019