Simple Assembly
Pliers
Posts: 280
I'm learning assembly, I think.
Would someone tell me why this does not work.
I have buttons for inputs on pins 4,5,6,and,7.
My LEDs are on pins:17,18,19, and 20.
I did a spin program, and it worked.
I read Mr Potatohead's article " Assembly Language Primer".
Would someone suggest other readings covering assembly language?
Would someone tell me why this does not work.
I have buttons for inputs on pins 4,5,6,and,7.
My LEDs are on pins:17,18,19, and 20.
I did a spin program, and it worked.
pub main cognew(@IOtest,0) dat org 0 IOtest mov dira, pin loop mov outa,ina jmp #loop pin long %00000000000011110000000000000000
I read Mr Potatohead's article " Assembly Language Primer".
Would someone suggest other readings covering assembly language?
Comments
Do you really mean 17..20? If so your pin mask is off by 1.
I just barley understand why I need the shift left.
I'll give it a good study.
Thanks again.
In PASM you read all 32bit of ina. Which means that the bits you're interested in are down here %00000000_00000000_00000000_????0000. Somehow you have to get them up to here %00000000_000xxxx0_00000000_00000000, so you have to shift them left a bit.
Practice! ASM is hard to wrap your brain around at first, but once it "clicks," it's easy and fun. Check out the "Getting Started and Key Thread Index" thread near the top of this forum for links to some good ASM academics and examples.