-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Some questions to get it going / Keyboard Layout #2
Comments
Hi @mczero80
Thanks! I'll answer your questions in separate messages. |
There are a few different ways of doing that. Probably one of the easiest ways is to rename CREATE TBLSC-US
( )
( ) 0 c, ESC c,
( ) | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = BACK c,
( ) TAB c, | q | w | e | r | t | y | u | i | o | p | [ | ] RET c,
( ) CTRL c, | a | s | d | f | g | h | j | k | l | ; | ' | `
( ) SHIFT c, | \ | z | x | c | v | b | n | m | , | . | / SHIFT c,
( ) PRSCR c, ALT c, ______SPACE______ c, CAPSLOCK c,
( )
( ) TBLSC-SPECIAL
( )
TBLSC-US END. For example, you could switch keymaps with something like DEFER TBLSC
: US ['] TBLSC-US ['] TBLSC-US-SHIFT ;
: setxkmap ( tblsc-addr tblsc-shift-addr )
IS TBLSC-SHIFT
IS TBLSC ;
\ And call it like
US setxkmap |
It's definitely ridicuous from my side :-D I should have documented it better. Don't worry, I also struggle to remember. Try typing this in a freshly booted eulex: eulex \ will switch to the eulex vocabulary, the main one, where most of the internal code lives
\ The editor.fs is a block-editor. Blocks are not like text files, they are fixed length. Look at blocks.fs for an idea about what they are, or google a bit for it. Eulex provides 2 backends for blocks, memory and floppy. This command will switch to the memory implementation.
use-memory
\ This will open the editor for the block 0.
0 edit
\ Here you can type some emacs-like keybindings. You can save with `C-x C-s`, navigate and exit with `C-x C-c`. If you later open the same block, you should see the same content. |
Not really super standard, but I think it is mostly conventional. The thing about the assembler is, it is not in use in the project. No other code is using that assembler. It was an attempt for me to bootstrap the whole project, I wanted to get rid of That being said, here is a snippet that you can try. Note, you can execute assembler.fs into gforth as well! (after all the idea was to bootstrap this). But you can also run this in Eulex. Copy the following snippet to eulex
require @assembler.fs
\ Enable the vocabulary
also assembler
\ Assembly is compiled into the dictionary.. give it a name
create target
\ compile some code
nop
5 # %eax mov
ret
\ Disassemble!
target disassemble-memory
\ Or Look at the binary code
target 10 dump It supports most of the addressing modes and such, but it is not very well tested. So be preapred to touch assembler.fs itself if you want to work on it. If you would like to know the register conventions and such, have a look to Let me know if you have any other questions! |
Thank you very much! I will take a look into it tomorrow. So far, eulex is really promising to play around with forth as a standalone system. I found some really cool forth benchmarks, and would like to try them. So far, only one word seems to be missing for benchmarking, "TIMER-RESET" . Perhaps I am able to implement it somehow. |
That sounds great! The compiler is quite naive unfortunately, but any improvement is welcome! I would have liked to define a IR for the compilation instead, as I did in this other project https://github.com/ams-hackers/gbforth . You may be interested in that one as well. It has some technical docs: https://ams-hackers.github.io/gbforth/ |
Just searched google for IR, you mean intermediate representation? I came across gbforth recently, and I must say that I have a gameboy myself and that it sounds interesting, but I don't know for what its good really? Could I write a small game like tetris with it, while avoiding Z80 assembler? Perhaps it is just because the gameboy has no keyboard, which irritates me in this case. But apart from my understanding problem, they are all really great projects, and worth a look! |
Yes, intermediate representation. It allows you to easily transform that representation before the code is emitted, so you can implement some optimizations.
Anyway, let me know how it goes! |
Sure, I will give feedback, perhaps even upload a pull request to github when I have something interesting, that is useful too! :) Ahh one more question, I am sorry. Could I boot eulex from grub? I know, it is dangerous to use it on a real machine, but that is no problem here. |
Sure. It should boot. I haven' tried on real hardware for a while... it would be wise to try. Hopefully there is no big issues! |
Hi, still haven't tested it on bare metal. Your proposed changes for |
So each modifier For special characters like So, it sounds good to me! 👍 |
As far as I know, there are no chars that are in a ALT-CTRL table. Only ALT, CTRL and SHIFT as separate tables. ö, ü and ä are reachable without a modifier, but there are uppercase chars from it: Ä,Ö and Ü while holding SHIFT. I tried inserting ä, ö and ü, but both gave me a compile error (I guess missing words for them) Really important are chars like \ of course. And they need a ALT table for german keyboards. I guess other countries need a ALT table as well... |
Btw I will take a look into emacs keys, so far I have only used nano and vim :D |
Hi,
first thank you for this wonderful forth variant!
I really like it.
I have some questions, and I must admit, that I am a forth beginner.
I would like to modify keyboard.fs for my german keyboard, but I am really unsure how.
Some important characters like @ or \ are only reachable with ALT-key on a german keyboard.
keyboard.fs unfortunately seems only to map a unshifted and a shifted keymap,
at least thats how I understand the code for now. Perhaps you could help me
a bit what to modify?
And the second question is perhaps a bit ridiculous, I don't know how to start the editor that
you build! I don't find a word to execute for it.
Third and last question (I hope), how to use the in-built assembler. Does it follow a particular
forth assembler standard? I would be very interested, how I could take a value from the stack,
and do some assembler things like MOVing, and how to put a value from assembler back on the forth stack.
Thank you very much in advance!
The text was updated successfully, but these errors were encountered: