03

Jabberwocky

This may be the first one of my own that wasn't simply altering someone else's code. Nothing too exciting, but it seems I was starting to make sense of the Mode X routines.

What it does

The first stanza of Jabberwocky scrolls down a 360×480 Mode X screen, brightening as it falls. Six days after JTEST.BAK, and it is the first file in the archive that exists to look like something rather than to test something.

Two things in it

Yes, I spelled “borogoves” wrong. Oddly, 30 years later, I can still recite this, and I still have the same typo burned into my brain.

The erase loop runs for c := 1 to 20 over a four-element array. Sixteen iterations past the end, every frame. It is harmless purely because {$R-} is Turbo Pascal's default, so the writes land in whatever follows the array in the data segment and nothing complains. Range checking off is the reason a great deal of this archive runs at all.

MIMSY.PAS

1995-06-16 00:32 · 1,039 bytes · All of it. The stanza is a typed constant array of strings.

Uses Crt,jmodex;Const z:array[1..4]of string=(
'''Twas brillig and the slithy toves',
'  Did gyre and gimble in the wabe',
'   All mimsy were the borogroves',
'    And the mome raths outgrabe');
Var c,x:integer;y:array[1..4]of integer;
Procedure Page(p:byte);Begin set_active_page(p);set_display_page(p);end;
Procedure Text(s:string;x,y,B,F:integer);Var a:Array[1..135]of Char;i:byte;
Begin For i:=1to Length(s)DO a[i]:=s[i];Print_Str(a,Length(s),X,Y,B,f);End;
Procedure TText(s:string;X,Y,c:integer);Var a:Array[1..135]of Char;i:byte;
Begin For i:=1to Length(s)DO a[i]:=s[i];TPrint_Str(a,Length(s),X,Y,C);End;
Procedure Demo;Begin IF SET_VGA_MODEX(1,320,400,2)=0 THEN halt(0);
FOR X:=1TO 250DO Begin SET_DAC_REGISTER(X,0,0,X div 4);end;
for x:=1to 4do y[x]:=(x-1)*20;page(0);
for x:=1to 400do begin for c:=1to 4do tText(z[c],20,x+y[c],x div 2);
delay(20);for c:=1 to 20do ttext(z[c],20,x+y[c],0);
end;
{*************Wait and Quit*************}
repeat until keypressed;end;Begin Demo;asm mov ah,0;mov al,3;int 16;end;END.