1802 Assembly

1 program Added 2026-03-13T00:00:00Z Agent: claude-codeModel: claude-sonnet-4-6WebSearch: disabled Evidence Report issue View issues
Aliases: RCA 1802 Assembly, COSMAC Assembly, CDP1802 Assembly
Provenance: commit 43ddff130c · authored 2026-03-13T07:05:48+01:00 · agent claude-code · model claude-sonnet-4-6

Sources mentioning this language

1 source · not in taxonomy (canonical name didn't match any upstream)
LLM (this repo) · 1

Related languages

TX-2 Assembly (0.27)CDC 6600 Assembly (0.24)DLX (0.24)PDP-6 Assembly (0.23)PDP-11 Assembly (0.23)

LLM-contributed programs

Fibonacci Sequence

Provenance: commit 43ddff130c · authored 2026-03-13T07:05:48+01:00 · agent claude-code · model claude-sonnet-4-6 · WebSearch disabled
code.asm · license: Public Domain · added: 2026-03-13T00:00:00Z
; RCA 1802 Assembly - Fibonacci Sequence
; Computes first 10 Fibonacci numbers (8-bit) and stores to memory
; Assembles with standard RCA 1802 assembler syntax

        ORG  0000H

; Memory layout:
;   0000H: Program code
;   0100H: Result buffer (10 bytes)
;
; Register use:
;   R0 = program counter (P=0)
;   R2 = memory pointer (X=2), also result pointer
;   R4 = F(n-1), previous Fibonacci number
;   R5 = F(n),   current Fibonacci number
;   R6 = loop counter
;   R7 = temporary (F(n+1))

        LDI  01H        ; Load high byte of result address
        PHI  R2
        LDI  00H        ; Load low byte of result address
        PLO  R2         ; R2 = 0100H

        SEX  R2         ; Set X = 2 (memory operations via R2)

        LDI  00H
        PLO  R4         ; R4 = 0 (first Fibonacci number)
        LDI  01H
        PLO  R5         ; R5 = 1 (second Fibonacci number)
        LDI  0AH
        PLO  R6         ; R6 = 10 (loop count)

LOOP:   GLO  R4         ; D = F(n-1)
        STR  R2         ; Store F(n-1) to result buffer
        INC  R2         ; Advance result pointer

        GLO  R4         ; D = F(n-1)
        STR  R2         ; Temp: store F(n-1) at M(R2)
        GLO  R5         ; D = F(n)
        ADD             ; D = F(n) + M(R2) = F(n) + F(n-1) = F(n+1)
        PLO  R7         ; Save F(n+1) in R7

        GLO  R5
        PLO  R4         ; R4 = old F(n) [becomes new F(n-1)]
        GLO  R7
        PLO  R5         ; R5 = F(n+1) [becomes new F(n)]

        DEC  R6         ; Decrement counter
        GLO  R6         ; Load counter into D
        BNZ  LOOP       ; Branch if counter not zero

        IDL             ; Halt (wait for interrupt)

        END

Contribute — propose a file extension

Tell us where to find evidence about 1802 Assembly (mapped to pl/1802_assembly). A reference URL is required; at least one of extension or program code must be provided too. A maintainer reviews each submission via a draft PR before anything lands.
Optional: attach a program from that URL
If the reference URL points at a single source file you'd like to add as an example program, paste it below. The workflow will write it under languages/1802 Assembly/programs/<sha>/. Keep under ~200 lines.
(or open the pre-filled issue directly)
← 1764774817 1=0 →