Main Code

procedure main{
    arguments_none
    returns_never
    variable command byte

    call reset()
    loop_forever {
	command := get_byte()
	switch (command >> 6) {
	  case 0 {
	    switch ((command >> 3) & 7) {
	      case 0 {
		switch (command & 7) {
		  case 0 {
		    # Command 0000 0000:
		  }
		  #...
		  case 7 {
		    # Command 0000 0111:
		  }
		}
	      }
	      #...
	      case 7 {
		# ....
	      }
	    }
	  }
	  default 3 {
	    #...
	  }
	}
    }
}