Processor Hardware/Software Interface EECS 113 Assignment 2

$35.00

Category: You will Instantly receive a download link for .zip solution file upon Payment

Description

5/5 - (3 votes)

1 8051 Microcontroller Programming using Edsim51
If you have not already installed Edsim51 simulator, follow these instructions:
http://www.edsim51.com/installationInstructions.html
To see a list of all assembly commands, visit the following link:
https://www.keil.com/support/man/docs/is51/is51_opcodes.htm
To see a list of all characters, visit the following link:
http://www.asciitable.com/
You are required to write a code to multiply two 8 bit numbers and store the result in the memory.
The numbers are in code memory, starting from location 40H and are strings in ascii format. The 0
after each number translates to null and indicates the termination in the string. You can use this null
character, along with conditional jumps to determine if your number has ended. To run arithmetic operations on numbers in string format, you have to convert the strings to decimal numbers. For instance,
the {0x36H,0x34H,0x39H,0x30H} sequence represents the number 6490. Check the ascii table for full
detail on ascii representation. Store the 16 bit output result on location 40H(MSB) and 41H(LSB) on
the data memory as regular hexadecimal numbers. You do not need to convert the output to string!
The input numbers are 8 bit or less than 256. Use the following template to put the individual test cases
in your code memory:
ORG 40H
N1: DB ”23” ;40H=0x32H,41H=0x33H
DB 0
N2: DB ”58” ;43H=0x35H,44H=0x38H
DB 0
1
Test your code for the following cases:
N1=23, N2=58, OUTPUT: 40H=05H , 41H=36H (23*58=1334 that is 0536H in hex system)
N1=143, N2=234, OUTPUT: 40H=82H , 41H=B6H (143*234=33462 that is 82B6H in hex system)
2 Bonus point (10%)
Save the output in decimal system and in ascii format, i.e. convert each digit to ascii representation
and save them on data memory, starting from 40H. The most significant digit should be stored in 40H.
You can assume the output is always less than 256 (8 bits).
N1=12, N2=15, OUTPUT: 40H=31H , 41H=38H , 42H=30H
N1=14, N2=17, OUTPUT: 40H=32H , 41H=33H , 42H=38H
3 Assignment Deliverable
– Your code should be commented.
– Submit the commented assembly file.
– Submit the screenshots showing the output in the memory and the register values for each test case.
– Submit the assignment before the deadline through Canvas, in a zip file.
2