Le jeudi 7 septembre 2023 à 12:00:10 UTC+2,
[email protected] a écrit :
hello
currently I use an externol tool to do this in gforth over gnulinux station.
: caps ( -- ) s" xdotool key Caps_Lock" system ;
\ triggers capslock just like pressing the key
I'm looking for a forth solution to make it more forth & less xdotool dependant & even external applicatin independant.
so I am looking for a solution to simulate by a word the capslock keypress.
I ve been guided to https://www.complang.tuwien.ac.at/forth/gforth/Docs-html/386-Assembler.html#g_t386-Assembler and https://gforth.org/manual/AMD64-Assembler.html abi-code solution
then I tried
ONLY FORTH ALSO ASSEMBLER
code toto
$3A # al mov
$02 # ah mov
$80 # int
ret
end-code
that migth be also a solution but I failed as this creates a memory error on execution
I failed to find more documentation or examples to fix it
any pure forth idea ?
any abi-code idea or fix ?
any documentation about the specific abi-code inside gforth ?
thanks
I 've been stupid stupid
of course toupper was not working
'toupper' ( c1 -- c2 ) gforth-0.2 "toupper"
'accept' ( c-addr +n1 -- +n2 ) core "accept"
that is the point
so I just have to make toupper from another intermediary word addr len compatible
+ 110 \ need a specific input to get capitalized
+ 111 : $INPUT ( -- addr len) PAD DUP 16 ACCEPT ;
+ 112 \ convert a string in place. (not always good)
+ 113 : >UPPER ( addr len -- addr len)
+ 114 2DUP \ dup the string
+ 115 BOUNDS \ convert last-addr 1st-addr
+ 116 DO \ do loop counts from 1st to last char
+ 117 I C@ \ read the char from address 'I'
+ 118 TOUPPER \ convert character to upper case
+ 119 I C! \ store char back into the address
+ 120 LOOP ;
121 : isnum?
122 ." next number ? "
~ 123 pad dup 16 $INPUT >UPPER \ ask for an user input now works even lower cases
124 s>number? IF \ already an integer ?
\ etc etc
--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)