a-pointer

A program of Roots.

main.ngp

target { region $0080 .. $00FF ram   region $2000 .. $BFFF ram }
modules { "call.asm" }
container raw

call.asm

.section zeropage
vector
        .res 2
.ends

.proc handler
        rts
.endp

; tag nobody
; The address of `handler` goes into a pointer and the pointer is jumped
; through. Neither line says the two are the same jump.
.section
address
        .own entry
        .word handler
.ends

.proc entry
        lda address
        sta vector
        lda address + 1
        sta vector + 1
        jmp (vector)
.endp
; end nobody

Memory map

  1. phase02 zero page, 16 bytes
AddressBytesSectionModuleKindPhasesWaits
$0080–$00812vectorcallsection0
$2000–$20001handlercallproc0
$2001–$20022addresscallsection0
$2003–$200F13entrycallproc0