mirror of
https://github.com/KarolS/millfork.git
synced 2026-04-20 18:16:35 +00:00
Fix function pointers (fixes #86)
This commit is contained in:
@@ -39,7 +39,7 @@ Examples:
|
||||
You are not allowed to call such functions directly.
|
||||
The function cannot have parameters and the return type should be `void`.
|
||||
|
||||
* `kernal_interrupt` – the function is an interrupt handler called from a generic vendor-provider hardware interrupt handler.
|
||||
* `kernal_interrupt` – the function is an interrupt handler called from a generic vendor-provided hardware interrupt handler.
|
||||
The hardware instruction handler is assumed to have preserved the CPU registers,
|
||||
so this function only has to preserve the zeropage pseudoregisters.
|
||||
An example is the Commodore 64 interrupt handler that calls the function at an address read from $314/$315.
|
||||
@@ -85,9 +85,12 @@ and return `void` or a value of size max 2 bytes,
|
||||
can be accessed via a pointer.
|
||||
|
||||
void f() {}
|
||||
void g(byte x) {}
|
||||
|
||||
function.void.to.void p = f.pointer
|
||||
function.byte.to.void p = g.pointer
|
||||
|
||||
call(p)
|
||||
call(p, 13)
|
||||
|
||||
The value of the pointer `f.pointer` may not be the same as the value of the function address `f.addr`.
|
||||
|
||||
Reference in New Issue
Block a user