Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2000-12

Support for 16-bit assembler ?

13 messages · 6 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Davor Dundovic
to Florian Klaempfl
>Will support for 16-bit assembler be added to FPC in the future ? No, because there is no use for it. FPC is a 32 bit compiler.

I meant for compatibility reasons. I have a lot of assembly code built in my TPUs and it is pain in the neck to change that to 32-bit code.

BTW, I don't know if this is right mailing-list, both DOS and Windows versions of IDE are quite unstable. They crash every 10 compiling or so.

Reply by email

Marco van de Voort
to Davor Dundovic
Show quoted text 7 lines
>>Will support for 16-bit assembler be added to FPC in the future ? > >No, because there is no use for it. FPC is a 32 bit compiler. I meant for compatibility reasons. I have a lot of assembly code built in my TPUs and it is pain in the neck to change that to 32-bit code.

Afaik, everything 16-bit that runs in 32-bit protected mode is supported (like purely calculating code). Supporting 16-bit segment and hardware interfacing would come down to writing a 16-bits realmode emulator inside the 32-bit extender.

Marco van de Voort ( or )

Reply by email

Florian Klaempfl
to Davor Dundovic: I meant for compatibility reasons. I have a lot of assembly code built in my TPUs and it…
you wrote 7 lines
>>Will support for 16-bit assembler be added to FPC in the future ? > >No, because there is no use for it. FPC is a 32 bit compiler. I meant for compatibility reasons. I have a lot of assembly code built in my TPUs and it is pain in the neck to change that to 32-bit code.

There is no way, you've to rewrite it because 32 bit protected mode uses a completly
different memory model.

BTW, I don't know if this is right mailing-list, both DOS and Windows versions of IDE are quite

It is the right one.

unstable. They crash every 10 compiling or so.

Which version do you use?

Reply by email

Davor Dundovic
to Florian Klaempfl
Show quoted text 6 lines
>I meant for compatibility reasons. I have a lot of assembly code built in >my TPUs and it is pain in the neck to change that to 32-bit code. There is no way, you've to rewrite it because 32 bit protected mode uses a completly different memory model.

OK, different question: is it possible to read/write from/to absolute address without generating runtime error ?

var p : ^byte;
begin
p := $f0000000;
writeln(p^);
end.

This program generates runtime error 216. This is, I belive, general protection fault.

Show quoted text 8 lines
>BTW, I don't know if this is right mailing-list, both DOS and Windows >versions of IDE are quite It is the right one. >unstable. They crash every 10 compiling or so. Which version do you use?

FreePascal IDE for Win32 Version 0.9.1 2000/10/12 (Compiler Version 1.0.2) and the DOS version is that which came in dosw32102full.zip.

I have downloaded snapshot hoping some of the problems would be solved so current version is
FreePascal IDE for Dos
Version 0.9.1 2000/12/03
(Compiler Version 1.1)
(Debugger GDB 4.18.pas.b1)

I'm having some problems with these snapshots. First of all what files do I need. Is it sufficient to DL basego32.zip, idego32.zip, basew32.zip and idew32.zip ? Also basew32.zip and idew32.zip downloaded from site in Germany had errors and could not be unpacked. I don't know if the problem is on my side.

I have already submitted two bug reports.

Reply by email

Michael Knapp
to Davor Dundovic
Davor Dundovic wrote 19 lines
>>I meant for compatibility reasons. I have a lot of assembly code built in >>my TPUs and it is pain in the neck to change that to 32-bit code. > >There is no way, you've to rewrite it because 32 bit protected mode uses a >completly >different memory model. OK, different question: is it possible to read/write from/to absolute address without generating runtime error ? var p : ^byte; begin p := $f0000000; writeln(p^); end. This program generates runtime error 216. This is, I belive, general protection fault.

It's ok that the program crashes ... :-)

that should work

uses go32v2;
var p:^byte;
begin
  set_segment_limit(get_ds,$ffffffff);
p:=pointer(get_linear_addr($f0000000,1)-get_segment_base_address(get_ds));
  writeln(p^);
end.

