Hey friends, please help me as soon as possible, I just need the assembly(ASM) code for an 8086 for a simple PC Alarm clock, that just allows the user to set alarm and that plays an mp3 or any other format at that specified time. Its absolutely fine if the program (code) has almost no features just the above two specified features,that is just set and ring the alarm.Please help me

Dani AI

Generated

Brief expert addendum for (and ) with a practical, low-friction route and the hardware option that exists on real IBM/AT-class PCs. is right that this can look like homework; the best learning route is to implement small pieces and test them (RTC read, compare, then trigger). The RTC/CMOS provides both a hardware alarm and readable time registers — and DOS/BIOS services exist to use them. (fd.lod.bz)

Two practical approaches (notes and tradeoffs):

  • Hardware alarm: install a handler at the BIOS “user alarm” vector and call the BIOS RTC alarm service (INT 1Ah, AH=06) with the alarm time in BCD; BIOS will invoke the alarm vector when the RTC matches. This avoids polling but requires installing INT 4Ah handler and understanding that some machines/BIOSes vary. (fd.lod.bz)
  • Simple polling (most portable under DOS): poll the RTC time via INT 1Ah, AH=02 (returns hour/min/sec in CH/CL/DH in BCD), compare to an alarm triple, then launch an external player when matched. Spawning an external player is easiest (INT 21h AH=4Bh EXEC) rather than trying to decode MP3 in 8086 code. (fd.lod.bz)

Minimal 8086 sketch (poll-and-launch; convert your decimal time to BCD constants):

; alarm_h/alarm_m/alarm_s hold BCD values (e.g. 0x07 = 07)
start:
  mov  ah,02h
  int  1Ah        ; CH=hour(BCD), CL=min(BCD), DH=sec(BCD)
  cmp  ch,[alarm_h]
  jne  cont
  cmp  cl,[alarm_m]
  jne  cont
  cmp  dh,[alarm_s]
  jne  cont
  ; launch player: DS:DX -> "MPPLAY.EXE",0
  xor  al,al
  mov  ah,4Bh
  int  21h
  ; wait until seconds change to avoid repeated launches
waitchg:
  mov  ah,02h
  int  1Ah
  cmp  dh,[alarm_s]
  je   waitchg
cont:
  jmp  start

Quick cautions: RTC registers are BCD on many BIOSes — convert correctly; some BIOSes or modern systems restrict port access, and there is no standard guaranteed MP3 player on every machine. For low-effort testing, launch a small WAV or a command-line player installed on the machine. For CMOS/register details and RTC programming notes see the RTC/CMOS references. (wiki.osdev.org)

Recommended Answers

All 2 Replies

me, too...;;-_-
HELP ME~~Plz

commented: Open your own new thread +0

Actually what you want is someone to do your homework not help with a specific problem. I can think of three places where you could find this exact answer, but I think you should at least make a feeble attempt at googling anyway.

commented: Bang on the money! +13
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.