• Jal Lib
  • Jal List
  • Jal Web Dev
  • Jaluino
Navigation
  • Home
  • Getting Started
  • Installation
  • Downloads
  • Tutorials
  • Jaluino
  • FAQ
  • Blogs
  • Development
  • Recent posts
  • Popular content
Search
Top Pages

Today's:

  • Downloads
  • I want split a word variable to two bytes, what's the best way to do it in JAL ?
  • Installation

All time:

  • The Tutorial Book
  • SD Memory Cards
  • Downloads
Blogs
sebastien.lelong (11)
wattystuff (1)
more
My Account
  • Login / Account
Links

Support lists
jallist - jalv2 support
jallib group - jallib support

Main sites
jallib
- jalv2 libraries
jalv2 - jalv2 compiler
jaledit - jalv2 IDE

More...

Syndicate
Syndicate content
Home

I want split a word variable to two bytes, what's the best way to do it in JAL ?

PostDateIcon Fri, 11/23/2012 - 11:55 | PostAuthorIcon sunish

A common way to address the individual bytes of a word (or larger)
variable is to split it as an array of bytes.

This can be done as follows

var word w
var byte wb[2] at w

You can then refer the two bytes of the word w as wb[0] and wb[1]

If the individual bytes of the array wb[0] and wb[1] need a specific name alias keyword can be used as given below.

alias hibyte is wb[0]
alias lowbyte is wb[1]

PostCommentsIcon Add new comment

Contact Us | Terms of Use | Trademarks | Privacy Statement
Copyright © 2009 . All Rights Reserved.

Powered by Drupal and Drupal Theme created by vigilianty.