Skip to content

Latest commit

 

History

History
151 lines (144 loc) · 11.4 KB

changelog.md

File metadata and controls

151 lines (144 loc) · 11.4 KB

CHANGELOG

The following bug fixes and additions were made to the original pceForth code.

Forth500 v1.0

  • removed useless rc before jp interp__
  • replaced jp interp__ by jp cont__ to skip BREAK key test in code when control flow is not jumping backward and no IO (with a few exceptions)
  • jp cont__ with fetch-exec loop cycle takes 15 CPU cycles, 7 cycles saved (i.e. BREAK key test adds 40% overhead), BREAK key interruption is fully working by testing BREAK key in docol__xt, when performing backward jumps and when performing IO
  • removed unused floating point words (float operations are not implemented in pceForth)
  • optimized code that returns TRUE (-1 or $ffff) or FALSE (0) by using mv ba,$0000, jpnz cont__, dec ba, jp cont__ or by using mv ba,$ffff, jpnz cont__, inc ba, jp cont__
  • optimized mv i,$00xx to mv il,$xx since the latter short version sets the I register high byte to 0
  • fixed and optimized internal throws that removed the TOS
  • optimized internal throws by setting the 8-bits il register and jumping to new throw__ code
  • added 2VALUE and 2VALUE?, updated TO and +TO to set VALUE and 2VALUE accordingly
  • replaced (IS) with standards-compliant DEFER!
  • replaced BEHAVIOR with standards-compliant ACTION-OF using new DEFER@
  • removed non-standard MATCH?
  • removed non-standard RECURSIVE (same as REVEAL), not that RECURSE is preferred
  • replaced M+ and M- with Forth code instead of assembly to reduce code size
  • added standards-compliant PARSE-NAME
  • fixed 2CONSTANT lo/hi cell order swapped
  • removed BLOCK (BLK, BLOCK, BUFFER, LOAD, LIST, THRU) because blocks are not implemented and EVALUATE does not even use BLK
  • added standards-compliant HOLDS
  • removed NO-IOERROR constant that is always zero
  • optimized dolit__xt 0, 1, 2, -1 with new dolit0_xt, dolit1_xt, dolit2_xt, dolitm1_xt
  • replaced FALSE and TRUE with jump to dolit0_ and dolitm1_ instead of docon__xt
  • optimized STDI, STDO, STDL, R/O, W/O, R/W with jump to dolit0_xt, dolit1_xt, dolit2_xt, dolit3_xt
  • fixed DRIVE-NAME to return current DRIVE string (E: by default) when drive is not specified
  • renamed internal FILE-NAME to FILENAME and DRIVE-NAME to DRIVENAME
  • changed internal FNP to VALUE FNP instead of VARIABLE FNP to reduce code size
  • added standards-compliant BUFFER:
  • added standards-compliant SAVE-INPUT and RESTORE-INPUT
  • added K
  • removed ALLOCP that is unused
  • added standards-compliant S\" implemented with new \"-PARSE
  • changed old graphics words PSET, PRESET, etc to new GMODE to set the mode (set, reset, flip), GPOINT, GPOINT?, GLINE, GBOX
  • added graphics words GDOTS, GDOTS?, GDRAW, GBLIT!, GBLIT@
  • replaced internal POCKET#, POCKET0, POCKET1, WHICH-POCKET with new WHICH-POCKET with internal storage
  • replaced internal FILENAME#, FILENAME0, FILENAME1, WHICH-FILENAME with new WHICH-FILE with internal storage
  • renamed >FILENAME to >FILE, this takes a fileid to return a file status address (with 18 byte filename and 8 status bytes) and ior error code
  • renamed FILENAME>STRING to FILE>STRING
  • renamed STRING>FILENAME to STRING>FILE
  • removed non-standard SKIP-CHARS, which is the same as relative file move with ( d fileid ) SEEK-CUR SEEK-FILE
  • fixed RESIZE-FILE to enlarge a file (but cannot truncate a file in Forth500)
  • fixed FILE-STATUS to comply with standard, returns file structure pointer f-addr with file info
  • removed FILE-SET to set a file's attribute, it does not appear to work and there is a danger of losing files
  • fixed WRITE-LINE to add CR LF instead of just LF
  • fixed FILE>STRING when used after >FILE
  • added FIND-FILE support for * and ? globs (can only use a single * for name and extension, such as . and foo*.*)
  • added FILES to list files on a drive, supports ? and * globbing
  • added 2TUCK for consistency with 2NIP
  • removed VERIFY-FILE, which is not usable
  • renamed internal FORGET-LIMIT to the more conventional FENCE variable
  • renamed internal CHECK-STACK to the more conventional ?STACK
  • optimized (;CODE) assembly
  • added standards-compliant BEGIN-STRUCTURE, END-STRUCTURE, +FIELD, CFIELD:, FIELD:, 2FIELD:
  • optimized CASE OF with new (OF) conditional jump that is faster and saves 6 bytes per OF-ENDOF pair
  • changed DOUBLE-NUMBER to >DOUBLE with optimized code to reduce code size
  • fixed D+! bug that was missing a popu ba to set new TOS
  • changed to case-insensitve Forth, words can be typed in upper/lower/mixed case
  • updated the filename-related words to automatically change the current drive letter (stored in DRIVE) when specified
  • fixed 2/ and D2/ that removed the sign, should perform an arithmetic shift right, not a logical shift right
  • replace mv ba,0 with sub ba,ba when possible (but the latter sets flags), saving >40 bytes
  • added dictionary underflow and overflow checks to ALLOT and to all of the comma words
  • added CELL (same as 1 CELLS)
  • replaced (UNINIT) non-standard -59 exception "execution of an uninitialized deferred word" with a system-defined -256 exception
  • fixed (DO2LIT) lo/hi cell order swapped
  • fixed FORGET memory leak (did not forget old link cell and old name)
  • added INCLUDE
  • added VALUE TTY to support redirecting EMIT and TYPE output (default is STDO for screen output, STDL to print)
  • added PRINTER to connect to a printer (e.g. CE-126P) and check printer status
  • optimized ?STACK stack check in assembly
  • added stack overflow/underflow checks to all loop words
  • changed return address size from 3 bytes to 2 bytes (1 cell) for standard Forth compliance, support "caller cancelling" with R>DROP and "continuation passing"
  • reduced MOVE code size
  • replaced S= machine code with Forth code to call COMPARE, saving 50 bytes
  • optimized DNEGATE, D2*, D+ and D-
  • added -CHARS used by -TRAILING and F.
  • added (DORET) to return from a colon definition instead of (EXIT), this allows a future SEE to list a colon definition correctly
  • added 'char' literals (standard Forth <cnum%gt;), also permits 'char literals without a closing quote
  • replaced WITHIN Forth code by faster assembly code of the same size
  • reduced code of (?DO) by reusing (DO)
  • reduced code of (+TO) and (D+2TO) by reusing +! and D+!
  • reduced code of EVALUATE and INCLUDE-FILE, both now use SAVE-INPUT N>R and NR> RESTORE-INPUT which is more logical
  • changed LAST and LAST-XT to VALUE instead of VARIABLE
  • changed (COLON-SYS), (ORIG), (DEST), (DO-SYS) constants to CREATEed words without data that return a unique address
  • changed SOURCE definition to a 2VALUE and removed (SOURCE)
  • removed (REFILL) and inlined its code into (QUIT)
  • optimized FIND-WORD dictionary search
  • added PAUSE to display text in reverse video and wait for a keypress if TTY is the keyboard (redirecting to printer does not wait for a key)
  • updated WORDS and FILES to break with BREAK and C/CE at the (more) prompt
  • optimized >NAME to increase speed and reduce code size
  • added missing REQUIRE and REQUIRED
  • automatically close open SOURCE-ID file when an exception is raised, e.g. when INCLUDE fails
  • improved exception reporting, showing the initial part of the input that caused the exception
  • replaced >BINARY with >DIGIT in assembly, shorter and faster
  • added Forth standard FLOAT (complete) and FLOAT-EXT (most) words
  • fixed F/ double fp when divided by single fp returning garbage by the function driver syscall: make both arguments double fp if one is double fp
  • added blinking cursor at start and after an exception or ABORT and QUIT which are otherwise silent
  • improved OK[] prompt to also report the depth of the floating point stack, when not empty
  • improved EDIT to fix long line editing issues and to reduce code size
  • added new FLOATEXT.FTH with additional words to complete FLOATEXT
  • optimized DECIMAL, HEX, UNUSED to reduce code size
  • added FVALUE and FVALUE?, changed the corresponding TO part of this code to assign FVALUE
  • added missing extra words F0> and F0<>
  • added TAPE and CLOAD to load raw data and compile Forth source code from cassette tape
  • reduduced code size by rewriting ?COMP, HIDE, REVEAL, IMMEDIATE in assembly
  • reduduced code size by refactoring VALUE?, 2VALUE?, FVALUE?, COLON?, MARKER? to reuse and share code
  • renamed some of the internal (...) words to shorter names to reduce code size
  • changed (UNDEF) and CHECK-NAME to assembly to increase speed and reduce code size
  • removed variable HP and optimized <#, HOLD and #> in assembly to increase speed and reduce code size
  • changed MS to allow BREAK
  • replaced "illegal" instruction mv a,il with mv ba,i and mv il,a with mv i,ba that perform the same operation anyway
  • optimized assembly code of all filesystem-related words to reduce code size
  • added new SEE.FTH, NQUEENS.FTH and updated DEBUGGER.FTH
  • fixed a floating point exception -46 problem that caused the system to hang without progress
  • fixed GPOINT? returns 0, 1 or -1 (Sharp E500 technical manual does not mention that A=255 can be returned)
  • added FLOATING-STACK and MAX-FLOAT to ENVIRONMENT? queries (obsolescent FLOATING and FLOATING-EXT are not included)
  • optimized [, ], DEPTH, HIDE, REVEAL, IMMEDIATE, ABORT, QUIT in assembly code
  • fixed TO with floating point values, floating point stack imbalance
  • added new FF.FTH example with definition of FF. to display floating point values as fractions
  • slightly better optimized D*, /MOD, D/MOD, UMD*, UM/MOD, M*/
  • improved error reporting at multiple source locations when files are imported
  • optimized D*, UMD*, M*/ to reduce code size
  • corrected <error 0 message with INCLUDE when an exception occurred
  • added stack overflow/underflow checks to SP! and FP!
  • increased floating point stack to 10 floats
  • added COMPLEX.FTH and updated FLOATEXT.FTH
  • updated BREAK exception to display Break instead of <Error -28
  • updated REPRESENT to produce 12 or 13 non-rounded digits for single floating point results
  • updated double floating point computation results to round to 20 digits rather than ignoring the guard digits
  • fixed EKEY? issue
  • fixed M*/ regression issue

Forth500 v2.0

  • increased colon call-return execution speed by 20%, using yi and zi 20 bit address registers with a fixed 11th segment: this optimizes all 16 to 20 bit address conversions by moving a 16 bit address through yi or zi to obtain a 20 bit address
  • increased execution speed of single and double integer literals, variables, values, constants, single and double integer store and fetch, single integer arithmetic involving addition and subtraction, and single and double integer stack operations
  • fixed MOVE when source and destination address are equal
  • added RUN and PRO display annunciators: RUN lights up when interpreting and PRO lights up when compiling from the prompt
  • changed WORDS to no longer display inaccessible smudged (hidden) words (e.g. when their definition failed to compile)
  • changed FENCE to a value instead of a variable
  • added FORTH, VOCABULARY, DEFINITIONS, CURRENT and CONTEXT words
  • corrected minor errors and omissions in the manual

Forth500 v2.1

  • removed unused CS-ROLL
  • added RDROP (same as R>DROP)
  • improved manual