<1>修改 原fkernel.f的 UPPER 內容如下:
( 註: 修改的 SUPPER 會呼叫 UPPERCASE ,所以 要在 UPPERCASE之後定義 )
1 constant cword_support?
cword_support? #if
: UPPER ( addr len -- ) \ translate to uppercase
cword_support?
if
2dup 0 -rot ( a l 0 a l)
0 ?do dup i + c@ 127 >
if
swap drop -1 swap
then
loop drop
if
2drop
exit
then
then
ucasetab tr ; \ use tr to do the work
#else
: UPPER ( addr len -- ) \ translate to uppercase
ucasetab tr ; \ use tr to do the work
#then
cword_support? #if
: ?UPPERCASE
cword_support?
if
dup
@ 0xff00ffff and
0x27002703 = if exit then \ skip '?'
dup count 0 -rot ( str 0 a l )
0 ?do dup i + c@ 127 >
if
swap drop -1 swap
then
loop drop
if
exit
then
then
UPPERCASE
;
#else
' UPPERCASE ALIAS ?UPPERCASE
#then
<2>修改 src\class.f 中的 @word 內容如下:
: @word ( -- addr ) \ bl word uppercase ; bl word ?uppercase ;
<3>修改 fkernel.f & class.f 後
執行 setup.exe 選 B (Rebuild win32for.exe)
之後執行 win32for.exe
<4>
: 古惑仔 ." 古惑仔" ;
如果你看到古惑仔 , 就表示成功了
這時你打 words 當然也會出現 古惑仔這個詞.
( p.s 原本 "古" 會變成 "仔" )
PS:若要讓系統找指令也不出錯,則需再將fkernel.f源程式中尾段PARMFIND指令中的UPPERCASE也改成?UPPERCASE才行。
原文出處: http://groups.google.com.tw/group/figtaiwan/web/win32forth-61400

沒有留言:
張貼留言