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)
395 views
Computer Architecture Lab Programs
CA lab programs complete sep syllabus
Uploaded by
swethashetty537
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 now
Download
Save Computer Architecture Lab Programs For Later
Download
Save
Save Computer Architecture Lab Programs For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
0 ratings
0% found this document useful (0 votes)
395 views
Computer Architecture Lab Programs
CA lab programs complete sep syllabus
Uploaded by
swethashetty537
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 now
Download
Save Computer Architecture Lab Programs For Later
Carousel Previous
Carousel Next
Download
Save
Save Computer Architecture Lab Programs For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
Download now
Download
You are on page 1
/ 33
Search
Fullscreen
PN eT ERD aH TN ay 1. Write an 8085 Program to Swap two 8-bit Numbers, 2, @. Write a Program to Find the Largest of Two Numbers b. Write an BOBS Program to Find the Smallest of Two Numbe . Write on 8085 Program to find whether an 8-bit number is positi display EE, if negative display FF, if zero display DD, i. Write on 8085 Program to check wheth 'er 4th bit of @ number Is zero of one. If 4th bit FF, if 4th bit is O display DD. is 1 display + Write an 8085 Program to Calculate the Sum of First Ten Notural Numbers: - Write an Assembly Lon guage Program in BOBS Microprocessor to Find the Sum of Digits of Number. ‘an 8-bit 7. Write an 8085 Program to Find the Reverse of an B-bit Number 8. Write on 8085 Program to Check Whether 1 -byte Number is a Palindrome or Not. If itso Palindrome display FF otherwise display DD. 9. Write an 8085 Program to Check whether a Number is ODD or EVEN, {f it is Even then Display 00, if Isis Odd, then Display FF. 10. Write on 8085 Program to Count a Number of Ones in the given B-bit Number. Me Write an 8085 Program to Find Acldition & Subtraction of two 8 bit HEX Numbers. 12. Write on 8085 Program to Find Addition of two 16 13. 14. 15. 16. 7. 18. 19. 20. bit Numbers, Write an 8085 Program to find Subtraction of two 16-bit numbers. Write on 8085 Program for Swapping of wo 16-bit Numbers. ‘Write on 8085 Program to Implement 2 out of 5 codes Write on 8085 Program to Generate Fibonacc! Series Write en 8085 Program to Find the Firs Ten Terms of Odd andl Even Numbers. Write an 8085 Program to Find 4-Digit BCD Addition. Write an 8085 Program to Find Multiplication of 2-digit BCD Numbers. Write an 8085 Program to Find Division of two B-bit Numbers.CD comurer arcinecure OTE Write an 8085 Program to Swap two &-bit Numbers, Algorithm: 1, Load the value from memory location 2500H into Accumulator A, Store the value of Accumulator A into register B. Load the value from memory location 2501H into Accumulator A, Store the value of Accumulator A into memory location 2500H. Move the value from register B to Accumulator A. eure Store the value of Accumulator A into memory location 2501H, Halt the Program, Mnemonic Code with Hex Code and Explanation z ES in Explanation 3A 0025 si Load the value from memory location 2500H into the Accumulator A | a7 Move the value from Accumulator A to Register B to store 3A0125 it temporarily Load the value from memory location 2501H into Accumulator A. 32.00 25 | Stor the value from Accumulator A into memory location 25001, effectively swapping the values, a Nove the value from Register B Accumulator’A, (original value of memory 2500H) back to} 320125 | Store the value from Accumulator A i ‘number location). into memory location 2501H (the second 76 Halt the execution of the program, * Iusing GNU Sim 8085, type the mnemonics cod i 00 need to manually enter hi ics code directly in the code editor, as there i ex codes, During the assemb! tically converts the mnemonics DB ly process, the simulator autom: into corresponding hex codes, + fusing a Physical Mi icroprocessor Kit, the hi ually in specie Tieeatanae t, the hex codes need to be entered mani ich as storing 3A at 10001 00 at 10014, 25 at 1002H, 47 9" 1003H, and so on. After entering the hex co yenst tease cati fr locations ‘such as 2500H and 2501 Cok les, load the input data into memory loc Counter (PC) to start hold the value: the Prog Fonneae sto be swapped). Then, update location 1000H to execute the program.on Appendix C Lab Programs « GD In.GNU Sim 8085, data is entered in decimal format, and the corre: isshown in brackets. For example, 58 in decimal is equivale Indecimal is equivalent to 52H, + Input: The memory location 2500H contains the value 58 (which is 3AH in he r : 53 exadecima and memory location 2501H contains the value 82 (which is 52H in hexadeci i) ao + Output: After executing the program, the values are swapped. Memory location 2500H now contains 82 (92H in hexadecimal), and memory location 2501H containe 58 (3AH in hexadecimal). sponding hexadecimal NU to 3AH in hexadecimal, and 82 Write a Program to Find the Largest of Iwo Numbers 1, Load the first number from memory location 2500H into Accumulator A. 2 Move the value from Accumulator A into register B for temporary storage 3, Load the second number from memory location 2501H into Accumulator A 4, Compare the value in Accumulator A with the value in register 8. 5 Ifthe value in Accumulator A is greater than or equal to the value in register B, jump to hext step. Otherwise, move the value from register B back to Accumulator A. 6. Store the largest value from Accumulator A into memory location 2502H, 7. Halt the program. Mnemonic Code with Hex Code and Explanation ! Explanation |_c 3A.00 25 AT 340125 | Load the second number from memory location [ Compare the value in Accumulator A with the value in register B IEA Gs Load the first number from memory location 2500H into Accumul Move the value in Accumulator A to register B for 01H {nto Accum Compare the value in Ac greater or equal, the Carry Flag is not set (6 | IAccumulator Ais greater than or equal to the value In register 8 (CY 0 Jump to the label NEXT, as A already contains the largest value from register B back into Hf Accumulator A (s smaller (CY = 1), toad the value). (OF Ainto memory location BON |Ls Ceampumee Arehiteatore © Input: Memory locations 2500H and 25011 contain 58 and 82 respectively * Output: The largest value (82) is stored in memory location 250211 Note : [NCNEXT' stands for "Jump if No Carry to F ndieg ‘Accumulator A is greater than or equal to the value in register B. The program jumps tq ‘and skips loading a new value, If the Carry Flag is set (CY = 1), it means Accumulator 4 {s smaller so no jump occurs, and the value from register B (the larger value) is loaded ineq Accumulator A. Ifthe Carry Flagis not set (cy 255 (FFH): Indicates the input value(128) was negative. Or negative, the corresponding results are stored at memory Note: * In8-bit signed representation, numbers range from -128 to +127. ~ Positive values: Range from 0 to 127. ~ Negative values: Range from -128 to -1, * The number 128 becomes negative when Tepresented as an 8-bit value because the most ‘significant bit (MSB) acts as a sign bit: ~ Ifthe MSB is 0, the value is positive or zero, ~ Ifthe MSBis 4, the value is negative. + Inthis » 134 (86H) has its MSB set to 1, j representa _ , indicating that it is a negative value in &-bit ‘Write an 8085 Program to Chee bit is 1 display FF, if ath bit is 1. Load the 8-bit number from memory location 2500H into Accumulator A. ‘With the Value OBH to isolate the 4th bit, ins the 4th bitis 0, Jump to ZERO and store DDH in memory location ‘k whether 4th bit ofa Number is Zero or One. If th 0 display DD,Appendix € : Leb Progrems -_CE7) [memonic Gode with Hex Code and Explanation a | Hex er [ MmemonteCode | cote Explanation T | | px2500H lscaage | Load the number from memory location 2500H into Accumulator | a eaee!| Sn a ae ee | Pra | Perform AND operation with 08H to isolate the Ath bit of the | _ | number. [)22ERO __|carzoo | ifthe MVLA.OFFH [28 FF [Move the value OFFH (indicati inte Accumulator A. | JMP STORE | €3 16.00 | Jump to STOR a 1 | ZERO: MVI A, DDH al STORE: STA 25014 [Her Iuput & Outputs Input = Output | Address | Data | Address | Data 2500H 6 (06H) | | 25011 [an (oon) | 2500H soon) lk cH + Input: Memory location 2500H contains values: ~ 6 (06H): The binary value of 6 is 0000 0110and hence the 4th bitis 0 = 9 (09H): The binary value of 9 is 0000 1001 and hence the 4th bit is 1. * Output: Memory location 2501H stores the result: - 221 (DDH); Indicates that the 4th bit of the input value (6) is 0, (a ~ 255 (FFH): Indicates that the 4th bit of the input value (9) is 1. (8086 Program to Calet Algorithm: 1. Initialize Register C with OAH (decimal 10), which represents the count of numbers to be added. 2, Initialize Register A with 00H (decimal 0) to store the running sum, 3. Initialize Register D with 01H (decimal 1) to keep track of the current number. ‘4, Add the current number (from Register D) to Accumulator A, 5. Increment the current number (Register D) by 1, 6, Decrement the counter (Register C) by 1. 7, if Register Cis not zero, repeat the process of adding the next number. a “Gin Accumulator A) Into memory location 250014,CE Comer rcrinecre ‘Mnemonic Code with Hex Code and Explanation —, 1 Hex Explanation | code MVIC, OAH OE 0A Load OAH (count of 10) into Register C. MVIA,0OH |3E00 | Load 00H into Accumulator A to initialize the sum to 0, - ___ | MVID,O1H |1601 | Load 01H into Register D to start from the first natural number (1), 4 LOOP: ADD D | 82 Add the value in Register D to Accumulator A. INRD 14 Increment the value in Register D (next number) DERE oD Decrement the value in Register C by 1 =} JNZLOOP €2.06.00 If Register C is not zero, jump to LOOP to continue adding, STA2SO0H | 32.0025 HUT 76 1, Initialization: Store the final sum from Accumulator A into memory location 2500H Halt the program execution. El + Register C (OAH) keeps track ofhow many numbers are left to add (initially 10) Setto 1O(OAH in hexadecimal), indicating that there are 10 numbers to add (from 1 to 10), * Accumulator A (OOH) starts with the value 0 to hold the running sum, Set to 0 (00H),s0 that the sum starts from zero. All subsequent numbers will be added to Accumulator A, * Register D (01H) holds the current natural number to be added, Set to 1 (01H), Tepresenting the first number in the sequence of natural numbers, 2, Loop to Add the Numbers: * The LOOP label starts the iteration for a microprocessor to repeat the instructions * ADD D adds the value in Register D (current number) to Accumulator A. The' Accumulator is updated each time to maintain the running sum. Ly + INRD increments the current number by 1. * DCR C decrements the counter to keep track of how many numbers have been added. = <.._ nzhoop repeats the loop ifthe counts not zero to ensure all ten sumnbersare added. result idding numbers. this label allow within section. output: sum ofthe first naturel ww is c: tab programs="Write" an assembly language program in microprocessor find of digits number algorithm: load from memory location into accumulator a copy value register b for safekeeping mask higher nibble extract units digit by performing and operation with ofh move c store it temporarily restore original a. rotate left four times bring tens lower position. again ofh. add halt program. mnemonic code hex explanation temporary storage zeae perform retain only _ c. once. accurnulator again. accumtilator one more time fo out leaving accumulao fram execution straightforward way finding individual dea rotations isolate each decima computer architecture output adress data address nibble: binary aniofh will odh which decimal or times: after bei digit: ani results provided me represented as hexadecimal. hexadecimal should be decimal. mory ui i write reverse using rlc instruction. . rotates accumulator. aleft through carry flag. rlcshifts bits left. leftmost bit moves flag lag fed rightmost instructions z effectively swap places ul positions highe cat>
You might also like
BCA 1st Year 2017
PDF
No ratings yet
BCA 1st Year 2017
24 pages
Microprocessor 6 Sem E and C Notes
PDF
33% (3)
Microprocessor 6 Sem E and C Notes
204 pages
Array
PDF
No ratings yet
Array
19 pages
Mysql Practice
PDF
No ratings yet
Mysql Practice
4 pages
Basic Computer Organization and Design
PDF
No ratings yet
Basic Computer Organization and Design
35 pages
UNIT2 Stacks Queues
PDF
No ratings yet
UNIT2 Stacks Queues
14 pages
I Sem Lab Manul C Programming 23-24
PDF
No ratings yet
I Sem Lab Manul C Programming 23-24
41 pages
Pixeles Bca & Mca (Ignou) : Classes
PDF
No ratings yet
Pixeles Bca & Mca (Ignou) : Classes
15 pages
PST Important Questions
PDF
No ratings yet
PST Important Questions
4 pages
Menu Driven Program To Perform Various Operations On The Array
PDF
No ratings yet
Menu Driven Program To Perform Various Operations On The Array
20 pages
TCS Notes Unit 1
PDF
No ratings yet
TCS Notes Unit 1
30 pages
Bca Bsc 3rd Sem English Textbook
PDF
No ratings yet
Bca Bsc 3rd Sem English Textbook
93 pages
Bcs 011 PDF
PDF
No ratings yet
Bcs 011 PDF
33 pages
Question Bank
PDF
No ratings yet
Question Bank
9 pages
Laboratory Technical Assistant Computer - Application
PDF
No ratings yet
Laboratory Technical Assistant Computer - Application
12 pages
Aecs Lab Manual Final - 2019-20
PDF
No ratings yet
Aecs Lab Manual Final - 2019-20
101 pages
ML-Lab Manual - NEP - DSS
PDF
No ratings yet
ML-Lab Manual - NEP - DSS
23 pages
FYBSC - CS Sem 1 Web Programming Journal
PDF
No ratings yet
FYBSC - CS Sem 1 Web Programming Journal
38 pages
Download the full PDF version of Solution Manual for Computer Organization and Architecture, 11th Edition, William Stallings right away.
PDF
100% (16)
Download the full PDF version of Solution Manual for Computer Organization and Architecture, 11th Edition, William Stallings right away.
46 pages
Problem Solving & Programming Notes - Unit - IV
PDF
100% (1)
Problem Solving & Programming Notes - Unit - IV
82 pages
CBCS Syllabus For BCA Kashmir University
PDF
100% (2)
CBCS Syllabus For BCA Kashmir University
70 pages
BCA I Year Digital Computer Oragnisation Practice Questions
PDF
No ratings yet
BCA I Year Digital Computer Oragnisation Practice Questions
6 pages
Unit 5-Cloud PDF
PDF
No ratings yet
Unit 5-Cloud PDF
33 pages
STD 12 Chapter 9 Working With Array and String Textual Exercise and Previous Years Board Papers
PDF
100% (1)
STD 12 Chapter 9 Working With Array and String Textual Exercise and Previous Years Board Papers
10 pages
Brief Resume Dr-R-H-Goudar CS Dept1
PDF
No ratings yet
Brief Resume Dr-R-H-Goudar CS Dept1
2 pages
Computer SC Specimen QP Class Xi
PDF
0% (1)
Computer SC Specimen QP Class Xi
7 pages
Computer Project Isc Class 11 1st Term
PDF
No ratings yet
Computer Project Isc Class 11 1st Term
49 pages
DataVisualization_lab_manual (1)
PDF
No ratings yet
DataVisualization_lab_manual (1)
110 pages
Proceedings of The International Conference On RASTEMS-2023
PDF
No ratings yet
Proceedings of The International Conference On RASTEMS-2023
267 pages
Ugc Net: Computer Science and Applications
PDF
No ratings yet
Ugc Net: Computer Science and Applications
65 pages
DSA Notes Well Organised
PDF
No ratings yet
DSA Notes Well Organised
166 pages
ICSE Computer Project
PDF
75% (4)
ICSE Computer Project
51 pages
CS-I Practicals Answer Key 11th
PDF
No ratings yet
CS-I Practicals Answer Key 11th
11 pages
Organization of Intel 8086
PDF
No ratings yet
Organization of Intel 8086
10 pages
Computer Science UGC NET 40 Days Study Plan
PDF
No ratings yet
Computer Science UGC NET 40 Days Study Plan
3 pages
Case Study-Application Developed in C
PDF
No ratings yet
Case Study-Application Developed in C
9 pages
ICSE Supplement - 2 July
PDF
No ratings yet
ICSE Supplement - 2 July
48 pages
Mca Alagappa University
PDF
No ratings yet
Mca Alagappa University
27 pages
Dhananjay Upadhyay
PDF
No ratings yet
Dhananjay Upadhyay
40 pages
Google App Engine
PDF
No ratings yet
Google App Engine
10 pages
Ict Assignment
PDF
No ratings yet
Ict Assignment
3 pages
class 9 icse looping practice questions
PDF
No ratings yet
class 9 icse looping practice questions
69 pages
HTML Slips
PDF
No ratings yet
HTML Slips
31 pages
BCA-244 C++ Programming Laboratory
PDF
No ratings yet
BCA-244 C++ Programming Laboratory
51 pages
Class 12 Computer Notes by Binod Rijal
PDF
100% (1)
Class 12 Computer Notes by Binod Rijal
31 pages
AVL Trees - Horowitz Sahani
PDF
No ratings yet
AVL Trees - Horowitz Sahani
31 pages
MCSE-011 IGNOU Solved Assignment of 2013-14
PDF
100% (1)
MCSE-011 IGNOU Solved Assignment of 2013-14
14 pages
Deca Cho
PDF
No ratings yet
Deca Cho
9 pages
Boolean Algebra and Venn Diagrams
PDF
No ratings yet
Boolean Algebra and Venn Diagrams
52 pages
PRACTICAL FILE OF Matlab
PDF
No ratings yet
PRACTICAL FILE OF Matlab
27 pages
Frank 1
PDF
No ratings yet
Frank 1
10 pages
Coding Decoding Quiz 78
PDF
No ratings yet
Coding Decoding Quiz 78
5 pages
Bcs-011 Important Concepts
PDF
No ratings yet
Bcs-011 Important Concepts
92 pages
Unit 1: An Economic History of The Constitution of India
PDF
100% (1)
Unit 1: An Economic History of The Constitution of India
1 page
Co Lab Manual II
PDF
No ratings yet
Co Lab Manual II
48 pages
Computer Science Department: Majlis Arts and Science College, Puramannur
PDF
No ratings yet
Computer Science Department: Majlis Arts and Science College, Puramannur
20 pages
BCS 042 ALGO Imp Ques
PDF
100% (1)
BCS 042 ALGO Imp Ques
3 pages
Computer Science
PDF
No ratings yet
Computer Science
6 pages
BPSC Previous Year Question For AP, ANE, AME, ADA, AE by Stack IT Job Solution
PDF
No ratings yet
BPSC Previous Year Question For AP, ANE, AME, ADA, AE by Stack IT Job Solution
5 pages
MPECC08 Practical File
PDF
No ratings yet
MPECC08 Practical File
13 pages