Announcement

Collapse
No announcement yet.

what is ASMDATA ?

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

    what is ASMDATA ?

    I saw Stuart's program on creation of ASMDATA block from a file
    https://forum.powerbasic.com/forum/u...ode#post815737

    how do we make use of this resultant ASMDATA block ? what would be its applications?


    I know that to convert this block into a working program is to place a ! in front of DB
    for example

    Code:
    DB 77,90,10,0,2,0,0,0,4,0,15,0,255,255,0,0,192,0,0,0,0,0,0,0,64,0,0,0,0
    becomes

    Code:
    ! DB 77,90,10,0,2,0,0,0,4,0,15,0,255,255,0,0,192,0,0,0,0,0,0,0,64,0,0,0,0
    but will this scheme work?

    #2
    Originally posted by Tim Lakinir View Post
    I saw Stuart's program on creation of ASMDATA block from a file
    how do we make use of this resultant ASMDATA block ? what would be its applications?
    See Help -> ASMDATA/END ASMDATA statements

    It lets you store any sort of data in your application which can be retrieved and used for any purpose.
    You can't use a [HASHTAG="t211"]resource[/HASHTAG] statement in an SLL, so it essentially gives you a replacement for [HASHTAG="t211"]resource[/HASHTAG] RCDATA in an SLL
    See for example https://forum.powerbasic.com/forum/u...sll#post815731
    where an ASMDATA block is used to store a file in an SLL which is then extracted and saved to disk.

    Apart from that, its use is only limited by your imagination.
    =========================
    https://camcopng.com
    =========================

    Comment


      #3
      Good one -- learn something new
      Thank you sir Stuart

      Code:
      LOCAL sTemp AS STRING sTemp = PEEK$(CODEPTR(zlibdll),53248) ' Name and size of ASMDATA block as pasted.

      Comment


        #4
        Tim,

        The original author of PB compilers, Bob Zale was an assembler language programmer and a member of the MASM forum until he passed away and his intention with one of the next versions of PB was to write the next version in PB, this is why you have things like the ASMDATA block and FASTPROC built into the current versions. With enough experience, you can in fact do more with a FASTPROC as it allows you to not only write a block of DB data but return a pointer to the DB block or even convert it to a basic string.
        hutch at movsd dot com
        The MASM Forum - SLL Modules and PB Libraries

        http://www.masm32.com/board/index.php?board=69.0

        Comment


          #5
          Thanks Steve, this is very interesting, please give an example of using FASTPROC ... does FASTPROC works faster than an ordinary function ?

          what's the advantages of FASTPROC over normal functions or subs ?

          Comment

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