nanorg's
Posted: Thu Jan 20, 2011 9:50 pm
I am doing the nanorg progect for this years science fair when i hit a problem. I wrote my own program with gide lines from the sample. No one i know can under stand what i wrote. I can't seem to understand what the cmp dose and what 0xFFFF dose. I would realy like to have some feed back and sugestions. I think it might be good for a 9th grader. please reply back. this is the program me and my partner have wrote.
info: slpnanorg, devyn tristan
main:
rand [dir], 1
rand [count], 1
add [count], 1
loop:
sense r2
jns nofood
eat
nofood:
energy r0
cmp r0, 2000
jl notenufenergy
sense r5
cmp r5, 0xFFFF
jne notenufenergy
release 100
notenufenergy:
cmp [count], 0
je poke
jns poke
sub [count], 1
poke:
mov r2, 15
poke 1, 1000
poke 2, 1000
poke 3, 1000
poke 0, 1000
jns charge
js charge
charge:
charge 0, 500
charge 1, 500
charge 2, 500
charge 3, 500
jmp loop
newdir:
rand [dir], 4
rand [count], 1
jmp loop
dir:
data { 0 }
count:
info: slpnanorg, devyn tristan
main:
rand [dir], 1
rand [count], 1
add [count], 1
loop:
sense r2
jns nofood
eat
nofood:
energy r0
cmp r0, 2000
jl notenufenergy
sense r5
cmp r5, 0xFFFF
jne notenufenergy
release 100
notenufenergy:
cmp [count], 0
je poke
jns poke
sub [count], 1
poke:
mov r2, 15
poke 1, 1000
poke 2, 1000
poke 3, 1000
poke 0, 1000
jns charge
js charge
charge:
charge 0, 500
charge 1, 500
charge 2, 500
charge 3, 500
jmp loop
newdir:
rand [dir], 4
rand [count], 1
jmp loop
dir:
data { 0 }
count: