Int21,36 geht eigentlich nur mit Partitionen bis 2GB.
RBIL->inter61b.zip->INTERRUP.F
--------D-2136-------------------------------
INT 21 - DOS 2+ - GET FREE DISK SPACE
AH = 36h
DL = drive number (00h = default, 01h = A:, etc)
Return: AX = FFFFh if invalid drive
else
AX = sectors per cluster
BX = number of free clusters
CX = bytes per sector
DX = total clusters on drive
Notes: free space on drive in bytes is AX * BX * CX
total space on drive in bytes is AX * CX * DX
"lost clusters" are considered to be in use
according to Dave Williams' MS-DOS reference, the value in DX is
incorrect for non-default drives after ASSIGN is run
this function does not return proper results on CD-ROMs;
use AX=4402h"CD-ROM" instead
(FAT32 drive) the reported total and free space are limited to 2G-32K
should they exceed that value
SeeAlso: AH=1Bh,AH=1Ch,AX=4402h"CD-ROM",AX=7303h
------------------------------------------------------------------
Ralf Browns Interrupt List(RBIL)
http://www.pobox.com/~ralf
http://www.pobox.com/~ralf/files.html
ftp://ftp.cs.cmu.edu/afs/cs.cmu.edu/user/ralf/pub/
Meine "HDspace.bat" für 2GB-Partitionen:
Code: Alles auswählen
@echo off
if not (%1)==() goto DOIT
echo.
echo Fehler !!! Bitte Laufwerks-Buchstabe angeben.
echo Zum Beispeil: C[:] !
echo.
exit
:DOIT
if (%1)==(A:) set Drive=1
if (%1)==(B:) set Drive=2
if (%1)==(C:) set Drive=3
if (%1)==(D:) set Drive=4
if (%1)==(E:) set Drive=5
if (%1)==(F:) set Drive=6
if (%1)==(G:) set Drive=7
if (%1)==(H:) set Drive=8
if (%1)==(I:) set Drive=9
if (%1)==(J:) set Drive=a
if (%1)==(K:) set Drive=b
if (%1)==(L:) set Drive=c
if (%1)==(M:) set Drive=d
if (%1)==(N:) set Drive=e
if (%1)==(O:) set Drive=f
if (%1)==(P:) set Drive=10
if (%1)==(Q:) set Drive=11
if (%1)==(R:) set Drive=12
if (%1)==(S:) set Drive=13
if (%1)==(T:) set Drive=14
if (%1)==(U:) set Drive=15
if (%1)==(V:) set Drive=16
if (%1)==(W:) set Drive=17
if (%1)==(X:) set Drive=18
if (%1)==(Y:) set Drive=19
if (%1)==(Z:) set Drive=1a
if (%1)==(a:) set Drive=1
if (%1)==(b:) set Drive=2
if (%1)==(c:) set Drive=3
if (%1)==(d:) set Drive=4
if (%1)==(e:) set Drive=5
if (%1)==(f:) set Drive=6
if (%1)==(g:) set Drive=7
if (%1)==(h:) set Drive=8
if (%1)==(i:) set Drive=9
if (%1)==(j:) set Drive=a
if (%1)==(k:) set Drive=b
if (%1)==(l:) set Drive=c
if (%1)==(m:) set Drive=d
if (%1)==(n:) set Drive=e
if (%1)==(o:) set Drive=f
if (%1)==(p:) set Drive=10
if (%1)==(q:) set Drive=11
if (%1)==(r:) set Drive=12
if (%1)==(s:) set Drive=13
if (%1)==(t:) set Drive=14
if (%1)==(u:) set Drive=15
if (%1)==(v:) set Drive=16
if (%1)==(w:) set Drive=17
if (%1)==(x:) set Drive=18
if (%1)==(y:) set Drive=19
if (%1)==(z:) set Drive=1a
if (%1)==(A) set Drive=1
if (%1)==(B) set Drive=2
if (%1)==(C) set Drive=3
if (%1)==(D) set Drive=4
if (%1)==(E) set Drive=5
if (%1)==(F) set Drive=6
if (%1)==(G) set Drive=7
if (%1)==(H) set Drive=8
if (%1)==(I) set Drive=9
if (%1)==(J) set Drive=a
if (%1)==(K) set Drive=b
if (%1)==(L) set Drive=c
if (%1)==(M) set Drive=d
if (%1)==(N) set Drive=e
if (%1)==(O) set Drive=f
if (%1)==(P) set Drive=10
if (%1)==(Q) set Drive=11
if (%1)==(R) set Drive=12
if (%1)==(S) set Drive=13
if (%1)==(T) set Drive=14
if (%1)==(U) set Drive=15
if (%1)==(V) set Drive=16
if (%1)==(W) set Drive=17
if (%1)==(X) set Drive=18
if (%1)==(Y) set Drive=19
if (%1)==(Z) set Drive=1a
if (%1)==(a) set Drive=1
if (%1)==(b) set Drive=2
if (%1)==(c) set Drive=3
if (%1)==(d) set Drive=4
if (%1)==(e) set Drive=5
if (%1)==(f) set Drive=6
if (%1)==(g) set Drive=7
if (%1)==(h) set Drive=8
if (%1)==(i) set Drive=9
if (%1)==(j) set Drive=a
if (%1)==(k) set Drive=b
if (%1)==(l) set Drive=c
if (%1)==(m) set Drive=d
if (%1)==(n) set Drive=e
if (%1)==(o) set Drive=f
if (%1)==(p) set Drive=10
if (%1)==(q) set Drive=11
if (%1)==(r) set Drive=12
if (%1)==(s) set Drive=13
if (%1)==(t) set Drive=14
if (%1)==(u) set Drive=15
if (%1)==(v) set Drive=16
if (%1)==(w) set Drive=17
if (%1)==(x) set Drive=18
if (%1)==(y) set Drive=19
if (%1)==(z) set Drive=1a
echo ecs:100>tmp.deb
echo 8C C8 8E D8 8E C0 B2 %Drive% B4 36 CD 21 3D FF FF 74>>tmp.deb
echo ecs:110>>tmp.deb
echo 59 66 F7 E3 66 F7 E1 BF 00 02 B1 0A 66 BB 00 CA>>tmp.deb
echo ecs:120>>tmp.deb
echo 9A 3B 66 31 D2 66 F7 F3 04 30 66 89 D6 88 05 47>>tmp.deb
echo ecs:130>>tmp.deb
echo 66 89 D8 66 BB 0A 00 00 00 66 31 D2 66 F7 F3 66>>tmp.deb
echo ecs:140>>tmp.deb
echo 89 C3 66 89 F0 FE C9 75 D9 B9 0B 00 BE FF 01 BF>>tmp.deb
echo ecs:150>>tmp.deb
echo 00 02 49 46 83 F9 01 74 05 80 3C 30 74 F4 83 F9>>tmp.deb
echo ecs:160>>tmp.deb
echo 0A 74 07 89 CA FC F3 A4 89 D1 31 DB 3D FF FF 75>>tmp.deb
echo ecs:170>>tmp.deb
echo 02 31 C9>>tmp.deb
echo g=cs:100 173>>tmp.deb
echo n space.tmp>>tmp.deb
echo w cs:200>>tmp.deb
echo q>>tmp.deb
debug <tmp.deb >nul
del tmp.deb
echo -Bytes auf Laufwerk %1>>space.tmp
type space.tmp
del space.tmp
Den Opcode mit ndisasm(NASM) betrachtet:
http://www.nasm.us/
http://www.nasm.us/pub/nasm/releasebuil ... 05-dos.zip
Code: Alles auswählen
00000000 8CC8 mov ax,cs
00000002 8ED8 mov ds,ax
00000004 8EC0 mov es,ax
00000006 B203 mov dl,0x3
00000008 B436 mov ah,0x36
0000000A CD21 int 0x21
0000000C 3DFFFF cmp ax,0xffff
0000000F 7459 jz 0x6a
00000011 66F7E3 mul ebx
00000014 66F7E1 mul ecx
00000017 BF0002 mov di,0x200
0000001A B10A mov cl,0xa
0000001C 66BB00CA9A3B mov ebx,0x3b9aca00
00000022 6631D2 xor edx,edx
00000025 66F7F3 div ebx
00000028 0430 add al,0x30
0000002A 6689D6 mov esi,edx
0000002D 8805 mov [di],al
0000002F 47 inc di
00000030 6689D8 mov eax,ebx
00000033 66BB0A000000 mov ebx,0xa
00000039 6631D2 xor edx,edx
0000003C 66F7F3 div ebx
0000003F 6689C3 mov ebx,eax
00000042 6689F0 mov eax,esi
00000045 FEC9 dec cl
00000047 75D9 jnz 0x22
00000049 B90B00 mov cx,0xb
0000004C BEFF01 mov si,0x1ff
0000004F BF0002 mov di,0x200
00000052 49 dec cx
00000053 46 inc si
00000054 83F901 cmp cx,byte +0x1
00000057 7405 jz 0x5e
00000059 803C30 cmp byte [si],0x30
0000005C 74F4 jz 0x52
0000005E 83F90A cmp cx,byte +0xa
00000061 7407 jz 0x6a
00000063 89CA mov dx,cx
00000065 FC cld
00000066 F3A4 rep movsb
00000068 89D1 mov cx,dx
0000006A 31DB xor bx,bx
0000006C 3DFFFF cmp ax,0xffff
0000006F 7502 jnz 0x73
00000071 31C9 xor cx,cx
Das
Lesspace von Kenneysoftware täte das zwar, aber die Lizenzbedingungen (jährliche Gebühr von >10 USD) erscheinen mir für die gestellt Aufgabe irgendwie unangemessen.
Das finde ich auch unangemessen.
Ich versuche gerade zusammenzugoogeln, wie das mit der TSR-Programmierung unter TurboPascal funktionierte. Ich erinnere mich da an durchaus funktioniosfähige eigene Programmierversuche vor mehr als 20 Jahren zum Einblenden der Uhrzeit auf dem Bildschirm plus eine verbesserte Printscreen-Routine auf dem Nadeldrucker. Aber die Sourcen von damals sind leider verschollen.
Hat vielleicht von Euch jemand ein Beispielsourcen (header) plus Info zur "passenden" TP-Version, mit der die laufen.
-jha-
Mit TP kenne ich mich nicht so richtig aus. Aber wenn du Assembler lesen kannst hilft dir vieleicht dieses kleine Beispiel für eine Timer-TSR weiter:
Code: Alles auswählen
;*********************************************************
;
; Dieses Programm laedt den Interruptvektor fuer den
; Timerinterrupt um auf eine eigene Interruptprozedur,
; die exakt dasselbe macht wie die Original-ROM-BIOS
; Vers.3.1 Prozedur, zusaetzlich jedoch bei jedem Aufruf
; die aktuelle Uhrzeit rechts oben am Bildschirm anzeigt.
;
;**********************************************************
CODE SEGMENT
ASSUME CS:CODE
ORG 100h ; um COM Datei daraus zu machen
START: mov ax,0
mov ds,ax
nop
mov ah,0Fh
int 10h ; Bildschirm-Modus lesen
cmp al,2
je FARBE
cmp al,3
je FARBE
cmp al,7
je MONO
MOV ah,4Ch ; Bildschirm ist auf ungeeigneten
int 21h ; Modus eingestellt ; Programm bleibt
; unwirksam - Rueckkehr ins MS-DOS
FARBE: mov cs:VAR,0B800h ; Startadresse des Farb-
jmp WEITER ; Bildschirmspeichers
MONO: mov cs:VAR,0B000h ; Startadresse des Mono-
; chrombildschirmspeichers
;******************* Umladen des Interruptvektors fuer INT 8 **************
WEITER: cli
mov WORD PTR ds:[32],OFFSET TIMER_INT
mov WORD PTR ds:[34],cs
sti
mov dx,OFFSET ENDE
INT 27h ; Beenden aber resident bleiben
;**************************************************************************
VAR DW ? ; zum Zwischenspeichern der BS-Adresse
;**************************************************************************
TIMER_INT PROC FAR
STI ; Interrupts erlauben
push ax
push bx
push cx
push dx
push ds
push es
mov ax,40h
mov ds,ax
inc WORD PTR ds:[6Ch] ; Timer_low
jnz T4
inc WORD PTR ds:[6Eh] ; Timer_high
T4: cmp WORD PTR ds:[6Eh],018h ; Timer_high
jnz T5
cmp WORD PTR ds:[6Ch],0B0h ; Timer_low
jnz T5
mov WORD PTR ds:[6Eh],0 ; Timer_high
mov WORD PTR ds:[6Ch],0 ; Timer_low
mov BYTE PTR ds:[70h],1 ; Timer_OFL
T5: dec BYTE PTR ds:[40h] ; Motor_count
jnz T6
and BYTE PTR ds:[3Fh],0F0h ; Motor_status
mov al,0Ch
mov dx,03F2h
out dx,al
;**************************************************************************
T6: mov ax,40h
mov es,ax
mov ax,es:[6Eh] ; ROM-BIOS Stunden
mov bl,10 ; in zwei Dezimalziffern
div bl ; aufspalten
add ax,3030h ; in ASCII-Code umwandeln
mov cx,cs:VAR ; Startadresse des Bild-
mov ds,cx ; schirmspeichers
mov ds:[144],al ; Stunden-Zehner
mov BYTE PTR ds:[145],70h ; Inverse Darstellung
mov ds:[146],ah ; Stunden-Einer
mov BYTE PTR ds:[147],70h
mov BYTE PTR ds:[148],3Ah ; Doppelpunkt
mov BYTE PTR ds:[149],70h
mov dx,0
mov ax,es:[6Ch] ; ROM-BIOS Timer_low
mov bx,1092 ; Divisor fuer Minuten
div bx
mov bl,10
div bl
add ax,3030h
mov ds:[150],al ; Minuten-Zehnen
mov BYTE PTR ds:[151],70h
mov ds:[152],ah ; Minuten-Einer
mov BYTE PTR ds:[153],70h
mov BYTE PTR ds:[154],3Ah
mov BYTE PTR ds:[155],70h
mov ax,dx
mov bh,18 ; Divisor fuer Sekunden
div bh
mov ah,0
div bl
add ax,3030h
mov ds:[156],al ; Sekunden-Zehner
mov BYTE PTR ds:[157],70h
mov ds:[158],ah ; Sekunden-Einer
mov BYTE PTR ds:[159],70h
;**************************************************************************
int 1Ch ; Anschluss fuer Benutzerprozedur
mov al,020h ; =EOI
out 020h,al
pop es
pop ds
pop dx
pop cx
pop bx
pop ax
iret
TIMER_INT ENDP
ENDE LABEL WORD
CODE ENDS
END START
Dirk