Welcome

To my blog. My name is Sebastian Fox, I'm from germany, and I'm 13 Years old. In this blog, I wanna write, what I have programmed in my OS. The OS called Nerdix, and it is written completly in NASM.

2/26/2011

how you can programming a clock (but: i experimenting on fat12, too.)

i have programmed today a bios clock function. you must the hour, .. change in a hexadeziaml number, because when you dont chance it, its comming out mysterious characters. here the code:
clock:
mov ah, 0x02
int 0x1A

mov ax, cs
mov ds, ax
mov es, ax

mov di, Zeit

mov al, ch
shr al, 4
or al, 0x30
stosb

mov al, ch
and al, 0x0F
or al, 0x30
stosb

inc di
mov al, cl
shr al, 4
or al, 0x30
stosb

mov al, cl
and al, 0x0F
or al, 0x30
stosb

inc di

mov al, dh
shr al, 4
or al, 0x30
stosb

mov al, dh
and al, 0x0F
or al, 0x30
stosb

mov si, Zeit
mov cx, strlen
print_bios:
lodsb
mov ah,0x0E
int 0x10
loop print_bios

mov ax, 0x4C00
int 0x21

Zeit: db "00:00:00"
strlen EQU $-Zeit

here is a video to the clock function(made by me)





No comments:

Post a Comment