Results 1 to 10 of 19

Thread: Converting ASM to Pascal

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #4
    OK, so from you routines i see you are needing to deal with low level access, so converting to high level pascal would not be a good idea. What you will need to do is make your integers be nativeint, ie. _EAX, _EDX etc... also change them to _RAX, _RCX etc

    replace your registers for mov to RAX, RCX etc e.g. mov rax, _RAX, the stack on 64-bit is also 16 byte aligned so you can push int64 directly on the stack for stdcall (however i don't recommend it as if the called function is not 64-bit and they do not clean the stack correctly, since they will expect stack on 4 byte alignment this could be a disaster). else you can still use the pascal functions StrLCopy etc for the memory copy to stack it will probably be more efficient.

    some other things to note, for Adr if the called function is fastcall, it will not alter esp for passed params since it does not use the stack, in this case you would need to correct the stack yourself.
    Last edited by Colin; 18-03-2013 at 05:39 PM.
    Download the Ziron Assembler
    Get free hosting for Ziron related fan-sites and Ziron projects, contact me in private message.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •