PDA

View Full Version : .ASM help needed very urgently!!! :)


Gokou
26-11-2000, 19:01
Ok i have writtin a small program to make lights flash in a 'traffic light' way. Anyway to make it so u could see the lights go on and off etc i needed to add a small 1 second delay which looks like

Delay movlw .119
movwf Reg3
Here3 movlw .120
movwf Reg1
Here2 movlw .22
movwf Reg2
Here1 decfsz Reg2
goto Here1
decfsz Reg1
goto Here2
decfsz Reg3
goto Here3
return


anyways the teacher gave this out and i lost the explaination of wat each of the lines means!! Please help meh :cry:

Thanks in advance
Goks

WildWayz
27-11-2000, 11:30
Hmmmm been 6ish years since I done assembler but I will try to help.

The Delay procedure is...
Move .119 into the lw register
move contents of Reg3 into the wf register

Here3 etc procedure
move .120 into lw register
move contents of Reg1 into wf register

Here 1 is
Decrease Reg2 from fsz register
Goto Here1
Decrease Reg1 from fsz register
Goto Here2
Decrease Reg3 from fsz register
Goto Here3
Return(exit)


Think that is it.

--WildWayz

Gokou
28-11-2000, 00:22
ahhhhhhhhhh nice one mate.....saved me life is more ways than one :)