interp is a powerful programming language, a testing platform, and a development framework. It is targeted for Linux/Unix-based systems, yet remains adaptable to less powerful embedded systems that were never intended to host an interactive programming language, because all you need is a serial port. I2 is a compiler for interp.
2011-05-25: Interp Release 01.08.00
introduces Interp Image Format (IIF) files. They are portable
binary containers for your interp programs. They are the
perfect way to distribute an interp-based solution to a
This release also incorporates Patch 01.07.01,
Patch 01.07.02, and Patch 01.07.03 in their entirety. Keep
reading the following three news items for more, and
read all the release details in the NOTES and the CHANGELOG.
2011-01-15:Add a new QUOTE (") and M-QUOTE (M") modifier (C) for the '#' meta-character to print one ASCII character. The original "#c" will print -anything- you pass to it on the data stack. It does not check the data. It assumes you have given it exactly what you want to print. On the other hand, the new "#C" will only print ASCII characters in the inclusive range 0x20-0x7E. If you pass it something outside this range, it will print '.' instead.
Add two new print meta-characters, '!' and '@', to QUOTE (") and M-QUOTE (M"). These new print facilities make it possible to print values taken directly from memory as bytes, halfword, or words. A memory address called the PRINT_ITERATOR_ADDRESS (System Constant 38) is set via "!A". This address is automatically incremented/decremented as each location is printed. Whether to increment or decrement is determinted by PRINT_ITERATOR_MODE (System Constant 39.) It is initialized to auto-increment by "!A", but can be switched to auto-decrement by "!d", or back to auto-increment by "!i". Auto-decrement requires a more complex implementation because the decrementing can only be done just before printing the value of the -next- memory location. That is handled by PRINT_ITERATOR_FIRST_ONE (System Constant 40.) It is set TRUE by "!A", "!i", and "!d", and set FALSE by the first following '@' meta-character.
As with the '#' print meta-character, the '@' may be followed by an optional modifier. Without a modifier, the value is read from memory as a 32-bit word and printed in the current output base. If a modifier is present, the value is read from memory as indicated below (HALFWORD is 2-bytes, and WORD is 4-bytes):
a - (WORD) print the print iterator address as a notated (0x)
hexadecimal word (10 characters). Print iterator address is
not changed by this modifier.
A - (WORD) print the print iterator address as a hexadecimal
word (8 characters). Print iterator address is not changed
by this modifier.
b - (BYTE) print value as a notated (0x) hexadecimal byte
B - (BYTE) print value as a hex byte (2 characters)
c - (BYTE) print value as one ASCII character
C - (BYTE) print value as one ASCII character, prints '.' if the
character is non-printable
d - (WORD) print value as free-form decimal
Dn - (BYTE/HALFWORD/WORD) display decimal value right-
justified in an n-digit field. The range of n is 0-9 with 0
representing a 10-digit field and all other values
representing their equivalent field width. The size of
memory read is determined by the specified field width:
BYTE - D1, D2, and D3
HALFWORD - D4 and D5
WORD - D6, D7, D8, D9, and D0
h - (HALFWORD) print value as a notated (0x) hexadecimal
halfword (6 chars)
H - (HALFWORD) print value as a hex halfword (4 characters)
s - (WORD) use value as the address of a null-terminated
string of ASCII characters, and print the entire string or
"NULL" if the value (treated as pointer) is NULL.
S - (string length+1) use value as a zero-terminated string
of ASCII characters, and print the entire string
T - (WORD) treat the value as elapsed time in microseconds
and print it as hh:mm:ss.uuuuuu, where "hh" is hours, "mm"
minutes, "ss" seconds, and "uuuuuu" microseconds
w - (WORD) print value as a notated (0x) hexadecimal word
W - (WORD) print value as a hex word (8 characters)
NOTE: these modifiers (bBhHwW) specify minimum field
width. If the value is larger, it still prints properly.
NOTE: Each modifier (except aA) increments the print
iterator address after reading the value.
NOTE: the 'S' modifier is illegal when outo-decrement mode is
enabled ("!d") because of the uncertainty associated with
searching backwards for the beginning of a variable-length
Because there are now two new print meta-characters, you are advised to check through your scripts for '!' or '@' in any QUOTE or M-QUOTE print statement, and escape them with a preceding '\' character.
For working examples that use the new print iterator, look in DOC/SAMPLE_SCRIPTS for argtest.int, dump.int, example17.int, example18.int, kdump2.int, mprint.int, and mprint2.int.