projects
/
dosemu.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7a2614a
)
Implement DOS INT 21h AH=2Ah get system date
author
Robert Pengelly
<robertapengelly@hotmail.com>
Sun, 18 Oct 2026 08:18:27 +0000
(09:18 +0100)
committer
Robert Pengelly
<robertapengelly@hotmail.com>
Sun, 18 Oct 2026 08:18:27 +0000
(09:18 +0100)
interrupts.c
patch
|
blob
|
history
diff --git
a/interrupts.c
b/interrupts.c
index f5009ac03ca9b39de7cd3cdf929ded462439c2aa..d990a5daeb156f89d8c3c87a9010d6b341e4b0aa 100644
(file)
--- a/
interrupts.c
+++ b/
interrupts.c
@@
-3800,6
+3800,24
@@
static void int_21 (CPU8086 *cpu) {
}
+ case 0x2A: { /* Get System Date */
+
+ time_t now = time (NULL);
+ const struct tm *local = localtime (&now);
+
+ if (local != NULL) {
+
+ set_reg8 (cpu, REG_AX, (uint8_t) local->tm_wday);
+
+ cpu->regs[REG_CX] = (uint16_t) (local->tm_year + 1900);
+ cpu->regs[REG_DX] = (uint16_t) (((uint16_t) (local->tm_mon + 1) << 8) | (uint16_t) local->tm_mday);
+
+ }
+
+ break;
+
+ }
+
case 0x2F: { /* Get DTA address */
uint16_t dta_seg;