Re: Microsoft Basic listing from 1978
Posted: Sun Sep 08, 2019 4:46 am
So you actually were able to measure the difference ... cool! I have a slightly different use case for my current coding exercise. It's for my new version of MSBASIC's FIN, which I cheekily renamed atof:
Here, I assume that we're still in the land of NMOS, that the current string of interest is smaller than 256 bytes, and that scanned decimal digits will be used as binary immediately.
Code: Select all
getnxt:
iny ; bump the buffer pointer
gettxt:
lda (txtptr),y ; grab a char from text buffer
cmp #' ' ;
beq getnxt ; skip over any space char(s)
eor #'0' ;
cmp #10 ; ASCII decimal digit?
bcc gottxt ; yes: CC, convert to binary
eor #'0' ; no: CS, return orig. ASCII
gottxt:
rts ;