JAL: Just Another Language

Fonte: Wouter van Ooijen

What is Jal?

Jal is a high-level language for a number of Microchip PIC (16c84, 16f84, 12c508, 12c509, 16F877) and Ubicom SX (SX18 and SX28) microcontrollers. I created Jal because I did not like any of the low-cost (or free) languages for these chips and implementing a high level language looked like a nice project. Implementing an existing HLL seemed more difficult and less fun than creating my own, so I just started writing the compiler and the language evolved on with it.

Sorry for all C-lovers, but Jal is more like Pascal. I don't like C that much (although for practical reasons I use C a lot, the Jal compiler is written in C) and I wanted a HLL which is better mached to the PIC architecture, to my programming habits, and which I could explain to the kids of the local electronics club without giving a full course on computer architecture.

All reactions (experiences, suggestions, projects, bugs, contributions, flames, whatever) are welcome. Reactions that are 'for my eyes only' can be sent to me, but in most cases the Jallist is a better forum.



legal status

The Jal compiler is freeware: you are free to copy and use the compiler and the documentation for whatever purpose you want, except for Jal for life-critical or weapons systems is explicitly forbidden. I don't like the idea of anyone being killed because some Jal bug - or by the absence thereof! There is absolutely no warranty for the fitness of the provided software and documentation for any purpose. I like to be notified of any significant use (on the Jallist, by postcard, email or whatever), but that is not an obligation.

The Jal libraries are covered by the GNU Library General Public License, which means that you are free to distribute either these libraries or derived versions. You are even allowed to ask money for it, but you are not allowed to remove the LGPL notice. Confrom the LGPL there is no such obligation for the compiled version (hex file), so you can freely sell or (give away) a product which contains these libraries in compiled form. In simple words: you can use Jal for commercial applications.

Sorry, the source of the Jal compiler is not available.



documentation

For a quick impression of Jal you could read either the summary or the examples section of the on-line manual. The release notes explain the difference between the public versions of Jal. Although I don't get much questions I wrote a Jal FAQ. For a first-time PIC users the english version of the 16x84 assignments I wrote for the local "young engineers" club might be interesting.



support

The Jallist (a mailing list) at Yahoo!Groups has (may 2001) 181 members who can answer all kinds of questions (often better than I could) and are interested to read your experiences. Note that this list runs on a free mailing list server, so you must accept al little advertising. The files and links pages of the jallist might also be interesting for non-members.

There is a Jal page at techref that provides some code fragments, and another page that provides some links.

BTW the piclist and the piclist pages at techref are THE place for all general (non-Jal) PIC questions.

Rindert Nauta has made a math library by wrapping some fixed point routines from the Microchip AN00617 and AN526B application notes in Jal procedures.



Jal on the web

Some links:

  • Vasile Surducan has quite a number of Jal projects on his page.
  • Gilbert Ghyselbrecht has written an article about his Meccano cliff-lift controller.
  • Andrew Markhams Electronics Pages show a PIC Based Intelligent Alarm System and his Light Master (Disco lights).
  • Jesse Druehl presents his Nibble computer and a Mastermind Game for it.
  • An article about Jal by Sustat Jozef (which I can not read because it is in the Servian language).
  • G. Shearer has some Jal-related information on his pages.
  • Edward Rupp has programmed his minimal bot in Jal, but the code is not shown.
  • scud_racer has programmed his spider robot in Jal.
  • Lasse Madsen has created a Jal Community with an on-line forum and a searcheable manual.
  • Not a Jal link, but Matthew Rowe's dos gear page shows a very cheap way to program PICS, and provides a copy of the required DOS programs. Note for Elektuur readers: Elektuur has mentioned my Jal page as the place to find such software, this is the best alternative I was able to find.
I removed some older links that were no longer active. If you have a Jal project on the web send me the URL so I can add it.



downloads

Essentially the same Jal distribution is available for dos/windows (a zip file, ~400Kb) and (not all versions) for linux (tgz file, ~220Kb).

