Write programs that will accomplish the desired tasks listed below, using as few lines of code as possible. a) Add the bytes in RAM locations 34H and 35H ; put the result in register R5 (LSB) and R6 (MSB) b) Subtract the content of R2 from the number F3H ; put the result in external RAM location 028BH. c) Subtract the content of R1 from R0 ; put the result in R7.

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter2: Problem Solving Using C++using
Section2.5: Variables And Declaration Statements
Problem 10E
icon
Related questions
Question

Write programs that will accomplish the desired tasks listed below, using as few lines of code as possible.

a) Add the bytes in RAM locations 34H and 35H ; put the result in register R5 (LSB) and R6 (MSB)
b) Subtract the content of R2 from the number F3H ; put the result in external RAM location 028BH.
c) Subtract the content of R1 from R0 ; put the result in R7.
d) Multiply the data in RAM location 22H by the data in RAM location 15H ; put the result in RAM
location 19H (low byte) and 1AH (high byte).
e) Divide the data in RAM location 3EH by the number 12H ; put the quotient in R4 and the remainder
in R5.
f) Divide the data in RAM location 15H by the data in RAM location 16H ; put the quotient in
external RAM location 7CH and the remainder in in external RAM location 7DH.
g) Double the number in register R2, and put the result in register R3 (high byte) and R4 (low byte).
Use logic operations.
h) OR the contents of ports 1 and 2 ; put the result in external RAM location 0100H
i) Set Port 0, bits 1, 3, 5 and 7 to one, set the rest to zero.
j) Clear bit 3 of RAM location 22H without affecting any other bit.
k) Invert the data on the port 0 pins and write the data to port 1. 

Expert Solution
steps

Step by step

Solved in 4 steps

Blurred answer
Knowledge Booster
Fundamentals of Computer System
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr