3 ms·
throughout 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
by kragen 3y ago
throughout 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