flat assembler
Message board for the users of flat assembler.

flat assembler > High Level Languages > Problem with freePascal

Author
Thread Post new topic Reply to topic
arcangel



Joined: 19 Aug 2009
Posts: 39
Hi!

Code:
 program GrafAsm;

 uses crt;

var   pantalla: array [0..319,0..199]  of byte absolute $A000:$0000;         { Pues la pantalla Wink }
      bucle: integer;
const NumPuntos = 10000;       { NĂºmero de puntos que dibujaremos }

 procedure Modo320; assembler;
 {$ASMMODE intel}
 asm
   mov eax,$13
   int $10
 end;

 procedure ModoTxt; assembler;
  {$ASMMODE intel}
 asm
   mov eax,3
   int $10
 end;

 begin
 Modo320;
   for bucle := 1 to NumPuntos do 
     Pantalla[ random(319), random(199)] := random(255) ; 
   readln;
ModoTxt;
 end.
    


It doesn't recognise "$A000:0000"

Please, could anyone help me?

Thanks
Post 19 Aug 2012, 20:03
View user's profile Send private message Reply with quote
f0dder



Joined: 19 Feb 2004
Posts: 3172
Location: Denmark
Iirc, FreePascal only compiles for 32- and 64-bit - you're trying to use 16-bit addressing as well as BIOS calls... so this isn't going to work Smile
Post 19 Aug 2012, 20:39
View user's profile Send private message Visit poster's website Reply with quote
arcangel



Joined: 19 Aug 2009
Posts: 39
f0dder wrote:
Iirc, FreePascal only compiles for 32- and 64-bit - you're trying to use 16-bit addressing as well as BIOS calls... so this isn't going to work Smile


Embarassed I know, but I haven't found information on the net for 32 bits Mad

Please, can you help me? Rolling Eyes

Thanks Wink
Post 20 Aug 2012, 12:19
View user's profile Send private message Reply with quote
JohnFound



Joined: 16 Jun 2003
Posts: 3490
Location: Bulgaria
We can help you, but what actually you want to do? IMHO, the above program is easier to be written directly in FASM. (In this case you can create it for 16 bit dos and these interrupts will work)
Post 20 Aug 2012, 12:57
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
arcangel



Joined: 19 Aug 2009
Posts: 39
JohnFound wrote:
We can help you, but what actually you want to do? IMHO, the above program is easier to be written directly in FASM. (In this case you can create it for 16 bit dos and these interrupts will work)


I'm working with a little Pascal compiler, it generates its own code. Twisted Evil

My question is for virtual machine that executes this code Embarassed

I want that this works with Linux, Windows and Octaos Twisted Evil

I've made a little version, you can watch it in https://sites.google.com/site/bluedragonos1/

I would like to do this with freePascal too Rolling Eyes
Post 20 Aug 2012, 16:17
View user's profile Send private message Reply with quote
CandyMan



Joined: 04 Sep 2009
Posts: 286
Location: film "CandyMan" directed through Bernard Rose OR Candy Shop
Try linear address
Code:
var pantalla: array [0..319,0..199]of byte absolute $A0000;    

_________________
smaller is better
Post 21 Aug 2012, 15:46
View user's profile Send private message Reply with quote
arcangel



Joined: 19 Aug 2009
Posts: 39
CandyMan wrote:
Try linear address
Code:
var pantalla: array [0..319,0..199]of byte absolute $A0000;    

warning
Quote:

:~/Escritorio/binario$ fpc vga3.pas
Free Pascal Compiler version 2.4.0-2 [2010/03/06] for i386
Copyright (c) 1993-2009 by Florian Klaempfl
Target OS: Linux for i386
Compiling vga3.pas
Linking vga3
/usr/bin/ld: warning: link.res contains output sections; did you forget -T?
46 lines compiled, 0.1 sec

Runtime error 216
Quote:

:~/Escritorio/binario$ ./vga3
Runtime error 216 at $080480A5
$080480A5
$08069A47


It is not working Sad Sad Sad
Post 21 Aug 2012, 16:33
View user's profile Send private message Reply with quote
CandyMan



Joined: 04 Sep 2009
Posts: 286
Location: film "CandyMan" directed through Bernard Rose OR Candy Shop
This will only be working in pure dos (DOSEMU).

_________________
smaller is better
Post 21 Aug 2012, 17:58
View user's profile Send private message Reply with quote
rugxulo



Joined: 09 Aug 2005
Posts: 2311
Location: Usono (aka, USA)
news://comp.lang.pascal.borland is probably a better place (though it's quite empty these days and users of FPC for Go32v2 [DOS] are ever rarer).

Try looking at sources to Blocek (esp.VenomGfx) for inspiration.

Also, there are a lot of Pascal users (including aforementioned) at BTTR's forum.

The problem is that pmode is complicated and requires you to allocate a selector and point a descriptor?? to it (or some such). Some explicitly allocate $A000:0 in advance due to popularity, but Go32v2 (DJGPP v2 extended via DPMI via CWSDPMI) doesn't by default. Or at least Go32v2 (DJGPP) isn't zero-based like WDOSX or similar Watcom-y extenders. It can definitely be done, but I'm not big on graphics, so I don't know personally.

I would assume their (improved) Graph unit would support VGA out of the box. You can easily switch video modes via BIOS under DPMI with no problems (as long as you don't need addresses or translations or any direct read/write memory access).

P.S. Moderators: this may be better off in the DOS subforum.
Post 25 Nov 2012, 01:27
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:  


< 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-2018, Tomasz Grysztar.

Powered by rwasa.