void xms_access(union REGS *inregs, union REGS *outregs) { union REGS in, out; struct SREGS segs; unsigned segs_ds, save_bx; unsigned flags; void far (*xms)(void); // pointer to the XMS services // Get the entry point to the XMS services in.x.ax = 0x4310; int86x (0x2F, &in, &out, &segs); xms = (void far *) (((long) (segs.es) << 16) + out.x.bx); // Assign the input registers to the actual registers _AX = inregs->x.ax; _CX = inregs->x.cx; _DX = inregs->x.dx; _SI = inregs->x.si; _DI = inregs->x.di; _BX = inregs->x.bx; xms(); // Call the XMS entry point. // Assign the registers to the output register structure asm { pushf push bx pop save_bx pop flags } outregs->x.ax = _AX; outregs->x.bx = save_bx; outregs->x.cx = _CX; outregs->x.dx = _DX; outregs->x.si = _SI; outregs->x.di = _DI; outregs->x.cflag = flags & 1; outregs->x.flags = flags; }
std::string Angle::hms(const char separator) const { return xms(hours(), separator); }
std::string Angle::dms(const char separator) const { return xms(degrees(), separator); }