- Joined
- Sep 20, 2022
- Messages
- 317
- Reaction score
- 41
Code:
;slinky0
;Endlessly move register 0 to register 1 and back again.
jmp 3
dec 0
inc 1
isz 0
jmp 1
jmp 8
dec 1
inc 0
isz 1
jmp 6
jmp 0
There are many jumps in low level programming, and they don't all need unique meaningful names.
>frog refers to the first frog label after the current line, <frog refers to the last frog label before the current line.This kind of system really pays off when expanding macros that have internal jumps.
Code:
;slinky1
start:
jmp >wend
while:
dec 0
inc 1
wend:
isz 0
jmp <while
jmp >wend
while:
dec 1
inc 0
wend:
isz 1
jmp <while
jmp start
Last edited: