This assembler SX is nuts#!
metron9
Posts: 1,100
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!
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!
Comments
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
·