CSA Practical File
CSA Practical File
DELHI UNIVERSITY
DEPARTMENT OF COMPUTER SCIENCE
INDEX
S NO. OBJECTIVE
DATE SIGN.
1. Write an assembly language program to simulate
the following 23\02\2021
Logical operations on two user entered
numbers: OR, NOT,
XOR, NOR, NAND.
2. Write an assembly program for simulating
following memory- 25\02\2021
Reference instructions: ADD, LDA, STA, BUN, ISZ.
3. Write an assembly language program to simulate
the machine 18\02\2021
For following register reference instructions and
determine the
Contents of AC, E, PC, AR and IR registers in
decimal after the
Execution: CLA, CMA, CME, HLT.
4. Write an assembly language program to simulate
the machine 18\02\2021
For following register reference instructions and
determine the
Contents of AC, E, PC, AR and IR registers in
decimal after the
Execution: INC, SPA, SNA, SZE.
5. Write an assembly language program to simulate
the machine 18\02\2021
For following register reference instructions and
determine the
Contents of AC, E, PC, AR and IR registers in
decimal after the
Execution: CIR, CIL.
5. WRITE AN ASSEMBLY PROGRAM TO SIMULATE THE
FOLLOWING LOGICAL OPERATION ON TWO – USER
ENTERED NUMBERS.
.OR
.NOT
.XOR
.NOR
.NAND
OR:
;this program adds two numbers
LDA a ;load a to ac
write ;write
hlt
a: .data 2 0
b: .data 2 0
OUTPUT:
NOT:
;this program adds two numbers
start: read ;read->ac
LDA a ;load a to ac
write ;write
hlt
a: .data 2 0
b: .data 2 0
OUTPUT:
XOR:
;this program add two number
start: read;read->ac
STA a;store a in ac
read ;readb->ac
STA b
LDA a ;load a to ac
hlt
a: .data 2 0
b: .data 2 0
OUTPUT:
NOR:
;this program add two number
STA a ;store a in ac
read ;readb->ac
STA b
LDA a ;load a to ac
write ;write
hlt
a: .data 2 0
b: .data 2 0
OUTPUT:
NAND:
;this program add two number
STA a ;store a in ac
read ;readb->ac
STA b
LDA a ;load a to ac
write ;write
hlt
a: .data 2 0
b: .data 2 0
OUTPUT:
b: .data 2 0
a: .data 2 0
b: .data 2 0
OUTPUT:
STA a ;store a in ac
LDA a ;load a to ac
write ;write
hlt
a: .data 2 0
OUTPUT:
Enter an integer 5
Output 5
BUN:
;this program branch unconditionally number
STA a ;store a in ac
LDA a ;load a to ac
BUN 5
XOR a
write ;write
hlt
a: .data 2 0
OUTPUT:
Enter an integer 5
Output 5
ISZ:
;this program increment and skip number
STA a ;store a in ac
LDA a ;load a to ac
inc ;increment ac
write ;write
hlt
a: .data 2 0
b: .data 2 0
OUTPUT:
Enter an integer -1
Output 0
LDA a ;load a to ac
cla ;clear ac to 0
write ;write
cma ;complement ac
write
OUTPUT:
Enter an integer 2
Output 0
Output -1
Hlt
9. WRITE AN ASSEMBLY LANGUAGE PROGRAM TO
SIMULATE THE MACHINE FOR THE FOLLOWING
REGISTER REFERENCE INSTRUCTIONS AND DETERMINE
THE CONTENTS IF AC, E, PC, AR, AND IR REGISTER IN
DECIMAL AFTER THE EXECUTION.
.INC
.SPA
.SNA
.SZE
;this program increment ac
Start: read
STA a ;store a to ac
LDA a ;load a to ac
inc ;increment ac
write ;output
write ;output
hlt
a: .data 2 0
10. WRITE AN ASSEMBLY LANGUAGE PROGRAM TO
SIMULATE THE MACHINE FOR THE FOLLOWING
REGISTER REFERENCE INSTRUCTIONS AND DETERMINE
THE CONTENTS OF AC, AR, PC, E, AND IR REGISTER IN
DECIMAL AFTER EXECUTION.
.CIR
.CIL
;this program circulate left
Start: read
STA a ;store a to ac
LDA a ;load a to ac
hlt ;stop
a: .data 2 0
THANK YOU!