FORTH 的 code space, data space alignment

84 views
Skip to first unread message

H.C.Chen

unread,
Aug 8, 2020, 1:11:20 AM8/8/20
to 符式協會

感謝政昌兄指點,做個筆記:

2020.08.08 星期六
11:26 陳厚成 eforth64 沒有任何 alignment , 我試了一下, here 是指在單數的位置上! 
      I have no idea how to deal with that.
12:22 吳政昌 here 指在單數位址上沒問題
12:24 陳厚成 喔,感謝!確實。我一時以為 dictionary 也要以 cell 為單位,非也。
12:25 吳政昌 code 或 create 或 : 會先把 here 調整成 aligned
12:26 吳政昌 看設計。可能 aligned 成可被 16 整除或偶數。
12:32 吳政昌 原始的 eforth 對性能比較不講究,所以不重視 alignment。
12:37 陳厚成 原來是在 code, create, : 這些小關鍵處下手,感謝政昌兄指點。
12:50 吳政昌 nfa, cfa 或 dfa 都是指向 aligned 的位址。所以是在建立這些欄位時就算好。
             並根據這些 align 好 here。其他就靠使用 FORTH 的人來維持資料的 alignment 了。
13:00 陳厚成 這又更精準了
12:51 吳政昌 我以前用 FPC 時,完全沒有 alignment 的概念。
12:54 吳政昌 也從來沒用過 aligned  align faligned falign 這些指令。
12:56 吳政昌 因為自己開發 FORTH,又看了 FORTH APPLICATION TECHNIQUES 才懂得用。
13:00 吳政昌 @陳厚成 如果要自己開發 FORTH,一定要看 Forth standard 網站
13:01 吳政昌 比如這兒對 create 的說明
13:02 吳政昌 就提到要對 data space 做 alignment。
             code space 不需要。但我通常會 aligned 到能被 16 整除。x86 系統比較不必省 memory\


H.C.Chen

unread,
Aug 8, 2020, 1:17:06 AM8/8/20
to 符式協會
這些討論都記一記

燕南: 所以用cell是個好習慣 雖然浪費一些空間 (現在字元也常改用 uni code32)
吳政昌: cell 的概念出來時,那時我還在用 32 位元的 FPC,不能理解為什要用 CELLS CELL+,也不會在程式中用 ALIGN ALIGNED 來使資料和 CELL 對齊。
Reply all
Reply to author
Forward
0 new messages