News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

: vs +

Started by mr_miyagi, June 20, 2005, 07:22:15 PM

Previous topic - Next topic

mr_miyagi

i am a n00b to x86 asm and i was wonder what is the difference between using
mov eax,[fs:30h]
and using
mov eax,[fs+30h]
i am using NASM (yeah i know this is a MASM forum but its one of the only x86 asm boards i could find) if it helps
thanks for your help

AeroASM

: is used to show which segment the data is in.
+ simply means add up to find the address.

The first instruction puts into eax the dword at address 30h in the segment pointed to by fs.
The second instruction puts into eax the dword at the address (30h + value of fs register) in the segment pointe to by ds.

Bieb

Speaking of which, is there a tutorial somewhere about how segmentation works?  I never did learn all that...

AeroASM

Segmentation means that to get a linear address, you add together a base and an offset.

THe offset is specified in the program, and has the option of depending on registers as well as constants.

In real mode the base is the value of the segment register * 16
IN protected mode the base is worked out by looking up the entry in the GDT referenced by the segment register.

Eóin

Robert check out charpter 4 of Randall Hydes Art of Assembly book for 16bit DOS. It explains it all very well.

donkey

Hello Mr Miyagi,

Yes, this is the same Donkey as at the other forum you are banned from, BTW you can probably add this one to the list of bans, it will be Hutch who makes that determination. We are well aware that you are only interested in shellcode for malicious purposes and I do watch your IP and can track you if I please.
"Ahhh, what an awful dream. Ones and zeroes everywhere...[shudder] and I thought I saw a two." -- Bender
"It was just a dream, Bender. There's no such thing as two". -- Fry
-- Futurama

Donkey's Stable

hutch--

mr_miyagi,

Take the moderators warning seriously, both members and moderators here know what this type of code is used for and we have all heard the tricks and other nonsense before. You are welcome here as a member to ask technical questions related to programming issues but our rules are specific to ANY ilegal activity whatsoever and if there is any nonsense, we will act to prevent it from happening.

This is the only warning you will get and we will act if there are any more indiscretions.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php