Extract (Get) a (8-bit) ASCII coded (printable) hexadecimal number from a buffer in RAM.
Consider an Xwire receive data block to be nn bytes of RAM starting at address bb. Extract a hexadecimal number from the data block, starting at RAM address bb+I (i.e. the starting address is indexed). Skip any leading spaces. Process at most 2 hexadecimal digits. Terminate on anything that's not a hex digit. Advance I past the characters used, leaving it pointing at the terminating character (auto-index). Result in X, 0 if nothing there. R register signals outcome. 0 = OK, 1 = no valid hexadecimal number present. This instruction is not case sensitive.
Notes:
Dialect exclusions: Not available in dialects before 28
See also: iifPrintWFW, iifPrintWVW,
The following program will write some test data to RAM (iiPrintText) and then loop around extracting hexadecimal numbers from the data. To try the program yourself in SPLat/PC (simulation).:
File>Configure>Dialect). If you don't have you will need to upgrade SPLat/PC.CTRL+R)F9)CTRL+F7.F5 repeatedly, and look at the result in X, I and R each time.CTRL+F7 at any time to start again.XWBuffer mEQU 100
BufLen EQU 30
LoadI 0
iiPrintText XWBuffer,"1 2 A AB DEFedcba9876543210abcdef"
; 012345678901234567890123456789
LoadI 0
Agin:
iiGetHex XWBuffer,BufLen
GoTo Agin ;<<<<<< Breakpoint here