2 "@(#) disfp.c, Ver. 2.1 created 00:00:00 87/09/01";
4 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
6 * Copyright (C) 1987 G. M. Harding, all rights reserved *
8 * Permission to copy and redistribute is hereby granted, *
9 * provided full source code, with all copyright notices, *
10 * accompanies any redistribution. *
12 * This file contains handler routines for the numeric op- *
13 * codes of the 8087 co-processor, as well as a few other *
14 * opcodes which are related to 8087 emulation. *
16 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
18 #include "dis.h" /* Disassembler declarations */
20 #define FPINT0 0xd8 /* Floating-point interrupts */
29 /* Test for floating opcodes */
31 (((x) >= FPINT0) && ((x) <= FPINT7))
33 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
35 * This is the handler for the escape family of opcodes. *
36 * These opcodes place the contents of a specified memory *
37 * location on the system bus, for access by a peripheral *
38 * or by a co-processor such as the 8087. (The 8087 NDP is *
39 * accessed only via bus escapes.) Due to a bug in the *
40 * PC/IX assembler, the "esc" mnemonic is not recognized; *
41 * consequently, escape opcodes are disassembled as .byte *
42 * directives, with the appropriate mnemonic and operand *
43 * included as a comment. FOR NOW, those escape sequences *
44 * corresponding to 8087 opcodes are treated as simple *
47 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
52 register int j
; /* Pointer to optab[] entry */
54 {/* * * * * * * * * * START OF eshand() * * * * * * * * * */
63 a
= mtrans((j
& 0xfd),(k
& 0xc7),TR_STD
);
67 printf("\t.byte\t0x%02.2x\t\t| esc\t%s\n",j
,a
);
69 for (k
= 1; k
< objptr
; ++k
)
70 printf("\t.byte\t0x%02.2x\n",objbuf
[k
]);
72 }/* * * * * * * * * * * END OF eshand() * * * * * * * * * * */
74 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
76 * This is the handler routine for floating-point opcodes. *
77 * Since PC/IX must accommodate systems with and without *
78 * 8087 co-processors, it allows floating-point operations *
79 * to be initiated in either of two ways: by a software *
80 * interrput whose type is in the range 0xd8 through 0xdf, *
81 * or by a CPU escape sequence, which is invoked by an op- *
82 * code in the same range. In either case, the subsequent *
83 * byte determines the actual numeric operation to be per- *
84 * formed. However, depending on the method of access, *
85 * either one or two code bytes will precede that byte, *
86 * and the fphand() routine has no way of knowing whether *
87 * it was invoked by interrupt or by an escape sequence. *
88 * Therefore, unlike all of the other handler routines ex- *
89 * cept dfhand(), fphand() does not initialize the object *
90 * buffer, leaving that chore to the caller. *
92 * FOR NOW, fphand() does not disassemble floating-point *
93 * opcodes to floating mnemonics, but simply outputs the *
94 * object code as .byte directives. *
96 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
101 register int j
; /* Pointer to optab[] entry */
103 {/* * * * * * * * * * START OF fphand() * * * * * * * * * */
111 printf("\t.byte\t0x%02.2x\t\t| 8087 code sequence\n",
114 for (k
= 1; k
< objptr
; ++k
)
115 printf("\t.byte\t0x%02.2x\n",objbuf
[k
]);
117 /* objout(); FOR NOW */
119 }/* * * * * * * * * * * END OF fphand() * * * * * * * * * * */
121 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
123 * This is the handler for variable software interrupt *
124 * opcodes. It is included in this file because PC/IX im- *
125 * plements its software floating-point emulation by means *
126 * of interrupts. Any interrupt in the range 0xd8 through *
127 * 0xdf is an NDP-emulation interrupt, and is specially *
128 * handled by the assembler. *
130 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
135 register int j
; /* Pointer to optab[] entry */
137 {/* * * * * * * * * * START OF inhand() * * * * * * * * * */
151 printf("%s\t%d\n",optab
[j
].text
,k
);
155 }/* * * * * * * * * * * END OF inhand() * * * * * * * * * * */