Preface: Before writing anything that I got it wrong, it might be helpful to take a look at the original documentations instead of refering some web page, as there are TONS out there who got that part wrong.
I'm just curious if there was ever other instructions that were more ASCII-centric than the CISC associated ones we're left with now?
Sure, while the Intel ones still left the number without its zone(*1) part, the IBM /360 did even add that in their unpackign instrucktions accoding to the mode set (ASCII or EBCDIC)
Specifically, all the Binary Coded Decimal (BCD) instructions currently labeled "ASCII", [AAA/AAS/...]
And even defined as "ASCII Adjust"?
Ok, this is maybe a tiny bit missleading, as they are not so much codeset specific, as they are about single byte BCD numbers. But then again, it's what is needed after adding/subracting/etc. two ASCII numbers. Last but not least the much nicer 'DECIMAL ADJUST x' names where already taken.
The 8086 supports two set of adjust instructions the DAx which are used to normalize the result of a binary add of single byte packed BCD numbers, that is two decimal digits per byte, stored in each nibble. It's what most people usually see as BCD.
But then there are also single byte BCD numbers, where only the lower nibble of a byte contains a BCD digit. The higher nibble may contain anything as it's not regarded useful. When some common character encoding is used it may contain a zone - like
3 in case of ASCII of
F when it's about EBCDIC. The AAx instructions are ment to adjust (correct) the result of an operation on such single digit BCD numbers after being done in binary fashion.
With these instructions it is possible two ASCII numbers (
30h..39h) without any prior conversion and adjust the result. It will yield a valid BCD number in the lower nibble of AL, while the higher is cleared. The get a valid ASCII number again
30h needs to be ORed onto AL ant the result sstored in an ASCII string again (*2). Similar for the other operations.
These adjust operations allow direkt arithmetics on ASCII strings without prior conversion when done in a loop arbitary length ASCII strings can be handled - and by using string operation this gets quite performant.
So while they are not exactly produceing ASCII, they do provide what's needed to directly calculate with ASCII numbers.
*1 - While ASCII is a collection of various characters without much structure, IBM did organize it's 8 bit EBCDIC in a way that the upper nibble clearly defines what kind a character is, control, uppercase alpha, lower case alpha, symbol, number. That Nibble is called a 'Zone' as it defines the 'Zone' a code (character) belongs to.
For example the
F- zone consists only of numbers
0..9, no other characters (no,
FF is not a character but high value mark).
*2 - For example like this code to add two strings of up to 32768 ASCII digits (STRING2 onto STRING1)
MOV SI,OFFSET STRING2
MOV DI,OFFSET STRING1
LODSB * Get one (ASCII) number from STRING2
ADC AL,[DI] * Add one (ASCII) number from STRING1
AAA * Correst it for decimal overflow
LAHF * Flags sichern
OR AL,30h * Make it ASCII again
SAHF * Restore flags
STOSB * Resulting ASCII Character to STRING1
LOOP LP * Go for it Tiger.