Assignment 2
Assignment 2
MODULE : CUIT401
org 100h
.data
a dw 0071H
b dw 0002H
c dw ?
.code
mov AX,a
mov BX,b
cmp AX,BX
JLE label1
jmp end
label1;
mov c,1
mov DX,c
end:
ret
Question 2
Org 100h
.code
mov BL, CL
INC SI
[ ]:
ADD AH, 00
INC SI
DEC SL
JNZ 40E
DIV BL
MOV [DI], AX
HLT:
ret
QUESTION 3
ORG 100
.DATA
A EQU 56H
B EQU 34H
C EQU 14H
D EQU 12H
.CODE
MOV AL,A
PUSH SI
MOV AL,C
PUSH SI
POP SI
RET
Question 4
A processor like 8086 but has 8 bit registers and a physical address is 10bit
a) ASSUME:
It is used to tell the processor that the name of the logical segment should be used for a
specific segment
for example: ASSUME DS: DATA tells the assembler that for any program instruction
which refer to the data segment it should use the logical segment called DATA.
b) EQU:
It used to give name to some values or symbol each time the assembler finds the given
names in the program it replaces it with the value of the symbol.
For example: FACTOR EQU 03H equates factor to 03h which can be used as ADD
AL,FACTOR
c) DW
it is used to declare word that is 16 bits long
for example: num1 DW 1234H
d) DD
It is used to declare double value that is a 32 bit storage allocation
For example, when we want to declare a string of names we say: name DD 12345678H
e) .DATA
The .data assembler directive tells the assembler to start assembling the line after the
directive into the .DATA section of the computer program. It contains permanent constants
and variables used in the computer program. For example:
.data
Num1 dw 1234h
Num2 dw 1002h
QUESTION 6 I/O strategics
a) Polled I/O
It is also referred to as programmed I/O, this data transfer technique means a data transfer between
I/O devices and memory or an I/O device and the processor. If computer system I/O operations
are completely controlled by the processor, then that system is said to be using Polled I/O.
In this technique, the processor executes its main program and only stop service peripheral devices
when it is told to do so by the device it self. It provides the external asynchronous input that informs
the processor that it completes whatever instruction that is currently being executed and fetch new
routine that will service the requesting device.
c) DMA
It is known as the direct memory access, this circuit provides direct access to the memory without
using the central processing unit. The DMA can provide high speed transfer to data from one part
of the memory to another. It can also pass data direct to and from the memory. This provides
significant improvement in operating speed of the whole system. (Godse & D .A, 2007).