var byte LSB_crc, MSB_crc

procedure swap_LSB_MSB (word in crc, word out swapped_crc) is
-- When the CRC is placed into the message, its upper and lower bytes must
be swapped crc_lo; crc_hi
   LSB_crc = byte (crc & 0x00ff)
   crc = crc >> 8
   MSB_crc = byte (crc)
   swapped_crc = 256*LSB_crc + MSB_crc
end procedure


Obviously the procedure in the  email below was wrong...not really sure
about this one (from the compiler perspective)....:)

On Wed, Sep 18, 2024 at 12:28 PM vsurducan <[email protected]> wrote:

> I think this topic was previously discussed a long time ago...
> How can I search for a specific procedure ( for example swapping bytes in
> a word) in order to find different types of implementation (for lower code
> length, etc)?
> thx,
>
> procedure swap_LSB_MSB (word in crc, word out swapped_crc) is
> -- When the CRC is placed into the message, its upper and lower bytes must
> be swapped crc_lo; crc_hi
>    LSB_crc = byte (crc & 0x00ff)
>    MSB_crc = byte (crc & 0xff00)
>    swapped_crc = 256*LSB_crc + MSB_crc
> end procedure
>

-- 
You received this message because you are subscribed to the Google Groups 
"jallib" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jallib/CAM%2Bj4quAieRNT9RWkHa-qS2EjA9SNXA6qL%3DTvdg2WVcyLmwhaQ%40mail.gmail.com.

Reply via email to