Jeśli chcesz wziąć udział w dyskusjach na forum - zaloguj się. Jeżeli nie masz loginu - poproś o członkostwo.
Vanilla 1.1.4 jest produktem Lussumo. Więcej informacji: Dokumentacja, Forum.
BYTE ch=764 ; ESC = 28
BYTE RTCLOCK=20 ; sys timer
CARD SAVMSC=88 ; screen addr
BYTE col1=709
BYTE col2=710
BYTE colB=712
BYTE stop
PROC drawBoard()
BYTE i1b, i2b, i3b, x, color, modLine
BYTE ARRAY SCREEN
SCREEN=SAVMSC
modLine=0
FOR i3b=1 TO 8
DO
FOR i2b=1 TO 24
DO
x=0
FOR i1b=1 TO 8
DO
color=0
IF (i1b & 1) <> modLine THEN color=255 FI
IF color <> 0 THEN
SCREEN(x)=color
SCREEN(x+1)=color
SCREEN(x+2)=color
FI
x==+3
OD
SCREEN==+40
OD
IF (i3b & 1) = 0 THEN modLine=0
ELSE modLine=1 FI
OD
RETURN
PROC main()
BYTE I=[0]
GRAPHICS(8+16)
col1=1
col2=11
colB=12
RTCLOCK=0
WHILE RTCLOCK<150
DO
drawBoard()
I==+1
OD
stop=RTCLOCK
GRAPHICS(0)
PRINTF("%E %U iterations",I)
WHILE ch=255 DO OD
RETURN
Mad Pascal YoshPlus: 35572 iterations in 100 ticks
Action! YoshPlus: 33239 iterations in 100 ticks
Quick 1.6 YoshPlus: 16242 iterations in 100 ticks
Fast Basic 4.0 Int YoshPlus: 1458 iterations in 100 ticks
fig-Forth 1.1 YoshPlus: 715 iterations in 100 ticks
CLSN Pascal YoshPlus: 487 iterations in 100 ticks
#include <stdio.h>
#include <atari.h>
#include <_atarios.h>
void draw_board()
{
register unsigned char i1b, i2b, i3b, x, modLine;
register unsigned char *screen = OS.savmsc;
modLine = 0;
for (i3b = 1; i3b <= 8; ++i3b)
{
for (i2b = 1; i2b <= 24; ++i2b)
{
x = 0;
for (i1b = 1; i1b <= 8; ++i1b)
{
if ((i1b & 1) != modLine)
{
screen[x] = 255;
screen[x + 1] = 255;
screen[x + 2] = 255;
}
x += 3;
}
screen += 40;
}
if ((i3b & 1) == 0)
modLine = 0;
else
modLine = 1;
}
}
void main(void)
{
unsigned char stop;
unsigned char I;
_graphics(8 + 16);
OS.color1 = 1;
OS.color2 = 11;
OS.color4 = 12;
OS.rtclok[2] = 0;
while (OS.rtclok[2] < 150)
{
draw_board();
++I;
}
stop = OS.rtclok[2];
_graphics(0);
printf("%u", I);
infinite:
goto infinite;
}
Mad Pascal YoshPlus: 35572 iterations in 100 ticks
Action! YoshPlus: 33239 iterations in 100 ticks
Quick 1.6 YoshPlus: 16242 iterations in 100 ticks
Fast Basic FBI YoshPlus: 1458 iterations in 100 ticks
fig-Forth 1.1 YoshPlus: 715 iterations in 100 ticks
CLSN Pascal YoshPlus: 487 iterations in 100 ticks
CC65 Chessboard: 26 iterations in 150 ticks [~5,8]
Mad Pascal Chessboard: 24 iterations in 150 ticks [6,25]
Action! Chessboard: 21 iterations in 150 ticks [~7,1]
program chessboard;
uses crt, graph;
var i, stop : byte;
rtClock : byte absolute 20;
col1 : byte absolute 709;
col2 : byte absolute 710;
colB : byte absolute 712;
bmpAdr : word absolute 88;
procedure drawBoard;
var i1b, i2b, i3b, x, color, modLine : byte;
p, p2 : PByte;
begin
p := pointer(bmpAdr);
p2:= p;
modLine := 0;
for i3b := 1 to 8 do begin
for i2b := 1 to 24 do begin
x := 0;
for i1b := 1 to 8 do begin
if i1b and %1 <> modLine then begin
p2[0]:= 255;
p2[1]:= 255;
p2[2]:= 255;
end;
inc(p2,3);
end;
Inc(p, 40);
p2:=p;
end;
modLine:=ord(i3b and %1 <> 0);
end;
end;
begin
InitGraph(8 + 16);
col1 := 1;
col2 := 11;
colB := 12;
pause;
rtClock := 0;
while rtClock < 150 do begin
drawBoard;
inc(i);
end;
stop:=rtClock;
ReadKey;
InitGraph(0);
writeln('Drawing time: ', i);
ReadKey;
end.
Mad Pascal YoshPlus: 35572 iterations in 100 ticks
Action! YoshPlus: 33239 iterations in 100 ticks
Quick 1.6 YoshPlus: 16242 iterations in 100 ticks
Fast Basic FBI YoshPlus: 1458 iterations in 100 ticks
fig-Forth 1.1 YoshPlus: 715 iterations in 100 ticks
CLSN Pascal YoshPlus: 487 iterations in 100 ticks
Mad Pascal Chessboard: 27 iterations in 150 ticks [5,55]
CC65 Chessboard: 26 iterations in 150 ticks [~5,8]
Action! Chessboard: 21 iterations in 150 ticks [~7,1]
#include <stdio.h>
#include <atari.h>
#include <_atarios.h>
void draw_board()
{
register unsigned char *p = OS.savmsc;
register unsigned char *p2=p;
register unsigned char i1b, i2b, i3b, x, modLine;
modLine = 0;
for (i3b = 1; i3b <= 8; ++i3b)
{
for (i2b = 1; i2b <= 24; ++i2b)
{
x = 0;
for (i1b = 1; i1b <= 8; ++i1b)
{
if ((i1b & 1) != modLine)
{
p2[0] = 255;
p2[1] = 255;
p2[2] = 255;
}
p2 += 3;
}
p += 40;
p2 = p;
}
modLine = i3b & 1;
}
}
void main(void)
{
unsigned char stop;
unsigned char I=0;
_graphics(8 + 16);
OS.color1 = 1;
OS.color2 = 11;
OS.color4 = 12;
OS.rtclok[2] = 0;
while (OS.rtclok[2] < 150)
{
draw_board();
++I;
}
stop = OS.rtclok[2];
_graphics(0);
printf("%u", I);
infinite:
goto infinite;
}
Mad Pascal YoshPlus: 35572 iterations in 100 ticks
Action! YoshPlus: 33239 iterations in 100 ticks
Quick 1.6 YoshPlus: 16242 iterations in 100 ticks
Fast Basic FBI YoshPlus: 1458 iterations in 100 ticks
fig-Forth 1.1 YoshPlus: 715 iterations in 100 ticks
CLSN Pascal YoshPlus: 487 iterations in 100 ticks
CC65 Chessboard: 41 iterations in 150 ticks [3,65]
Mad Pascal Chessboard: 27 iterations in 150 ticks [5,55]
Action! Chessboard: 21 iterations in 150 ticks [~7,1]
#include <stdio.h>
#include <atari.h>
void main(void)
{
register unsigned int i=0;
register unsigned int a=0;
register unsigned int b=0;
OS.rtclok[2] = 0;
while (OS.rtclok[2] < 100)
{
++a;
b=a;
++b;
a=b;
++i;
}
printf("%u", i);
infinite:
goto infinite;
}
BYTE ch=764 ; ESC = 28
BYTE RTCLOCK=20 ; sys timer
CARD SAVMSC=88 ; screen addr
BYTE col1=709
BYTE col2=710
BYTE colB=712
BYTE stop
PROC drawBoard()
BYTE i1b, i2b, i3b, modLine
BYTE ARRAY SCREEN1
BYTE ARRAY SCREEN2
SCREEN1=SAVMSC
SCREEN2=SCREEN1
modLine=0
FOR i3b=1 TO 8
DO
FOR i2b=1 TO 24
DO
FOR i1b=1 TO 8
DO
IF (i1b & 1) <> modLine THEN
SCREEN2(0)=255
SCREEN2(1)=255
SCREEN2(2)=255
FI
SCREEN2==+3
OD
SCREEN1==+40
SCREEN2=SCREEN1
OD
modLine = i3b & 1
OD
RETURN
PROC main()
BYTE I=[0]
GRAPHICS(8+16)
col1=1
col2=11
colB=12
RTCLOCK=0
WHILE RTCLOCK<150
DO
drawBoard()
I==+1
OD
stop=RTCLOCK
GRAPHICS(0)
PRINTF("%E %U iterations",I)
WHILE ch=255 DO OD
RETURN
CC65 YoshPlus: 41844 iterations in 100 ticks
Mad Pascal YoshPlus: 35572 iterations in 100 ticks
Action! YoshPlus: 33239 iterations in 100 ticks
Quick 1.6 YoshPlus: 16242 iterations in 100 ticks
Fast Basic FBI YoshPlus: 1458 iterations in 100 ticks
fig-Forth 1.1 YoshPlus: 715 iterations in 100 ticks
CLSN Pascal YoshPlus: 487 iterations in 100 ticks
CC65 Chessboard: 41 iterations in 150 ticks [3,65]
Mad Pascal Chessboard: 27 iterations in 150 ticks [5,55]
Action! Chessboard: 22 iterations in 150 ticks [6,82]
void draw_board()
{
register unsigned char* p = OS.savmsc;
register unsigned char i, j, k;
for (i = 8; i > 0; --i)
{
for (j = 24; j > 0; --j)
{
for (k = 4; k > 0; --k)
{
p[0] = 255;
p[1] = 255;
p[2] = 255;
p += 6;
}
p += 16;
}
p += i & 1 ? -3 : 3;
}
}
BYTE ch=764 ; ESC = 28
BYTE RTCLOCK2=20 ; sys timer
BYTE RTCLOCK1=19
CARD COUNT,PRIME, stop
PROC sieve()
BYTE ARRAY FLAGS(8190)
CARD I,K
PRIME=0
COUNT=0 ; init count
FOR I=0 TO 8190 ; and flags
DO
FLAGS(I)='T
OD
FOR I=0 TO 8190 ; and flags
DO
IF FLAGS(I)='T THEN
PRIME=I+I+3
K=I+PRIME
WHILE K<=8190
DO
FLAGS(K)='F
K==+PRIME
OD
COUNT==+1
FI
OD
RETURN
PROC main()
BYTE I=[0]
RTCLOCK1=0
RTCLOCK2=0
WHILE I<10
DO
sieve()
I==+1
OD
stop=RTCLOCK1 * 256 + RTCLOCK2
PRINTF("%E %U PRIMES IN",COUNT)
PRINTF("%E %U JIFFIES",stop)
PRINTF("%E %U iterations",I)
WHILE ch=255 DO OD
RETURN
CC65 YoshPlus: 41844 iterations in 100 ticks
Mad Pascal YoshPlus: 35572 iterations in 100 ticks
Action! YoshPlus: 33239 iterations in 100 ticks
Quick 1.6 YoshPlus: 16242 iterations in 100 ticks
Fast Basic FBI YoshPlus: 1458 iterations in 100 ticks
fig-Forth 1.1 YoshPlus: 715 iterations in 100 ticks
CLSN Pascal YoshPlus: 487 iterations in 100 ticks
CC65 Chessboard: 41 iterations in 150 ticks [3,65]
Mad Pascal Chessboard: 27 iterations in 150 ticks [5,55]
Action! Chessboard: 22 iterations in 150 ticks [6,82]
CC65 (opt) SIEVE: 602 ticks in 10 iterations
Mad Pascal (opt) SIEVE: 644 ticks in 10 iterations
Action! SIEVE: 1003 ticks in 10 iterations
void draw_board()
{
register unsigned char *p = OS.savmsc;
register unsigned char i, j, k;
for (i = 8; i > 0; --i)
{
for (j = 24; j > 0; --j)
{
p[0] = 255;
p[1] = 255;
p[2] = 255;
p[0 + 6] = 255;
p[1 + 6] = 255;
p[2 + 6] = 255;
p[0 + 12] = 255;
p[1 + 12] = 255;
p[2 + 12] = 255;
p[0 + 18] = 255;
p[1 + 18] = 255;
p[2 + 18] = 255;
p += 40;
}
p += i &1 ? -3 : 3;
}
}
program chessboard;
uses crt, graph;
var i, stop : byte;
rtClock : byte absolute 20;
col1 : byte absolute 709;
col2 : byte absolute 710;
colB : byte absolute 712;
bmpAdr : word absolute 88;
procedure drawBoard;
var i1b, i2b, i3b, color : byte;
p : PByte;
begin
p := pointer(bmpAdr);
for i3b := 1 to 8 do begin
for i2b := 1 to 24 do begin
for i1b := 1 to 4 do begin
p[0]:= 255;
p[1]:= 255;
p[2]:= 255;
Inc(p,6);
end;
Inc(p,16);
end;
if (i3b and %1) = 0 then Dec(p,3) else Inc(p,3);
end;
end;
begin
InitGraph(8 + 16);
col1 := 1;
col2 := 11;
colB := 12;
pause;
rtClock := 0;
while rtClock < 150 do begin
drawBoard;
inc(i);
end;
stop:=rtClock;
InitGraph(0);
writeln('Drawing iterations: ', i);
ReadKey;
end.
CC65 YoshPlus: 41844 iterations in 100 ticks
Mad Pascal YoshPlus: 35572 iterations in 100 ticks
Action! YoshPlus: 33239 iterations in 100 ticks
Quick 1.6 YoshPlus: 16242 iterations in 100 ticks
Fast Basic FBI YoshPlus: 1458 iterations in 100 ticks
fig-Forth 1.1 YoshPlus: 715 iterations in 100 ticks
CLSN Pascal YoshPlus: 487 iterations in 100 ticks
CC65 Chessboard: 76 iterations in 150 ticks
Mad Pascal Chessboard: 40 iterations in 150 ticks
Action! Chessboard: 22 iterations in 150 ticks
CC65 (opt) SIEVE: 602 ticks in 10 iterations
Mad Pascal (opt) SIEVE: 644 ticks in 10 iterations
Action! SIEVE: 1003 ticks in 10 iterations
BYTE ch=764 ; ESC = 28
BYTE RTCLOCK=20 ; sys timer
CARD SAVMSC=88 ; screen addr
BYTE col1=709
BYTE col2=710
BYTE colB=712
BYTE stop
PROC drawBoard()
BYTE i1b, i2b, i3b
BYTE ARRAY SCREEN
SCREEN=SAVMSC
FOR i3b=1 TO 8
DO
FOR i2b=1 TO 24
DO
FOR i1b=1 TO 4
DO
SCREEN(0)=255
SCREEN(1)=255
SCREEN(2)=255
SCREEN==+6
OD
SCREEN==+16
OD
IF (i3b & 1) = 0 THEN SCREEN==-3 ELSE SCREEN==+3 FI
OD
RETURN
PROC main()
BYTE I=[0]
GRAPHICS(8+16)
col1=1
col2=11
colB=12
RTCLOCK=0
WHILE RTCLOCK<150
DO
drawBoard()
I==+1
OD
stop=RTCLOCK
GRAPHICS(0)
PRINTF("%E %U iterations",I)
WHILE ch=255 DO OD
RETURN
CC65 YoshPlus: 41844 iterations in 100 ticks
Mad Pascal YoshPlus: 35572 iterations in 100 ticks
Action! YoshPlus: 33239 iterations in 100 ticks
Quick 1.6 YoshPlus: 16242 iterations in 100 ticks
Fast Basic FBI YoshPlus: 1458 iterations in 100 ticks
fig-Forth 1.1 YoshPlus: 715 iterations in 100 ticks
CLSN Pascal YoshPlus: 487 iterations in 100 ticks
CC65 Chessboard: 76 iterations in 150 ticks
Mad Pascal Chessboard: 40 iterations in 150 ticks
Action! Chessboard: 35 iterations in 150 ticks
CC65 (opt) SIEVE: 602 ticks in 10 iterations
Mad Pascal (opt) SIEVE: 644 ticks in 10 iterations
Action! SIEVE: 1003 ticks in 10 iterations
mads -x -i: -o:
CC65 YoshPlus: 41844 iterations in 100 ticks
Mad Pascal YoshPlus: 35572 iterations in 100 ticks
Action! YoshPlus: 33239 iterations in 100 ticks
Quick 1.6 YoshPlus: 16242 iterations in 100 ticks
Fast Basic FBI YoshPlus: 1458 iterations in 100 ticks
fig-Forth 1.1 YoshPlus: 715 iterations in 100 ticks
CLSN Pascal YoshPlus: 487 iterations in 100 ticks
CC65 Chessboard: 76 iterations in 150 ticks
Mad Pascal Chessboard: 40 iterations in 150 ticks
Action! Chessboard: 35 iterations in 150 ticks
CC65 (opt) SIEVE: 602 ticks in 10 iterations
Mad Pascal (opt) SIEVE: 644 ticks in 10 iterations
MADS (opt) SIEVE: 683 ticks in 10 iterations
MADS SIEVE: 900 ticks in 10 iterations
Action! SIEVE: 1003 ticks in 10 iterations
CC65 YoshPlus: 41844 iterations in 100 ticks
Mad Pascal YoshPlus: 35572 iterations in 100 ticks
Action! YoshPlus: 33239 iterations in 100 ticks
Quick 1.6 YoshPlus: 16242 iterations in 100 ticks
Fast Basic FBI YoshPlus: 1458 iterations in 100 ticks
fig-Forth 1.1 YoshPlus: 715 iterations in 100 ticks
CLSN Pascal YoshPlus: 487 iterations in 100 ticks
CC65 Chessboard: 76 iterations in 150 ticks
Mad Pascal Chessboard: 40 iterations in 150 ticks
Action! Chessboard: 35 iterations in 150 ticks
MADS (opt) SIEVE: 440 ticks in 10 iterations
CC65 (opt) SIEVE: 602 ticks in 10 iterations
Mad Pascal (opt) SIEVE: 644 ticks in 10 iterations
Action! SIEVE: 1003 ticks in 10 iterations
CC65 YoshPlus: 41844 iterations in 100 ticks
Mad Pascal YoshPlus: 35572 iterations in 100 ticks
Action! YoshPlus: 33239 iterations in 100 ticks
Quick 1.6 YoshPlus: 16242 iterations in 100 ticks
Fast Basic FBI YoshPlus: 1458 iterations in 100 ticks
fig-Forth 1.1 YoshPlus: 715 iterations in 100 ticks
CLSN Pascal YoshPlus: 487 iterations in 100 ticks
CC65 Chessboard: 76 iterations in 150 ticks
Mad Pascal Chessboard: 40 iterations in 150 ticks
Action! Chessboard: 35 iterations in 150 ticks
MADS (opt) SIEVE: 440 ticks in 10 iterations
CC65 (opt) SIEVE: 602 ticks in 10 iterations
Mad Pascal (opt) SIEVE: 644 ticks in 10 iterations
Action! SIEVE: 1003 ticks in 10 iterations
PL65 SIEVE: 3853 ticks in 10 iterations
fig-Forth 1.1 SIEVE: 8482 ticks in 10 iterations