IMPORTANT: Write to any addresses ONLY if you know which areas in the address space you (over)write, otherwise
it could result in data loss (happened to me once)

Michael

+--------------------------------------------------------------------+ | Michael Knapp - Mauerbach - Niederösterreich - Austria - Europe | | E-Mail: ICQ: 36542787 | +--------------------------------------------------------------------+ | G r a p h i X http://programmierer.freepage.de/graphix/ | | Graphics Library for Freepascal, Virtual Pascal and Borland Pascal | | http://graphix4pascal.cjb.net/ http://www.graphix4pascal.de.vu/ | +--------------------------------------------------------------------+

Reply by email

Florian Klaempfl
to Michael Knapp
you wrote 30 lines
> OK, different question: is it possible to read/write from/to absolute > address without generating runtime error ? > > var p : ^byte; > begin > p := $f0000000; > writeln(p^); > end. > > This program generates runtime error 216. This is, I belive, general > protection fault. It's ok that the program crashes ... :-) that should work uses go32v2; var p:^byte; begin set_segment_limit(get_ds,$ffffffff); p:=pointer(get_linear_addr($f0000000,1)-get_segment_base_address(get_ds)); writeln(p^); end. IMPORTANT: Write to any addresses ONLY if you know which areas in the address space you (over)write, otherwise it could result in data loss (happened to me once)

... and it works only for the DOS version. There is no way to get this working on linux/win/os2 etc

Reply by email

Davor Dundovic
to Michael Knapp: It's ok that the program crashes ... :-) that should work uses go32v2; var p:^byte; begin…
you wrote
It's ok that the program crashes ... :-)

;-))

Show quoted text 12 lines
that should work uses go32v2; var p:^byte; begin set_segment_limit(get_ds,$ffffffff); p:=pointer(get_linear_addr($f0000000,1)-get_segment_base_address(get_ds)); writeln(p^); end.

Very complicated. :-(( I have over 3 MB of Turbo pascal code, some of it written in BASM, which I would like to port to FP. It's not going to be an easy task.

I use absolute addresses mostly for fast writing characters to video memory. How do I do that in FP ? Is there a unit that I could use ?

Reply by email

Michael Van Canneyt
to Davor Dundovic
Davor Dundovic wrote 28 lines
At 02:36 04. 12. 00 +0100, you wrote: >It's ok that the program crashes ... :-) ;-)) >that should work > >uses go32v2; > >var p:^byte; > >begin > set_segment_limit(get_ds,$ffffffff); > >p:=pointer(get_linear_addr($f0000000,1)-get_segment_base_address(get_ds)); > writeln(p^); >end. Very complicated. :-(( I have over 3 MB of Turbo pascal code, some of it written in BASM, which I would like to port to FP. It's not going to be an easy task. I use absolute addresses mostly for fast writing characters to video memory. How do I do that in FP ? Is there a unit that I could use ?

Yes, the video unit.

It's not yet documented, though.

But the IDE uses it so it performs well..

Michael.

Reply by email

Davor Dundovic
to Florian Klaempfl
Show quoted text 5 lines
>I use absolute addresses mostly for fast writing characters to video >memory. How do I do that in FP ? Is there a unit that I could use ? Which OS do you use? Under go32v2 you can use the mem[...] array as with TP/BP.

DOS/Win98. I have various assembly fastwrite routines that I can't use under FP. Michael mentioned video unit. Is there any kind of documentation for it ? An example program maybe ?

Reply by email

Jonas Maebe
Show quoted text 9 lines
>>I use absolute addresses mostly for fast writing characters to video >>memory. How do I do that in FP ? Is there a unit that I could use ? > >Which OS do you use? Under go32v2 you can use the mem[...] array as with >TP/BP. DOS/Win98. I have various assembly fastwrite routines that I can't use under FP. Michael mentioned video unit. Is there any kind of documentation for it ? An example program maybe ?

The video unit still doesn't allow you direct access to the screen, it only has a virtual buffer (a simple array) to which you can write and afterwards you can tell the video unit to blit its contents to screen (with a choice whether only the changed parts should be updated or the whole screen).

Direct (text video) memory access is simply not possible under Win32.

Jonas

Reply by email