flat assembler
Message board for the users of flat assembler.

Index > High Level Languages > 17 byte demo! in pascal

Goto page Previous  1, 2
Author
Thread Post new topic Reply to topic
arcangel



Joined: 19 Aug 2009
Posts: 39
arcangel 03 Feb 2014, 21:36
not working Sad

Instructions that work best are those with the demo


Code:
if (ax+cx) < ax then newcarryflag=1 else newcarryflag=0  
oldcarryflag = newcarryflag; 
ax := ax + cx + oldcarryflag;
    
Post 03 Feb 2014, 21:36
View user's profile Send private message Reply with quote
arcangel



Joined: 19 Aug 2009
Posts: 39
arcangel 08 Feb 2014, 12:26
Looking at the example. I want to do small multitasking and this is the code:

Code:
uses crt, Graph,SVGA_;
label exit, loop0, loop1;
var MX,MY: integer;
    FillInfo: FillSettingsType;
    s,s1:string;
    indice, carryflag, auxiliary, counter, color, x,y:integer;

{procedure setrgbpalette(i,r,g,b : byte);
begin
asm;
mov dx,3c8h;
mov al,i;
out dx,al;
inc dx;
mov al,r;
out dx,ax;
mov al,g;
out dx,al;
mov al,b;
out dx,al;
end;
end;
}
var i:integer;

BEGIN
{ SetVMode(0);}
     SetVMode(2);{v1024x768); }

{i:=0;
repeat
setRGBpalette(i,0,0,lo(i) shr 2);
inc(i);
until i=0;
}
     MX:=GetMaxX;
     MY:=GetMaxY;
x:=0;
y:=0;
repeat
putPixel(x,y,GetMaxColor div 3);
inc(x);
if x> MX then begin x:=0;inc(y);end;
until y> MY;
     str(MX,s);
     str(MY,s1);
     OutTextXY(MX div 3,MY div 2,s+','+s1);


carryflag := 0;

counter := 0;

color := 0;

indice := 0;


loop0:

x:=1;

y:=1;

loop1:

auxiliary := 0;

inc(auxiliary,color);

inc(auxiliary,counter);

carryflag := 0;

if auxiliary < color then inc(carryflag,1);

inc(color, counter);

inc(color, carryflag);

putPixel(x,y,color); { Tasking 1 }

putPixel(x+300,y+300,color); { Tasking 2 }

inc(x);
if x > 320 then begin x:=1;inc(y);end;

inc(indice,1);

dec(counter,1);

if counter <> 0 then goto loop1;

inc(color,1);

if keypressed then goto exit;

goto loop0;

exit:

end.

     readln;
     CloseGraph;
END.    


But it's very slow. I think that : I should put the computer in protected mode and use VESA 2.0 protocol for writing directly in video memory. I don't know how to do that. Can anybody help me, please?
Post 08 Feb 2014, 12:26
View user's profile Send private message Reply with quote
rugxulo



Joined: 09 Aug 2005
Posts: 2341
Location: Usono (aka, USA)
rugxulo 17 Feb 2014, 08:01
arcangel wrote:

But it's very slow. I think that : I should put the computer in protected mode and use VESA 2.0 protocol for writing directly in video memory. I don't know how to do that. Can anybody help me, please?


Protected mode? So you're trying to use old Turbo Pascal? Try using FreePascal instead. It definitely optimizes way better than TP. There are more DOS FPC users over at http://www.bttr-software.de/forum/ .
Post 17 Feb 2014, 08:01
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  
Goto page Previous  1, 2

< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.