1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Z80 Programming Help - Smart Home Alarm

Discussion in 'Assembly Language Programming (ALP) Forum' started by Salcybercat, Apr 13, 2010.

  1. Salcybercat

    Salcybercat New Member

    Joined:
    Apr 13, 2010
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    0
    Hello! I need some help with this program...it doesn't quite run by the way I want it to

    Question:
    Develop a program that will simulate a home alarm system, using the DIL switches on the application board to simulate the sensors and the speaker to signal the alarm. The system will detect two conditions (SW =1, means door not closed or window is open)
    a. SW0 - detect the door
    b. SW1 - detect the window
    when switch detected/ or sensor triggered, a high frequency sound will activate as warning. At the same time, LED D4 will be turned on if the door is opened or/and LED D5 will be turned on if the window is opened.


    My program:
    ORG 1800H
    LD A,4FH
    OUT (82H),A
    LD A,0FH
    OUT (83H),A
    START LD B,01H
    IN A,(80H)
    CP B
    JP Z,DOOR

    DOOR LD A,10H
    OUT (8IH),A
    CALL TONE
    JP START

    TONE EQU 05E4H


    It's not quite finished yet,I'm trying to make it work with one switch first. Do give me your thoughts and opinions! If you cannot help, giving me any good sites for reference would be very helpful too. :happy:
     

Share This Page