Program in Machine language: ASCII conversion|computer science

Goals:

This programming venture will provide help to

· to use ideas discovered in programming the LC-Three machine;

· to write down ML function and knowledge motion directions ONLY;

· to make use of LC3Edit for program modifying; and

· to make use of LC-Three Simulator to debug and execute a program.

Description:

For this programming venture, you’ll write an LC-Three ML program that can convert ASCII decimal characters saved in reminiscence, to their corresponding two’s complement representations. After conversion, the values shall be added and the outcomes saved in reminiscence.

Specifics:

Your program ought to be written in LC-Three machine language. It’s possible you’ll write the directions both in binary or hexadecimal kind.
Load your program in reminiscence tackle x3000.
Assume that the ASCII illustration of a two-digit decimal worth is saved in a single reminiscence location the place bits [15:8] comprise the tens digit worth and bits [7:0] comprise those digit worth. For instance, 0011 0011 0011 0100 represents the ASCII digits ‘Three’ and ‘four’, which represents the decimal quantity 34.
Assume that two (2) two-digit ASCII values are saved in addresses x3101 and x3102. Convert every to its decimal values, add the values and retailer the sum in reminiscence tackle x3100.
Overwrite the saved ASCII values with the transformed decimal values in reminiscence.
Instance:

Handle

Preliminary Contents

Outcomes

x3100

undefined

62 = 0000 0000 0011 1110 (sum)

x3101

‘24’ = 0011 0010 0011 0100

24 = 0000 0000 0001 1000

x3102

‘38’ = 0011 0011 0011 1000

38 = 0000 0000 0010 0110

EC +5points: Use all three addressing modes not less than as soon as.

Venture doesn’t have any connected recordsdata

Published by
Essays
View all posts