Alignement
  Home FAQ Contact Sign in
comp.lang.forth only
 
Advanced search
POPULAR GROUPS

more...

comp.lang.forth Profile…
 Up
Alignement         


Date: Oct 2, 2007 11:36

Hi,

ANS states clearly, that programs do have to take care about
alignement. But if I do have data that comes from say a file from
another machine, I want to read this. So I've to do things like

\ VAX-order
: v@ dup c@
over 1+ c@ 8 << or
over 2 + c@ 16 << or
swap 3 + c@ 24 << or ;

\ Network-order
: n@ dup c@ 24 <<
over 1+ c@ 16 << or
over 2 + c@ 8 << or
swap 3 + c@ or ;

Is there any common practise how to name such words? Perl for example
has it's pack/unpack to do such things and I could imagine I'm not the
first that stumbles about this problem.

Regards,
-Helmar
27 Comments
Re: Alignement         


Author: Alex McDonald
Date: Oct 2, 2007 12:08

On Oct 2, 7:36 pm, hel...@gmail.com wrote:
> Hi,
>
> ANS states clearly, that programs do have to take care about
> alignement. But if I do have data that comes from say a file from
> another machine, I want to read this. So I've to do things like
>
> \ VAX-order
> : v@ dup c@
> over 1+ c@ 8 << or
> over 2 + c@ 16 << or
> swap 3 + c@ 24 << or ;
>
> \ Network-order
> : n@ dup c@ 24 <<
> over 1+ c@ 16 << or
> over 2 + c@ 8 << or
> swap 3 + c@ or ;
>
> Is there any common practise how to name such words? Perl for example ...
Show full article (0.90Kb)
no comments
Re: Alignement         


Date: Oct 2, 2007 12:13

On Oct 2, 9:08 pm, Alex McDonald rivadpm.com> wrote:
> On Oct 2, 7:36 pm, hel...@gmail.com wrote:
>
>
>
>> Hi,
>
>> ANS states clearly, that programs do have to take care about
>> alignement. But if I do have data that comes from say a file from
>> another machine, I want to read this. So I've to do things like
>
>> \ VAX-order
>> : v@ dup c@
>> over 1+ c@ 8 << or
>> over 2 + c@ 16 << or
>> swap 3 + c@ 24 << or ;
>
>> \ Network-order
>> : n@ dup c@ 24 <<
>> over 1+ c@ 16 << or ...
Show full article (1.38Kb)
no comments
Re: Alignement         


Author: Anton Ertl
Date: Oct 2, 2007 12:10

helmwo@gmail.com writes:
>Hi,
>
>ANS states clearly, that programs do have to take care about
>alignement. But if I do have data that comes from say a file from
>another machine, I want to read this. So I've to do things like
>
>\ VAX-order
>: v@ dup c@
> over 1+ c@ 8 << or
> over 2 + c@ 16 << or
> swap 3 + c@ 24 << or ;
>
>\ Network-order
>: n@ dup c@ 24 <<
> over 1+ c@ 16 << or
> over 2 + c@ 8 << or
> swap 3 + c@ or ;
>
>Is there any common practise how to name such words? ...
Show full article (1.08Kb)
no comments
Re: Alignement         


Author: Alex McDonald
Date: Oct 2, 2007 12:18

On Oct 2, 8:13 pm, hel...@gmail.com wrote:
> On Oct 2, 9:08 pm, Alex McDonald rivadpm.com> wrote:
>
>
>
>> On Oct 2, 7:36 pm, hel...@gmail.com wrote:
>
>>> Hi,
>
>>> ANS states clearly, that programs do have to take care about
>>> alignement. But if I do have data that comes from say a file from
>>> another machine, I want to read this. So I've to do things like
>
>>> \ VAX-order
>>> : v@ dup c@
>>> over 1+ c@ 8 << or
>>> over 2 + c@ 16 << or
>>> swap 3 + c@ 24 << or ;
>
>>> \ Network-order ...
Show full article (1.60Kb)
no comments
Re: Alignement         


Date: Oct 2, 2007 12:31

