Skip to content
Snippets Groups Projects
Commit dff0fe8b authored by Peter Gerwinski's avatar Peter Gerwinski
Browse files

Beispiele 25.5.2021

parent 400d8ad4
Branches
No related tags found
No related merge requests found
;redcode
;name Dwarf
;author A. K. Dewdney, P. Gerwinski
;strategy Throw DAT bombs around memory, hitting every 4th memory cell.
;strategy This program was presented in the first Corewar article.
; Variante, die bessere Chancen gegen Knirps hat
bomb DAT #1
DAT #0 ; Knirps-Falle
dwarf ADD #4, bomb
MOV bomb, @bomb
JMP dwarf
END dwarf ; Programs start at the first line unless
; an "END start" pseudo-op appears to indicate
; the first logical instruction. Also, nothing
; after the END instruction will be assembled.
;redcode
;name Dwarf
;author A. K. Dewdney, P. Gerwinski
;strategy Throw DAT bombs around memory, hitting every 4th memory cell.
;strategy This program was presented in the first Corewar article.
; Variante, die noch bessere Chancen gegen Knirps hat ... oder auch nicht ... ?!?
bomb DAT #1
DAT #0 ; Knirps-Falle
dwarf ADD #5, bomb
MOV bomb, <bomb
JMP dwarf
END dwarf ; Programs start at the first line unless
; an "END start" pseudo-op appears to indicate
; the first logical instruction. Also, nothing
; after the END instruction will be assembled.
;name Mice
;author Chip Wendell, P. Gerwinski
;assert 1
ptr dat #0
start mov #12, ptr ; n = 12
loop mov @ptr, <dest ; *dest = *(ptr+(*ptr))
djn loop, ptr ; if(--ptr != 0)
; goto loop
jmp @dest ; jump(*dest)
dest dat #833
end start
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment