[fpc-pascal] Identifier not found "MEMW"

Karoly Balogh (Charlie/SGR) charlie at scenergy.dfmk.hu
Fri May 9 15:38:12 CEST 2014


Hi,

On Fri, 9 May 2014, nitinjain wrote:

>                *MEMW[$B800:(width_offset-1)*2
>                          +(height_offset-1)*160]:=current_location^.code;*

For the sake of completeness, this piece of code is just writing a
character to the text mode memory of the display hardware directly.

That memory area starts at a fixed address of $B800:0000 in 16bit DOS.
So, the second part after the colon is just a normal X/Y coordinate to
address (offset) calculation where the width values are multiplied by 2,
because the hardware stores a character on 2 bytes (this is also why MEMW
is used). The 160 there is really just the width of the screen (80
characters) multiplied by 2.

Hope this helps a bit. As others suggested, it's possible to rewrite such
code using the video unit to work with modern systems.

Charlie



More information about the fpc-pascal mailing list