Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Forth > Alignement
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 28 Topic 3558 of 4325
Post > Topic >>

Alignement

by helmwo@[EMAIL PROTECTED] Oct 2, 2007 at 06:36 PM

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@[EMAIL PROTECTED]
    dup      c@[EMAIL PROTECTED]
        over 1+  c@[EMAIL PROTECTED]
  8 << or
        over 2 + c@[EMAIL PROTECTED]
 16 << or
        swap 3 + c@[EMAIL PROTECTED]
 24 << or ;

\ Network-order
: n@[EMAIL PROTECTED]
    dup      c@[EMAIL PROTECTED]
 24 <<
        over 1+  c@[EMAIL PROTECTED]
 16 << or
        over 2 + c@[EMAIL PROTECTED]
  8 << or
        swap 3 + c@[EMAIL PROTECTED]
       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
 




 28 Posts in Topic:
Alignement
helmwo@[EMAIL PROTECTED]   2007-10-02 18:36:13 
Re: Alignement
Alex McDonald <blog@[E  2007-10-02 12:08:45 
Re: Alignement
helmwo@[EMAIL PROTECTED]   2007-10-02 19:13:17 
Re: Alignement
anton@[EMAIL PROTECTED]   2007-10-02 19:10:23 
Re: Alignement
John Doty <jpd@[EMAIL   2007-10-02 13:47:36 
Re: Alignement
Andrew Haley <andrew29  2007-10-03 08:38:30 
Re: Alignement
Alex McDonald <blog@[E  2007-10-02 12:18:36 
Re: Alignement
helmwo@[EMAIL PROTECTED]   2007-10-02 19:31:23 
Re: Alignement
helmwo@[EMAIL PROTECTED]   2007-10-02 21:15:46 
Re: Alignement
John Doty <jpd@[EMAIL   2007-10-02 15:55:47 
Re: Alignement
Alex McDonald <blog@[E  2007-10-02 14:38:13 
Re: Alignement
Alex McDonald <blog@[E  2007-10-02 14:57:15 
Re: Alignement
John Doty <jpd@[EMAIL   2007-10-02 16:13:29 
Re: Alignement
Bernd Paysan <bernd.pa  2007-10-04 14:52:05 
Re: Alignement
John Doty <jpd@[EMAIL   2007-10-04 07:34:19 
Re: Alignement
Alex McDonald <blog@[E  2007-10-02 15:07:21 
Re: Alignement
John Doty <jpd@[EMAIL   2007-10-02 16:25:24 
Re: Alignement
helmwo@[EMAIL PROTECTED]   2007-10-02 23:17:39 
Re: Alignement
John Doty <jpd@[EMAIL   2007-10-02 18:05:12 
Re: Alignement
anton@[EMAIL PROTECTED]   2007-10-03 09:29:22 
Re: Alignement
anton@[EMAIL PROTECTED]   2007-10-03 09:22:47 
Re: Alignement
helmwo@[EMAIL PROTECTED]   2007-10-03 12:40:11 
Re: Alignement
Bruce McFarling <agila  2007-10-03 11:00:19 
Re: Alignement
helmwo@[EMAIL PROTECTED]   2007-10-03 18:58:59 
Re: Alignement
Bruce McFarling <agila  2007-10-03 13:54:57 
Re: Alignement
helmwo@[EMAIL PROTECTED]   2007-10-03 21:05:17 
Re: Alignement
Bruce McFarling <agila  2007-10-04 10:15:36 
Re: Alignement
helmwo@[EMAIL PROTECTED]   2007-10-04 17:58:27 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat Nov 22 14:18:10 CST 2008.