3 ms·
You could save one byte by replacing "0=" with "0<>" (well, except for the name, maybe use "0#"?): pop ax neg ax ;sets carry flag if nonzero sb
by rep_lodsb 3y ago
You could save one byte by replacing "0=" with "0<>" (well, except for the name, maybe use "0#"?):
pop ax
neg ax ;sets carry flag if nonzero
sbb ax,ax
push ax
And another two bytes in DOCOL:
;add ax,4
;mov si,ax
xchg ax,si
lodsw
lodsw
Maybe even free up a word register to always hold the address of DOCOL, then you only need two bytes at each colon definition. If it's possible without adding any extra instructions, this should save 4 bytes in total (one stosw in COLON, the DOCOL.addr variable, one lodsw in the above version of DOCOL)
- fuzzballcat 3y agoGood thinking! I wouldn't have thought of that `xchg` one in DOCOL, very clever. I'll futz around with making DOCOL's address as a register and see if I can make that work, though I don't know if that will work since I think some of the mechanisms in place have additional functions. EDIT: So, I don't think this will work. I'd be using `dx` to store DOCOL's address, but this appears to get clobbered somewhere, fixing which would outweigh the 1 byte benefit you end up actually getting. I'll keep thinking about it though!