flat assembler
Message board for the users of flat assembler.
![]() Goto page Previous 1, 2 |
Author |
|
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? |
|||
![]() |
|
rugxulo 17 Feb 2014, 08:01
arcangel wrote:
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/ . |
|||
![]() |
|
Goto page Previous 1, 2 < Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.