Download as pdf or txt
Download as pdf or txt
You are on page 1of 5

COAA – Lab Assignment 4

Name: Shubham Waghule


Roll No- 94
GR No : 12120127
Div: CS - D
Batch : B3

AIM :
Write 8086 ALP to count positive number and negative number from the array of
signed number stored in memory
Memory Models in 8086
The memory models in 8086 specify the size of memory assigned to the different
parts of a program. The. MODEL directive is used at the start to specify which
model is going to be used. There are total 6 memory models:
1. TINY – In this model both code and data occupy a single physical
segment of memory. On linking a file with this model, it automatically
generates a com file which is smaller than exe file.

2. SMALL – In this model, the code and data occupy individual


physical segments from memory.

3. COMPACT – In this model the code occupies a single physical segment


while the contents of data can be given their own separate segments.

4. MEDIUM – In this model the data occupies a single segment.

5. LARGE – In this model, both code and data are stored in different
physical statements.

6. HUGE – It is similar to LARGE with the only difference that a data


array may have a size that exceeds one physical segment.
INSTRUCTIONS :

• LEA : Used to load the address of operand into the provided register.

• ADD : The contents of the register or memory are added to the contents
of the accumulator and the result is stored in the accumulator.

• SUB : The contents of the register or the memory are subtracted from the
contents of the accumulator, and the result is stored in the accumulator.

• JBE : Used to jump if below/equal/ not above instruction satisfies.

• INC : Used to increment the provided byte/word by 1

• DEC : Used to decrement the provided byte/word by 1.

• CMP : Used to compare 2 provided byte/word.

• DIV : Performs the division of two unsigned operands

• CALL : Used to call a procedure and save their return address to the
stack

• Near Procedure: A near procedure refers to a procedure which is in the


same code segment from that of the call instruction

• RET : The RET instruction stands for return. This instruction is used at
the end of the procedures or the subprograms

• JMP : Used to jump to the provided address to proceed to the next


instruction.

• SHL : Used to shift bits of a byte/word towards left and put zero(S) in.

COMMANDS :

• 09h : Displays the string until “$” is reached


• int 21h : Interrupt used to exit the program
• .data : This Command is used only when we want to store data in a Data
Segment, basically, it is the memory access of the Data Segment.
Whatever we want to print must be written here.Also, the variables are
declared here.
• 10, 13 : They work as Escape Sequence Character
• $: It states the end of a Statement
• db (Define Byte): It acts as an Assembler Directive
• .code: Full Logical Program is written here

SCREENSHOT OF SOURCE CODE:


SCREENSHOT OF OUTPUT :

You might also like