Important Announcement
PubHTML5 Scheduled Server Maintenance on (GMT) Sunday, June 26th, 2:00 am - 8:00 am.
PubHTML5 site will be inoperative during the times indicated!

Home Explore 9193_MP_Lab3

9193_MP_Lab3

Published by Ivan Dsilva, 2022-02-27 17:53:10

Description: 9193_MP_Lab3

Search

Read the Text Version

Department of Computer Engineering Academic Term: Jan-April 2022 Class: SE Computer Subject Name: Microprocessor Practical No. 3 Title (A) To implement block transfer (B) To find average of 10 numbers Date of Performance Date of Submission / 02 / 2022 Roll No. / 02 / 2022 9193 Name of the student Ivan Dsilva Evaluation: Grade Sr. Rubric No 1 On time completion and submission (02) 2 Coding Standards (02) 3 Post lab Assignments (06) Signature of the Teacher:

Title: LAB SESSION 3 (A) Objective TO IMPLEMENT BLOCK TRANSFER Program involves transferring source string from a particular location in source segment (Data Segment) to the desired location in destination segment (Extra Segment). The objective of this program is to give an overview of the String instructions of 8086. Pre- 1. Knowledge of TASM directives. Requisites 2. Knowledge of String Instructions of 8086. Algorithm: 1. Initialize the data segment. 2. Store the source string in consecutive memory location. 3. Initialize the extra segment. 4. Allocate consecutive memory locations for transfer. 5. Load the effective address of source string in SI register. 6. Load the effective address of destination string in DI register. 7. Initialize the Direction flag for Auto increment or Auto decrement. 8. Store number of bytes to be transferred in any of the general purpose registers. 9. Transfer the source string using appropriate string instructions (MOVSB / MOVSW) 10. Decrement count. 11. Check if count = 0. If yes then stop else repeat steps 9 - 11. 12. Stop Code: ;To implement block transfer .8086 .model small .data list1 db 01H,02H,03H,04H,05H list2 db 4 dup(0) res db ? .code start: mov ax, @data mov ds, ax mov es, ax lea si,list1 lea di, list2 ;mov cs,05h ;cld ;rep movsb

mov res,al mov ah,4ch int 21h end start Output: Conclusion: Thus, we have successfully implemented block transfer using 8086 microprocessor kit

Title: LAB SESSION 3 (B) Objective TO FIND AVERAGE OF 10 NUMBERS Pre- Program involves averaging of ten numbers Requisites 1. Knowledge of TASM directives. Algorithm: 2. Knowledge of CMP and Jump Instructions of 8086 1. Initialize the data segment. Code: 2. Clear carry flag. 3. Store initial address of list in a register. 4. Move 0A to register AL. 5. Store count in register AL. 6. Reset AL registers (content of AX) 7. Add one number from array to contents of AL 8. Decrement count 9. Increment SI 10. If count ≠ 0 go to step 8 11. Divide content of AX with that of BL. 12. Store answer in register. 13. Stop. ;To find average of ten numbers .8086 .model small .data num1 db 5 num2 db 8 num3 db 7 avg db ? .code start: mov ax, @data mov ds,ax mov al,num1 add al,num2 add al,num3 mov ah,0 mov dl,3 div dl mov avg,al mov ah, 4ch int 21h end start

Output: Conclusion: Thus, we have successfully calculated the average of ten numbers using 8086 microprocessor kit.


Like this book? You can publish your book online for free in a few minutes!
Create your own flipbook