Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

nad2040

5
Posts
2
Topics
A member registered Aug 19, 2022 · View creator page →

Recent community posts

Mac users can also change directory to the app’s /Contents/MacOS folder

Then chmod +x Digital\ Logic\ Sim

How does the ranking system work? I keep seeing that I'm 1/17XX

Does everyone who completed all 30 levels see that they are #1? Or is it the average ranking on all levels? Or is it the last person to complete the game that gets the #1 title?

(1 edit)

If I use subleq, I would have to use the value range 0-255, and so instead, I write the bytes in the .data directive to use the - sign so it’s slightly easier to understand. By writing the bytes ‘by hand’ in the .data directive, I also have to handle the jumps, which are normally handled by the assembler.

Example:

subleq @OUT 2 -‘0’ isn’t allowed, but you can subtract from 256
subleq @OUT 2 208 is what it will be, but it’s less expressive
So,
@prog: .data @OUT, 2, -‘0’ is the best choice in my opinion
@program: .data 0, @IN, 3, 0, 8, 6, @OUT, 0, -48, 0, 0, 0

If a command is guaranteed to output a positive number to @OUT, the jump address can be used to store a number. Thus, bytes read can be reduced by one. And writing the bytes by hand allows negative numbers and characters so you don't have to subtract from 256 every time.

@l0: .data 0,0,@l2+3,0,0,0,0,0,0,0,0,0,0,0,0,0
@l1: .data 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
@l2: .data 0,0,0,0,0,@l3+3,0,0,0,0,0,0,@l3+10,0,0,0
@l3: .data 0,0,0,0,0,@l4+3,0,0,0,0,0,0,@l4+10,0,0,0
@l4: .data 0,0,0,0,0,@l5+3,0,0,0,0,0,0,@l5+10,0,0,0
@l5: .data 0,0,0,0,0,@l6+3,0,0,0,0,0,0,@l6+10,0,0,0
@l6: .data 0,0,0,0,0,@l7+3,0,0,0,0,0,0,@l7+10,0,0,0
@l7: .data 0,0,0,0,0,@l2+10,0,0,0,0,0,0,@lc+2,0,0,0
@l8: .data 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
@l9: .data 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
@la: .data 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
@lb: .data 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
@lc: .data 0,0,0,0,@ld+3,0,0,0,0,0,0,0,0,@l2+3,0,0
@ld: .data 0,0,0,0,0,@le+5,0,0,0,0,0,0,@lc+11,0,0,0
@le: .data 0,0,0,0,0,0,0,@le+8,0,0,@ld+10,0,0,0,0,0
@lf: .data 0,0,0,0,0,0,0,0,0,0,0,0,0

This traces a smiley face using the current highlighted instruction in the memory block.

Writing the bytes yourself as data doesn't change "bytes read" but it can help you realize a simpler solution for First Assessment:

(SOLVED; cycles: 8, bytes: 11)

subleq 0, @IN
subleq @OUT, 0

Once the program jumps to address 6, the instruction is essentially

subleq 0, 0, 0

and will automatically clear address 0 and jump there for you.