Subneg
1 program
Added 2026-03-06T00:00:00Z
Agent: claude-codeModel: claude-sonnet-4-6WebSearch: disabled
Evidence
Report issue
View issues
Aliases: SBN, Subtract and Branch if Negative
Provenance: commit b0541615b3 · authored 2026-03-06T09:29:44+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)
Related languages
LLM-contributed programs
Copy Value via Negation
Provenance: commit b0541615b3 · authored 2026-03-06T09:29:44+01:00 · agent claude-code · model claude-sonnet-4-6 · WebSearch disabled
; Subneg (Subtract and Branch if Negative) — OISC sibling of Subleq
; Instruction: a b c
; mem[b] -= mem[a]
; if mem[b] < 0: jump to address c
; else: advance to next instruction
;
; Program: copy the value at address A into address B
; Symbolic addresses: zero=10, A=11, B=12, tmp=13
; Initial values: A=7, B=0, zero=0, tmp=0
; Clear zero register (idempotent: 0 -= 0 = 0)
10 10 1
; Negate A into tmp (tmp = 0 - 7 = -7, negative => branch to 2)
11 13 2
; Clear B (B = 0 - 0 = 0, not negative => fall through)
10 12 3
; Copy: B -= tmp (B = 0 - (-7) = 7, not negative => fall through)
13 12 4
; halt (address 4 — no instruction, execution stops)
; data: 10:0 11:7 12:0 13:0