C instructions implementation

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

C instructions implementation

Mike2345
Hello,

I have been wondering is there anyway anybody can suggest me besides hard code writing the tables in our code for the C instructions I found it a bit repetitive.
Reply | Threaded
Open this post in threaded view
|

Re: C instructions implementation

WBahn
Administrator
Not really, but it shouldn't be too bad. You have 8 entries for the dest, 28 for the comp, and 8 for the jump. There's enough structure to them that it should just take a few minutes to build them.

I would recommend not hard coding them into the body of the code, but rather put the tables as the initial values in some arrays. That's just more elegant, especially if you want to go beyond the basic assembler at some point.