F
fsmchinese
Unregistered / Unconfirmed
GUEST, unregistred user!
请把下列c程序转换成Delphi
/*
Omr Operating Function FOR TURBO C 2.0
Copyright (c) 1994 Shando
ng University OME Inc. All rights reserved.
Use:
include "omrtc.c"
*/
#include <dos.h>
/************************************************************************/
/* */
/* FUNCTION: char * Omr (char *cmd) */
/* INPUT: char * cmd ---- command string to OMR */
/* OUTPUT: return char * ---- return information from OMR */
/* */
/************************************************************************/
char * Omr (char *cmd);
char * Omr (char *cmd)
{
char * temp;
char far * buffer, far * tb;
int i;
buffer = MK_FP (peek (0, 0x7c * 4 + 2), peek (0, 0x7c * 4));
tb = buffer;
temp = cmd;
i = 0;
do
{
*tb++ = *temp;
i++;
} while (( *temp++ != 0) &&
(i < 254));
geninterrupt (0x7d);
tb = buffer;
temp = cmd;
i = 0;
do
{
*temp++ = *tb;
i++;
} while (( *tb++ != 0) &&
(i < 254));
}
/*
Omr Operating Function FOR TURBO C 2.0
Copyright (c) 1994 Shando
ng University OME Inc. All rights reserved.
Use:
include "omrtc.c"
*/
#include <dos.h>
/************************************************************************/
/* */
/* FUNCTION: char * Omr (char *cmd) */
/* INPUT: char * cmd ---- command string to OMR */
/* OUTPUT: return char * ---- return information from OMR */
/* */
/************************************************************************/
char * Omr (char *cmd);
char * Omr (char *cmd)
{
char * temp;
char far * buffer, far * tb;
int i;
buffer = MK_FP (peek (0, 0x7c * 4 + 2), peek (0, 0x7c * 4));
tb = buffer;
temp = cmd;
i = 0;
do
{
*tb++ = *temp;
i++;
} while (( *temp++ != 0) &&
(i < 254));
geninterrupt (0x7d);
tb = buffer;
temp = cmd;
i = 0;
do
{
*temp++ = *tb;
i++;
} while (( *tb++ != 0) &&
(i < 254));
}