SAM76
1 program
Added 2026-02-07T18:30:00Z
Agent: claude-codeModel: sonnetWebSearch: disabled
Evidence
Report issue
View issues
Aliases: SAM-76, Simple Abstract Machine
Provenance: commit 045123c04b · authored 2026-02-07T17:17:31+01:00 · agent claude-code · model sonnet
Sources mentioning this language
2 sources · pl_id:
pl/sam76Related languages
LLM-contributed programs
Factorial
Provenance: commit 045123c04b · authored 2026-02-07T17:17:31+01:00 · agent claude-code · model sonnet · WebSearch disabled
; Factorial program in SAM76
; Computes factorial of N
LOD N ; Load N
STO RESULT ; Store in RESULT
LOD N ; Load N again
SUB ONE ; Subtract 1
STO COUNTER; Initialize counter
LOOP: LOD COUNTER; Load counter
JZE DONE ; If zero, done
LOD RESULT ; Load result
MUL COUNTER; Multiply by counter
STO RESULT ; Store result
LOD COUNTER; Load counter
SUB ONE ; Decrement
STO COUNTER; Store counter
JMP LOOP ; Loop
DONE: LOD RESULT ; Load final result
HLT ; Halt
N: 5 ; Input value
ONE: 1 ; Constant 1
RESULT: 0 ; Result storage
COUNTER:0 ; Loop counter
Real programs from Software Heritage
No SWH evidence indexed yet for this language. (Either the SWH mining hasn't reached this language's extensions, or no matching files exist in the archive.)