Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Word Digit appears to be missing from 2.2.21 #152

Closed
VK6TT opened this issue Jan 25, 2018 · 9 comments
Closed

Word Digit appears to be missing from 2.2.21 #152

VK6TT opened this issue Jan 25, 2018 · 9 comments
Assignees
Labels

Comments

@VK6TT
Copy link
Collaborator

VK6TT commented Jan 25, 2018

Tried the latest binary today for my WD1209-FD testing. Found that the word "digit" is no longer in the pre-compiled binary. Which is odd because the forth.asm file in the master shows the entry. (Line 2860)

@VK6TT
Copy link
Collaborator Author

VK6TT commented Jan 25, 2018

Maybe this is related to a possible vocabulary issue alluded to in #153?

@TG9541
Copy link
Owner

TG9541 commented Jan 25, 2018 via email

@VK6TT
Copy link
Collaborator Author

VK6TT commented Jan 27, 2018

Hi Thomas,

if I look at forth.asm I see in line

stm8ef/forth.asm

Line 2178 in c420dcf

; DIGIT ( u -- c ) ( TOS STM8: -- Y,Z,N )
the definition of digit. eg
; DIGIT ( u -- c ) ( TOS STM8: -- Y,Z,N )

I had assumed that all the words in the file forth.asm, and also mentioned in words.md, would simply be there in the W1209-FD binary distribution. It's no big deal, in the case of the word digit, to define my own version of word if it's not in the vocabulary of the binary distribution.

But given that I couldn't understand what the following line in the file \stm8ef-bin.V2.2.21pre2\out\W1209-FD\target\digit meant I'm hoping I don't have to do this for other words.
: DIGIT [ $CC C, $88F1 , OVERT

Kind regards
Richard

@TG9541
Copy link
Owner

TG9541 commented Jan 27, 2018

Hi Richard,

first of all, thanks for pointing out that the whole Alias stuff needs a better explanation.

I updated the Using Alias Words Wiki in the hope of making this more accessible.

Could you please check if the concept is sufficiently understandable? I would also appreciate a recommendation on where to point users to the "missing words", and hear your opinion on e4thcom and codeload.py.

Kind regards
Thomas

@VK6TT
Copy link
Collaborator Author

VK6TT commented Jan 28, 2018 via email

@TG9541
Copy link
Owner

TG9541 commented Jan 28, 2018

Hi Richard,
you have a point: simplicity of use, by avoiding unnecessary complexity, is, of course, a very important aspect. On the other hand, building more complicated applications requires more memory.

I'd like to propose the following:

  • the ALIAS feature makes it possible to build a binary that includes all the core words, even those which are unlinked for conserving space
  • a new feature allows users of e4thcom "shedding" these ALIAS words. They can then be added as needed.

This would accommodate both use cases, "basic interactive Forth programming", and "assisted interactive Forth programming".

As for e4thcom: I agree that for simple applications Windows-XT and Hyperterm is fast, simple, and very usable. However, booting an old Pentium 90 PC to a Linux console, and running e4thcom on it, would be even more lean and simple (e4thcom is Forth based).

Kind regards,
Thomas

@TG9541
Copy link
Owner

TG9541 commented Jan 28, 2018

I tried adding full dictionary as aliases (it was actually a 5 minutes hack) - the binaries are here: W1209-fulldict.zip

The aliases require 550 bytes memory, but they can be removed by RESET as shown below. By using PERSIST from the /lib folder you can make them permanent. Of course, creating subset is also easy.

words
 CP NUMBER? do$ dm+ QUIT $"| docon $COMPILE CUPPER DOXCODE _TYPE PRESET (+loop) QUERY ?STACK ?UNIQUE doVAR LOCKF NAME? PAD str TAP DIGIT? EXTRACT WORD $," PACK$ .OK 1 0 dodoes EVAL find ?branch COMPILE? branch PARSE >CHAR .ID ABORT TOKEN DIGIT ^H SAME? -1 $INTERPRET kTAP ULOCKF ACCEPT ."| $,n IRET SAVEC RESET RAM NVM LOCK ULOCK ADC@ ADC! ?KEYB P7S E7S WORDS .S DUMP IMMEDIATE ALLOT VARIABLE CONSTANT CREATE DOES> ] : ; OVERT ." $" ABORT" AFT REPEAT WHILE AHEAD ELSE THEN IF AGAIN UNTIL BEGIN +LOOP LOOP DO NEXT FOR COMPILE [COMPILE] LITERAL CALL, C, , ' hi CR [ NAME> \ ( .( ? . U. TYPE U.R .R SPACES SPACE KEY DECIMAL HEX <# SIGN HOLD #S # #> ERASE FILL CMOVE HERE COUNT +! DEPTH PICK 0= ABS NEGATE NOT 1+ 1- 2+ 2- 2* 2/ EXG */ */MOD M* * UM* / MOD /MOD M/MOD UM/MOD WITHIN MIN MAX < U< = DNEGATE 2DUP ROT ?DUP BG TIM BL OUT last '?KEY 'EMIT BASE - 0< OR AND XOR + UM+ I OVER SWAP DUP 2DROP DROP NIP >R R@ R> C! C@ ! @ B! 2C@ 2C! 2@ 2! EXIT EXECUTE LEAVE EMIT ?KEY TX! ?RX 'BOOT BKEY OUT! COLD ok
reset
STM8eForth 2.2.21 ok
words
 IRET SAVEC RESET RAM NVM LOCK ULOCK ADC@ ADC! ?KEYB P7S E7S WORDS .S DUMP IMMEDIATE ALLOT VARIABLE CONSTANT CREATE DOES> ] : ; OVERT ." $" ABORT" AFT REPEAT WHILE AHEAD ELSE THEN IF AGAIN UNTIL BEGIN +LOOP LOOP DO NEXT FOR COMPILE [COMPILE] LITERAL CALL, C, , ' hi CR [ NAME> \ ( .( ? . U. TYPE U.R .R SPACES SPACE KEY DECIMAL HEX <# SIGN HOLD #S # #> ERASE FILL CMOVE HERE COUNT +! DEPTH PICK 0= ABS NEGATE NOT 1+ 1- 2+ 2- 2* 2/ EXG */ */MOD M* * UM* / MOD /MOD M/MOD UM/MOD WITHIN MIN MAX < U< = DNEGATE 2DUP ROT ?DUP BG TIM BL OUT last '?KEY 'EMIT BASE - 0< OR AND XOR + UM+ I OVER SWAP DUP 2DROP DROP NIP >R R@ R> C! C@ ! @ B! 2C@ 2C! 2@ 2! EXIT EXECUTE LEAVE EMIT ?KEY TX! ?RX 'BOOT BKEY OUT! COLD ok

@VK6TT
Copy link
Collaborator Author

VK6TT commented Jan 30, 2018 via email

@TG9541
Copy link
Owner

TG9541 commented Jan 30, 2018

Hi Richard,

I had a look at the changes - I like a lot that you write about ALIAS from the user perspective!

Thanks!

By the way, ALIAS dictionary entries, unlike normal words with executable code, can reside in EEPROM memory. I didn't try it but it should be possible to free up even more Flash memory!

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants