home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   alt.os.development      Operating system development chatter      4,255 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 4,120 of 4,255   
   Paul Edwards to wolfgang kern   
   Re: x64 address indexed by 32-bit addres   
   13 Feb 24 14:24:13   
   
   From: mutazilah@gmail.com   
      
   On 30/01/24 17:14, wolfgang kern wrote:   
      
   >>          movl    $4294967295, %eax   
      
   >> That first instruction - the movl - has   
   >> negative 1 as an unsigned value.   
   >   
   > of course because it's just the lower part of RAX   
   > where the upper part become zeroed by a move to EAX.   
      
   It took me a while to realize this zero extension.   
   I was looking at code that looked like it should   
   be 64-bit but was seemingly 32-bit. I had to run   
   a testcase before I realized that the high 32 bits   
   were being zeroed.   
      
   Regardless, the original problem with the compiler   
   has been resolved (the way I was building it, I had   
   missed a define, so indexes were 32-bit instead of   
   64-bit), and with that resolved, and with a switch   
   to Win64 conventions, I now have:   
      
   D:\devel\gcc\gcc>type foo.s   
            .file   "foo.c"   
            .text   
            .p2align 2,,3   
   .globl foo   
   foo:   
   .LFB1:   
            movsbl  -1(%rcx),%eax   
            ret   
   .LFE1:   
      
   D:\devel\gcc\gcc>   
      
      
   And the compiler (now 64-bit pointers and 64-bit   
   long) is capable of self-recompilation.   
      
   And on my 32-bit Windows 2000 development environment   
   I can use it to produce 64-bit executables for my   
   Windows 10 host.   
      
   BFN. Paul.   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca