[fpc-pascal]interrupt 13h

XHajT03 at mbox.vol.cz XHajT03 at mbox.vol.cz
Tue Mar 5 18:40:23 CET 2002

From:           	BigMatt19 at aol.com
Date sent:      	Mon, 04 Mar 2002 14:08:05 EST
Subject:        	Re: [fpc-pascal]interrupt 13h
To:             	<fpc-pascal at deadlock.et.tudelft.nl>
Send reply to:  	fpc-pascal at deadlock.et.tudelft.nl

> Best as I can explain it... since fpc is a 32bit compilier when you
> are using assembler type stuff (eg. registers) you need to use 32bit
> registers.  ax, bx, cx, etc are all 16 bit registers.  It is pretty

 This isn't quite correct, IMHO. You don't necessarily have to use 32-
bit registers if you're trying to call 16-bit BIOS services (which is 
this case), and nothing else (namely, if you don't try to use 16-bit 
assembly as well). There's another problem though - some BIOS and DOS 
functions (including this one) expect to get address of a memory 
buffer for exchanging larger amounts of data. However, you must make 
sure this memory buffer is accessible to them (i.e. under the 1 MB 
boundary - 16-bit real mode functions can't access more memory), and 
you give them a correct address for the buffer (i.e. the one valid in 
real mode - the same memory area is addressed in an absolutely 
different way in 32-bit protected mode environment). Basically, you 
have to use special DPMI functions (GlobalDosAlloc and GlobalDosFree) 
for allocating memory within the first MB. You can either use unit 
Go32 delivered as part of our RTL, or unit DPMI by Thomas Schatzl 
(this one is packed together with a pretty comprehensive manual for 
DPMI functions; there should be a link to this unit in the 
contributions sections on our WWW pages).

Hope this helps


More information about the fpc-pascal mailing list