standardized call-out blocks
[rrq/rrqforth.git] / adoc / inline_code.adoc
1 // rrqforth.asm:        WORD inline_code,'[ASM]',fasm
2
3 anchor:inline_code[]
4
5 === Word: [ASM]
6
7 ....
8 data stack: ( -- )
9 ....
10
11 "[ASM]" is a function word that introduces inline assembly in an
12 RRQFORTH definition. Such assembly code may return to subsequence
13 RRQFORTH executon by means of the following instruction sequence:
14
15 ====
16 ----
17         mov rsi,forthcode
18         lodsq
19         jmp qword [rax]
20 forthcode:
21 ----
22 ====
23
24 Note that the FORTH compiler does not invoke an assembler so any
25 inline assembly code must be provided in its binary form.