microprocessors Write a program to sum all the odd numbers f


microprocessors

Write a program to sum all the odd numbers from Oh to 199h. On the 8255 Parallel Programmable interface, the Control Port has the address ffffh. The control word 81h will program the lower - C - port as input and the upper - C port as output. (We don\'t care about the other ports). The address of the C - port is fffdh. Write a program to perform as follows: Address the Control Port and program the C - port as given above. Read from the lower - C port. Subtract 4 from the number that is read in. Output the number read using the upper - C port. Return to step 2 and report the operation 6 times and then stop

Solution

a)

XRA A
//A=0

MOV B,A
//B=0

MVI C,200
//counter

LOOP: INR B
//B++

ADD B
//A=A+B

DCR C
//C--

JNZ LOOP
//if C!=0 goto LOOP

HLT
//end

by changing you can do similar type of programs

 microprocessors Write a program to sum all the odd numbers from Oh to 199h. On the 8255 Parallel Programmable interface, the Control Port has the address ffffh

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site