|The Command Handler|
Command handler sounds very important and critical doesn't it! Well it is! OK, so what happens? Essentially you have 2-bytes which are collected from the PSX controller when a certain combination of buttons are pressed. Once you have those two bytes, you then have to decide what to do. The command handler works down the list in a heirarchical fashion, first matching the leading byte, and then matching the trailing byte. This all sounds good so far. That is until you realise that the RISC assembly language of these processors has only 35-instructions. Most are mathmatical functions, whereby flags are set depending on what happens. There is no 'IF A=B THEN DO C' function available, so you have to do it all by hand.
The following few lines of code are what's required to see if a number matches. This is the much taken for granted 'IF A=B THEN DO C.'
When you consider that there's about 20-commands in JeST at the time of writing, version _006, it all starts to mount up. That snippet of code is 8-bytes, and when multiplied by 20 that equals 160-bytes, which doesn't even include leading byte or the procedures which are called. Certainly the fair bulk of the firmware which JeST runs is dedicated to the additional features and flow control.