Skip to content
Snippets Groups Projects
Commit f52a4587 authored by Jakob Kirsch's avatar Jakob Kirsch
Browse files

fix clock

parent b417f9d9
Branches
No related tags found
No related merge requests found
No preview for this file type
......@@ -14,7 +14,7 @@ init: xor ax, ax
jmp start
start: mov si, interrupts
mov di, 0x0027 * 4
mov cx, 0x0002
mov cx, 0x0001
.loop: movsw
stosw
loop .loop
......@@ -33,6 +33,9 @@ main: pusha
mov ds, ax
mov es, ax
xor ax, ax
mov di, 0x80
mov cx, 0x10
rep stosw
mov di, 0x0090
mov ah, 0x02
int 0x1a ; get time: ch=hours cl=minutes dh=seconds
......@@ -44,6 +47,24 @@ main: pusha
call prnt
mov al, dh
call digit
; date
mov di, 0x011c
mov cx, 0x10
xor ax, ax
rep stosw
mov di, 0x012c
mov ah, 0x04
int 0x1a
mov al, dl
call digit
call prnt2
mov al, dh
call digit
call prnt2
mov al, ch
call digit
mov al, cl
call digit
popf
pop ds
pop es
......@@ -72,9 +93,11 @@ prnt: mov al, ":"
mov al, 0xf0
stosb
ret
test: iret
prnt2: mov al, "."
stosb
mov al, 0b01110000
stosb
ret
interrupts:
dw main
dw test
\ No newline at end of file
dw main
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment