Announcement

Collapse
No announcement yet.

DEF SEG

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

    DEF SEG

    I AM TRYING TO FIGURE OUT HOW TO USE DEF SEG.
    HOW DO YOU KNOW WHAT SEGMENT TO USE OR WHAT NUMBER TO USE
    WITHOUT CAUSING A PROBLEM. HOW DO YOU KNOW WHAT EACH SEGMENT
    IS USED FOR ? ANY HELP WOULD BE GREAT. THANK YOU ALL.

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

    #2

    Hi tim,
    Look under "Memory" in "Ralph Brown's Interrupt List". It has
    very detailed information on it. I'm using the one in WinHelp
    format.

    Tony Burcham


    ------------------
    TheirCorp's projects at SourceForge

    TheirCorp's website

    sigpic

    Comment


      #3
      DEF SEG is only used to set up conditions used by other functions such as PEEK, POKE, or VARTPR; it is a statement which has no real meaning except in those contexts.

      Yes, under MS-DOS certain system tables are always located within certain segments; however, accessing that data requires PEEK or POKE, so again, DEF SEG serves only as a 'setup' for those functions.

      MCM

      Michael Mattias
      Tal Systems (retired)
      Port Washington WI USA
      [email protected]
      http://www.talsystems.com

      Comment


        #4
        Michael,
        It used to be that if you had data that exceeded the size of your
        data segement, then you used DEF SEG to switch among those blocks.
        A very necessary function in some circumstances.
        regards,

        ------------------
        [email protected]
        :) IRC :)

        Comment


          #5
          Among other uses, I like to copy Text Screens to a string.

          Code:
          DEF SEG = &HB800  ' is the starting address of a color screen.
          
          a$ = PEEK$(0, 4000)  ' will copy all text and color attributes into a$
          CLS                     ' you can clear the screen
                                 ' Segment already set
          POKE$ 0, a$           ' is a fast way of putting your screen back
          
          DEF SEG                ' back to its default segment
          You would want to use DEF SEG if you wanted to BSAVE a screen to a file
          Code:
          DEF SEG = &HB800
          BSAVE "TEXT.bsa",0, 4000
          CLS                            'Clear the screen
          'Segment already set, don't need to reset it
          BLOAD "TEXT.bsa             'Put the screen back
          DEF SEG    'Reset to Default
          If you are BLOADing a screen from a file that has been saved before,
          You would want to use DEF SEG = &HB800 on it first.

          For Monochrome monitors you would use setting &HB000 instead of &HB800.

          Read about BSAVE in your manuel, it should have something about DEF SEG.




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

          Comment


            #6
            thank you for the help. after reading all the coments about
            mr. bush i was sorta afraid to post a topic. it's always
            nice to get just help without the strange comments.

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

            Comment


              #7
              There is a few who makes strange and unwanted comments, but don't
              let that bother you. When it comes to dishing out help, most here
              are pretty free with it. You might as well get your share of it.

              You've got to respect the ones who sees their mistakes and apologize
              for it.

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

              Comment


                #8
                that's true if someone says sorry we must forgive and just
                remember we have all made mistakes in the past. the biggest
                mistake i made was not finding powerbasic sooner!

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

                Comment

                Working...
                X
                😀
                🥰
                🤢
                😎
                😡
                👍
                👎