kolibrios/programs/develop/SPForth/meforth_samples/locals.f
Kirill Lipatov (Leency) 09488af869 KolSPForth12 uploaded to SVN
git-svn-id: svn://kolibrios.org@4867 a494cfbc-eb01-0410-851d-a64ba20cac60
2014-04-21 19:22:58 +00:00

35 lines
1.7 KiB
Forth
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

( ˆ§ <EFBFBD> à ­®¢ :
‘⥪ ¤ ­­ëå ª ª ã­¨¢¥àá «ì­®¥ á।á⢮ ¤«ï ¯¥à¥¤ ç¨ ¯ à ¬¥â஢ ¨ १ã«ìâ â®¢
¬¥¦¤ã ä®àâ-á«®¢ ¬¨ ¨¬¥¥â ­¥®á¯®à¨¬ë¥ ¯à¥¨¬ãé¥á⢠. ‚¬¥á⥠á ⥬ ¢­ãâà¨
®¯à¥¤¥«¥­¨ï ®­ ¨á¯®«ì§ã¥âáï ¤«ï ¯à®¬¥¦ãâ®ç­ëå ¢ëç¨á«¥­¨© ¨ à §¬¥é¥­¨ï §­ ç¥­¨©,
ª®â®àë¥ ¢ ­¨å ãç áâ¢ãîâ. <EFBFBD>â® ¢ë§ë¢ ¥â ®¯à¥¤¥«¥­­ë¥ âà㤭®á⨠¤«ï ¤®áâ㯠 ª
â ª®¬ã «®ª «ì­®¬ã §­ ç¥­¨î, ¯®áª®«ìªã ¥£® ¯®«®¦¥­¨¥ ®â­®á¨â¥«ì­® ¢¥à設ë á⥪ 
¯®áâ®ï­­® ¬¥­ï¥âáï.
„«ï ã¯à®é¥­¨ï à ¡®âë ¦¥« â¥«ì­® § ªà¥¯¨âì §  «®ª «ì­ë¬ ®¡ê¥ªâ ¬¨ ¢­ãâà¨
®¯à¥¤¥«¥­¨ï ­¥ª®â®àë¥ ¯®áâ®ï­­ë¥ ¨¬¥­ , ç¥à¥§ ª®â®àë¥ ¨ ®áãé¥á⢫ïâì ¤®áâ㯠ª
­¨¬.
ˆ¬¥î騩áï ¢ ï§ëª¥ ¬¥å ­¨§¬ ®¯¨á ­¨ï ¯¥à¥¬¥­­ëå ¢ ¤ ­­®¬ á«ãç ¥ ­¥ ¯®¤å®¤¨â,
¯®áª®«ìªã ᮧ¤ ¥â £«®¡ «ì­ë¥ ¨¬¥­ , ⮣¤  ª ª âॡã¥âáï ¨¬¥­®¢ âì «®ª «ì­ë¥
®¡ê¥ªâë, ãç¨âë¢ ï ¯à¨ í⮬ ¢®§¬®¦­®áâì ४ãàᨢ­ëå ¢ë§®¢®¢. <EFBFBD>®áâ ¢«¥­­ãî § ¤ çã
à¥è ¥â ¢ª«î祭¨¥ ¢ à ¡®âã ¤®¯®«­¨â¥«ì­®£® á⥪ , ®â«¨ç­®£® ®â á⥪  ¤ ­­ëå.
‹®ª «ì­ë¥ §­ ç¥­¨ï à §¬¥é îâáï ¢ í⮬ á⥪¥ ¯à¨ ¢å®¤¥ ¢ ®¯à¥¤¥«¥­¨¥ ¨ 㡨à îâáï
¨§ ­¥£® ¯à¨ ¢ë室¥.
<EFBFBD>  ¢á¥ ¢à¥¬ï ¨á¯®«­¥­¨ï ®¯à¥¤¥«¥­¨ï ¨å ¯®«®¦¥­¨¥ ®â­®á¨â¥«ì­® ¢¥à設ë á⥪ 
®áâ ¥âáï ¯®áâ®ï­­ë¬, íâ® ¯®§¢®«ï¥â ®à£ ­¨§®¢ âì ®ç¥­ì ¯à®á⮩ ¤®áâ㯠ª â ª¨¬
§­ ç¥­¨ï¬.
<EFBFBD>à®á⥩è ï ­ ¤áâனª  ­ ¤ ï§ëª®¬ ”®àâ, ª®â®à ï ¯®§¢®«ï¥â à ¡®â âì á «®ª «ì­ë¬¨
¯¥à¥¬¥­­ë¬¨, ¢ë£«ï¤¨â â ª:)
100 ALLOT HERE CONSTANT LP0 ( <20>€—€Ž ‹ŽŠ.‘’…Š€)
VARIABLE LP ( ’…Š“™€Ÿ <E2809A>˜ˆ<CB9C>ŽŠ€œ<E280B9>ŽƒŽ ‘’…Š€)
: INITLP ( ->) LP0 LP ! ; INITLP
: LOC ( N:‘—…’—ˆŠ->) 1+ CELLS LP @ OVER - DUP LP ! ! ;
: UNLOC ( ->) LP @ @ LP +! ;
: @@ ( N:‘Œ…™->) CREATE , DOES> ( PFA->A) @ CELLS LP @ + @ ;
: !! ( N:‘Œ…™->) CREATE , DOES> ( A,PFA->) @ CELLS LP @ + ! ;
1 @@ @1 2 @@ @2 3 @@ @3 4 @@ @4 5 @@ @5 ( ˆ .„.)
1 !! !1 2 !! !2 3 !! !3 4 !! !4 5 !! !5 ( ˆ .„.)