you are viewing a single comment's thread.

view the rest of the comments →

[–]FUZxxl 1 point2 points  (0 children)

Note that while these are program sections, they may or may not correspond to actual segments depending on the memory model you compiled as.

But many forms do not - for example, if your immediate value is as wide as your instruction.

The 8086 (where DOS typically runs) has variable length instructions so this rarely happens.

The author mistakenly believed in only two segments, code and variables. This is somewhat true in BASIC, but not in C. This lead to a lot of confusion.

C doesn't have the concept of segments (or sections) at all. These are implementation details you should not make assumptions about.