Announcement

Collapse
No announcement yet.

ASCIIZ string

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

  • ASCIIZ string

    I have to pass a pointer to an ASCIIZ string from PBDOS to an assembler language TSR driver.

    If I define a fixed-length string in PBDOS with "DIM mystring$ as string*80" is this the same as an asciiz string? Or is there a command I have overlooked which allows to define asciiz strings in PBDOS? The string varies in length up to a maximum length and has to be terminated with a NUL-character.

    Do I use varptr/varseg to get the pointer to the fixed-length string or strptr/strseg?

    Georg

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

  • #2
    Dusting off the synaptic connections to PBdos, I don't believe
    that ASCIIz strings were native so you'll have to create your
    own by adding a CHR$(0) to the end of whatever text is in the
    string.

    MyStr$ = "Hello World" & CHR$(0)



    ------------------
    C'ya
    Don
    don at DASoftVSS dot com
    http://www.DASoftVSS.com
    C'ya
    Don

    http://www.ImagesBy.me

    Comment


    • #3
      Believe it or not, they were, at least in version 3.50, that is the one
      that I have used.

      DIM MyStr AS ASCIIZ * 40
      Forum: http://www.jose.it-berater.org/smfforum/index.php

      Comment


      • #4
        Georg,
        data types in PBDOS3.5
        Code:
        TYPE                 KEYWORD  IND  SIZE  RANGE
        Byte                 BYTE     ?      1   0 to 255
        Word                 WORD     ??     2   0 to 65,535
        Integer              INTEGER  %      2   -32,768 to 32,767
        Double Word          DWORD    ???    4   0 to 4,294,967,295
        Long Integer         LONG     &      4   -2,147,483,648 to 2,147,483,647
        Quad Integer         QUAD     &&     8   }9.22x10^18
        Single Precision     SINGLE   !      4   }8.43x10^-37  to }3.37x10^38
        Double Precision     DOUBLE   #      8   }4.19x10^-307 to }1.67x10^308
        Extended Precision   EXT      ##    10   }3.4x10^-4932 to }1.2x10^4932
        BCD Fixed Point      FIX      @      8   }9.99x10^-63  to 9.99x10^63
        BCD Float Point      BCD      @@    10   }9.99x10^-63  to 9.99x10^63
        Pointer              PTR      @      4   n/a
        
        Dynamic String       STRING   $          32750 bytes (see $STRING)
        Flex String          FLEX     $$         32750 bytes
        Fixed-length String  STRING*n            32750 bytes
        ASCIIZ String        ASCIIZ*n            32750 bytes
        Use VARPTR32 to point to the data. I suppose you could use varptr/varseg but varptr32 is easier.
        Code:
        dim a as asciiz*20
        a="01234qwerty"
        
        print a
        
        dim p as byte ptr
        p=varptr32(a)
        
        for r& = 0 to 20
        print chr$(@p[r&])
        
        next
        Paul.

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


        [This message has been edited by Paul Dixon (edited April 09, 2006).]

        Comment


        • #5
          Thank you very much! I am impressed how quick my question was answered here.

          Georg

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

          Comment

          Working...
          X