You are on page 1of 5

Lab 1

Objective:

Student will be able to follow basic transfer instructions and show data after each line execution in
registers, flags and memory

Tools:

Using emu8086, that is an emulator for 8086 microprocessor which can the user to follow assembly
program step by step and observe changes that occur in registers, flags, memory, ALU … etc.

Program 1:

ORG 100H
MOV AL, 93H
MOV AH, 01001000B Objective:
MOV BL, ‘B’ - Recognize register of MP
MOV BH, -39 - understand and realize changers occur in registers
MOV CL, AL - follow program execution line by line
MOV DX, AX
RET

Program 2:
ORG 100H
MOV AL, ARR
Objective:
MOV BX, 300H
MOV [BX], AL - Recognize RAM and how to access specific address

MOV CL, ARR+2 - how data represented on it

MOV [BX +2], CL - recognize segment and offset and physical address

RET
ARR DB 45H, 87H, 65
Program 3:
ORG 100H
Objective:
MOV AL,45H
- Recognize Flags changing after arithmetic instruction executed
ADD AL,75H
- understand different between signed and unsigned
DAA
multiplication and division
MOV BL,54H
- treat error occur due to division
ADC BL,11H
; …………………….;
MOV AX,90
MOV BX,-290
IMUL BX
;…………………….:
MOV AX, 48F0H
MOV BL, 4
DIV BL
;……………………..;
MOV AX,-100
MOV BL, 12
IDIV BL
Program 4:
MOV AH, 2H
Objective:
MOV CX,5
- ability to display letters on screen
LEA BX, MSG
- understanding interrupt 21H functions
AGAIN:
MOV DL, [ BX ]
INT 21H
INC BX
LOOP AGAIN
RET
MSG DB ‘HELLO’

Program 5:
MOV AH, 1
MOV CX, 10
LEA BX, USER
AGAIN: Objective:

INT 21H - ability to read letters from key board

CMP AL, 0DH - understanding interrupt 21H functions

JE EXIT
MOV [ BX ] ,AL
INC BX
LOOP AGAIN
EXIT:
RET
USER DB 10 DUP (?)
Program 6:
MOV AH, 1
MOV CX, 10
LEA BX, USER
AGAIN1: Objective:

INT 21H - read 10 chars from user and store them in memory

CMP AL, 0DH - display ‘hello’ and user name

JE EXIT
MOV [ BX ] ,AL
INC BX
LOOP AGAIN1
EXIT:

MOV AH, 2H
MOV CX,5
LEA BX, MSG
AGAIN2:
MOV DL, [ BX ]
INT 21H
INC BX
LOOP AGAIN2

MOV DL,’ ‘
INT 21H

MOV CX,10
LEA BX, USER
A1:
MOV DL, [BX]
INT 21H
INC BX
LOOP A2
RET

MSG DB ‘HELLO’
USER DB 10 DUP (?)

You might also like