0% found this document useful (0 votes)
13 views

Assemb

The document discusses the flat memory model used for 32-bit Windows programs. It has a single segment containing both code and data within a 4GB range, differing from earlier 16-bit models with 64KB segments. Segment registers are automatically set to the same value, so segment/offset addressing is not used. The flat model defaults to NEAR code and data addressing within 4GB, and the FS and GS segments are mainly used by the operating system.

Uploaded by

Beny Abdou
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views

Assemb

The document discusses the flat memory model used for 32-bit Windows programs. It has a single segment containing both code and data within a 4GB range, differing from earlier 16-bit models with 64KB segments. Segment registers are automatically set to the same value, so segment/offset addressing is not used. The flat model defaults to NEAR code and data addressing within 4GB, and the FS and GS segments are mainly used by the operating system.

Uploaded by

Beny Abdou
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Flat memory Model Page 1 of 1

Flat memory Model


A program written in native 32 bit Windows format is created in what is called FLAT memory
model which has a single segment that contains both code and data. The programs must be run
on a 386 or higher processor.

Differing from earlier 16 bit code that used combined segment and offset addressing with a
64k segment limit, FLAT memory model works only in offsets and has a range of 4 gigabytes.
This makes assembler easier to write and the code is generally a lot faster.

All segment registers are automatically set to the same value with this memory model and this
means that segment / offset addressing must NOT be used in 32 bit programs that run in 32 bit
Windows.
For programmers who have written code in DOS, a 32 bit Windows PE executable file is
similar in some respects to a dos COM file, they have a single segment that can contain both
code and data and they both work directly in offsets, neither use Segment / Offset addressing.

The defaults in flat-model programs are NEAR code addressing and NEAR data addressing
within the range of 4 gigabytes.

The FS and GS segment registers are not normally used in application programs but are used
in some instances by the operating system.

file:///C:/Users/abdou/AppData/Local/Temp/~hh78EE.htm 2017-03-17

You might also like