flat assembler
Message board for the users of flat assembler.
Index
> Macroinstructions > Pascal like function declarations |
Author |
|
macomics 05 Aug 2021, 17:24
As an alternative to the macros from proc.inc, I tried to create my own. They allow you to describe functions close to the syntax from Pascal. These macros are easily rewritten for 64-bit mode. Just replace the set of registers and the length of the predefined variables.
Code: function <NAME>,<REGS>,<CONF> <ARGS_LIST> var <VARS_LIST> begin <CODE> return <STATUS>, <VALUE> .local_label: return <STATUS>, <VALUE> except <SEH_CODE> return <ERROR>, <RESULT> where: <NAME> - name of function; <REGS> - any set of integer register (eax, ebx, ecx, edx, ebp, esi, edi, efl, all); <CONF> - one of function type: stdcall, fastcall, cdecl, register; <ARGS_LIST>,<VARS_LIST> - function args and local vars accessed from function body(names must start with the character '.'); <CODE> - function code; <STATUS> - carry flag value: SUCC(CF=0), FAIL(CF=1),SWAP(!CF),DONE(CF not changed); <VALUE> - return value, or [.Result] can be used to hold return value; <SEH_CODE> - Structured exception handling code (for Win32); <ERROR> - SEH return status: BREAK(continue from the point of safe return from the current function), CONTINUE(continue with the command that caused the program to be interrupted), RETRY(continue searching for a suitable SEH function); <RESULT> - error result.
|
|||||||||||
05 Aug 2021, 17:24 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.