Shop OBEX P1 Docs P2 Docs Learn Events
Inc W... — Parallax Forums

Inc W...

dkemppaidkemppai Posts: 315
edited 2008-02-23 09:38 in General Discussion
Yeah, I know it isn't supposed to be a command, but when I type it in and just for fun assemble it,
code is generated that is: Inc·· IND...

Maybe "Inc W"this should generate an error, instead of generating "INC IND"???

Or am I missing some important feature of the assembler?

-Dan

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔

"A saint-like quantity of patience is a help, if this is unavailable, a salty vocabulary works nearly as well." - A. S. Weaver

Comments

  • Guenther DaubachGuenther Daubach Posts: 1,321
    edited 2008-02-23 09:38
    Hey, this is one of SASM's "nice features" smile.gif .

    Here comes the trick:

    Make sure, bit 7 in the OPTION register is clear so that W is mapped into memory address $01. Then use

    inc wreg

    instead of inc w, and - voila - you can increment w (and perform similar operations with w as well).

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Greetings from Germany,

    G
Sign In or Register to comment.