by-its-argument

A program of Conditionals and packs.

main.ngp

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

skip.asm

; Advance a zero-page pointer by a constant. There is a shortest way for each
; of them, and which one is written out is decided where the macro is used.
.macro skip p, n
.if n == 1
        inc p
.elsif n == 2
        inc p
        inc p
.else
        clc
        lda p
        adc #n
        sta p
.endif
.endm

.proc entry
at      .ztemp 1

        skip at, 1
        skip at, 2
        skip at, 7
        rts
.endp

Memory map

  1. phase01 zero page, 14 bytes
AddressBytesSectionModuleKindPhasesWaits
$0080–$00801entry.atskiptemporary0
$2000–$200D14entryskipproc0