From: Charles Krug <charles AT pentek DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Text mode windowing
Date: Tue, 28 Oct 1997 13:48:59 -0500
Lines: 27
Message-ID: <3456339B.6FBE6F9B@pentek.com>
NNTP-Posting-Host: mail.pentek.com
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Precedence: bulk

I'm writing a text mode program that I'd like to "window" in text mode
--create a text window that I can use to scroll through lengthy lists.
The application is a database for my own purposes.   I'm open to
suggestions.  Here are my thoughts:

1. Write the display routines using int21 and int10.  This is very
familiar territory for me, but I wonder if there isn't a better way that
can be done from protected mode.

2.  Display lengthy lists by spawning LESS.  This is attractive, and is
likely to be the first iteration.

3.  I suppose I could roll one w/ Allegro.  That may be the last
iteration--for my own education.

4. Link using an existing library that provides some of the same
functions.  Unfortunatly, the only one's that I have access to are real
mode--and frankly not much easier than writing my own int10 routines.

Anyone with another idea?

Thanx


Charles Krug, Jr.


16

_GRFXBackgrBlit__FPUcPUci:
      ; prepare stack frame
      push ebp
      mov ebp, esp

      cld
      mov edi, [ebp + GRFXBackgrBlit_screenbuffer]
      mov esi, [ebp + GRFXBackgrBlit_image]
      mov ecx, [ebp + GRFXBackgrBlit_size]
      rep movsb

      ; restore stack frame
      mov esp, ebp
      pop ebp
      ret

I also have a grfx.cc file with the function declared as:

#include <grfx.h>

..other functions..

// copies a background to the screen buffer
extern void GRFXBackgrBlit(byte screenbuffer[],  // screen buffer to
copy background to
                        byte image[],         // background image
bitmap to copy
                        int size);            // size of bitmap

And a grfx.h header file with the function declared as:

// copies a background to the screen buffer
void GRFXBackgrBlit(byte screenbuffer[],  // screen buffer to copy
background to
                    byte image[],         // background image bitmap
to copy
                    int size);            // size of bitmap

The object file is created with: nasm -f coff grfx_a.asm
Now, when I try to link the external routine into my DJGPP C++
program, the linker responds with:
"undefined reference: void GRFXBackgrBlit(unsigned char *, unsigned
char *, int)"
All the other assembler functions (GRFXClearBuffer etc.) link orrectly
with the same type of header file. So the problem doesn't seem to be
with the C++ portions of the program.

I discovered that removing one of the pointers from the GRFXBackgrBlit
parameter list in both the C++ and assembler source files causes the
function to be recognised by the DJGPP linker. It seems that one is
unable to use two pointers as parameters in an external function. But
this surely can't be.

I would appreciate it if someone could explain to me what I'm doing
wrong. Please mail me at:
9618872 AT pukrs3 DOT puk DOT ac DOT za
I will send a summary to the newsgroup at a later stage.

Rudolf Visagie