PNut v37 - OBJ parameterization, field pointers, locals cleared, plus more
PNut v37 (released 11/20/2022)
Download zip archive from Assets, below.
Updates:
- Parameterization added to child-object instantiations.
- Up to 16 parameters are passable to each child object.
- Parameters override CON symbols by the same name within the child object.
- Useful for hard-coding child objects with buffer sizes, pin numbers, etc.
ObjName : "ObjFile" | ParameterA = 1, ParameterB = 2, …
- Spin2 local variables now get zeroed upon method entry.
- New
^@variable
returns a field pointer for any hub byte/word/long OR registers, including any bit field. - New
FIELD[ptr]
variable alias uses^@variable
pointers, making all variables passable as parameters. - New
'...'
symbol can be used to ignore the rest of the line and continue parsing into the next line. - New Spin2
GETCRC(dataptr,crcpoly,bytecount)
method computes a CRC of bytes using any polynomial. - New Spin2
STRCOPY(destination,source,maxsize)
method copies z-strings, including the zero. - DEBUG display BITMAP now has
SPARSE color
to plot large round pixels against a background color. - GRAY, in addition to GREY, is now recognized as a color in DEBUG displays.
- Debugger's Go/Stop/Break button now temporarily inverses when clicked.
Posted and discussed in forum thread here.
Previous PNut (and P2 Compiler) Release History; prior to this repository
v36 : 2022-09-18
DEBUG
now adapts to run-time clock frequency changes. This is done by using the serial receive pin (P63) in long-repository mode to store the clock frequency outside of debug interrupts. The Spin2CLKSET
instruction now supports this feature.
v35v : 2022-09-11
- The serial transmit pin (P62) is now held high before DEBUG, in case no pull-up resistor is present on P62. This enables the PASM-level debugger to work on early P2 Edge modules which don't have serial pull-ups.
- PASM-only programs which use non-RCFAST clock modes now get prepended with a 16-long clock-setter program which sets the clock mode, moves the PASM program down into position, and then executes it. This means that the
ASMCLK
instruction is no longer needed at the start of PASM-only programs. This harmonizes with the PASM-level debugger's operation, where the clock is automatically set.
v35u : 2022-08-26
- Serial interface code now runs in a separate thread for better concurrency with the GUI. Should be more reliable.
v35t : 2022-08-12
- New PASM-level debugger added for single-stepping and breakpoints, invoked by
DEBUG
in Spin2/PASM. - The
DEBUG()
commandPC_MOUSE
now reports a 7th long which contains the $00RRGGBB pixel color.
v35s : 2022-02-05
- Negative floating-point constants can be preceded with a simple '-', so that '-.' is only needed for variables and expressions.
- Fixed
FSQRT()
bugs in the compiler and the interpreter. Both were failing onFSQRT(-0.0)
and the compiler was generating a wrong result forFSQRT(0.0)
. - Improved floating-point rounding operations in both the compiler and the interpreter, so that even mantissas with fractions of 0.500 will not have the usual 0.500 added to them before truncation. This eliminates rounding bias.
- Added
BYTEFIT
, which is likeBYTE
for use inDAT
sections, but verifies byte data are -$80 to $FF. - Added
WORDFIT
, which is likeWORD
for use inDAT
sections, but verifies word data are -$8000 to $FFFF. - Added
@"Text"
, which is a shorthand version ofSTRING("Text")
that only allows text between quotes.
v35r : 2021-12-22
PC_KEY
andPC_MOUSE
added for keyboard and mouse feedback from the host computer to the DEBUG Displays.
v35q : 2021-10-13
- Main symbol table increased from 64KB to 256KB, others from 4KB to 32KB.
v35o,p : 2021-09-22
- Floating-point math operators added to Spin2 with normal precedence rules. Fixed
FSQRT
bug in v35p.
v35n : 2021-05-23
- Sprites added to DEBUG PLOT window. REPEAT-var fixed so that var = final value after
REPEAT
(was final value +/- step).
v35m : 2021-05-03
- Improved command-line interface of PNut.exe to support compiling with/without DEBUG and with/without flash loader, and saving .bin files without downloading. Also added axis inversion to the PLOT display in
DEBUG
.
v35L : 2021-03-23
- Added complete command-line interface to PNut.exe and included batch files for invoking PNut.exe and returning error status to STDOUT, STDERR, and ERRORLEVEL. See "Command Line options for PNut.exe".
v35k : 2021-03-19
- Added
DOWNLOAD_BAUD
to existingDEBUG_BAUD
for overriding default 2 Mbaud download andDEBUG
.
v35j : 2021-03-16
- Fixed problem with DEBUG_BAUD <> 2_000_000 not working on some boards.
v35i : 2021-02-20
- Added command-line DEBUG-only mode for presenting flash-programmed DEBUG data and displays.
- Fixed Floating-point error in SCOPE_XY.
v35h : 2021-02-15
- The first 16 LUT registers in the Spin2 interpreter were freed to allow for streamer 'imm-->LUT' usage. This is intended to support 1/2/4-bit video, via interrupt, within the same cog that the interpreter is running in. The inline-PASM limit went from $134 down to $124, in order to compensate.
- A new
DEBUG_WINDOWS_OFF
symbol was added to inhibit any DEBUG windows from opening after a download.DEBUG_BAUD
can now be set to alter the baud rate that DEBUG uses with PNut.exe.
v35g : 2021_02_13
- DEBUG fixes. Line-clipping routine was causing floating-point exceptions and memory-access violations.
v35f : 2021_01_29
- DEBUG fixes. Was erring at 63
DEBUG
s, now goes to 255. Was not always resetting the DEBUG.log file.
v35e : 2021_01_06
DEBUG_BAUD
symbol added. Spin2 stack-locating bug fixed.
v35 : 2020_11_18
- DEBUG improved with anti-aliasing throughout,
QSIN
/QCOS
added.
v34u : 2020_07_19
- DEBUG improved, documentation up-to-date.
v34t : 2020_07_15
- DEBUG added, documentation up-to-date.