Lab 1 MP
Lab 1 MP
1.0 Assalamualaikum
Welcome to Intel x86 Assembly Language programing Lab. In this lab we will learn and practice
programming 8088 using Microtraininer. Quick introduction to BGC Micro trainer given below.
The basic idea is to write Assembly codes directly into memory.
As you could see, the system has no keyboard, big monitors and software, therefor, we use
Monitor Commands(short key) to instruct the Trainer, for example to start writing program, to
execute a program, etc. The monitor commands must be typed in a command prompt which is
displayed using * in the small display. Here is the list of some commonly used monitor
commands
G: Execute
R: Display / Modify the register content
T: Trace program execution
5. I/O Commands ( N , O )
1
Lab 1: Introduction to BGC 8088 And Microprocessor
6. Communication commands ( L, Z )
Assembly language is a hardware language and a low level language. This means, unlike in high
level language the programmer should have knowledge on the hardware details and their
limitation as well as the ‘mnemonics’ or the language. The programmer should understand the
MP’s registers, memory organization and limitation of the syntax. The group of instruction for
8088 is known as x86 instruction set, basically refers to set of supported instructions.
MOV is the opcode which means operation code, which is your syntax
While destination operand and source operand is ‘places’ of your data. The data can be given
directly , from a register and from a memory
X86 instructions can be categorized such as (1) artimetric and logical group (2) Data copy (3)
Branch instruction (4) loop instructions (5) Machine Control (6) Flag instruction (7) Shift and
Rotate (8) String Instruction (9) IO instructions
Many believe studying and programming in Assembly is difficult and hard, but believe me, it is not
!!
MOV , means copying data from source operand to destination operand , example MOV AX,
1234(h) means we are writing 1234(h) to register AX
5.1 Lets write a program to add 12(h) with 36(h) using 8 bit register
MOV AL, 12
MOV BL,36
ADD AL,BL
2
Lab 1: Introduction to BGC 8088 And Microprocessor
Your result will be stored in register AX. Confirm your programe is correct by validating content in
AX
5.2 Exercise :
(1) Repeat the program with 16 bit registers , use 16 bit numbers such as 1234(h) with
4321(h) ( change AL to AX and BL to BX )
(2) Do addition for 5678(h)+F001(h) , ( Note your result will be stored in AX ad DX)
(3) Note the changes in the offset address
A multiplication syntax in x86 is unique as it is a single operand instruction. It accepts only source
operand . Example MUL BX, MUL BL, MUL CX .
Do the following
(1) 2(h)*3(h)
(2) 34(h)*56(h)
(3) 1234(h)*2(h)
(4) 1234*67(h)
Note : register AH/ DX will used to accommodate bigger results, means if your 8 bit multiplication
Summary
After finishing all the steps above, one should have basic knowledge on writing and executing an
assembly language program with BGC 8088. More monitor commands will be explored in coming
labs together with more Intel’s Instruction Set for 8088.
Following questions is to be answered in a separate paper ( hand written only) . Please submit
this manual in 1 ( one ) week from date of practical section. Late reports will carry –2 marks .
Extremely late reports ( i.e. reports submitted after lab manual is returned to class ) will not
graded.
3
Lab 1: Introduction to BGC 8088 And Microprocessor
Questions
Clock Rate:
RAM:
ROM:
Memory:
Interrupt Signals