Announcement

Collapse
No announcement yet.

$LINK assembly lang module

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Paul G. Penn
    replied
    Linking assembly into PB

    Doesn't PB have/use an $ALIAS metastatement that should correct this?

    Leave a comment:


  • Tom Hanlin
    replied
    DS will be set to PowerBASIC's one data segment by default. There is
    no need to reference DGROUP in a PB program. No, I'm not sure why it
    isn't supported; presumably, some conflict with the PB group handling.

    ------------------
    Tom Hanlin
    PowerBASIC Staff

    Leave a comment:


  • Guest's Avatar
    Guest replied
    PS the FAQ that Lance references also says use LARGE model.
    That may be where I got the idea originally, but again the model is not germaine to the problem at hand, which is referencing DGROUP.

    Thanks again.

    ------------------

    Leave a comment:


  • Guest's Avatar
    Guest replied
    thank you for your reply.
    I have read Ch 15, and reviewed it again before replying.
    All calls in PB are far. Data passed by ref is passed using far pointers, strings also get their own segments, this implies far data (large model). But the model is not important, since both med and large use far code.
    PB apparently does maintain its own local data in the default data segment. This is usually specified as DGROUP.
    The problem only occurs (regardless of model) when I try to reference DGROUP. I have tried using both the simplified segment directives (preferred method) and the old style of "DATA SEGMENT PARA PUBLIC 'DATA'" followed by a "DGROUP GROUP DATA". Neither one works.
    It implies that PB will not share the default data segment with an object file (again suggesting large model).
    However, because the object file will be used by a variety of programmers using C, C++, PASCAL, and PB, in all memory models (except for PB) we would like to only supply and maintain 1 source file/object file. The code in the original thread referencing DGROUP works fine in all of these other languages, just not PB. PB is forcing me to not reference DGROUP, which is required for the small model versions where DS and SS must remain equal.

    What is the issue loading DGROUP?

    Again, thanks in advance.

    ------------------

    Leave a comment:


  • Lance Edmonds
    replied
    Also check out the CTOPB.FAQ file that was installed with PB/DOS...


    ------------------
    Lance
    PowerBASIC Support
    mailto:[email protected][email protected]</A>

    Leave a comment:


  • Tom Hanlin
    replied
    I believe PB/DOS is expecting MEDIUM-model code. You may find it helpful to review Chapter 15, "Assembly language and PowerBASIC", in the PowerBASIC User's Guide.


    ------------------
    Tom Hanlin
    PowerBASIC Staff

    Leave a comment:


  • Guest's Avatar
    Guest started a topic $LINK assembly lang module

    $LINK assembly lang module

    I have written a simple assembly language module which has local data in the default data segment.
    The module will be shared by C and PB programs.
    I have written it for assembled it using the LARGE model.
    The problem is any reference to DGROUP causes PB to generate a "ERROR 507 Invalid link file" when it compiles the $LINK statement.
    I am simply trying to load ds with the local data segment.
    mov ax, DGROUP ; causes error
    mov ds, ax

    What is the solution to creating and using a data segment so that PB will $LINK correctly.

    Thank you.

    ------------------
Working...
X