Shop OBEX P1 Docs P2 Docs Learn Events
This assembler SX is nuts#! — Parallax Forums

This assembler SX is nuts#!

metron9metron9 Posts: 1,100
edited 2006-11-10 17:32 in General Discussion
I have been working with assemblers for a long time back to the 6502 days. I have tried to learn the SX but the following three pictures show you why I don't understand it.

Debugger running, three lines of code, pictures are step1, step2, and step3

Step1 shows the register w = F0 = %111000 RA has just been loaded and contains %00001111
That's fine I understand it flips the bits 0=1 and 1=0 why the flipping is necessary is beyond the scope of this post.

Step2 shows:

mov M,#f
MOV w,#0f
mov !RB,W

have just been executed now RA changes from %00001111 to %00000000 Why?

Step3 shows

mov !RB,W

Now w is still %01000101 but !RB is now %11111110

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Think outside the BOX!
744 x 421 - 45K
743 x 424 - 46K
744 x 423 - 45K

Comments

  • BeanBean Posts: 8,129
    edited 2006-11-10 17:32
    At step 1 W is 0F not F0.
    You are changing RA.0 to RA.3 from outputs to inputs.
    Since they were 1's when they were outputs it take a while for that charge to bleed off, so they don't turn to zeros right away.

    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Cheap used 4-digit LED display with driver IC·www.hc4led.com

    Low power SD Data Logger www.sddatalogger.com
    SX-Video Display Modules www.sxvm.com

    "People who are willing to trade their freedom for·security deserve neither and will lose both." Benjamin Franklin
    ·
Sign In or Register to comment.