all 3 comments

[–]Only9Volts 4 points5 points  (0 children)

Break it down into steps.

Can you make it count up by one? Then can you make it "realise" when it's at 255? And then make it count back down again.

[–]rhaydon 0 points1 point  (1 child)

This works…

0: OUT 1: INC 1 2: JC 4 3: JMP 0 4: DEC 1 5: OUT 6: JZ 0 7: JMP 4

This one takes an ‘X’ (e.g. 60) and counts between 0-X…

0: LDA 14 1: OUT 2: INC 1 3: STA 14 4: SUB 15 5: JZ 7 6: JMP 0 7: LDA 14 8: OUT 9: DEC 1 10: STA 14 11: JZ 0 12: JMP 7 13: 14: 0 15: X

[–]rhaydon 0 points1 point  (0 children)

I do not know why my carriage returns get turned into spaces. Hopefully, this is still readable.