by tezza · 16y ago · 0 comments
the 1k is aided and abetted by the architecture of the computer.
* Reading keyboard is reading a register/known address, not loading the keyboard library, allocating a structure and jumping into an OS routine.
* Clear screen is writing zeros to a known address space
* Drawing is writing a 1 to a known address space
* Yours is the only process on the machine
* Text compresses well with Huffman
With those assumptions a lot more can fit in the 1K
Reading keyboard is reading a register/known address, not loading the keyboard library, allocating a structure and jumping into an OS routine
Or calling a ROM routine. Reading the keyboard directly at the lowest level would probably just make the program bigger
Clear screen is writing zeros to a known address space
Generally, another ROM routine call.
Drawing is writing a 1 to a known address space
Not really. Just about all these machines had color. The Apple ][ had a fun non-linear video buffer layout, to boot.
Text compresses well with Huffman
Not a lot of text in a chess program.
Generally, another ROM routine call.
Thats @tezza's point. (Edit For Clarity): Since its just one instruction, you can shrink the size of your program, making fitting it into a small space less impressive (though, not unimpressive).
Not a lot of text in a chess program.
Fair enough, so that one doesn't help, but the other two do.
For reference to my original post: I wasn't trying to deny that this program is amazing... it is.
I was intending to illustrate that you could do a lot more with 1k historically than you can nowadays, and that some of the worst offenders to bulking out a process don't apply on older computers in assembly.
That doesn't take away from the brilliance of AI in 1k, but rather I think the focus should be on that and not the chessy bit.
1) Reading keyboard input and clearing the screen can both be executed via a ROM command.
2) Doing these things otherwise would have made the program bigger.
Am I right that we agree on these? If so, I don't see how you don't agree that:
3) Having both of these as ROM commands helps make the program smaller.
As far as I can tell, we agree on these 3 points. You, however, seem to be bringing up a few more points:
4) Instructions are short.
5) Alignment is on the byte.
...
And, from what I can tell, you are saying that these were more helpful in reducing the size of the program. Am I right so far?
If so, you maybe right that compared to modern computers, but that doesn't mean that @tezza is wrong that the other factors helped.
Also, I believe its already been agreed that Huffman encoding doesn't help...
The ZX81 did not have colors.
ROM routines is a jump into known addresses... so no extra impact on the 1K. Parameters are read from registers.
Color of 4bit? only a slight increase. Often acheivable in 1 instruction. Limit of 2 colors in 8x8 block on ZX81[1]
--------------------
6502 was my platform, so I missed the exact Z* platform...
I was sharing general info on assembly for 8bit, not specific to one platform (ZX81). This seems to have incensed some people who took a narrow view on what sort of comment was permitted.
A high quality 3D FPS that is a mere 97,280 bytes through the magic of procedural generation.