Hi all,

As mentioned before, I think the footprint of jal apps has increased.
There are good resons for this like:
- jalv2 supports multiple banks of ram and thus has to handle banking.
- jalv2 supports more complex vars and has to deal with those in
calculations (also when vars are in different banks).
- jallib provides more functionality
- jallib has better readable code

This is all valueble and so is code size ;)

The first (of probably many) example I came acros was a case of
checking of two bits within one register (asm is below):
if ((RCSTA_OERR == TRUE) | (RCSTA_FERR == TRUE)) then

This takes 12 lines (instructions?), since the compiler collects two
bits (wether the bits are true, i think) to a temp area and does the
OR from there. In old school jal, this would be done like:
if ((RCSTA & 0x11) != 0)
(
where 0x11 is just an example - it would be better if it was something like:
if ((RCSTA & ( OERR | FERR ) != 0)
)
This functional same code takes only 6 lines of code.

You could argue that 6 bytes is not worth any effort, but I think
there are a lot of similar situations.
Do you think code size is important enough to look into this and adapt
the source?

Joep




;  202       if ((RCSTA_OERR == TRUE) | (RCSTA_FERR == TRUE)) then  --
frame/overr error
                               bcf      v____bitbucket_29, 1 ; _btemp15
                               btfsc    v_rcsta, 1 ; rcsta_oerr
                               bsf      v____bitbucket_29, 1 ; _btemp15
                               bcf      v____bitbucket_29, 2 ; _btemp16
                               btfsc    v_rcsta, 2 ; rcsta_ferr
                               bsf      v____bitbucket_29, 2 ; _btemp16
                               bcf      v____bitbucket_29, 3 ; _btemp17
                               btfss    v____bitbucket_29, 1 ; _btemp15
                               btfsc    v____bitbucket_29, 2 ; _btemp16
                               bsf      v____bitbucket_29, 3 ; _btemp17
                               btfss    v____bitbucket_29, 3 ; _btemp17
                               goto     l__l299


;  204       if ((RCSTA & 0x11) != 0) then  -- frame/overr error
                               movlw    17
                               andwf    v_rcsta,w
                               movwf    v____temp_41
                               movf     v____temp_41,w
                               btfsc    v__status, v__z
                               goto

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"jallib" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/jallib?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to