Lab Manual Coal
Lab Manual Coal
Submitted to:
Mam Nashitah Alwaz
Submitted by:
Dua Fatima
Section:
A
Roll No:
2023-CS-33
Characteristics:
Key features:
Advantages:
Disadvantages:
Uses:
1. Operating systems
2. Embedded systems
3. Firmware
4. Device drivers
5. High-performance applications
6. Reverse engineering
Example code:
assembly
LABEL:
DosBox
DOSBox is a free, open-source emulator that mimics MS-DOS, allowing users to run retro games and
applications on modern operating systems. It simulates the DOS environment, emulating hardware
components and translating input. Compatible with Windows, macOS, and Linux.
Installation of DosBox
The installation of dosbox has involving folowing steps.
Then press Enter or Return. It will display the message "Drive C is mounted as local directory
c:\dos\." After that, type c: and hit Enter to enter the c:\dos directory.
mount c c:\dos
c:
dir
The above lines will automagically mount your dos folder as C:\ and take you directly into
the folder. Then it will show you your list of directories so you can just cd one and play your
game!
Emulator
An emulator is software or hardware that mimics a computer system, processor, or environment,
allowing programs to run on a host system as if on the original. Emulators ensure compatibility,
facilitate development, and preserve legacy systems. They translate instructions, simulate hardware,
and optimize performance.
Installation of Emulator
Step 1: Download
Click it and you will get a Website.
Click "Download for PC" button. This opens a new tab and the downloading starts.Observe that the
Step 3:Steup
Click on the small arrow, open the folder. A folder will be pop up.Double click at "Setup". It will ask
for the permission. Allow it by clicking "yes".
The Window will appear that will start the setup process.
Click "Next" to continue the process.
Now, You have to give the path for the folder .By default the path is given for the C directory but you
The Emu8086 icon will appear on your desktop. You can use it whenever you want.
Register
When we learn about register a big question arises in our mind that what are register.so here we will
discuss about short intro.
These are small, high-speed memory locations within the Central Processing Unit (CPU) that store
data temporarily while it is being processed.
Characteristics:
Types of Registers:
1. General-Purpose Registers (GPRs): Used for arithmetic, logical, and data transfer operations.
2. Index Registers: Used for array indexing and addressing.
3. Stack Registers: Used for stack operations (push, pop).
4. Pointer Registers: Used for memory addressing.
5. Flag Registers: Store status flags (e.g., carry, overflow).
6. Instruction Registers: Hold the current instruction.
7. Program Counter (PC): Stores the address of the next instruction.
Examples:
x86 Architecture:
1. EAX (Accumulator)
2. EBX (Base Index)
3. ECX (Counter)
4. EDX (Data)
5. ESI (Source Index)
6. EDI (Destination Index)
7. ESP (Stack Pointer)
8. EBP (Base Pointer)
ARM Architecture:
In summary, registers are essential components of CPU architecture, providing fast and efficient data
storage and manipulation for assembly language programming.
Lab Session 01
Print a chracter
.model small
.stack 100h
.data
.code
main proc
mov dl,'w'
mov ah,2
INT 21h
mov dl,'a'
mov ah,2
INT 21h
mov dl,'s'
mov ah,2
INT 21h
mov dl,'e'
mov ah,2
INT 21h
mov dl,'e'
mov ah,2
INT 21h
mov dl,'m'
mov ah,2
INT 21h
main endp
end main
Lab Session 02
.model small
.stack 100h
.data
.code
main proc
mov Ax, 2h
mov Bx, 3h
ADD Ax , Bx
mov Dx,Ax
mov Ah,0Eh
INT 0x10
main endp
end main
.data
.code
main proc
Mov AX, 2h
ADD Ax, 3h
Mov ah, 3h
MOV DL, AL
INT 0x10
main endp
end main
Increament(INC)
.model small
.stack 100h
.data
.code
main proc
mov ax, 3h
ADD Ax, 5h
INC Ax
mov dl,al
INT 0x10
main endp
end main
Decreament(DEC)
.model small
.stack 100h
.data
.code
main proc
mov AX,3h
DEC Ax
mov dl,al
INT 0x10
main endp
end main
Multiplication
.model small
.stack 100h
.data
.code
main proc
Mov Ax, 4h
Mov Bx,2h
MUL Bx
mov dl,al
INT 0x10
main endp
end main
Division
.model small
.stack 100h
.data
.code
main proc
Mov Ax, 4h
Mov Bx,2h
DIV Bx
mov dl,al
INT 0x10
main endp
end main