Announcement

Collapse
No announcement yet.

Little Help Asm

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

  • Little Help Asm

    hi all , i intended purchase powerbasic, but i need a very great information first.
    With powerbasic is possible to pass in ASM code this instruction:

    Example in C++ ASM
    ----------------------------------------------------
    _asm
    {
    lea eax, NewFunPoint
    mov ebx, FunEntry
    sub eax, ebx
    sub eax, 5
    move dword ptr [NewFunCode+1],eax
    }

    NewFunPoint:
    -------------------------------------------------------
    NewFunCode as an array of byte (0 to 5)

    the asm instruction for point direct to array of byte for fill
    in powerbasic this work? are equal ? or not

    i have try with registered powerbasic of a my friend and retrieve an error:
    "Asm Sintax Error" with powerbasic

    i have write this code with powerbasic for test:
    ------------------------------------------------------
    LOCAL NewFunCode(0 TO 5) AS BYTE

    !lea eax, NewFunPoint
    !mov ebx, FunEntry
    !sub eax, ebx
    !sub eax, 5
    !mov dword ptr [NewFunCode+1], eax <-- these instruction error "Asm sintax error"

    NewFunPoint:
    -----------------------------------------------------------------
    there are a method for equivalent solution in asm for powerbasic for manipulate array pointer?

    please help i need to purchase powerbasic.

  • #2
    Originally posted by a.sabato View Post
    please help i need to purchase powerbasic.
    No problem, just assign the address of the array to a dword pointer and load that in the register instead. But what on earth are you trying to do?

    Comment


    • #3
      Originally posted by a.sabato View Post
      i have try with registered powerbasic of a my friend and retrieve an error:
      "Asm Sintax Error" with powerbasic

      i have write this code with powerbasic for test:
      ------------------------------------------------------
      Now, how about this?
      Code:
      LOCAL NewFunCode(0 TO 5) AS BYTE
      LOCAL nfcPtr AS LONG
         nfcPtr = VARPTR(NewFunCode(0))
       
        !lea eax, NewFunPoint
        !mov ecx, nfcPtr  
        !mov ebx, FunEntry
        !sub eax, ebx
        !sub eax, 5
        !mov [ecx+1], eax    ;now I think we have it
      Last edited by John Gleason; 10 Jul 2008, 12:18 PM. Reason: corrected code

      Comment


      • #4
        Antonio,

        You can accomplish the goal of your code very easily with PowerBASIC, but the syntax as you entered it, is not a valid opcode for an Intel Pentium CPU.

        Please ask your friend (the one who owns a lawful copy of PowerBASIC) to contact PB Technical Support, and they'll provide him with detailed information at no cost. However, since PowerBASIC is licensed to just one programmer, we cannot sanction your use of his compiler. That would be a serious violation of our copyright and software license agreement.

        Since you said " please help i need to purchase powerbasic", I think the best solution would be for you to purchase the product right away. Then we can help you with all of your questions.

        Bob Zale
        PowerBASIC Inc.

        Comment


        • #5
          Is it just me to whom it looks as though the best way to write that function in PB would actually be something like an inline ARRAY INSERT on a byte array?

          (Someone who knows assembly language could figure it out).

          Just because C++ does not have ARRAY INSERT doesn't mean the PB compiler doesn't.


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

          Comment


          • #6
            How did Bob know that a.sabato is Antonio? Spooky.

            Comment


            • #7
              Bob has the Power...

              Comment


              • #8
                Because he gave his name when he registered for the forums?

                Rod

                PS Or what Brice said.
                Last edited by Rodney Hicks; 10 Jul 2008, 01:40 PM. Reason: overlapping posts.
                Rod
                In some future era, dark matter and dark energy will only be found in Astronomy's Dark Ages.

                Comment


                • #9
                  firstname, lastname?

                  Comment


                  • #10
                    aka...around here everyone is willing to help (hell even bend over backwards if needed) but there is a line where user MUST take the plunge, or they will never get wet
                    Engineer's Motto: If it aint broke take it apart and fix it

                    "If at 1st you don't succeed... call it version 1.0"

                    "Half of Programming is coding"....."The other 90% is DEBUGGING"

                    "Document my code????" .... "WHYYY??? do you think they call it CODE? "

                    Comment

                    Working...
                    X