This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

assembly funcntion

any one know about the error in this function that moving the stepper motor please replay to me :

NAME    A_HIGH

?PR?a_high?A_HIGH    SEGMENT CODE

        PUBLIC  a_high
        RSEG  ?PR?a_high?A_HIGH
a_high:
$mod51
delayreg data 08h
delayreg100us data 09h
delayreg1ms data 0ah
Flags1 data 20h
flg_disp0 bit Flags1.0
org 2000h
start:
mov p1,#9
call delay20us
mov p1,#5
call delay20us
mov p1,#6
call delay20us
mov p1,#10
call delay20us
jmp start
delay100us:
mov r7,#48
y1: djnz r7,y1
ret
delay200us:
mov r7,#96
y1b: djnz r7,y1b
ret
delay1ms:
mov r6,#10
y2: call delay100us
djnz r6,y2
ret
delay10ms:
mov r6,#100
y3: call delay100us
djnz r6,y3
ret
delay20ms:
mov r6,#200
y4: call delay100us
djnz r6,y4
ret
delay100ms:
mov r5,#5
y5: call delay20ms
djnz r5,y5
ret
delay500ms:
mov r5,#25
y6: call delay20ms
djnz r5,y6
ret
delay1sec:
mov r5,#50
y7: call delay20ms
djnz r5,y7
ret
delay25ms:
mov r5,#25
y8: call delay1ms
djnz r5,y8
ret
delay3ms:
mov r6,#30
y9: call delay100us
djnz r6,y9
ret
delay20us:
mov r7,#18
y10: djnz r7,y10
ret
end

Parents
  • Is there any specific reason why you did not spend a bit of time making your scribbles readable (indenting) and understandable (comments).

    I will gladly look at scribbles (the above can NOT be called code) if you pay me, but to ecpect anyone to spend time to decipher scribbles FOR FREE is an INSULT!

    Erik

Reply
  • Is there any specific reason why you did not spend a bit of time making your scribbles readable (indenting) and understandable (comments).

    I will gladly look at scribbles (the above can NOT be called code) if you pay me, but to ecpect anyone to spend time to decipher scribbles FOR FREE is an INSULT!

    Erik

Children
No data