Use pascal calling conventions for all clock related asm functions.

git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@852 6ac86273-5f31-0410-b378-82cca8765d1b
This commit is contained in:
Bart Oldeman 2004-04-09 13:47:20 +00:00
parent c5f6ed4aa8
commit c415f74ee4
5 changed files with 32 additions and 50 deletions

View File

@ -32,12 +32,11 @@
segment HMA_TEXT segment HMA_TEXT
global _getvec global GETVEC
_getvec: GETVEC:
pop ax ; return address pop ax ; return address
pop bx ; int # pop bx ; int #
push bx ; restore stack push ax ; restore stack
push ax
add bx,bx add bx,bx
add bx,bx ; Multiply by 4 add bx,bx ; Multiply by 4
xor dx,dx ; and set segment to 0 xor dx,dx ; and set segment to 0

View File

@ -33,11 +33,10 @@
segment HMA_TEXT segment HMA_TEXT
; ;
; BOOL ReadPCClock(Ticks) ; ULONG ReadPCClock(void)
; ULONG *Ticks;
; ;
global _ReadPCClock global READPCCLOCK
_ReadPCClock: READPCCLOCK:
mov ah,0 mov ah,0
int 1ah int 1ah
extern _DaysSinceEpoch ; ; update days if necessary extern _DaysSinceEpoch ; ; update days if necessary

View File

@ -39,25 +39,25 @@ segment HMA_TEXT
; BYTE bcdMinutes; ; BYTE bcdMinutes;
; BYTE bcdSeconds; ; BYTE bcdSeconds;
; ;
global _WriteATClock global WRITEATCLOCK
_WriteATClock: WRITEATCLOCK:
push bp push bp
mov bp,sp mov bp,sp
; bcdSeconds = 10 ; bcdSeconds = 4
; bcdMinutes = 8 ; bcdMinutes = 6
; bcdHours = 6 ; bcdHours = 8
; bcdDays = 4 ; bcdDays = 10
mov ch,byte [bp+6] ;bcdHours mov ch,byte [bp+8] ;bcdHours
mov cl,byte [bp+8] ;bcdMinutes mov cl,byte [bp+6] ;bcdMinutes
mov dh,byte [bp+10] ;bcdSeconds mov dh,byte [bp+4] ;bcdSeconds
mov dl,0 mov dl,0
mov ah,3 mov ah,3
int 1ah int 1ah
mov bx,word [bp+4] ;bcdDays mov bx,word [bp+10] ;bcdDays
mov dx,word [bx] mov dx,word [bx]
mov cx,word [bx+2] mov cx,word [bx+2]
mov ah,5 mov ah,5
int 1ah int 1ah
pop bp pop bp
ret ret 8

View File

@ -36,15 +36,13 @@ segment HMA_TEXT
; VOID WritePCClock(Ticks) ; VOID WritePCClock(Ticks)
; ULONG Ticks; ; ULONG Ticks;
; ;
global _WritePCClock global WRITEPCCLOCK
_WritePCClock: WRITEPCCLOCK:
; Ticks = 4 ; Ticks = 4
pop ax ; return address pop ax ; return address
pop dx pop dx
pop cx ; Ticks pop cx ; Ticks
push cx ; restore stack push ax ; restore stack
push dx
push ax
mov ah,1 mov ah,1
int 1ah int 1ah
ret ret

View File

@ -366,36 +366,22 @@ COUNT ASMCFUNC
CriticalError(COUNT nFlag, COUNT nDrive, COUNT nError, CriticalError(COUNT nFlag, COUNT nDrive, COUNT nError,
struct dhdr FAR * lpDevice); struct dhdr FAR * lpDevice);
#ifdef PROTO
VOID ASMCFUNC FAR CharMapSrvc(VOID); VOID ASMCFUNC FAR CharMapSrvc(VOID);
#if 0
VOID ASMCFUNC FAR set_stack(VOID); VOID ASMCFUNC FAR set_stack(VOID);
VOID ASMCFUNC FAR restore_stack(VOID); VOID ASMCFUNC FAR restore_stack(VOID);
#endif
/*VOID INRPT FAR handle_break(VOID); */ /*VOID INRPT FAR handle_break(VOID); */
BOOL ASMCFUNC ReadATClock(BYTE *, BYTE *, BYTE *, BYTE *);
ULONG ASMCFUNC ReadPCClock(VOID); ULONG ASMPASCAL ReadPCClock(VOID);
VOID ASMCFUNC WriteATClock(BYTE *, BYTE, BYTE, BYTE); VOID ASMPASCAL WriteATClock(BYTE *, BYTE, BYTE, BYTE);
VOID ASMCFUNC WritePCClock(ULONG); VOID ASMPASCAL WritePCClock(ULONG);
BYTE FAR * ASMCFUNC device_end(VOID); intvec ASMPASCAL getvec(UWORD);
COUNT ASMCFUNC kb_data(VOID); #ifdef __WATCOMC__
COUNT ASMCFUNC kb_input(VOID); #pragma aux (pascal) ReadPCClock modify exact [ax cx dx]
COUNT ASMCFUNC kb_init(VOID); #pragma aux (pascal) WriteATClock modify exact [ax bx cx dx]
VOID ASMCFUNC setvec(UWORD, intvec); #pragma aux (pascal) WritePCClock modify exact [ax cx dx]
intvec ASMCFUNC getvec(UWORD); #pragma aux (pascal) getvec modify exact [ax bx dx es]
COUNT con(COUNT);
#else
VOID FAR CharMapSrvc();
VOID FAR set_stack();
VOID FAR restore_stack();
WORD execrh();
VOID exit();
/*VOID INRPT FAR handle_break(); */
BYTE FAR *device_end();
COUNT kb_data();
COUNT kb_input();
COUNT kb_init();
VOID setvec();
intvec getvec();
COUNT con();
#endif #endif
/* */ /* */