The distributions contain:

  • the Jal compiler (command-line executable)
  • the Jal libraries (pic I/O, delays, i2c, asych, random, hd44780, I/O extension etc.)
  • the Jal on-line documentation (with some examples)
  • this page and the FAQearer
  • for the dos/windows version only: the wisp command-line tool (can be used only with my wisp programmer) and cwsdmpi.exe (a dos protected-mode interface which is needed to run the Jal compiler in a dos-only environment).
The documentation is not up-to-date, the recent distributions contain a number of features that are not documented in the manual. The table below gives some information about this. The releases that are shown as hyperlinks are available for download. Unless there are strong reasons against this the latest version should be used.

release(new) features
04-50.zip
sorry, dos/win only
some 18F support
04-40.zip
sorry, dos/win only
various bug fixes
16f628 lib files
04-35.zip
04-35.tgz
corrections:
- COMF instruction simulation
- problem with out parameters for functions
- handling of directory separator character
additions:
- minimalistic support for 12CE674
- ; as alternative for -- (to make it easier to 'import' commented MPASM fragments)
04-33.zip corrections:
- decfsz/incfsz in in-line assembler on 12-bit cores always used f as target
- simulation of decfsz/incfsz always used f as target
- previous version contained wrong documentation
04-32 - generates 8K code for the 16f877, but the generated code is about twice the size of 16x84 (and previous 16f877) code
- example e1008.jal lets a 16f877 quote a small part of 'the rhyme of the ancient mariner' to a serial link; e1008.tcl shows how I created this example (when you can read tcl)
- supports 12c508 (but this has not been tested on a real chip)
- generates save/restore code for interrupt
- generates 'put/'get when a var is passed as volatile parameter
- various reported problems solved
04-22.zip limited support for the 16f877:
- 2k code
- 96 file registers
- configuration word is fixed 0x3F7A
- support for the I/O pins
- support for reading and writing eeprom and flash
- no support for most on-chip peripherals
The other resources of a 16f877 can of course be used via in-line assembly.
04-18.zip - pass function result back in w (optimization)
- use jumps for compound boolean expressions
- use dest-f opcodes (optimization)
04-17 - solved 'asm goto p' problem
- '-r...' option determines the output produced by teh compiler
- 'pragma keep var x, y, z' prevents the optimizer from removing unused variables
04-16 - replace tail call in procedure or function by a goto
- problem with passing 'put & 'get (introduced in 0.4-15) solved
04-15 - asm output file shows page and bank overhead
- code, page prefix for assembler instructions
- pragma preserve code, page
- pragma to switch bank instruction elimination: -ob and -oB
- SX code now somewhat better, but still around 2* size of 16x84 code
- w used for parameter passing; pragma optimize [no] w, parameters -ow and -oW
- "at" works for parameters, jpic.jal reworked to use this (produces less code now)
- bug in interval corrected (could hang serial routines)
- jal.doc added (all documentation in one file, dos/windows only)
04-10.zip
04-10.tgz
latest version that is fully documented



some usefull banner links

Jal
[ Join Now Ring Hub Random <<> Next >> ]
V3-URL Direct URL: http://come.to/jal to this page
thefreecountry.com: Free programmers' resources, free web designers' resources, free software Free programmer's resources
DJGPP The Dos/Windows version of Jal is compiled by DJGPP
Microchip for PIC datasheet, application notes etc.
Ubicom for SX datasheet, application notes etc.
DonTronics Sells various PIC boards (simmsticks!) and other PIC-related things.
Parallax Parallax sells SX chips, SX programmers and much more.
PICList The PIC mailing list, THE place to be for both PIC wannabees and die-hards.
techref: PIC lots of information on TECHREF : PIC
techref: SX and lots of information on TECHREF : SX
P.H.Anderson P.H.Anderson: a good source for hobbyists to buy PICs.
Compilers.net Lots of compilers, including free ones (Jal is under free Pascal-like compilers).
DJO Amersfoort (Dutch) the electronics/computers hobby club where Jal was first used.
Snail Instruments Snail Instruments sells PICs at reasonable prices and accepts payment in low-tech ways like mailed cash.