flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
plusplus 17 Nov 2010, 00:46
Does anyone have an idea how to use fasm.dll with Delphi 2010, or even sample code.
I tried but did not get far. ![]() |
|||
![]() |
|
JohnFound 17 Nov 2010, 15:09
Probably you have to declare functions as external in Delphi. Actually I simply can't remember what was the proper format....
|
|||
![]() |
|
plusplus 17 Nov 2010, 17:53
JohnFound wrote: Probably you have to declare functions as external in Delphi. Actually I simply can't remember what was the proper format.... I know how to load the dll, I know how to find the functions. what I dont know is how to declare the structs of asm in delphi. |
|||
![]() |
|
JohnFound 18 Nov 2010, 09:54
For what structs you are talking about? Generally in Delphi, data structures are declared with "type" and "var".
Also there are dynamic data allocation procedures (New, GetMem or both. ![]() Isn't it better to describe what exactly you done and what exactly the problem is. Posting of your code would be very helpful. Now it looks like: "Help I am drowning!" ![]() |
|||
![]() |
|
plusplus 18 Nov 2010, 20:53
1. I am loading the dll with API Call LoadLibrary - no problem
2. I have declared a proc var which corresponds to fasm_Assemble This is where I am stuck. The lpMemory should be a pointer to the memory block and cbMemorySize should contain its size. In the beginning of this memory block the FASM_STATE structure will reside (as defined in FASM.ASH). The assembler doesn't allocate any memory beside this block, if it is not enough for its purposes, the function returns with FASM_OUT_OF_MEMORY state. 1. how do I type FASM_STATE structure and put it into the beginning of the memory? 2. How do I read it after the execution 3. How do I pass vars |
|||
![]() |
|
JohnFound 18 Nov 2010, 21:48
Well, FASM_STATE is very simply. I believe you have to define it with:
type TFasmState record condition: cardinal; and so on.... as in Delphi (Pascal) manual. Then you have to allocate some memory (read the Delphi/VCL manual for functions); then to assign the pointer to the pointer of type (I believe) var MyFasmState: ^TFasmState; and to use MyFasmState^ variable. Really, I have an impression you don't speak Delphi very well. Why not to make the task fully in assembly? ![]() |
|||
![]() |
|
plusplus 22 Nov 2010, 22:44
JohnFound wrote: Well, FASM_STATE is very simply. I believe you have to define it with: Mhm, I will dig some more into delphi manuals, I am trying to create a fasm scripting tool for inline assembly coding. |
|||
![]() |
|
Enko 04 Dec 2010, 15:51
Perhaps its a bit too late, but this site has greate staff about using the winApi in delphi.
http://www.angelfire.com/hi5/delphizeus/ here you can finde the data types equivalents: http://www.angelfire.com/hi5/delphizeus/lifts.html |
|||
![]() |
|
cg5210 09 Dec 2010, 08:23
the demo not hDisplayPipe
fasm_Assemble(lpSource,lpMemory,cbMemorySize,nPassesLimit,hDisplayPipe) how to use hDisplayPipe |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.