Assmbler Parser

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

Assmbler Parser

Tal Lempert (IDC)
In the comp/dest/jump methods,
there are many different cases for example the comp has 28 possibilities
for the c command.
should we keep these cases in constants or is there a logic we should find?
Reply | Threaded
Open this post in threaded view
|

Re: Assmbler Parser

cadet1620
Administrator
Tal Lempert (IDC) wrote
In the comp/dest/jump methods,
there are many different cases for example the comp has 28 possibilities
for the c command.
should we keep these cases in constants or is there a logic we should find?
I'd recommend using lookup tables for the comp and jump methods. The dest field is simple enough that you might want to scan it looking for the three valid destinations, but it you could also use a lookup table for it.

--Mark
Reply | Threaded
Open this post in threaded view
|

Re: Assmbler Parser

Tal Lempert (IDC)
Thanks