flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
Evenbit 02 Oct 2007, 19:54
http://sourceforge.net/project/showfiles.php?group_id=165727
Version 2.3 of the StdLib is now on SourceForge. - Improvements: Linux support is now more complete. - Includes: Automated Test Suite The intention of this project is to support users of Randall Hyde's HLA (High Level Assembly) language who wish to maintain, extend, or evolve the HLA Standard Library. http://webster.cs.ucr.edu/AsmTools/HLA/index.html http://webster.cs.ucr.edu/AsmTools/HLA/stdlib2/index.html Nathan. |
|||
![]() |
|
vid 02 Oct 2007, 20:07
can you provide example of usage in FASM? Or at least some .lib version, so i can try it? I am not accustomed with compiling HLA code.
|
|||
![]() |
|
rhyde 04 Oct 2007, 21:03
vid wrote: can you provide example of usage in FASM? Or at least some .lib version, so i can try it? I am not accustomed with compiling HLA code. Well, the easiest way to see how to call the libraries from FASM is to compile an HLA program and tell it to produce FASM output code. If you have a program xyz.hla, the way to do this is Code:
hla -sf xyz
As for the longer term issue of calling HLA stdlib code from FASM, yes, there are plans to provide MASM, NASM, and FASM header files that allow this sort of stuff. But first, I've got to finish documenting all the code. BTW, if you look here: http://webster.cs.ucr.edu/AsmTools/MASM/HLA4MASM.html You'll see a very old attempt I made at calling stdlib functions from MASM. Nathan, I believe it was, converted some of this code to FASM. These attempts do *not* apply directly to stdlib v2.3, but they should give you a start on how it's done. BTW, if you're still interested, here's the MASM macro that (sort of) handles the HLA TRY..ENDTRY statement: Code: __tryCntr__ = 0 __exCntr__ = 0 __exLabel__ textequ <> try macro % ifnb <__exLabel__> .err <Cannot statically nest TRY/ENDTRY statements> exitm endif __exLabel__ CatStr <__exception>,%__exCntr__ __endExLabel__ CatStr <__endExcept>,%__tryCntr__ __unprotected__ = 0 push offset32 __exLabel__ push ebp mov ebp, [ExceptionPtr__hla_] push dword ptr [ebp+8] mov ebp, [esp+4] push offset32 HWexcept__hla_ push dword ptr [ExceptionPtr__hla_] mov dword ptr [ExceptionPtr__hla_], esp endm exception macro exNum % ifb <__exLabel__> .err <EXCEPTION outside TRY..ENDTRY block> exitm endif if __unprotected__ eq 0 mov esp, dword ptr [ExceptionPtr__hla_] pop dword ptr [ExceptionPtr__hla_] add esp, 8 pop ebp add esp, 4 endif jmp __endExLabel__ __exLabel__: __exCntr__ = __exCntr__+1 __exLabel__ CatStr <__exception>,%__exCntr__ __unprotected__ = 1 cmp eax, exNum jne __exLabel__ endm unprotected macro % ifb <__exLabel__> .err <UNPROTECTED outside TRY..ENDTRY block> exitm endif __unprotected__ = 1 mov esp, dword ptr [ExceptionPtr__hla_] pop dword ptr [ExceptionPtr__hla_] add esp, 8 pop ebp add esp, 4 endm anyexception macro % ifb <__exLabel__> .err <ANYEXCEPTION outside TRY..ENDTRY block> exitm endif if __unprotected__ eq 0 mov esp, dword ptr [ExceptionPtr__hla_] pop dword ptr [ExceptionPtr__hla_] add esp, 8 pop ebp add esp, 4 endif jmp __endExLabel__ __exLabel__: __exCntr__ = __exCntr__+1 __exLabel__ CatStr <__exception>,%__exCntr__ __unprotected__ = 1 endm endtry macro % ifb <__exLabel__> .err <ENDTRY w/o corresponding TRY statement> exitm endif if __unprotected__ eq 0 .err <TRY..ENDTRY w/o an exception handler> endif __exLabel__: __endExLabel__: __exCntr__ = __exCntr__+1 __tryCntr__ = __tryCntr__+1 __exLabel__ textequ <> __endExLabel__ textequ <> endm A *far better* one could be written in FASM (that allows static nesting), indeed a far better one could be written in MASM, but this macro, at least, shows you the code you need to generate for try..exception..anyexception..endtry. hLater, Randy Hyde |
|||
![]() |
|
Evenbit 06 Oct 2007, 20:15
rhyde wrote:
Just for the record, this was not me. I am of the impression that such work was attempted prior to my awareness of the existence of HLA. A targeted search of the available newsgroups and forums might reveal to person's identity. { unless Hutch's "delete happy" fingers have already destroyed such information ![]() Nathan. |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.