searching for procedures in jal lib files

13 views
Skip to first unread message

vsurducan

unread,
Sep 18, 2024, 5:28:22 AM9/18/24
to jal...@googlegroups.com
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

vsurducan

unread,
Sep 18, 2024, 6:55:35 AM9/18/24
to jal...@googlegroups.com
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)....:)

Rob CJ

unread,
Sep 18, 2024, 1:06:06 PM9/18/24
to jal...@googlegroups.com
Hi Vasile,

You can search for keywords in all JAL libraries I assume.

But swapping can be done simpler I think. For example.

var word crc_in
var byte crc_in_low at crc_in
var byte crc_in_high at crc_in + 1
var word crc_out
var byte crc_out_high at crc_out
var byte crc_out_low at crc_out + 1

crc_out_low = crc_in_low
crc_out_high = crc_in_high

Kind regards,

Rob



Van: jal...@googlegroups.com <jal...@googlegroups.com> namens vsurducan <vsur...@gmail.com>
Verzonden: woensdag 18 september 2024 12:55
Aan: jal...@googlegroups.com <jal...@googlegroups.com>
Onderwerp: [jallib] Re: searching for procedures in jal lib files
 
--
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 jallib+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jallib/CAM%2Bj4quAieRNT9RWkHa-qS2EjA9SNXA6qL%3DTvdg2WVcyLmwhaQ%40mail.gmail.com.

vsurducan

unread,
Oct 21, 2024, 5:44:42 AM10/21/24
to jal...@googlegroups.com
Rob this example seems better, it eats 194 bytes compared with 202 of mine. Thx, I forgot this typo...

Reply all
Reply to author
Forward
0 new messages