You are on page 1of 4

Computer Organization and Assembly Language

Question # 1:What is segmented memory model? Describe it.


Segmented memory model is a model in which total memory size is divided in
the form of segments of various sizes. The segments in the segmented memory model
is just an area in the memory. Storing data in the form of segments is also known as
memory segmentation.

One of the examples of segmented memory model is intel 8086 processor. It


stores the data in the form of bytes. The size of data bus in this processor is 16 bits.
The intel 8086 processor has the address bus of the size 20 bits which is its physical
memory. So, as a result of this, it can address a maximum of 1 MB of memory.

1 MB = 2 20 bits (The size of address bus will be 20-bits.)

In this processor there are four memory segments:

 Code Segment (CS)


The part of memory where Bus Interface Unit is currently fetching the code
bytes.
 Stack Segment (SS)
A section of memory set aside to store addresses and data while a subprogram
executes.
 Data Segment (DS)
It is used to store the data values that are going to be used in the program
further later.
 Extra Segment (ES)
When any of the segment in these three got filled this segment is used to store
extra data.
Question # 2:

Describe the commands for Debugger in DOS Box and explain it shortly.

Assemble: A
Creates machine executable code in memory beginning at CS:0100 (or the specified
address) from the 8086/8088 (and 8087) Assembly Language instructions which are
entered.

Unassemble: U
Disassembles machine instructions into 8086 Assembly code. Without the optional
[range], it uses Offset 100 as its starting point, disassembles about 32 bytes and then
remembers the next byte it should start with if the command is used again.

Load: L
This command will load the selected number of sectors from any disk's Logical Drive
under the control of MS-DOS or Windows into Memory. 

Move: M
It actually copies all the bytes from within the specified range to a new address.

Name: N
This command can be used to load files into debug's Memory after you have started
the program, but its main function is to create a new file under control of the Operating
System which debug can write data to.

Register: R
Entering ' r ' all by itself will display all of the 8086 register's contents and the next
instruction which the IP register points to in both machine code and an unassembled
(Assembly Language) form.

Trace: T
The T command is used to trace CPU instructions one at a time.

Fill: F
This command can also be used to clear large areas of Memory as well
as filling smaller areas with a continuously repeating phrase or single byte. 

Write: W
The write command is often used to save a program to your hard disk from within
debug.

Enter: E
Used to enter data or instructions (as machine code) directly into Memory locations.
Go: G
Go is used to run a program and set breakpoints in the program's code.

Quit: Q
Immediately quits (exits) the Debug program.

Hex: H
It is a very simple (add and subtract only) Hex calculator.

Search: S
Searches within a range of addresses for a pattern of one or more-byte values given in
a list.

Compare: C
Compares two blocks of memory. If there are no differences, then debug simply
displays another prompt.

Question # 3:

Describe the steps for execution of program. And describe them shortly.
Mount:

A command inside DOSBox that can connect physical folders and drives
to virtual drives inside DOSBox. The mounted drive does not automatically
refresh files changed out side of DOSBox.
Mount c c:\MP

Edit:

A command inside DOSBox that is used to go away from debug screen after
typing filename and further writing Assembly Language program.
Edit file.asm

Masm:
MASM - is the Microsoft Macro Assembler. It is an assembler. It takes your code pre-
processes it and converts it to binary. The links it to runnable executable or an Object
file.
MASM file.asm;
Link:
It links the file and makes it into an object file.
LINK file.asm;
filename.exe:
After the object file is converted in the machine, it is finally ready to be executed.
It is an executable file that has a specific program and can be run on computer device.

TABLE SHOWING THE DATA AND CODE SIZE IN THE MODEL TYPE

MODEL SIZE CODE DATA


Tiny The code and the data sum must be <= 64
KB

Small <=64 KB <=64 KB

Medium Any size <=64 KB

Compact <=64 KB Any size

Large Any size Any size

Huge Any size Any size

You might also like