Close

Constants: Strategies and Challenges

A project log for TIS-100 (Geiger)

An ATTINY based TIS-100 Clone

big-boy-peteBig Boy Pete 04/28/2016 at 16:420 Comments

In the last project update, I introduced the concept of dealing with constants through the use of an array with a pointer.

So, in our program array, we might have something like this:

[(MOV|VAL)(VAL|001)]

The 8 bits are split into the move command and a marker for VAL, then the second is marked with VAL and a position in the VAL array. Although all of this is clever, it ends up wasting bits.

It will be more efficient to have [(MOV|VAL) (11001101)(10101010) - This means that when we are moving a value, we will have to increment the Program Counter by 3 - which is a little bit of book-keeping, which is what we were trying to avoid, but it's more bit efficient.

However, it may prove problematic in the future when we're trying to calculate JMP commands. As we continue to evaluate how we're implementing the rest of the language, we will resolve this problem.

Discussions