wswan:guide:c_assembly
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revision | |||
| wswan:guide:c_assembly [2025/08/15 14:43] – [Useful macros] asie | wswan:guide:c_assembly [2025/12/31 12:59] (current) – asie | ||
|---|---|---|---|
| Line 17: | Line 17: | ||
| - Include the Wonderful toolchain' | - Include the Wonderful toolchain' | ||
| - | - Include the libws library' | + | - Include the libws library' |
| - Tell the assembler to emit 16-bit code; this is useful as the GNU assembler supports all kinds of x86 code, including 32-bit and 64-bit. | - Tell the assembler to emit 16-bit code; this is useful as the GNU assembler supports all kinds of x86 code, including 32-bit and 64-bit. | ||
| - Tell the assembler to emit 80186 code; this unlocks some additional 80186-exclusive opcodes supported on the NEC V30MZ. | - Tell the assembler to emit 80186 code; this unlocks some additional 80186-exclusive opcodes supported on the NEC V30MZ. | ||
| Line 31: | Line 31: | ||
| ===== Useful macros ===== | ===== Useful macros ===== | ||
| - | '' | + | Including |
| - | | + | ==== Portable calling convention ==== |
| - | * **IA16_JMP** - for portability between code models, you can use this macro in place of the '' | + | |
| - | * **IA16_RET** - for portability between code models, you can use this macro in place of the '' | + | The '' |
| - | * **IA16_CALL_STACK_OFFSET(x)** - for portability between code models, you can use this macro to get a stack offset with the function return address accounted for. For exapmle, in a "near" | + | |
| + | | ||
| + | * **IA16_CALL_LOCAL** - use this macro in place of the '' | ||
| + | * **IA16_JMP** - use this macro in place of the '' | ||
| + | * **IA16_RET** - use this macro in place of the '' | ||
| + | * **IA16_CALL_STACK_OFFSET(x)** - for portability between code models, you can use this macro to get a stack offset with the function return address accounted for. For example, in a //near// code model, '' | ||
wswan/guide/c_assembly.txt · Last modified: by asie
