Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Upuc Assignment 1

Download as pdf or txt
Download as pdf or txt
You are on page 1of 14

PROGRAM No.

1
PROGRAM: Addion of tuo 8-6t numbegs.
Memory location Label Mnemonics Opcode
2000 MVI A, 05H 3E Commem
2001 05

2002 MVI 8,04H 06

2003 04

2004 ADD 8 80

2005 STA 200A 32


2006 OA(Ls8)
2004 20(wsa)
2008 HLT 76

RESULT: 09H

Sign. of Instructor
14
PROGRAM No. 2
PROGRAM : Addition 0+ tuo 16 bt numbesy
Memory location Label
Mnemonics 0PCOde. Comments
2000 LKI H,2050H 21
2001 50
2002 20
2003 LXIB, O102H
2004 02
2005 01

2006 LXID, 1210H 11


2007 10
12
2008
2009 MOV A,C 49
200A ADD E 83

2003 MOV M, A
200C MOV A, B
200D ADCD
200E INXH 23
200F MOV M,A
20 10 HLT 76

RESULT: 2060 2051


12. 13
Siga. of Instructor

15
PROGRAM No. 3
PROGRAM: Subtroction 0f two 8 6its Umbeus Comments
Mnemonics optode
Memory location Label
2000 MVI C, 00H
2001 21
(XI H,3000H
2002 00
2003 30
2004
2005
MOV A,M
23
INX H
2006 46
SUB M Jump On No
2007 D2
JNC L1 Cay
2008
2009 20
200A
INR Ci
2008
INX H 23
200C Li:
200 D MOV M,A
INX H; 23
200 E
200F
MOV M,C
2010 HLT

RESULT: oH 300 14 300 24


10 20
30
Sign. of Instructor

16
PROGRAM No, 4
PROGRAM Multiplication Ot 2- 8 bit numbey.
Memorylocation Label Mnemonics Comments

2000 LXI H, 3000H


MOV B, M 803 (Coont)
2003
INX H
2004
MOVD, M DeA1
2005
2006 MVI C,00H
MOV A,C A00
2008
L1 : ADD D 00+A1 (AJ
200 9
JNC L2
200A
200 D INR C
L2 : . DCR &
200 E
JNZ L1
200F
STA 3002 H'
2012
MOV A,C
2015
STA 3003H
2016
2019 HLT.

RESULT : 3000 30p! 3o02 3o0? Sign. ofInstructor

17
PROGRAM No. 5
Commnents
PROGRAM : numbe
de t0o & btMnemonics
Label
Memory location
WIH, 2050 H A=0B(divide,
2000
MOV A M
2003 B04Cdite
INX H
2004 MOV &,M C=00 (oNy
flo
2005 MVI C,0OH
2006 A Co mpar
li: CMP B' with B
2008
Jt L2 11-4 = 04
2009
SUB B
200 C INR C
200D
JMP.. L1 2ols2Q
200E
L2 INY H.
2011
MOV M,. C (20|52 R
20|2. INX H.
2013 MOV M,A
2014
HLT
2015

20S| 2os2 29s1


RESULT: 20SO
Sign. of Instructor
04 te
18
PROGRAM No, 6
PROGRAM : Pock an Unpacked BCD nymb.
Memory location Label Mnemonics Comments

LDA 3O00H
MOV B,A
LDA 3001H
RLC
RLC
RLC
RLC
ORA, B
STA 3002 H
HLT

RESULT:

Sign. of Instructor
19
PROGRAM No. 7
ten byteg from One locaton to anothe
Comments
PROGRAM : CopyLabel Mnemonics
Memory location LxI B, 2000H
LxI D, 3000 H
MVI L, OAH
Bock : LD AX B
STAX D
INX B
INX D
DCR L
JNZ BocK
HLT

RESULT: 2900
2001 2602 2003 2go4
9 Sign. of Instructor
Cort
Jo02
20
21
tructor Sign.
of
RESULT:
HLT
3002H STA
MOv!A,B
3001H STA
HA,MOV
3000H STA
LA,MOV
L2
JNZ,
DCRC L1:
INR,B
L1JNC
DE
HL+ HL DADD 12
03H C,HVI
f92GH 0, XI
0000H H,LXI
omments Label location Memory
urnten bit wth& Mnemonics
numbe Multiplcaton
bt4 16 0f PROGRAM
PROGRAM
8No.
PROGRAM No. 9
PROGRAM : Sep axode out nibble of 8 L9t numb
Comments
Memory location Label Mnemonics

HLDA FOSOH
MOV B, A
iANT OF H
STA FO52 H
MOV A, B
ANI FOH
RLC
RLC
RLC

STA FO51H
HLT

RESULT:

Sign. of Instructor
22
PROGRAM No. 10
PROGRAM : Additi on of 28bit num besu n BCD USing DAA.
Memory location Label Mnemonics Comments
XIH, 8000H
MOV A, M
INX H
ADD M
DAR
JNC L1
INR C
L1:INX H
MOV M,A
INX H
MOV M,C
HLT

RESULT: 4b+ Gl= Ol|2(&D)


Sign. of Instructor

23
PROGRAM No. 11
PROGRAM: XOR DATA Wth out usin XKH nstsucfong.
Memory location Label
Mnemonics
Commer
LXI H, 3000H
MOV B,M 8ç +¢'a
INX H
MOV C, M
CALL XOR GATE
INXH
MOV M,A
HLT
XURGATE MOV A,B !
CMA
ANA C
MOV. D, A
MOV'A,C
CHA
ANA 8
MOV E,A
MOv A,D
ADD E
RET

RESULT:
of

24
PROGRAM No, 12
PROGRAM: SubRoutlne houing multplitoion of 2 86l4 B numbeNs
Label
Memory location Mnemonics Comments
XI H,3000H
MOV B,M
INX H
CALL LL
INX H
MOV M, A
INX H
MOV M, ET
HLT.
Li: MVI-A,ODH
l3: ADD B
JNC L2
INR C
L2: DCR M
JNZ L3
RET,

RESULT:
Sign. of Instructor
25
PROGRAM No. 13

PROGRAM : HEX to sCII Mnemonics


Memory location Label
LXIH, 3000H
lxID, 3010H
MOV B,M
MOV A,M
ANI OFH
CALL L1
STAX D
Hov A,B
ANI, FOH
RLC
'RLC
RLC
RLC
CC L1
INX D
STAX D
HLT.
L1! CPI 0A H
JC L3
ADI 0? H
L8: ADI 30H
RET
RESULT:

Sign. ofInstruc
PROGRAM No. 14
PROGRAM Avanging n Alcend?ng Ovde
Memory location Label Mnenrbnics Comments
MVI B, 05 H
L3: LXIH,4000H
MVI C, 09 H
12: MOV E,M
I NK H
MOV A, M
CMP E
JNC L1
MOV M,E
DCX H
MOV M,A
INX H
L1: DCR C
JNZ L2
DCR B
JNX L3
HLT

RESULT:

Sign. of Instructor

27

You might also like