Open navigation menu
Close suggestions
Search
Search
en
Change Language
Upload
Sign in
Sign in
Download free for days
0 ratings
0% found this document useful (0 votes)
28 views
8 pages
Adobe Scan Sep 27, 2022
Adscan
Uploaded by
karthikbgmi143
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as PDF or read online on Scribd
Download
Save
Save Adobe Scan Sep 27, 2022 For Later
Share
0%
0% found this document useful, undefined
0%
, undefined
Print
Embed
Report
0 ratings
0% found this document useful (0 votes)
28 views
8 pages
Adobe Scan Sep 27, 2022
Adscan
Uploaded by
karthikbgmi143
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as PDF or read online on Scribd
Carousel Previous
Carousel Next
Download
Save
Save Adobe Scan Sep 27, 2022 For Later
Share
0%
0% found this document useful, undefined
0%
, undefined
Print
Embed
Report
Download
Save Adobe Scan Sep 27, 2022 For Later
You are on page 1
/ 8
Search
Fullscreen
CHAPTER 5 PROGRAMMING EXERCISES INTRODUCTION The exercises discussed in thi apte! microprocessor trainer kit and ase Barina who developed and tested these Programs has the user RAM sa uees the programs. The readers have to refer the operation manual oF thei trainer kits for the user RAM area an : locations. d load the programs at suitable 5.1 EIGHT BIT ADDITION Problem Statement Add the two hexadecimal numbers stored at the consecutive memory locations 2000H and 2001H and leave the result at the next location 2002H. Memory Initialisation Through the kit’s memory access commands load the desired numbers at 2000H and 2001H. Program Listing Mnemonics Comments LXI H,2000 Load HL register with the address of the first 3002 20 number 3003 TE MOV A, M_— Bring data into A reg 3004 23 INX H Point to next location 3005 86 ADD M Add the two numbers 3006 3 INX H Point to next location 77 MOV MA Transfer the result into 3007 71 memory location Stop execution HLTx , s Microprocessor and tts applications x Mi x esult after exe i ie program Result after executing the progra the content of the location 2002 for the sult. Cheek the ec 2 HIGHT BIT SUBTRACTION Problem Statement Subuast the hesadeetmal number stored at 2001 E from the conte, SQOOEL and Teave the result at 20021, tent Memory Initialisation S at 2000H ang 2001 memory access commands, H through th Program Listing Opcode Label Mnemonics Bring data Into A reg ‘oint to next location Subtract the 2nd numbe Point to next location Transfer the Tesult into memory location Stop execution After €xecuting the program, check the content of the location 2002H for the result. 5.3 MULTI- BYTE ADDITION Problem Statement Add 2 multibyte numbers The location of bytes) of the number. The first data is stored Starting from 2001H and the second data is stored Starting from 2010H. Store the result Starting from the location 2001H Replace the first number with the result) 2000H stores the size (numberP 19 Programminf pcre memory Initialisation [et us assume that the ne two hex numbers ro be added TAGASE and 42305 size in bytes 0 stored Fhe muunber ny dovlach ay stored in toca mie res sicanoredd in focatie! HH, GA an 200211 and 74 200s {and 42 in So the phe date SE The data C53 stored in location 2010H, 23 10 211k , 231 012H Flow Chart s (HL & DE register PUr? * | e count = Bytx0 Microprocessor and its applications Program Listing Memory Locaton LXI_ H,2000 Load HL regaster with 00 address 2000 3007 20 3008 46 MOV B.M Set byte counter 3009 23 INX H Point first byte of datat 300A 1 LXI.D2010 Load DE regsster with 300B 10 address of 2nd data 300C 20 300D AT ANA A Clear the CY flag. 300E. 1A TOP LDAX D Load Ace with a byte dats) 3008 8E ADC M Add 1 byte of data2 with | cy 3010 7 MOV M, A Transfer the result soll 13 INX D Point to next data byte 3012 3 INX H | 3013 5 DCR B Decrement byte counter wa 2 NZ TOP It the Byte count | 3015 t ts not equal to zero 316 3 repeat addition | MVI A, 00 make Accumulator = 0 | | | wie MW RAR carry 1s brought to bit T MOV M.A transfer to memory HL stop execution IB Result OOLH onwards for the result It N_ bytes Check the contents of location 2 each of the number added had N. bytes, the result would be NAL bytes long Note: ‘The above program adds the two numbers in Hexadecimal § Foe addition in decimal mode, insert DAA instruction at the locat 3010 with op code as 27 too the program, so thar the result as stored: from: the mer » 20101 Lonwardsaa Mrogramming Leercive WI FA giock TRANSFER OF DATA problem Statement block of data ts available starting from 20031 Gource tock, Tr that it 15 stored starting from 205011 (aestinanon block block s of data) 1s stored in 200241 er of bytes if the block (Siz the umb Jow Chart B Grart ) v Set HL register pair to Source block address Set DE register pair to Destination block address Set byte counter with C reg il Load Acc. with a byte from Source block |< | Store Acc. content into Destination block Increment the address pointers (HL & DE) | y YX
> No- f Yeu GDcations rand 1S applica rys0! tigation cy Initialisatto ory Mem! of specified bytes starting on 2003H onwards. Load the data ber of bytes in location 2002. Load the numbe ram Listing Prog! » Opcode Label = Mnemonics Comments Memory Location 3003 02 address of the size 3004 20 of data 3005 ul LXID, 2050 Load DE register with 3006 50 Destination address 3007 20 | ae * Nee M Set byte counter | 300A TE STAR fon A Pornt t0 source block | 300B 12 STAX 8 M Bring first data to Acc 300C % ANE - Transfer to destination 300D B INK 5 Point to next location | 300E ob DCR c Point to next location | 300F C2 NG ea , Dectement byte counte 3010 OA JNZ STAR Ig byte counter not 0 30114 30 Tepeat transfer. 3 012 76 ALT Stop execution Note Remember that After execution of the program, check th block Starting from 205¢ © content of the Destination JH. Find wi hether itis a Copy of the Source block. 55 PROGRAM To COUNT A “GIVEN VALUE” IN A SET OF DATA Problem Statement Check a block of data and count how many times a given value occu in the data block (How many times the given value is found in the data) T Ls size of data to be checked is stored in 204FH. The data is stored startin? from 2050H. The result (number of occurances) is to be placed in 20751Flow Chart Vv Initialise the HL regis ‘Bister with DATA block start address ‘| Vv set byte counter] Set number of times counter to (i) ' Load Accumulator with the VALUE to be checked / Vv Compare Acc. = Data byte No Yes Vv Increment number of times counter v > Increment data pointer HL Vv Store 7 | | | | J84 Microprocessor and its applications Memory Initialisation Store the number of bytes in the data starting from the next location 2050H at 204FH and the data block Program Listing P| $ Comments Memory Opcode Label —§ Mnemonics Cc Location 5 nM LXI H, 204F Load HL register with 3002 ~ address of size of data 3003 4F 3004 20 Sate 46 MOV B, M Set byte counter S00 f= MVI C, 00 Set number of times a _ 00 counter to zero ith VALUE t 3008 3E MVI A, XX _ Load few 3009 xx be chec! 300A 23 INX H Point to ie memory 3008 BE TOP CMPM Check data=GIVEN VALUE C2 JNZ STAR Go to STAR if they do 10 not match 30 oc INR C Increment counter 23 STAR INXH Point to next byte data 05 DCR B Decrement byte counte: C2 JNZ TOP Go to TOP if. byte counter 3013 OB is not equal to Zero 3014 30 . | 3015, 79 MOV A,C Copy C reg to A reg, | 3016 32 STA 2075 Store the A register 3017 75 content to specified 3018 20 memory location. 3019 16 HLT Stop execution Note: Remember that before ex ‘ecuuing, the program data has to be loaded from the memory location 205( JH onwards, and store the number of Replace data to be checked at 204PH XN at address 3009 ith desired value to be checked Result
You might also like
MPMC Lab
PDF
No ratings yet
MPMC Lab
62 pages
CS 2 Journal
PDF
No ratings yet
CS 2 Journal
25 pages
Microprocessor 8085 Journal
PDF
No ratings yet
Microprocessor 8085 Journal
27 pages
MPMC Nishant
PDF
No ratings yet
MPMC Nishant
59 pages
8085 Programs
PDF
No ratings yet
8085 Programs
23 pages
Micro Controller Programs
PDF
No ratings yet
Micro Controller Programs
63 pages
8085 MICROPROCESSOR 2078-HSMallik
PDF
No ratings yet
8085 MICROPROCESSOR 2078-HSMallik
96 pages
4CS3 MPI Unit 3
PDF
No ratings yet
4CS3 MPI Unit 3
79 pages
cs-2 Chapter 2
PDF
No ratings yet
cs-2 Chapter 2
31 pages
Microprocessor Alp (Repaired)
PDF
No ratings yet
Microprocessor Alp (Repaired)
55 pages
Cs 2 Practicals
PDF
No ratings yet
Cs 2 Practicals
61 pages
8085 Program List With Explanation
PDF
No ratings yet
8085 Program List With Explanation
11 pages
All Cs 2 Programs
PDF
No ratings yet
All Cs 2 Programs
31 pages
CAM - M3 - Ktunotes - in
PDF
No ratings yet
CAM - M3 - Ktunotes - in
49 pages
8085 Assembly Language Programs
PDF
No ratings yet
8085 Assembly Language Programs
9 pages
Programming of 8085 Processor Unit Ii: Mr. S. Vinod Assistant Professor Eee Department
PDF
No ratings yet
Programming of 8085 Processor Unit Ii: Mr. S. Vinod Assistant Professor Eee Department
72 pages
Microprocessor Architecture
PDF
No ratings yet
Microprocessor Architecture
64 pages
CAM Module 3 Notes
PDF
No ratings yet
CAM Module 3 Notes
30 pages
MPMC Lab Student Manual
PDF
No ratings yet
MPMC Lab Student Manual
118 pages
Microprocessor Assignment Final
PDF
No ratings yet
Microprocessor Assignment Final
96 pages
Document 3
PDF
No ratings yet
Document 3
26 pages
Paper-Ii Practical
PDF
No ratings yet
Paper-Ii Practical
13 pages
Microprocessor Lab File
PDF
No ratings yet
Microprocessor Lab File
15 pages
Codes and Machine Language
PDF
No ratings yet
Codes and Machine Language
20 pages
Lecture Topic 1.3.4
PDF
No ratings yet
Lecture Topic 1.3.4
20 pages
Microprocessor Assignment3
PDF
No ratings yet
Microprocessor Assignment3
27 pages
CS2 Practical Session 1
PDF
No ratings yet
CS2 Practical Session 1
12 pages
8089 Programming HSC 2025
PDF
No ratings yet
8089 Programming HSC 2025
19 pages
Microprocessor Lab Report
PDF
No ratings yet
Microprocessor Lab Report
39 pages
MPMC Assignment - Madhumitha
PDF
No ratings yet
MPMC Assignment - Madhumitha
14 pages
Add Arry - 16bit
PDF
No ratings yet
Add Arry - 16bit
2 pages
Experiment-1 DATE: - : HLT Program Entry Memory Location Instruction Hex Code Comment
PDF
No ratings yet
Experiment-1 DATE: - : HLT Program Entry Memory Location Instruction Hex Code Comment
18 pages
CS2 Practical
PDF
No ratings yet
CS2 Practical
30 pages
Microcontroller Lab Manual
PDF
No ratings yet
Microcontroller Lab Manual
35 pages
8086 Programing
PDF
50% (2)
8086 Programing
29 pages
CS II Practical Imp Program
PDF
No ratings yet
CS II Practical Imp Program
7 pages
Log Book Finished
PDF
No ratings yet
Log Book Finished
10 pages
CS Ii PDF
PDF
No ratings yet
CS Ii PDF
7 pages
MALP Lab Manual
PDF
No ratings yet
MALP Lab Manual
22 pages
Micro-Controller Labortary (Eelr-16) : Experiment No: 1 Roll No: 107119038 Group No: 2 Name: Devisree J Date: 14.02.2022
PDF
No ratings yet
Micro-Controller Labortary (Eelr-16) : Experiment No: 1 Roll No: 107119038 Group No: 2 Name: Devisree J Date: 14.02.2022
7 pages
Microprocessor Assignment
PDF
No ratings yet
Microprocessor Assignment
35 pages
8085 ALP For LAB
PDF
No ratings yet
8085 ALP For LAB
22 pages
Unit-4 Notes
PDF
No ratings yet
Unit-4 Notes
13 pages
Experiments On 8085 Microprocessor
PDF
100% (1)
Experiments On 8085 Microprocessor
18 pages
MICROPROCESSOR PROGRAM-FINAL - Doc-2
PDF
No ratings yet
MICROPROCESSOR PROGRAM-FINAL - Doc-2
25 pages
Search A Byte in A Given Number
PDF
No ratings yet
Search A Byte in A Given Number
4 pages
Index
PDF
No ratings yet
Index
2 pages
Lab Manual Microprocessor and Microcontrollers: Nehru College of Engineering and Research Centre, Pampady
PDF
No ratings yet
Lab Manual Microprocessor and Microcontrollers: Nehru College of Engineering and Research Centre, Pampady
34 pages
Log Book
PDF
No ratings yet
Log Book
8 pages
Manish Document
PDF
No ratings yet
Manish Document
16 pages
Statement:: Write An ALP Using 8085 To Evaluate The Expression C A +B
PDF
No ratings yet
Statement:: Write An ALP Using 8085 To Evaluate The Expression C A +B
17 pages
Micprocesor Nondoz
PDF
No ratings yet
Micprocesor Nondoz
41 pages
MI Practical Assignment Index
PDF
No ratings yet
MI Practical Assignment Index
3 pages
MPECC08 Practical File
PDF
No ratings yet
MPECC08 Practical File
13 pages
MPMC Lab-2
PDF
No ratings yet
MPMC Lab-2
10 pages
Programming of 8085 PPT 1
PDF
No ratings yet
Programming of 8085 PPT 1
17 pages
Microprocessor All Experiment IT PDF
PDF
No ratings yet
Microprocessor All Experiment IT PDF
22 pages
Microprocessor and Interfacing
PDF
No ratings yet
Microprocessor and Interfacing
25 pages