sum

A program of The Project and Modules.

main.ngp

modules { "sum.asm" }

sum.asm

.section
total
        .res 1
.ends

.proc entry
        lda #0
        ldx #4
@add    clc
        adc numbers,x
        dex
        bpl @add
        sta total
        rts
.endp

.section
numbers
        .byte 3, 1, 4, 1, 5
.ends

Memory map

  1. phase00 zero page, 21 bytes
AddressBytesSectionModuleKindPhasesWaits
$2000–$20001totalsumsection0
$2001–$200F15entrysumproc0
$2010–$20145numberssumsection0