Part C Unit 3 MPMC
Part C Unit 3 MPMC
1. Assuming that ROM space starting at 250H contains “America”, create a program to
transfer the bytes into RAM locations starting at 40H.(12m)
To transfer the bytes of the string "America" from ROM space starting at memory address
250H to RAM starting at memory address 40H, you can write a program using assembly
language for a microprocessor like the Intel 8085 (or similar architecture). The steps would
include loading the data from ROM into registers and then storing it in the corresponding
locations in RAM.
Assuming you're working with an 8-bit microprocessor and the string "America" is stored in
ROM starting at address 250H, here’s a simple assembly program to accomplish this:
Assumptions:
Explanation:
ORG 0H: This directive tells the assembler to start the program at memory address
0H.
MVI D, 40H: This instruction initializes register D with the starting RAM address
(40H).
MVI E, 250H: This instruction initializes register E with the starting ROM address
(250H).
TRANSFER Loop:
o MOV A, M: Loads the byte from the ROM (pointed by the address in register
E) into the accumulator.
o MOV M, A: Stores the byte from the accumulator into the RAM (pointed by
the address in register D).
o MOV A, M and ORA A: Checks if the byte is 00H (null terminator), in which
case the loop ends.
o JZ DONE: If the byte is 00H, the program jumps to the DONE label.
2 Construct a program for an 8051 microcontroller that sets, masks, and adds the 2's
complement to an 8-bit value.(12m)
To construct a program for the 8051 microcontroller that sets, masks, and adds the 2's
complement to an 8-bit value, we can break it down into the following steps:
The 8051 microcontroller operates with an 8-bit accumulator (A), so we will work
primarily with the accumulator and other registers for manipulation. The steps
involved are:
Explanation:
1. Set a bit:
o The instruction SETB 7 sets bit 7 of the accumulator A to 1. This modifies the
accumulator from 01111111 to 11111111.
2. Mask a bit:
o The instruction CLR 3 clears bit 3 of the accumulator, modifying the value
from 11111111 to 11110111.
3. 2's complement:
o The instruction CPL A inverts all the bits of the accumulator (complement),
turning 11110111 into 00001000.
o Finally, the instruction ADD A, #0x7F adds 0x7F (which is 01111111 in binary)
to the accumulator, which contains the 2's complement value. The result is
stored back in the accumulator.
3. Interpret the modes of operations in 8051 timer, with suitable diagram (12m)
4. Discuss the functions of 8051's ports and circuitry with necessary diagram(12m)
5. Illustrate the serial communication modes in 8051. Depicts the format SCON and PCON
register.(12m)
6. Create a program to transmit the character string "HELLO" to a serial port. Configure the
baud rate to 9600 with an 8-bit data and 1-bit stop.(12)
7. . Assume two switches are connected to pins P3.2 and P3.3, when a switch is pressed the
corresponding lines goes low. Create a program to (i) light all LEDs connected to port 0, if the
first switched is pressed. (ii) light all LEDs connected to port2 , if the second switch is
pressed(12)
8.Discuss role interrupts the in 8051 . Depicts the format IE and IP register.(12)
9 Create code to (a) deliver the message "We are ready" to the Computer. (b) take in any
information supplied by the PC and display it on the P1-connected LEDs. (c) gather
information from switches linked to P2 and send it serially to the PC. Use the 4800 Baud rate
10. Assume XTAL= 11.0952 MHz, determine the value need to be loaded in the timer
register, if the delay is 5ms. Develop the program using 8051 microcontroller to create a
pulse width of 5ms on P2.3 . Use Timer 0(12m)