TRADER@cup.portal.com (07/04/88)
Does anyone else out there have an interest in the IBM 5250 API?
This is the Applications Program Interface used in the emulation boards
that hook PC's to System/34/36/38's and AS/400's. It is used in
IBM's enhanced emulation products as well as the emulators that are
fully IBM-API compatible such as those made by AST Research.
If you'd like to swap info and/or programs, please let me know -
I can't give company confidential things out, but I have a lot of
info.
Paul McGinnis
TRADER@cup.portal.com
Here is a sample API program that I wrote in Turbo C that captures a
terminal screen to a disk file.
---------------------------------------------------------------------
/* SAVESCRN.C - captures System/34/36/38 & AS/400 screen */
/* 7/1/1988 - programmer: Paul McGinnis, AST Research Data Comm */
/* Tech Support - Dept. 430 - 714-863-9991 */
#include <dos.h>
#include <stdio.h>
#define XREGEN 0x146 /* EBCDIC screen buffer pointer offset */
#define XXLCHR 0x140 /* EBCDIC-to-ASCII table pointer offset */
main(argc, argv)
int argc;
char *argv[];
{
typedef unsigned char byte;
typedef unsigned int word;
char *fname;
byte EBCDIC_char;
word DCB_seg, j, xregen, xxlchr;
FILE *screenfile, *fopen();
DCB_seg = peek(0, 0x36);
if (DCB_seg == 0)
{
puts("Emulation not running or IBM-API not active.");
return;
}
j = peek(DCB_seg, XEC) + 1;
if (peek(DCB_seg, j) != 0x4345) /* Check emulation and version # */
{
puts("Emulation not running or IBM-API not active.");
return;
}
if (argc == 2)
screenfile = fopen(argv[1], "w");
else
{
printf("File name of screen dump: ");
gets(fname);
screenfile = fopen(fname, "w");
}
if (!screenfile)
{
printf("Unable to write to file %s.\n", fname);
return;
}
xregen = peek(DCB_seg, XREGEN);
xxlchr = peek(DCB_seg, XXLCHR);
for (j = 0; j < 1920; j++)
{
EBCDIC_char = peekb(DCB_seg, xregen + j);
if (j % 80 == 0)
fprintf(screenfile, "\n");
fprintf(screenfile, "%c", peekb(DCB_seg, xxlchr + EBCDIC_char));
}
fclose(screenfile);
}
/* Program tested with: */
/* Compiler: Borland Turbo C v1.5 */
/* Operating System: IBM PC-DOS v3.3 */
/* Computers: IBM PS/2 Model 30, AST Premium 286 */ TRADER@cup.portal.COM (07/04/88)
Does anyone else out there have an interest in the IBM 5250 API?
This is the Applications Program Interface used in the emulation boards
that hook PC's to System/34/36/38's and AS/400's. It is used in
IBM's enhanced emulation products as well as the emulators that are
fully IBM-API compatible such as those made by AST Research.
If you'd like to swap info and/or programs, please let me know -
I can't give company confidential things out, but I have a lot of
info.
Paul McGinnis
TRADER@cup.portal.com
Here is a sample API program that I wrote in Turbo C that captures a
terminal screen to a disk file.
---------------------------------------------------------------------
/* SAVESCRN.C - captures System/34/36/38 & AS/400 screen */
/* 7/1/1988 - programmer: Paul McGinnis, AST Research Data Comm */
/* Tech Support - Dept. 430 - 714-863-9991 */
#include <dos.h>
#include <stdio.h>
#define XREGEN 0x146 /* EBCDIC screen buffer pointer offset */
#define XXLCHR 0x140 /* EBCDIC-to-ASCII table pointer offset */
main(argc, argv)
int argc;
char *argv[];
{
typedef unsigned char byte;
typedef unsigned int word;
char *fname;
byte EBCDIC_char;
word DCB_seg, j, xregen, xxlchr;
FILE *screenfile, *fopen();
DCB_seg = peek(0, 0x36);
if (DCB_seg == 0)
{
puts("Emulation not running or IBM-API not active.");
return;
}
j = peek(DCB_seg, XEC) + 1;
if (peek(DCB_seg, j) != 0x4345) /* Check emulation and version # */
{
puts("Emulation not running or IBM-API not active.");
return;
}
if (argc == 2)
screenfile = fopen(argv[1], "w");
else
{
printf("File name of screen dump: ");
gets(fname);
screenfile = fopen(fname, "w");
}
if (!screenfile)
{
printf("Unable to write to file %s.\n", fname);
return;
}
xregen = peek(DCB_seg, XREGEN);
xxlchr = peek(DCB_seg, XXLCHR);
for (j = 0; j < 1920; j++)
{
EBCDIC_char = peekb(DCB_seg, xregen + j);
if (j % 80 == 0)
fprintf(screenfile, "\n");
fprintf(screenfile, "%c", peekb(DCB_seg, xxlchr + EBCDIC_char));
}
fclose(screenfile);
}
/* Program tested with: */
/* Compiler: Borland Turbo C v1.5 */
/* Operating System: IBM PC-DOS v3.3 */
/* Computers: IBM PS/2 Model 30, AST Premium 286 */