3 ms·
RAM ADDR ________ ---- |----***-| ---* |---*****| --*- |--*-**-*| --** |---****-| -*-- |-*-*-**-| -*-* |-*------| -**- |----**--| -*** |---**
by nsajko 11y ago
RAM
ADDR ________
---- |----***-|
---* |---*****|
--*- |--*-**-*|
--** |---****-|
-*-- |-*-*-**-|
-*-* |-*------|
-**- |----**--|
-*** |---****-|
*--- |--------|
*--* |--------|
*-*- |--------|
*-** |--------|
**-- |--------|
**-* |-------*|
***- |--------|
This should get the counter back to 0 after it gets to 255 :)
- daveloyall 11y agohah! I just implemented that locally. Here's what I came up with... ________ |----***-| |-*-*-**-| |---*****| |--*-*--*| |---****-| |-*------| |----**--| |---****-| |-*------| |-------*| As you can see, it's pretty much the same, except in mine, the conditional is earlier, and I moved the initial 1 further up... Which required an additional jump?? ...I'd dig deeper but I'm eager to review this other comment, too!
- ketralnis 11y agoYou 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 :)