Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

My Program Cannot Stop, Always Looping Back - help

Why is my program can't stop?
When it reaches the END line, it loops back.
How can I fix this?
Help...:(

Comments

  • AsmGuru62AsmGuru62 Member Posts: 6,519
    : Why is my program can't stop?
    : When it reaches the END line, it loops back.
    : How can I fix this?
    : Help...:(
    :
    [blue]Please, post the code.
    [/blue]
  • slickzslickz Member Posts: 4
    : : Why is my program can't stop?
    : : When it reaches the END line, it loops back.
    : : How can I fix this?
    : : Help...:(
    : :
    : [blue]Please, post the code.
    : [/blue]
    :
    Here we go:

    [italic];This Program Is Moving A Stepper Motor[/italic]
    COUNTER_5 EQU 50H
    ORG 0H
    MOTOR:
    MOV P1,#00H
    LCALL PUTAR_KI
    AJMP BERHENTI ;jump to end of program
    PUTAR_KI:
    MOV P1,#90H
    ACALL DELAY100
    MOV P1,#80H
    LCALL DELAY100
    MOV P1,#0C0H
    LCALL DELAY100
    MOV P1,#40H
    LCALL DELAY100
    MOV P1,#60H
    LCALL DELAY100
    MOV P1,#20H
    LCALL DELAY100
    MOV P1,#30H
    LCALL DELAY100
    MOV P1,#10H
    LCALL DELAY100
    RET
    [italic];I copy this function from book[/italic]
    DELAY100:
    MOV COUNTER_5,#0020
    TUNGGU_500:
    ACALL DELAY_5
    DJNZ COUNTER_5,TUNGGU_500
    RET
    [italic];using 11.0592 MHZ crystal[/italic]
    DELAY_5:
    PUSH TMOD
    MOV TMOD,#21H
    MOV TH0,#0EDH
    MOV TL0,#0FFH
    SETB TR0
    TUNGGU_5:
    JBC TF0,SUDAH_5
    AJMP TUNGGU_5
    SUDAH_5:
    CLR TR0
    POP TMOD
    RET
    BERHENTI:
    END [italic];The program should ended here :( but it didn't[/italic]
Sign In or Register to comment.