On Oct 2, 9:18 pm, Alex McDonald rivadpm.com> wrote:
> On Oct 2, 8:13 pm, hel...@gmail.com wrote:
>
>
>
>> On Oct 2, 9:08 pm, Alex McDonald rivadpm.com> wrote:
>
>>> On Oct 2, 7:36 pm, hel...@gmail.com wrote:
>
>>>> Hi,
>
>>>> ANS states clearly, that programs do have to take care about
>>>> alignement. But if I do have data that comes from say a file from
>>>> another machine, I want to read this. So I've to do things like
>
>>>> \ VAX-order
>>>> : v@ dup c@
>>>> over 1+ c@ 8 << or
>>>> over 2 + c@ 16 << or
>>>> swap 3 + c@ 24 << or ; ...
Show full article (2.23Kb)
no comments
Re: Alignement         


Author: John Doty
Date: Oct 2, 2007 12:47

Anton Ertl wrote:
> helmwo@gmail.com writes:
>> Hi,
>>
>> ANS states clearly, that programs do have to take care about
>> alignement. But if I do have data that comes from say a file from
>> another machine, I want to read this. So I've to do things like
>>
>> \ VAX-order
>> : v@ dup c@
>> over 1+ c@ 8 << or
>> over 2 + c@ 16 << or
>> swap 3 + c@ 24 << or ;
>>
>> \ Network-order
>> : n@ dup c@ 24 <<
>> over 1+ c@ 16 << or
>> over 2 + c@ 8 << or
>> swap 3 + c@ or ;
>> ...
Show full article (1.11Kb)
no comments
Re: Alignement         


Date: Oct 2, 2007 14:15

On Oct 2, 9:47 pm, John Doty whispertel.LoseTheH.net> wrote:
> Anton Ertl wrote:
>> hel...@gmail.com writes:
>>> Hi,
>
>>> ANS states clearly, that programs do have to take care about
>>> alignement. But if I do have data that comes from say a file from
>>> another machine, I want to read this. So I've to do things like
>
>>> \ VAX-order
>>> : v@ dup c@
>>> over 1+ c@ 8 << or
>>> over 2 + c@ 16 << or
>>> swap 3 + c@ 24 << or ;
>
>>> \ Network-order
>>> : n@ dup c@ 24 <<
>>> over 1+ c@ 16 << or
>>> over 2 + c@ 8 << or
>>> swap 3 + c@ or ; ...
Show full article (1.38Kb)
no comments
Re: Alignement         


Author: Alex McDonald
Date: Oct 2, 2007 14:38

On Oct 2, 8:31 pm, hel...@gmail.com wrote:
> On Oct 2, 9:18 pm, Alex McDonald rivadpm.com> wrote:
>
>
>
>> On Oct 2, 8:13 pm, hel...@gmail.com wrote:
>
>>> On Oct 2, 9:08 pm, Alex McDonald rivadpm.com> wrote:
>
>>>> On Oct 2, 7:36 pm, hel...@gmail.com wrote:
>
>>>>> Hi,
>
>>>>> ANS states clearly, that programs do have to take care about
>>>>> alignement. But if I do have data that comes from say a file from
>>>>> another machine, I want to read this. So I've to do things like
>
>>>>> \ VAX-order
>>>>> : v@ dup c@
>>>>> over 1+ c@ 8 << or ...
Show full article (2.47Kb)
no comments
Re: Alignement         


Author: John Doty
Date: Oct 2, 2007 14:55

helmwo@gmail.com wrote:
> On Oct 2, 9:47 pm, John Doty whispertel.LoseTheH.net> wrote:
>> Anton Ertl wrote:
>>> hel...@gmail.com writes:
>>>> Hi,
>>>> ANS states clearly, that programs do have to take care about
>>>> alignement. But if I do have data that comes from say a file from
>>>> another machine, I want to read this. So I've to do things like
>>>> \ VAX-order
>>>> : v@ dup c@
>>>> over 1+ c@ 8 << or
>>>> over 2 + c@ 16 << or
>>>> swap 3 + c@ 24 << or ;
>>>> \ Network-order
>>>> : n@ dup c@ 24 <<
>>>> over 1+ c@ 16 << or
>>>> over 2 + c@ 8 << or
>>>> swap 3 + c@ or ;
>>>> Is there any common practise how to name such words?
>>> Federico de Ceballos has presented a proposal in this direction and ...
Show full article (2.82Kb)
no comments
1 2 3