CHNGCOLR.P Disk Image
Notes
As written, the program runs so fast you can just about see the screen flicker. You could put in a second loop to slow it down.
I fixed a bug in the second to the last line, changing Color^:= Orig to Color^:=Orig^.
I changed the pointers from Integers pointers to Char pointers so that it would work with single byte variables rather than two byte variables.
If you want to display the value in the memory location, you can use the Ord() function, for example, Writeln(Ord(Color^)).
What's on the disk?
CHNGCOLR.P - Source code file
P.OUT - Kyan Pascal intermediate file
CHNGCOLOR - Executable file
Source Code
(* CHNGCOLR.P *)
(* Kyan Pascal 2.x / Atari 8-bit *)
Program CHNGCOLR(Input, Output);
(* Cycle through screen background colors *)
Var
Color, Orig : ^Char;
Procedure Cycle;
Var
Loop : Char;
Begin
For Loop := 0 To 255 Do
Color^ := Loop
End;
Begin
Color := Pointer(710);
Orig^ := Color^;
Cycle;
Color^ := Orig^;
End
No comments:
Post a Comment