The "2" through "6" scaling demonstration commands

The syntax of the "2", "3", "4", "5" and "6" commands is:
[2|3|4|5|6] #####
  where ##### is any numeric value (0 to 4294967295, 0x0 to 0xFFFFFFFF, -1 to -4294967295)
Notes:
  Only a single numeric value is parsed; anything after that is ignored.
  The numeric value may be specified in either decimal or hexadecimal format.
  These commands only generate serial output; they perform no any other action.
  The number of spaces, if any, is not a factor (unless more than about 70!)

Since the MIRTOS Operating System does not support native floating-point (i.e., either "float" or "double" types of) values, a pseudo floating-point value can be stored and manipulated as an integer and output using the PrintScaledULONG system command.

These five (5) commands required a total of 28 bytes to implement. Since "2" through "6" were not being used for any other system command, they were used for this illustration. In fact, as a rarity, the documentation for the PrintScaledULONG system routine shows the actual 28 bytes of source code from the Operating System for these "2" though "6" commands.

First, determine if system command extensions are enabled. If they are, we need to disable them for a moment. Use the Display System EEPROM command to see if they are enabled and the Edit command to toggle them off. Specifically:
>DSE
EEPROM contents:
0000:  10 21 00 9F 01 01 96 FF-04 00 FF FF 28 3C 50 FF  .!..........(.P.
0010:  C0 00 3F FF 60 08 03 67-FF 25 74 FF FF FF FF FF  ..?.`..g.%t.....
0020:  24 28 05 FF FF 40 FF FF-FF 14 FF 20 00 40 FF FF  $(...@..... .@..
0030:  80 16 FF FF FF FF FF FF-90 00 B0 00 90 01 FF FF  ................
0040:  FF FF FF FF FF FF 00 2F-FF FF FF FF FF FF FF FF  ......./........
>     ; The WORD at this ^^^^^ address (0x46) points to command extensions
>E 0x47 ^= 0x80     ; Toggle the MSBit to invalidate the pointer
>DSE
EEPROM contents:
0000:  10 21 00 9F 01 01 96 FF-04 00 FF FF 28 3C 50 FF  .!..........(.P.
0010:  C0 00 3F FF 60 08 03 67-FF 25 74 FF FF FF FF FF  ..?.`..g.%t.....
0020:  24 28 05 FF FF 40 FF FF-FF 14 FF 20 00 40 FF FF  $(...@..... .@..
0030:  80 16 FF FF FF FF FF FF-90 00 B0 00 90 01 FF FF  ................
0040:  FF FF FF FF FF FF 00 AF-FF FF FF FF FF FF FF FF  ................
>      ; Note the change ^^^^^ here                                             
Having done that, we can perform a few tests using a variety of values to see how the PrintScaledULONG routine handles the formatting. You're encouraged to try as many other combinations as you like. Here are just a few examples:
>2 314
3.14
>3    7
0.007
>4 31416
3.1416
>5    271828
2.71828
>6 6
0.000006
>6  -1
4294.967295
>6-2
4294.967294
>E 0x47 ^= 0x80 ; If we need to reenable command extensions
>6  ; Just to verify ...
Keypress '6' handler
>                                                                               
The '6' was just to verify that the factory default command extensions are in place. If you have already changed them, this may not be what you get when you enter '6'.

See also:
  The PrintScaledULONG system routine.