PDA

View Full Version : Assembler code



caskaz
12-29-2009, 11:47 AM
Hi Guys.

I start to study assembler, and soon I 'm confused.
I use Demo-board.

sample code below:




VAR
long d
OBJ
debug : "FullDuplexSerialPlus"
PUB main
debug.start(31,30,0,57600)
debug.tx(Debug#CLS)
dira[16]~~
cognew(@entry, @d)

repeat
!outa[16]
debug.hex(d, 8)
debug.str(String(" "))
waitcnt(clkfreq/5 + cnt)

DAT
org
entry mov t1, ina
and t1, mask
wrlong t1, par
jmp #entry

t1 res 1
mask long $00010000




It display "28000000" on PST. Still same, no change.

I commented "and t1, mask".
It display to repeat "FE00007C" and "FE01007C". P16'state is read.

"mask long $00010000" is mistake?
What is correct expression?

Is there good text for assembler?

kuroneko
12-29-2009, 11:53 AM
Any res has to be after any code and/or data in your program. In your case swap the last two lines:



mask long $00010000
t1 res 1

caskaz
12-29-2009, 12:10 PM
Thans!.

Is there good text for assembler?

kuroneko
12-29-2009, 12:15 PM
Have a look at Propeller: Getting Started and Key Thread Index (http://forums.parallax.com/showthread.php?p=791527). It's not all about assembler but you can obviously skip the stuff you don't need.