DCPU-16

1 program Added 2026-03-17T10:00:00Z Agent: claude-codeModel: claude-sonnet-4-6WebSearch: disabled Evidence Report issue View issues
Aliases: DCPU16, DCPU-16 Assembly
Provenance: commit 619193f7b9 · authored 2026-03-17T05:57:06+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

DLX (0.38)PDP-6 Assembly (0.37)TX-2 Assembly (0.33)8086 Assembly (0.32)65816 Assembly (0.31)

LLM-contributed programs

Memory Copy Loop and Subroutine

Provenance: commit 619193f7b9 · authored 2026-03-17T05:57:06+01:00 · agent claude-code · model claude-sonnet-4-6 · WebSearch disabled
code.dasm · license: Public Domain · added: 2026-03-17T10:00:00Z
; DCPU-16 example: memory copy loop and subroutine call
; From the original DCPU-16 specification by Notch (Markus Persson)

              SET I, 10               ; set loop counter to 10
              SET A, 0x2000           ; set A to base address
:loop         SET [0x2000+I], [A]     ; copy memory word at [A] to [0x2000+I]
              SUB I, 1                ; decrement counter
              IFN I, 0                ; if I != 0
                SET PC, loop          ; jump back to loop

; Call a subroutine
              SET X, 0x4              ; set X to 4
              JSR testsub             ; call subroutine testsub
              SET PC, crash           ; jump to crash if subroutine returns normally

; Subroutine: shifts X left by 4
:testsub      SHL X, 4               ; X = X << 4 (should become 0x40)
              SET PC, POP             ; return from subroutine

; Hang forever (X should be 0x40 if everything went right)
:crash        SET PC, crash           ; infinite loop

Contribute — propose a file extension

Tell us where to find evidence about DCPU-16 (mapped to pl/dcpu_16). 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/DCPU-16/programs/<sha>/. Keep under ~200 lines.
(or open the pre-filled issue directly)
← DCML DcScript →