flat assembler
Message board for the users of flat assembler.
Index
> OS Construction > multiple stacks in real mode. |
Author |
|
baldr 06 Mar 2010, 10:44
edfed,
This resembles the concept from FORTH: separate data and return stacks. Nothing really complex, you may use following (straightforward) macros, assuming that return stack is pointed by es:bp: Code: macro _call_f target* { local ..retaddr mov [es:bp-2], cs mov word[es:bp-4], ..retaddr lea ebp, [bp-4] jmp target ..retaddr: } macro _ret_f { lea ebp, [bp+4] jmp dword[es:bp-4] } Code: macro _call_r target* { local ..retaddr mov bp, ..retaddr jmp target ..retaddr: } macro _ret_r { jmp bp } |
|||
06 Mar 2010, 10:44 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.