langs a-z
This commit is contained in:
parent
db842d013d
commit
d066446780
11389 changed files with 98361 additions and 1020 deletions
23
Task/Animation/XPL0/animation.xpl0
Normal file
23
Task/Animation/XPL0/animation.xpl0
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
include c:\cxpl\codes;
|
||||
int CpuReg, Dir, I, J;
|
||||
char Str;
|
||||
string 0; \use zero-terminated strings, instead of MSb set
|
||||
[CpuReg:= GetReg; \provides access to 8086 CPU registers
|
||||
\ 0123456789012
|
||||
Str:= "Hello World! ";
|
||||
Clear;
|
||||
Dir:= -1; \make string initially scroll to the right
|
||||
I:= 0; \index to start of displayed portion of string
|
||||
repeat Cursor(0, 0); \set cursor position to upper-left corner
|
||||
for J:= 0 to 12 do
|
||||
[ChOut(0, Str(I)); I:= I+1; if I>12 then I:= 0];
|
||||
Sound(0, 2, 1); \delay about 1/9 second
|
||||
I:= I+Dir; \step starting position of displayed string
|
||||
if I<0 then I:=12; \wraparound
|
||||
if I>12 then I:= 0;
|
||||
CpuReg:= GetReg; \get mouse button press information
|
||||
CpuReg(0):= 5; CpuReg(1):= 0;
|
||||
SoftInt($33); \reverse direction if left button was pressed
|
||||
if CpuReg(1) then Dir:= -Dir;
|
||||
until KeyHit; \any keystroke terminates program
|
||||
]
|
||||
Loading…
Add table
Add a link
Reference in a new issue