Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ () — UMIPS/BSD System Programmer's Package 2.1

Media Vault

Software Library

Restoration Projects

Artifacts Sought

 

nuxi − routines to convert between little and big-endian byte order

swap_s = nuxi_s(s);
short swap_s, s;
swap_l = nuxi_l(l);
long swap_l, l;

swaps bytes within a 16 bit short value and return the swapped result.
If a and b are representable in 8 bits, then:

nuxi_s((a<<8)|b) == (b<<8)|a

swaps bytes within a 32 bit long value and returns the swapped result.  If a, b, c, and d are representable in 8 bits, then:

nuxi_l((a<<24)|(b<<16)|(c<<8)|d) == (d<<24)|(c<<16)|(b<<8)|a

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026