Announcement

Collapse
No announcement yet.

powerbasic data segment in inline asm

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

  • powerbasic data segment in inline asm

    Is it possible to load ds with powerbasic's data segment when you
    can't assume ds does? Something like a powerbasic internal variable
    or inline asm directive?

    Thanks,
    Ed

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

  • #2
    As far as I have seen, PB internally assigns its data segment
    to DS, so there is no reason to have to do it explicitly.
    IMPORTANT NOTE: before the ASM code in your procedures, make sure
    you include ! push ds. Then, be sure to include the corresponding
    ! pop ds at the end of the ASM stuff.


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

    Comment


    • #3
      Actually, with the memory model we use, SS always equals DS. Therefore, if you ever alter DS, Just...

      Push SS
      Pop DS

      ...to restore it, so it points to the main data segment.

      Bob Zale
      PowerBASIC Inc.


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

      Comment


      • #4
        Ahhhh! Good information to have! Thanks, Bob.


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

        Comment

        Working...
        X