Skip to content

Faster, leaner "pictured number output" #433

Closed
@TG9541

Description

While working on optional words for Forth Standard compatibility it became clear that while Forth Standard compliant "pictured number output" with # ( ud -- ud) instead of # ( u -- u) (double instead of single math) would increase the code size only marginally but the math would make printing numbers in a background process slower. This might break applications that print numbers in a background task as the limit of 1ms task run-time is exceeded (unless a fast 32bit/8bit division or buffered I/O is used).

While exploring options it also became clear that the current # can be made faster by using the DIV X,A (16bit / 8bit) instruction, and leaner by in-lining the code of DIGIT and EXTRACT, eForth words which other 16bit Forth implementations don't use (e.g. the well known F83) and that don't appear in the Forth Standard.

Forth Standard compatibility with double number output (e.g. D.) can be provided later through library words.

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions