#include "x86.h" void segread (union REGS16*); #if defined __COMPACT__ || defined __LARGE__ || defined __HUGE__ # pragma aux segread = \ "mov [di+4*2],sp" \ "mov [di+5*2],bp" \ "mov [di+8*2+0*2],es" \ "mov [di+8*2+1*2],cs" \ "mov [di+8*2+2*2],ss" \ "mov [di+8*2+3*2],ds" \ "pushf" "pop ax" "mov [di+24],ax" \ "and ax,1" "mov [di+26],ax" \ parm [ds di] nomemory modify exact [ax] nomemory; #else # pragma aux segread = \ "mov [di+4*2],sp" \ "mov [di+5*2],bp" \ "mov [di+8*2+0*2],es" \ "mov [di+8*2+1*2],cs" \ "mov [di+8*2+2*2],ss" \ "mov [di+8*2+3*2],ds" \ "pushf" "pop ax" "mov [di+24],ax" \ "and ax,1" "mov [di+26],ax" \ parm [di] nomemory modify exact [ax] nomemory; #endif void _segread (union REGS16 *r) { segread (r); } #ifdef TEST #include void main () { union REGS16 r; _segread (&r); printf ("ss:sp=%04Xh:%04Xh bp=%04Xh es=%04Xh cs=%04Xh ds=%04Xh flags=%04Xh\n", r.x.ss, r.x.sp, r.x.bp, r.x.es, r.x.cs, r.x.ds, r.x.flags); } #endif