Lab 2

Lab 2 - Segment Definition The CPU has several segment...

Info iconThis preview shows pages 1–6. Sign up to view the full content.

View Full Document Right Arrow Icon
Segment Definition ± The CPU has several segment registers: ² CS (code segment). ² SS (stack segment). ² DS (data segment). ² ES (extra segment). ² FS, GS (supplemental segments available on 386s, 486s and Pentiums. ± Every instruction and directive must correspond to a segment. ± Normally a program consists of three segments: the stack, the data, and the code segments.
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Segment Definition ± Model definition. ± .MODEL SMALL ² Most widely used memory model. ² The code must fit in 64k. ² The data must fit in 64k. ± .MODEL MEDIUM ² The code can exceed 64k. ² The data must fit in 64k. ± .MODEL COMPACT ² The code must fit in 64k. ² The data can exceed 64k. ± MEDIUM and COMPACT are opposites.
Background image of page 2
Segment Definition ± .MODEL LARGE ² Both code and data can exceed 64k. ² No single set of data can exceed 64k. ± .MODEL HUGE ² Both code and data can exceed 64k. ² A single set of data can exceed 64k. ± .MODEL TINY ² Used with COM files. ² Both code and data must fir in a single 64k segment.
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Segment Definition ± Segment definition formats: ² Simplified segment definition. ² Full segment definition. ± The Simplified segment definition uses the following directives to define the segments: ² .STACK ² .DATA ² .CODE ² These directives mark the beginning of the segments they represent.
Background image of page 4
Segment Definition ± The full segment definition uses the following directives to define the segments: ² Label SEGMENT [options] ;Statements belonging to the segment.
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 6
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 21

Lab 2 - Segment Definition The CPU has several segment...

This preview shows document pages 1 - 6. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online