2 ms·
You need the additional jump because he forgot his jump :) His doesn't actually reset on 255. It prints 254 and then stops. Here is his program commented:
by ketralnis 11y ago
You need the additional jump because he forgot his jump :) His doesn't actually reset on 255. It prints 254 and then stops. Here is his program commented:
RAM AD PC
ADDR ________ _ _
---- |----***-|-|*| ; read in SCRATCH (starts at 0)
---* |---*****|-|-| ; write it to OUTPUT
--*- |--*-**-*|-|-| ; add ONE
--** |---****-|-|-| ; write to SCRATCH
-*-- |-*-*-**-|-|-| ; IF MAX, GOTO LBL_RESET
-*-* |-*------|-|-| ; ELSE, start over
-**- |----**--|-|-| ; LBL_RESET: read in ZERO
-*** |---****-|-|-| ; write the ZERO to SCRATCH
*--- |--------|-|-| ; fall off the world (I think this is where is missing jump is)
*--* |--------|-|-|
*-*- |--------|-|-|
*-** |--------|-|-|
**-- |--------|-|-| ; ZERO (r/o literal)
**-* |-------*|-|-| ; ONE (r/o literal)
***- |--------|-|-| ; SCRATCH (r/w)
**** | OUTPUT |-|-|
If I change his "fall off the world" to a "start over" instruction (-*------) then it works fine
- nsajko 11y agoThank you :)