News:

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

use of 16 bits programming

Started by ookami, December 07, 2010, 09:28:47 PM

Previous topic - Next topic

ookami

Hi, I'm a beginer, sorry for my stupid questions...

-First, I want to make something sure : 16 bits programming = real mode ?

-Secondly, what is the use of the 16 bits programming, the 32 bits isn't better ?

-How does the flat memory model work ? Does it exist only in 32 bits ?

Those things aren't very clear in my head, if someone can also give me a link to a good and clear tutorial about this, that would be great.

thank you

redskull




Quote from: ookami on December 07, 2010, 09:28:47 PM
-First, I want to make something sure : 16 bits programming = real mode ?

Usually, yes, when people say '16-bit' programming, they mean real mode and/or DOS programming, and specifically the memory addressing scheme.  More generally, however, there are overlaps.  For instance, the 16-bit version of registers can be used in protected mode, and 32-bit sized registers can be used in real-mode.


Quote from: ookami on December 07, 2010, 09:28:47 PM
-Secondly, what is the use of the 16 bits programming, the 32 bits isn't better ?

32-bit is much, much better.  16-bit is still around because
1) It's easy to learn in bits and pieces
2) It lets you poke around with the guts of the CPU
2) There are still many, many 16-bit programs in the world

Quote from: ookami on December 07, 2010, 09:28:47 PM
-How does the flat memory model work ? Does it exist only in 32 bits ?

"Flat model" means a straight, linear address space, with no segments.  It works by setting the base of the segments to zero, and the upper limit to 4GB; technically there is still a segment, and the segment calculations still get done by the processor, but it's transparent to the programmer.  And yes, it only exists in protected mode, though a case could be made that the 'tiny' memory model is the same concept albiet on a smaller scale.

-r
Strange women, lying in ponds, distributing swords, is no basis for a system of government

FORTRANS

Quote from: ookami on December 07, 2010, 09:28:47 PM
Hi, I'm a beginer, sorry for my stupid questions...

Hi,

   Welcome to the forum.

Quote
-First, I want to make something sure : 16 bits programming = real mode ?

   There is a 16-bit protected mode.  And you can do some
32-bit work in real mode.  But most of the time people will
consider 16-bit assembly as meaning real mode.

Quote
-Secondly, what is the use of the 16 bits programming, the 32 bits isn't better ?

   Most of the people here in the forum would say so.  The
use of 16-bit Assembly is somewhat out of date.  But you
can do many things with 16-bit assembly if you want to.

Quote
-How does the flat memory model work ? Does it exist only in 32 bits ?

   The flat mode has the entire memory addressable without
modifying segment registers.  So instead of a segmented
memory model is was called flat.  Yes it is 32-bit (or now 64-bit)
only.

Regards,

Steve N.

hutch--

Hi ookami,

Welcome on board. It is not often we hear thew japanese term for Wolf.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

Magnum

Quote from: ookami on December 07, 2010, 09:28:47 PM
Hi, I'm a beginer, sorry for my stupid questions...

-First, I want to make something sure : 16 bits programming = real mode ?

thank you

Welcome on board.

No question is stupid.

My first programming language was batch files.

Have a great day,
                         Andy

Rockphorr

As a rule 16bit use in real mode. There everyone can try that wanted.
Model don't work. It is just refer the order of code and data in executable file.
There are no models in runtime.
In real mode restictions and protection are not exist.
Strike while the iron is hot - Бей утюгом, пока он горячий

ookami

Thank you everybody for your welcome !
And thanks to FORTRANS, redskull and Rockphorr for your answers.
Hutch, I'm surprised that you know this word ! Do you speak japanese ?

I have more questions about this subject (I did search in google before asking) :

-What the need to use segmentation in the programs since I can use flat model ?

-In the flat model, are there logical addresses and physical addresses like in the segmented models, or they are equals ?

-Does the Paged virtual memory change something for the programmer, or it's the same as the segmented memory ?

-Is the comprehension of the virtual memory absolutely required to program with masm ?

-What the points in memory models I do have to know for learning masm programmation ?

Sorry for my english...as you can see, it's not my native language.


Thank you

Rockphorr

Quote from: ookami on December 08, 2010, 06:55:59 PM

-What the need to use segmentation in the programs since I can use flat model ?


If you will write for windows 32/64 you can just use flat model only until you begin write os additions like drivers.
Strike while the iron is hot - Бей утюгом, пока он горячий