Shop OBEX P1 Docs P2 Docs Learn Events
SASM questions — Parallax Forums

SASM questions

ValioValio Posts: 29
edited 2009-06-01 00:41 in General Discussion
Hello!


After compiling SX/B, I found in listing such instructions:

...
144 002D 0C00 CJE FSR,#0,@__POWERUP
002E 0084 0643 0010 0A37
...
145 0032 0CFF CJNE FSR,#$FF,@__RESTORETRIS
0033 0084 0743 0010 0A4A
...
154 003F 03E4 IJNZ FSR,@$-3
0040 0010 0A3C
...


Look it through SASM manual but cant it find. Plz advice translation
for this asm jump mnemonics.

Regards.

Comments

  • JonnyMacJonnyMac Posts: 9,213
    edited 2009-05-31 14:56
    What can't you find?

    CJE - Compare and Jump if Equal
    CJNE - Compare and Jump if Not Equal
    IJNZ - Increment and Jump if Not Zero

    I don't have a SASM manual but these are certainly in the Parallax SX-Key manual. See the Appendix called "SX Instruction Set."
  • ValioValio Posts: 29
    edited 2009-05-31 20:47
    I guess the same way.

    I searched im my "SASM Cross Assembler User’s Manual Rev. 1.3" -

    It seems that it have missed some obvious instruction, for ex:
    it have DJNZ, but don't have IJNZ, stupid, ain't ?


    Stupid document content and their organization structure,
    most of them doesnt have mention of IJNZ command for ex:

    Ubicom™ SX Family User’s Manual - doesnt have
    Programming the SX Microcontroller - doesnt have - cuz just intro+title page (book's promo)
    Ubicom™ SX Cross Assembler User's Manual - doesnt have

    maybe support shall improve quality of documentation ?
    or user must guess missing details.

    Thanks anyway.

    Post Edited (Valio) : 5/31/2009 10:14:59 PM GMT
  • Mike GreenMike Green Posts: 23,101
    edited 2009-05-31 23:26
    There's an INCSZ instruction, but no IJNZ. If you follow an INCSZ instruction with a JMP instruction, you effectively get an IJNZ, but there's no native IJNZ. There's no native DJNZ either and that's implemented with a DECSZ followed by a JMP.

    I suggest you stop thinking of this sort of thing as "stupid" and read the documentation. If you don't understand why something is the way it appears to be, it's much more useful to ask for confirmation and an explanation. There may be a good reason or, as sometime happens, there are only a certain number of bits in the instruction and you can have only so many distinct instructions, and the designer has to make choices.
  • ZootZoot Posts: 2,227
    edited 2009-06-01 00:41
    Keep in mind some of the single MNEUMONIC instructions in the Parallax assembler are NOT in SASM. In either case, there are assembly instructions that the assembler converts to multiple single instructions. These should be thought of as "conveniences" or, really, a kind of built-in macro. I would suggest assembling with the Parallax supported assembler (and SX/B compiler if you choose) as those are supported; Ubicom long ago gave up supporting this chip series.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    When the going gets weird, the weird turn pro. -- HST

    1uffakind.com/robots/povBitMapBuilder.php
    1uffakind.com/robots/resistorLadder.php
Sign In or Register to comment.