4 ms·
It is odd! It really likes it's load/stores and you can branch on anything, but it appears to be missing any of the bitwise operators which seems to be an odd d
by howerj 3y ago
It is odd! It really likes it's load/stores and you can branch on anything, but it appears to be missing any of the bitwise operators which seems to be an odd deficiency. Perhaps that's (one of) the reasons this VM never caught on?
- HarHarVeryFunny 3y agoYeah, not clear what Woz really expected it to be used for. Apparently the only thing he used it for himself was a later Apple BASIC renumber utility! Memory and ROM space was so valuable back then, that I wonder if in retrospect he thought that was 300 bytes (size of SWEET16 interpreter) of ROM space wisely used ?!
- kragen 3y agoyes, because it saved more rom space than that
- HarHarVeryFunny 3y agoWell, it really didn't save any ROM space since nothing in the ROM used it! Woz has since said that he thinks that the Apple BASIC interpreter (in ROM) could have been shrunk by 1KB (5KB->4KB) without any loss of performance by selective use of SWEET 16, but that never actually happened. https://www.apple2history.org/museum-a-l/articles/byte8501/ https://www.apple2history.org/museum-a-l/articles/byte8501/
- kragen 3y agooh, thank you for the correction!
- kragen 3y agothroughout the 50s and 60s it was common for computers to not provide the bitwise operators at all; the first versions of mix (used in volume 1 of taocp) didn't have them. they take very little hardware to implement, and they're comparatively very slow if you have to implement them in software (though less so on an 8-bitter!) but most software doesn't use them at all. so it makes sense that you wouldn't include them in sweet-16; if you care about speed you'll call out from sweet-16 to 6502 code
- HarHarVeryFunny 3y ago> if you care about speed you'll call out from sweet-16 to 6502 code That's another somewhat odd omission from SWEET16 - the only way it lets you combine 6502 assembler and SWEET16 code is via the pattern. <6502 code> jsr SWEET16 // switch to inline SWEET16 code <SWEET16 code> rtn // SWEET16 instruction to switch back to inline 6502 code <6502 code> You can't do the opposite - switch to 6502 code for part of a SWEET16 function, or have 6502 code call (vs switch to) a SWEET16 subroutine (or vice versa).
- kragen 3y agoyeah interestingly, this form of argument passing, where the arguments follow the call instruction, was the standard way to pass arguments on the pdp-8. though usually it was just, like, a fixed number of arguments, not an arbitrary-sized blob as in the sweet-16 case it does seem like it would have been more convenient to orchestrate low-level 6502 subroutines by stringing them together with sweet-16 code than vice versa, but i guess the actual scripting language woz wrote for the apple 2 was integer basic