Question: Read a .obj file of LC3 instructions in binary and output it as an array of 16 bit elements in C(not C++) I have a

Read a .obj file of LC3 instructions in binary and output it as an array of 16 bit elements in C(not C++)

I have a .obj file which contains the following instructions in LC3 language

2001

f025

560a

4507

4501

0000

In binary these would be:

0010000000000001

1111000000100101

0101011000001010

0100010100000111

0100010100000001

0000000000000000

In LC3 these would be the instructions:

LD R0, A

F HALT

A .FILL X560A

B .FILL X4507

C .FILL X4501

.END

I need a way to put these instruction into a binary array which looks something like [0010000000000001,1111000000100101,0101011000001010,0100010100000111,0100010100000001,0000000000000000]

Thank you

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!