Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
1
Task/Binary-digits/Whitespace/binary-digits-1.ws
Normal file
1
Task/Binary-digits/Whitespace/binary-digits-1.ws
Normal file
|
|
@ -0,0 +1 @@
|
|||
|
||||
33
Task/Binary-digits/Whitespace/binary-digits-2.ws
Normal file
33
Task/Binary-digits/Whitespace/binary-digits-2.ws
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
push 0
|
||||
; Increment indefinitely.
|
||||
0:
|
||||
push -1 ; Sentinel value so the printer knows when to stop.
|
||||
copy 1
|
||||
call 1
|
||||
push 10
|
||||
ochr
|
||||
push 1
|
||||
add
|
||||
jump 0
|
||||
; Get the binary digits on the stack in reverse order.
|
||||
1:
|
||||
dup
|
||||
push 2
|
||||
mod
|
||||
swap
|
||||
push 2
|
||||
div
|
||||
push 0
|
||||
copy 1
|
||||
sub
|
||||
jn 1
|
||||
pop
|
||||
; Print them.
|
||||
2:
|
||||
dup
|
||||
jn 3 ; Stop at the sentinel.
|
||||
onum
|
||||
jump 2
|
||||
3:
|
||||
pop
|
||||
ret
|
||||
Loading…
Add table
Add a link
Reference in a new issue