summaryrefslogtreecommitdiff
path: root/system/shard-x86-at/7/src/CLOCK.ASM
diff options
context:
space:
mode:
authorLars-Dominik Braun <lars@6xq.net>2019-02-11 11:49:19 +0100
committerLars-Dominik Braun <lars@6xq.net>2019-02-11 11:49:39 +0100
commit98cab31fc3659e33aef260efca55bf9f1753164c (patch)
treef1affa84049ef9b268e6c4f521f000478b0f3a8e /system/shard-x86-at/7/src/CLOCK.ASM
parent71e2b36ccd05ea678e62e32ee6245df2b8d6ac17 (diff)
downloadeumel-src-98cab31fc3659e33aef260efca55bf9f1753164c.tar.gz
eumel-src-98cab31fc3659e33aef260efca55bf9f1753164c.tar.bz2
eumel-src-98cab31fc3659e33aef260efca55bf9f1753164c.zip
Add source files from Michael
Diffstat (limited to 'system/shard-x86-at/7/src/CLOCK.ASM')
-rw-r--r--system/shard-x86-at/7/src/CLOCK.ASM56
1 files changed, 56 insertions, 0 deletions
diff --git a/system/shard-x86-at/7/src/CLOCK.ASM b/system/shard-x86-at/7/src/CLOCK.ASM
new file mode 100644
index 0000000..b70f18e
--- /dev/null
+++ b/system/shard-x86-at/7/src/CLOCK.ASM
@@ -0,0 +1,56 @@
+;****************************************************************************
+;*======= Copyright (C) 1985,86 Martin Schoenbeck, Spenge ==================*
+;* *
+;* Lesen der Echtzeituhr des IBM PC-AT *
+;* Schreiben dummy routine *
+;* Aufruf: blockin/blockout mit code -4 ueber kanal 32 *
+;* Puffer: ROW 7 INT VAR *
+;* *
+;****************************************************************************
+
+clockread:
+ call hardware
+ cmp al,IBMat ;haben wir den IBM PC-AT
+ jnz no_clock
+ mov ah,4 ;read date
+ int 1ah
+ jc no_clock
+ mov al,ch ;jahrhundert
+ call putbcd ;ueber bx wegschreiben
+ mov al,cl ;jahr
+ call putbcd
+ mov al,dh ;monat
+ call putbcd
+ mov al,dl ;tag
+ call putbcd
+ mov ah,2 ;read time
+ int 1ah
+ jc no_clock
+ mov al,ch ;stunden
+ call putbcd
+ mov al,cl ;minuten
+ call putbcd
+ mov al,dh ;sekunden
+ call putbcd
+ mov cx,0 ;keine fehler
+ ret
+
+no_clock:
+ mov cx,-1 ;geht nicht
+ ret
+
+clockwrite:
+ mov cx,-1
+ ret
+
+putbcd:
+ mov ah,al
+ and ah,0fh ;in al niedrige nibble behalten
+ ib shr al,4 ;rueberschieben
+ or ax,3030h ;ziffern draus machen
+ mov word ptr es:[bx],ax ;eintragen
+ inc bx
+ inc bx ;zum naechsten
+ ret
+
+ \ No newline at end of file