I'm reading some Adobe Acrobat files that I have downloaded from the internet. I belive it is 'Art of Assembly Language' by Hyde I could be wrong though. I haven't read Icz's tutorial's yet and I have read MadWizard's tutorial( the yellow one that I downloaded ) Anyway's in Hyde's examples I have read about the different types of segments

Here is one such example

5.7.1 Simple Variable Declarations
; Sample variable declarations
; This sample file demonstrates how to declare and access some simple
; variables in an assembly language program.
; Randall Hyde
; Note: global variable declarations should go in the "dseg" segment:
dseg segment para public 'data'
; Some simple variable declarations:
character byte ? ;"?" means uninitialized.
UnsignedIntVar word ?
DblUnsignedVar dword ?

My question is why don't I see stuff like this is other ppl's examples. Such as from madwizard? Does Hutch's Masm do this for us? Or have I just skipped over something? Should I keep reading?

I was just curious

Posted on 2002-06-03 15:06:57 by gorshing
.model flat

;data segment

end start
Posted on 2002-06-03 15:22:34 by bdjames
....and the following declarations from your example go in the .data? section along with any other uninitialized variables:

character byte ? ;"?" means uninitialized.
UnsignedIntVar word ?
DblUnsignedVar dword ?
Posted on 2002-06-03 15:48:07 by Will

dseg segment para public 'data'

This is the old way (pre Masm v.5.00) of defining segments.

It is somewhat equivalent to the new .data pseudo-op introduced in Masm 5.00, although the new .data pseudo-op automatically allows you to link properly to HLL object files. The old 'segment' method required a particular method of naming to link properly to HLL object files.

In general the use of .data, .data?, .code, etc. is recommended.
Posted on 2002-06-04 21:34:49 by AmkG
Thank you AmkG, that is what I needed/wanted to know.

Thanks again,
Posted on 2002-06-05 09:52:08 by gorshing

Just as a bit of background, 16 bit DOS had a 2 step addressing method to get around the 64k limit that is inherant in 16 bit numbers, it used an extra 4 bits to address "segments" so you actually has a 20 bit segment/offset addressing system.

In 32 bit, the numeric range is nominally 4 gigabytes and the current 32 bit versions of windows are what you call FLAT memory model where the segment capacity in the processor is set to the same address for all normal segments. What is important is that you DON'T try and use segments in 32 bit.

32 bit addressing is ONLY offsets and this of course simplifies the code and extends the range by a massive amount. Randy Hyde's older AOA was a very good work but it is DOS based and the segment technology is not used in 32 bit windows so that section of AOA is limited in its use.

If you can get the swing of the basic architecture and enough of the instructions, you would be better to start working in 32 bit as it can do many more things and it is generally a lot faster.


Posted on 2002-06-05 11:16:33 by hutch--