Hi
I want Example for code in assembly language to develop alarm clock using 8085 microprocessor
As soon as you can

Thanks

Dani AI

Generated

Consistent with 's point about not handing in homework, the following is a concise, practical blueprint plus a small illustrative 8085 BCD-tick routine. It shows common, reusable techniques (hardware timer -> 1 Hz interrupt, BCD timekeeping with DAA, short ISR, alarm compare) rather than a full end-to-end assignment solution for to submit.

Typical hardware pieces and architecture: an 8085 CPU, a periodic 1 Hz source (8253/8254 PIT, a divider driven by a watch crystal, or a 555/divider), an I/O port expander (8255 or similar) to drive a multiplexed 7-seg display and read keypad buttons, and a transistor-driven buzzer on an output port. Feed the 1 Hz pulse to a vectored interrupt (e.g. RST7.5) so the CPU receives a clean tick. Keep the ISR minimal: just update time and set a flag if the alarm should sound; do display refresh and user input processing in the main loop.

Conceptual software flow: store seconds/minutes/hours as BCD bytes. On each 1 Hz interrupt, load seconds into A, ADI 01h followed by DAA to keep BCD correct; if result is 0x60 roll to 0x00 and cascade to minutes, then hours (24h check 0x24). For alarm, do a three-byte compare (hour,min,sec) and assert the buzzer port when all match. Debounce set buttons (hardware RC + short software sample) and keep long operations out of the ISR.

Example illustrative 8085 snippet (call from 1 Hz ISR, symbolic labels used):

; BCD time at SEC,MIN,HOUR. Alarm at ALM_SEC,ALM_MIN,ALM_HOUR. BUZZ_PORT symbolic.
INC_SEC_MIN_HR:
    LDA SEC
    ADI 01h
    DAA
    STA SEC
    CPI 60h
    JNZ CHECK_ALARM
    MVI A,00h
    STA SEC
    LDA MIN
    ADI 01h
    DAA
    STA MIN
    CPI 60h
    JNZ CHECK_ALARM
    MVI A,00h
    STA MIN
    LDA HOUR
    ADI 01h
    DAA
    STA HOUR
    CPI 24h
    JNZ CHECK_ALARM
    MVI A,00h
    STA HOUR

CHECK_ALARM:
    LDA HOUR
    MOV B,A
    LDA MIN
    MOV C,A
    LDA SEC
    MOV D,A
    LDA ALM_HOUR
    CMP B
    JNZ END_ISR
    LDA ALM_MIN
    CMP C
    JNZ END_ISR
    LDA ALM_SEC
    CMP D
    JNZ END_ISR
    MVI A,01h
    OUT BUZZ_PORT
END_ISR:
    RET

Testing notes and pitfalls: verify DAA behavior on your assembler/simulator, keep ISR time bounded, and prefer a hardware RTC if long-term accuracy is required.

Recommended Answers

All 2 Replies

I've ended up pulling this boilerplate reply out twice in 24 hours, sheesh

First off, we don't do other people's homework for them. Second, we don't do other people's homework for them. And third, we don't do other people's homework for them. Sensing a pattern here yet?

No one here will simply hand you a solution on a silver platter. If you show us what you've done, what you've tried to do, and what problems you've had with it, then we'll be happy to help. If you have specific questions, we can answer them, or at least point you in the right direction. If you have a program with a bug you can't swat on your own, we'll be glad to assist, so long as you pay attention to the forum rules and post sensible questions in an intelligent manner that we have some reasonable hope of answering.

But just demanding that we provide you with code with no evidence of any effort on your part is likely to get you booted from the message boards here and elsewhere - if you're lucky. What happens to you if you are unlucky is... well... let's just say that this guy probably won't be trying that again, on that forum or this one.

We take this issue seriously here. Very seriously. Asking us to do homework for you is a grave breach of academic ethics on your part, and actually doing so would be an even bigger breach on ours (not that this stops the many fine mercenaries at Freelancer.com, but still). Simply posting this here, in this way, could get you expelled from your school, if someone happens to notice it and blow the whistle on you. Furthermore, it does neither you nor us any good to help you cheat - especially since there's a good chance some day one of us will have to work with you, manage you, or, Eris forefend, fix code you've written. We have an obligation to our profession and our own future sanity to help you become a good programmer, and doing your coursework for you isn't going to do that.

And if you think you won't get caught by your professor... think again.

And please don't insult our intelligence by claiming that it isn't a class assignment. It's very easy to spot one, and we have a lot of practice at it. Trust me on this.

Now, if you actually don't know how to create a program that fits the requirements... hmmmn. Reading the book is definitely called for. As is speaking to the professor; while some can be a--holes about office hours, most are more than willing to give extra help, if only to keep their class grades from slipping to the point where they get re-assigned to teach remedial basketweaving.

commented: Remedial basket weaving? :-) A great course as I recall! +0

Sorry !!!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.