Abersoft fig-Forth v1.2 (with 42 cols driver)

Show us what you're working on, (preferably with screenshots).
Post Reply
User avatar
ketmar
Manic Miner
Posts: 713
Joined: Tue Jun 16, 2020 5:25 pm
Location: Ukraine

Abersoft fig-Forth v1.2 (with 42 cols driver)

Post by ketmar »

this is the modification of Abersoft fig-Forth system made on request of @PeterJ. it is using 42-columns print driver, and extended line editor. (and some bugfixes to the original system).

it is fully compatible with the original system.

download: v1.2 RC2 (includes mod source code).

brief documentation for new features (included in the download):
Spoiler

Code: Select all

Abersoft fig-Forth v1.2
=======================

The system is based on v1.1, extended with 42 columns printing and better
line editor. It is also possible to include some other extension words.


Rebuilding
==========

If you want to rebuild the system, you'll need to use x86 GNU/Linux OS.

run:

  ./urforth zx-aber-main.f --help

to learn build options. Or, if you are too lazy to read: ;-)

  --see          -- include "SEE" word
  --extra        -- include some extra words
  --no-ac        -- exclude autocompletion engine
  --no-editor    -- exclude advanced editor
  --editor-api   -- include editor API
  --input <arg>  -- input snapshot (default is "aber11.sna")
  --output <arg> -- output tape file (default is "z-new-aber.tap")


Fixed bugs
==========

Fixed fatal bug in "EXIT" -- this word now works as expected instead of
crashing the system.

"GOVER" and "INVERSE" don't modify unrelated memory byte anymore.

Some other words are optimised a little.


Extended editor
===============

New improved line editor allows using cursor control keys to move cursor.
CS+1 will clear the input line. (warning: there is no way to restore
cleared line contents!)

If autocompletion feature is included, pressing "SS+Enter" will try to
autocomplete the word before the cursor.


42 columns extension
====================

By default, the system is run in 42 columns mode. It is possible to switch
between 32 cols and 42 cols modes with "M8" and "M6" words.

42 cols mode has separate "inverse" and "over" control words.

Also, 42 cols "EMIT" doesn't support standard control codes to change ink,
paper and such. But it supports some other control codes:

2 emit
  if current printing position is not at the beginning of the line, does CR.

5 emit
  move cursor one line up.

6 emit
  move cursor one char right.

8 emit
  move cursor one char left.

9 emit
  print spaces until the cursor reaches next tab stop. tab size is 4.

10 emit
  the same as CR.

12 emit
  clear the screen. the same as CLS.

13 emit
  move cursor to the beginning of the current line.


M8  ( -- )
Switch to 32 cols mode.

M6  ( -- )
Switch to 42 cols mode.

M8?  ( -- bool )
Check if current mode is 32 cols.

TINV?  ( -- enabled? )
Return current "inverse" mode.

TINV  ( enabled? -- )
Set or reset "inverse" mode.

TOVER?  ( -- mode )
Return current "over" mode.

TOVER  ( mode -- )
Set "over" mode. There are 3 modes:
  0: overwrite
  1: XOR
  2: OR

TATTRS?  ( -- enabled? )
Return "set attributes" mode.

TATTRS  ( -- enabled? )
Enable or disable attribute change.

6X@  ( -- x )
Get current printing column.

6Y@  ( -- y )
Get current printing row.

6CUR!  ( visible? -- )
Set "show cursor while waiting a key" mode.

6CUR@  ( -- visible? )
Get current "show cursor while waiting a key" mode.

6CUR.  ( -- )
Draw cursor. Doesn't change current printing position.


Quans
=====

Quan support words are always included. Quan is a variable which doesn't
need "@".

  69 quan q

q . cr  -- prints "69"
qaddr q -- get address of "q" value.
  qaddr q @ . cr -- prints "69".
42 to q -- set new value. use this instead of "!"!


Extended words
==============

1-  ( n -- n-1 )
2-  ( n -- n-1 )
2*  ( n -- n*2 )
2/  ( n -- n/2 )
2U/ ( u -- u/2 )
OFF ( addr -- )  -- : OFF  0 SWAP ! ;
ON  ( addr -- )  -- : ON   1 SWAP ! ;

NIP  ( n1 n2 -- n2 )  -- : NIP  SWAP DROP ;
TUCK ( n1 n2 -- n2 n1 n2 )  -- : TUCK  SWAP OVER ;

0MAX  ( n -- n/0 )  -- slightly faster (and smaller) version of "0 MAX".

0IF -- the same as "NOT IF", but faster.
+IF -- the same as "0 > IF", but faster.
-IF -- the same as "0 < IF", but faster.
+0IF -- the same as "0 >= IF", but faster.
-0IF -- the same as "0 <= IF", but faster.

0WHILE -- the same as "NOT WHILE", but faster.
0UNTIL -- the same as "NOT UNTIL", but faster.
User avatar
PeterJ
Site Admin
Posts: 6879
Joined: Thu Nov 09, 2017 7:19 pm
Location: Surrey, UK

Re: Abersoft fig-Forth v1.2 (with 42 cols driver)

Post by PeterJ »

Many thanks @ketmar,

It works very well.
Post Reply