spacer
Yehuda Shiran June 22, 2000
WMLScript's Bytecode
Tips: June 2000

Yehuda Shiran, Ph.D.
Doc JavaScript

Developer News
SaaS Tool Offers Custom Database Development
Microsoft’s Automated Agent: Can We Talk?
Borland Finally Sells CodeGear
To fit the narrow bandwidth in wireless communication, both WML and WMLScript code are compiled into a bytecode on the server and then sent to the user agent. The bytecode is a binary representation of the text-based WML and WMLScript code. It is structured very similarly to binary executable files. It consists of instruction sets, opcodes, addresses, etc. The advantage of bytecode files over binary executable files is that it is machine independent. You compile it once and run on any machine capable of running WMLScript interpreter. From now on, when you hear the term compiled once - run everywhere, you'll know where it is coming from. Let's examine the bytecode of the mortgage example from Column 62. The size of mortgage.wml is 1071 bytes. Its bytecode's length is 446 bytes (more than 2x reduction in size). Here is the top portion of the bytecode:

00000000  01 04 6A 20 70 72 69 6E-63 69 70 61 6C 00 69 6E  ..j principal.in
00000010  74 65 72 65 73 74 00 6E-75 6D 5F 70 61 79 6D 65  terest.num_payme
00000020  6E 74 73 00 7F E7 55 03-63 61 72 64 31 00 36 03  nts..?U.card1.6.
00000030  4D 6F 72 74 67 61 67 65-20 43 61 6C 63 00 23 01  Mortgage Calc.#.

This display can be generated only by an application that can interpret WMLScript. We used the Nokia WAP Toolkit for this. It supports two views: WML and bytecode. The above output is mortgage.wml's bytecode representation. Each byte is represented by two hexadecimal characters and is surrounded by white space. The left column shows the byte number (from the beginning of the file) of next row's first byte (in hexadecimal notation). For example, the top entry on the most-left column is 10, which is 16 in decimal notation. Each line includes 16 bytes, with a separation hypen between the first and last eight. If we start counting from zero, byte number 16 is the first one on the second row. The most-right column tries to interpret each byte as an ASCII character. Some of the interpretations are garbage, of course, but some of them reconstruct the original WML code.

For more on WMLScript and bytecode, go to Column 62, WMLScript Primer.


People who read this tip also read these tips:

Look for similar tips by subject:



JupiterOnlineMedia

internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and JupiterOnlineMedia

Jupitermedia Corporate Info


Legal Notices, Licensing, Reprints, & Permissions, Privacy Policy.

Advertise | Newsletters | Tech Jobs | Shopping | E-mail Offers

Solutions
Whitepapers and eBooks
Microsoft Article: Will Hyper-V Make VMware This Decade's Netscape?
Microsoft Article: 7.0, Microsoft's Lucky Version?
Microsoft Article: Hyper-V--The Killer Feature in Windows Server 2008
Avaya Article: How to Feed Data into the Avaya Event Processor
Microsoft Article: Install What You Need with Windows Server 2008
HP eBook: Putting the Green into IT
Whitepaper: HP Integrated Citrix XenServer for HP ProLiant Servers
Intel Go Parallel Portal: Interview with C++ Guru Herb Sutter, Part 1
Intel Go Parallel Portal: Interview with C++ Guru Herb Sutter, Part 2--The Future of Concurrency
Avaya Article: Setting Up a SIP A/S Development Environment
IBM Article: How Cool Is Your Data Center?
Microsoft Article: Managing Virtual Machines with Microsoft System Center
HP eBook: Storage Networking , Part 1
Microsoft Article: Solving Data Center Complexity with Microsoft System Center Configuration Manager 2007
MORE WHITEPAPERS, EBOOKS, AND ARTICLES
Webcasts
Intel Video: Are Multi-core Processors Here to Stay?
On-Demand Webcast: Five Virtualization Trends to Watch
HP Video: Page Cost Calculator
Intel Video: APIs for Parallel Programming
HP Webcast: Storage Is Changing Fast - Be Ready or Be Left Behind
Microsoft Silverlight Video: Creating Fading Controls with Expression Design and Expression Blend 2
MORE WEBCASTS, PODCASTS, AND VIDEOS
Downloads and eKits
Sun Download: Solaris 8 Migration Assistant
Sybase Download: SQL Anywhere Developer Edition
Red Gate Download: SQL Backup Pro and free DBA Best Practices eBook
Red Gate Download: SQL Compare Pro 6
Iron Speed Designer Application Generator
MORE DOWNLOADS, EKITS, AND FREE TRIALS
Tutorials and Demos
How-to-Article: Preparing for Hyper-Threading Technology and Dual Core Technology
eTouch PDF: Conquering the Tyranny of E-Mail and Word Processors
IBM Article: Collaborating in the High-Performance Workplace
HP Demo: StorageWorks EVA4400
Intel Featured Algorhythm: Intel Threading Building Blocks--The Pipeline Class
Microsoft How-to Article: Get Going with Silverlight and Windows Live
MORE TUTORIALS, DEMOS AND STEP-BY-STEP GUIDES
webref The latest from WebReference.com Browse >
How to Create an Ajax Autocomplete Text Field: Part 6 · Software Engineering for Ajax · Perl Pragma Primer
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
Using File Virtualization for Disaster Recovery · VoIP Security: SIP—Versatile but Vulnerable · Around the World in 80 Nodes