45379515-8086-Programs - ANAND MISHRA MICROPROCESSOR 8086...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
ANAND MISHRA MICROPROCESSOR 8086 PROGRAMS SCHOOL OF INSTRUMENTATION D.A.V.V. INDORE 1 BATCH 2010-12 EXPERIMENT NO. 1 Object - Given a number N in the range 0<N≤5, write a program that computes its factorial and saves the result in memory location FACT. Apparatus Required - An 8086 kit or simulator in Computer. Program - MOV AL, 1H MOV CL, 0H MOV DL, N NXT: CMP CL, DL JE DONE INC CL MUL CL JMP NXT DONE: MOV [FACT], AL Limitation - This program is limited up to factorial of 5 because more than 128 bits are required for factorial of 6. So our register requirement is greater than 8-bit, which is modified according to problem.
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
ANAND MISHRA MICROPROCESSOR 8086 PROGRAMS SCHOOL OF INSTRUMENTATION D.A.V.V. INDORE 2 BATCH 2010-12 EXPERIMENT NO. 2 Object - Write a program that compares the elements of two arrays, A(I) and B(I). Each array contains 100 16-bit signed numbers. The comparison is to be done by comparing the corresponding elements of the two arrays until either two elements are found to be unequal or all elements of the arrays have been compared and found to be equal. Assume that the arrays start at addresses A00016 and B0001 respectively. If the two arrays are found to be unequal, save the address of the first unequal element of A(I) in memory location FOUND: otherwise, write all 0s into this location. Apparatus Required - An 8086 kit or simulator in Computer. Program - MOV CX, 64H MOV SI, 0A000H MOV DI, 0B000H GO_ON: MOV AX, [SI] CMP AX, [DI] JNE MIS_MATCH ADD SI, 2 ADD DI, 2 DEC CX JNZ GO_ON MOV [FOUND], 0H JMP DONE MIS_MATCH: MOV [FOUND], SI DONE: HLT
Background image of page 2
ANAND MISHRA MICROPROCESSOR 8086 PROGRAMS SCHOOL OF INSTRUMENTATION D.A.V.V. INDORE 3 BATCH 2010-12 EXPERIMENT NO. 3 Object - Given an array A(I) of 100 16-bit signed numbers that are stored in memory starting at address A00016, write a program to generate two arrays from thee given array such that one P(J) consists of all the positive numbers and the other N(K) contains all the negative numbers. Store the array of positive numbers in memory starting at address B00016 and the array of negative numbers starting at address C00016. Apparatus Required
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 11/10/2011 for the course COMPUTER E 444 taught by Professor Amigo during the Fall '10 term at Al-Quds University.

Page1 / 14

45379515-8086-Programs - ANAND MISHRA MICROPROCESSOR 8086...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online