Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is meaning of .model small in 8086 programs?

I am a beginner in 8086 assembly language. I can understand the logic used in the program and write small programs myself. But I just want to know what this does:

.model small
.stack 300h

What is explanation for .model small?

I am using masm.

like image 924
Sakil Mallick Avatar asked Nov 12 '17 18:11

Sakil Mallick


1 Answers

With .model tiny you get a program where CS, DS, and SS are all pointing to the same 64KB of memory. The stack is placed in the highest region of this 64KB segment.

With .model small you get a program where CS points to a segment of its own, followed by the segment where DS and SS are pointing to. The stack is placed in the highest region of the SS segment.

The directive .stack 300h is telling MASM the size of the stack, so MASM can warn you when the rest of the program (data,bss,heap) would clash with the stack.

In both these models all access to data items is done using near pointers.

like image 115
Sep Roland Avatar answered Sep 18 '22 12:09

Sep Roland