EngineersGarage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
You are here: Home / Topics / to detect error in assembly code

to detect error in assembly code

|

Projects › Projects › to detect error in assembly code

  • This topic has 0 replies, 1 voice, and was last updated 9 years, 5 months ago by lakshmi.
Viewing 1 post (of 1 total)
  • Author
    Posts
  • March 16, 2013 at 1:07 am #2190
    lakshmi
    Participant

    i have written a program for my miniproject -automatic room light controller with visitor counter………….but it is not working………..i don’t know how to correct my program and i have to submit it in next week………….please help me………….i am enclosing my progrm here

     

    ORG 000
    SJMP main

    ORG 000BH

    MOV R4,#40H
    MOV A,R2
    MOV B,#10
    DIV AB
    ADD A,R4
    MOV R0,A
    MOV A,@R0
    MOV P0,A
    SETB P2.7
    CLR P2.6
    CALL DELAY
    MOV A,B
    ADD A,R4
    MOV R0,A
    MOV A,@R0
    MOV P0,A
    SETB P2.6
    CLR P2.7
    MOV TH0,6FH
    MOV TL0,0FDH
    SETB TR0
    RETI

     
    main:MOV 40,#0C0H
    MOV 41,#0F9H
    MOV 42,#0A4H
    MOV 43,#0B0H
    MOV 44,#99H
    MOV 45,#92H
    MOV 46,#82H
    MOV 47,#0F8H
    MOV 48,#80H
    MOV 49,#98H

    MOV R2,#00

    MOV TMOD,#02H
    MOV IE,#82H
    MOV TL0,#0FDH
    MOV TH0,#6FH
    SETB TR0

    RPT1:JNB P1.0,RPT2
    CALL IN
    RPT2:JNB P1.1,RPT1
    CALL OUT

    IN:JNB P1.1,IN
    INC R2
    CJNE R2,#01,RETURN
    SETB P2.5
    RETURN:RET

    OUT:JNB P0.0,OUT
    DEC R2
    CJNE R2,#00,NXT
    CLR P2.5
    NXT:RET

    DELAY:MOV R5,#03H
    MOV R6,#85H
    L1:DJNZ R6,L1
    L2:DJNZ R5,L2
    RET

    END

     

    when i debugged the program,the instructions of subroutines IN and OUT never get executed.once these subroutines is called,it stucks in their first instruction…………………………………………….

    please help me to correct my program,i want to submit it next week

  • Author
    Posts
Viewing 1 post (of 1 total)
  • You must be logged in to reply to this topic.
Log In

RSS Recent Posts

  • How to power up two stereo audio amplifiers from a single source of power supply August 13, 2022
  • WXmeteo in APRS at 144.8MHz project schematic question August 13, 2022
  • uc3843 Buck-boost August 13, 2022
  • Add a low power indicator LED August 13, 2022
  • ESP32/Arduino OTA problems August 13, 2022

Stay Up To Date

Newsletter Signup
EngineersGarage

Copyright © 2022 WTWH Media LLC. All Rights Reserved. The material on this site may not be reproduced, distributed, transmitted, cached or otherwise used, except with the prior written permission of WTWH Media
Privacy Policy | Advertising | About Us

Search Engineers Garage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools