; CS617 - Chapter 01 - unsigned 32-bit calculator
; Xandrian Labs / Alex and Sol / source modernization candidate
;
; Single versionless HD61 entry; assemble from the staged src/ root.
; Original r003 interface, calculator rules, splash, and card ID.
; This source is NOT an accepted ROM until owner build and regression.
;
; Dependency contract: source-exact lib-set-01/src/lib2 generations.
; Keep module and include order stable; see src/README.md.

        ORG     0
        LEVEL   0

; Constants and borrowed RAM, then the card's private boot scaffolding.
#INCLUDE (apps/u32calc/defs.inc)
#INCLUDE (lib2/keyboard/3/keyv540.inc)
#INCLUDE (apps/u32calc/card.s)

; Application owns semantics and display composition.
; ROM placement belongs to this root composition unit, not classic.s.
        ORG     &H0E80
#INCLUDE (apps/u32calc/classic.s)
#INCLUDE (apps/u32calc/ui.s)

; Shared physical services. No app-private copy of these mechanisms.
#INCLUDE (lib2/platform/1/lcd.s)
#INCLUDE (lib2/keyboard/3/keyv540.s)
#INCLUDE (lib2/timer/1/timer.s)
#INCLUDE (lib2/splash/1/splash.s)

; 32-bit unsigned primitives. The implementation instructions match the
; historical Chapter 01 providers after private-label normalization.
#INCLUDE (lib2/u32/1/divmod_u32_u32.inc)
#LIST
#INCLUDE (lib2/u32/1/divmod_u32_u16.inc)
#LIST
#INCLUDE (lib2/u32/1/mod_u32_u32.inc)
#LIST
#INCLUDE (lib2/u32/1/add_u32_u32.inc)
#LIST
#INCLUDE (lib2/u32/1/sub_u32_u32.inc)
#LIST
#INCLUDE (lib2/u32/1/mul_u32_u32.inc)
#LIST
#INCLUDE (lib2/u32/1/dec_append_u32.inc)
#LIST
#INCLUDE (lib2/u32/1/format_u32_dec.inc)
#LIST

        ORG     &HFFFF
        DB      0
