Replies: 7 comments 8 replies
-
Since we have evolved from 8bit computing I would '*user test' this
vernacular:
1bit@ 8bit@ 16bit@ 32bit@ 64bit@ 128bit@;
I have accessed memory in my forths up to that last (128) bit size.
'see' how it feels to you and let me know please
…On Mon, Jun 24, 2024 at 11:12 AM ruv ***@***.***> wrote:
There is a new proposal at forth-standard.org: Special memory access words
<https://forth-standard.org/proposals/special-memory-access-words#contribution-343>
.
This made me wonder what words people use to read a byte (of 8 bits) from
memory.
If in your application you need to read exactly one byte (octet) at an
address, which word do you use (or are likely to use): c@ ( addr -- x )
or b@ ( addr -- x )? Or something else?
—
Reply to this email directly, view it on GitHub
<#158>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABILVRIGI2AU4YTGJKGLQ3DZJBAN3AVCNFSM6AAAAABJ2EF7PKVHI2DSMVQWIX3LMV43ERDJONRXK43TNFXW4OZWHA2TQOBSGU>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Evolution of c@ is easy enough to read and understand, yet
wouldn't 64 = 2L?
…On Mon, Jun 24, 2024 at 7:25 PM Chris Curl ***@***.***> wrote:
C@ 8 bits
W@ 16 bits
L@ 32 bits
@ 32 or 64 bits depending on target system
—
Reply to this email directly, view it on GitHub
<#158 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABILVROCYXS5YL45WUH4YF3ZJC2G3AVCNFSM6AAAAABJ2EF7PKVHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM4TQNRVGY2DM>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
This is why I propose words - to see the response of this community.
I agree RUV, your words are 'better', tho I have no aversion to words
starting with digits, so far~!
sint8@
so what about endianess? How is this evolution?
LE_sint8@
BE_sint8@
…On Tue, Jun 25, 2024 at 7:55 AM ruv ***@***.***> wrote:
I would '*user test*' this vernacular: 1bit@ 8bit@ 16bit@ 32bit@ 64bit@
128bit@;
What is the stack diagram for 1bit@ and 128bit@? And what about
endianness and sign extension?
Otherwise, these names are somewhat acceptable to me, but I prefer a form
that does not start with a digit.
Possible variants:
- uint8@ uint16@ uint32@ uint64@ uint128@
- u8@ u16@ u32@ u64@ u128@
—
Reply to this email directly, view it on GitHub
<#158 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABILVRIICOM6NIFW3ZTJTFTZJFSC3AVCNFSM6AAAAABJ2EF7PKVHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM4TQNZRGQYDI>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Open Firmware, which was standardized as IEEE1275-1994 (approximately concurrently with ANS-FORTH) and subsequently deployed on millions of computers, has a comprehensive solution. The size prefixes are B, W, L, and X for 8,16,32, and 64. Those can be further prefixed with BE-, LE-, and REG- for big-endian, little-endian, and hardware register access. Prepend < for sign extension. The Forth community is famous for not knowing its history and reinventing the same wheel "OVER AND OVER AND OVER AGAIN" - which could be a Forth program if you prepend BEGIN. |
Beta Was this translation helpful? Give feedback.
-
Don't forget alignment. When you are unpacking an externally-defined data packet, the fields might not be aligned suitably for hardware fetch/store instructions, either because they are packed wrong or because the start of the packet is not strongly-aligned. For this reason, Open Firmware specified that the BE- and LE- words must be implemented so they would not cause hardware exceptions due to alignment. Byte-swizzling-after-native-access often fails on aligned hardware. Exceptions due to accessing non-existent memory is okay. The opposite was true for the REG- words, since hardware registers often require a specific access width. Saving a few words at the expense of making programmers work harder is often not the right tradeoff. |
Beta Was this translation helpful? Give feedback.
-
Thanks Mitch. I admire the work you have done to get us here.
My interest is at the root of Forth, yet extending or swapping the "machine
primitives"
is a intellectual foray into vernaculars for domains, and as such are just
conjectures and musing on the side of the pre existing Forth systems and
Standards.
Weather than being ignorant or lacking in domain research or expertise I
feel fine with this discussion, and appreciate your input. Let's not be
little committees squabbling about the conferderates outside in the
hallways please.
…On Tue, Jun 25, 2024 at 10:52 AM Mitch Bradley ***@***.***> wrote:
Open Firmware, which was standardized as IEEE1275-1994 (approximately
concurrently with ANS-FORTH) and subsequently deployed on millions of
computers, has a comprehensive solution. The size prefixes are B, W, L, and
X for 8,16,32, and 64. Those can be further prefixed with BE-, LE-, and
REG- for big-endian, little-endian, and hardware register access. Prepend <
for sign extension.
The Forth community is famous for not knowing its history and reinventing
the same wheel "OVER AND OVER AND OVER AGAIN" - which could be a Forth
program if you prepend BEGIN.
—
Reply to this email directly, view it on GitHub
<#158 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABILVRPEIWCZONDWOXDV353ZJGG2FAVCNFSM6AAAAABJ2EF7PKVHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM4TQNZTGMZDC>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Thank you for the clarification. I also apologize as I did not consider
this thread as inside the committee doors. I will ask the first question
first from now on. Tx for the ascii.
…On Tue, Jun 25, 2024 at 12:54 PM ruv ***@***.***> wrote:
The different is: 24 - 18 = 6 words.
There is a mistake. Different endianness is not needed to read/write a
byte.
*The corrected variant.* The first approach produces a set of *21 words*:
| {<, } × {BE-, LE-} × {W, L, X} × {@ } + {BE-, LE-} × { W, L, X} × {! }
+ {<, } × {B } × {@} + {B } × { ! } |
= 2 * 2 * 3 * 1 + 2 * 3 * 1 + 2 * 1 * 1 + 1 * 1 = 12 + 6 + 2 + 1 = 21
words.
The difference is: 21 - 18 = 3 words.
If we need to read/write fixed-width units in the Forth-system native
endianness, it adds: 2*3 + 3 = 9 words in the first approach, and nothing
in the second approach. The different will be 3 + 9 = *12 words*.
—
Reply to this email directly, view it on GitHub
<#158 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABILVRJRMGS6FSZUXBHOFM3ZJGVFDAVCNFSM6AAAAABJ2EF7PKVHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM4TQNZUGQ2TG>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
There is a new proposal at forth-standard.org: Special memory access words.
This made me wonder what words people use to read a byte (of 8 bits) from memory.
If in your application you need to read exactly one byte (octet) at an address, which word do you use (or are likely to use):
c@ ( addr -- x )
orb@ ( addr -- x )
? Or something else?5 votes ·
Beta Was this translation helpful? Give feedback.
All reactions