flat assembler
Message board for the users of flat assembler.

Index > Compiler Internals > Do address spaces have a sign ?

Author
Thread Post new topic Reply to topic
shutdownall



Joined: 02 Apr 2010
Posts: 518
Location: Munich
shutdownall
I am working on the sources and found some big changes in ASSEMBLE.INC regarding older version 1.69.35.

I am actually working on ORG directive and virtual address spaces and found an address sign for an address space.
What's it for ?
Can an address space have a negative sign ?

Code:
      virtual_at_current:
  dec     esi
 mov     ebp,[addressing_space]
      mov     al,[ds:ebp+9]
   mov     [value_type],al
     mov     eax,edi
     xor     edx,edx
     xor     cl,cl
       sub     eax,[ds:ebp]
    sbb     edx,[ds:ebp+4]
  sbb     cl,[ds:ebp+8]
   mov     [address_sign],cl
   mov     bx,[ds:ebp+10h]
 mov     cx,[ds:ebp+10h+2]
       xchg    bh,bl
       xchg    ch,cl
       mov     ebp,[ds:ebp+14h]
    
Post 17 Dec 2012, 23:59
View user's profile Send private message Send e-mail Reply with quote
l_inc



Joined: 23 Oct 2009
Posts: 881
l_inc
shutdownall
Not sure, what you mean under an "address space sign", but addresses can definitely have a sign (and, obviously, an address space can start with such a negative address). Especially in the context of the 64-bit "canonical addressing".
Post 18 Dec 2012, 13:17
View user's profile Send private message Reply with quote
baldr



Joined: 19 Mar 2008
Posts: 1651
baldr
shutdownall,

This is probably because fasm uses 65-bit values internally.
Post 18 Dec 2012, 19:56
View user's profile Send private message Reply with quote
shutdownall



Joined: 02 Apr 2010
Posts: 518
Location: Munich
shutdownall
l_inc wrote:
shutdownall
Not sure, what you mean under an "address space sign", but addresses can definitely have a sign (and, obviously, an address space can start with such a negative address). Especially in the context of the 64-bit "canonical addressing".


Okay - this is new to me.
Do you have an example ? Shocked
Post 18 Dec 2012, 20:09
View user's profile Send private message Send e-mail Reply with quote
l_inc



Joined: 23 Oct 2009
Posts: 881
l_inc
shutdownall
An example of what? Negative address in fasm? Here it is:
Code:
org -$10
dw $
dd $-2
dq $-6    

Sure, there are no easter egg memory locations addressable with a negative address. Thus the value just wraps around. In some cases like canonical addressing this could be convenient.
Post 19 Dec 2012, 14:56
View user's profile Send private message Reply with quote
shutdownall



Joined: 02 Apr 2010
Posts: 518
Location: Munich
shutdownall
l_inc wrote:

Sure, there are no easter egg memory locations addressable with a negative address.


What a pity. Very Happy
Anyway thanks, I never thought about using these address techniques.
Post 30 Dec 2012, 00:09
View user's profile Send private message Send e-mail Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.

Website powered by rwasa.