Write an assembly language program that prompts for and reads a decimal number with a magnitude less than or equal to 4681. Your program should make two copies of the number. It should left shift the first copy once and the second copy twice. It should then add the original number and the two shifted copies and display the sum. What is the relationship between the original number and the number displayed? Why? [Put the answer in the header comments]
Test with both positive and negative integers.
Example output:
Enter integer (-4681..4681): 5
Result: 35
Using the instruction set for specifically the LCC
Version: 2024-03-07 16:12
LCC Instruction Set Summary Format:
Opcode of the code, pc + pcoffset9 to dr sr1 sr2 r sr+Smf
Opcode of dr pooffset dr men[pc pcoffset9]
Opcode of ar pooffset9 men[pc+ pcoffset9] sr r pc; pc e- [pc pcoffsett1] ase x fx 4 n rsrim5bitdse AD)
Opcode of dz baser offset6 dr - men[baser + offset6]
Opcode of ae baser offset6 es[baser offset6] -- sr nor sr1 s2(xag) sr1-15fag
Opcode of ne dr ar1
Opcode of [--p],- 0000 0000 [s+] r et sr c ctin d right at ser atr = not r # r r 0 01011 r 1 s r sr inire ive ORj 6r e sr dr ar1 ar2
Opcode of code baser offset6 on code, pc baser offset6
Opcode of imd 6r 1m9
Opcode of pooffset9 dr pc pcoffset9 oidt dr i re. 3p-* wi lea dr,sr,sr1 ishin Lnn5,imm9,offset6.pcoffset9.pcoffset11a
Trap Instructions (call OS) Format: 00 000 00000
Flags Set Description: Display contents of ar a signed decimal
Debugging Instructions: Display all segments
Description of req o negative (signed be a-1 Greater than (signed comp Carry or less than u Branch always [90q-892q
Assembler Directives Description: Cd idtv ri Same ar-vtere Some on-ybere ASCr
Rere caine> -40ies -string <string -rostring -start -global evars ertern oan -orig cadtress
Spy ar i goai rie -global y cvar in an external variable