If there ISN"T a rule limiting the number of
occurences of consecutive
digits, then 6 could be expressed as IIIIII, etc. That gives rise to
another flippant entry:
; data segment is composed of 3999 I's followed by a null
MOV DX, 3999 ; DX now points to the null
SUB DX, AX ; for a value X in AX, DX now points to a location
: from which there are X I's and a null.
You might win the speed contest, assuming there's no upper bound on
memory usage. But you won't win the size contest.
The earlier roman numeral competition I brought up that inspired this mess
was only a memory usage competition, although apparently the motivation of
the current one is speed.
If I were setting the rules, I'd say that you only got 256 consecutive
8-bit bytes for total memory usage (code, tables, output buffer, etc.), and
were not allowed to reference any memory outside this area. For machines
not organized with 8-bit bytes, the equivalent amount of contiguous memory
is permitted (i.e., 2048 bits). For some machines it may be necessary to
relax the rules to allow access to architecturally specified memory areas
such as the PDP-8's auto-index locations. However, those locations would
count against the total memory usage.
But fortunately for me, I'm not running this contest. :-)