Category : Dbase (Clipper, FoxBase, etc) Languages Source Code
Archive   : CLIP5INT.ZIP
Filename : INTANY.C

 
Output of file : INTANY.C contained in archive : CLIP5INT.ZIP
/*
Call any interrupt from CLIPPER 5.0x and return reg-values per @ref.
(c) jsi 1991, germany, Jobst Hensiek

**********************************************************************
** WARNING ***** WARNING ****** WARNING ******* WARNING *** WARNING **
**********************************************************************
* Don't use this func() if your are not knowing what you are doing !*
**********************************************************************

Syntax:
ierr := INT_86X(,,,,,,,)

ierr == 0 -> OK !
== -1 -> parameter error

Example:
#define MOUSE_INT 51

LOCAL AX = 1, BX = 0, CX = 0, DX = 0, ES = 0, DS = 0, _flag = 0
INT_86X( MOUSE_INT, @AX, @BX, @CX, @DX, @DS, @ES, @_flag )

Note:
compile with MICROSOFT(tm) C 6.0a
*/

#include
#pragma optimize("",off)

CLIPPER INT_86X( void ) {

int _AX = 0,
_BX = 0,
_CX = 0,
_DX = 0,
_DS = 0,
_ES = 0,
_flag = 0,
_INT = 0,
_ierror = 0,
_len = 0;


switch( ( _len = PCOUNT ) ) {

case 8:
case 7:
_ES = _parni( 7 );

case 6:
_DS = _parni( 5 );

case 5:
_DX = _parni( 5 );

case 4:
_CX = _parni( 4 );

case 3:
_BX = _parni( 3 );

case 2:
_AX = _parni( 2 );
if ( (_INT = _parni( 1 )) > 255) {
_ierror = -1;
goto ERROR_EXIT;
}
break;

default:
_ierror = -1;
goto ERROR_EXIT;
}

_asm {
push es
push ds

; get interrupt and poke into loc "POKE_ME + 1"
MOV AX, _INT
MOV BYTE PTR CS:[ POKE_ME + 1 ], AL

; stuff regs
MOV AX, _AX
MOV BX, _BX
MOV CX, _CX
MOV DX, _DX
MOV DS, _DS
MOV ES, _ES

POKE_ME:
INT 00h

;pop regs
MOV _AX, AX
MOV _BX, BX
MOV _CX, CX
MOV _DX, DX
MOV _DS, DS
MOV _ES, ES

; get flag
PUSHF
POP AX
mov _flag, AX

pop ds
pop es
}

// pop up the regs
switch ( _len ) {

case 8:
_storni( _flag, 8 );

case 7:
_storni( _ES, 7 );

case 6:
_storni( _DS, 6 );

case 5:
_storni( _DX, 5 );

case 4:
_storni( _CX, 4 );

case 3:
_storni( _BX, 3 );

case 2:
_storni( _AX, 2 );
}

ERROR_EXIT:;
_retni( _ierror );

}




  3 Responses to “Category : Dbase (Clipper, FoxBase, etc) Languages Source Code
Archive   : CLIP5INT.ZIP
Filename : INTANY.C

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/