star/star.c
/*
** Read flags from CX into our SR, performing a mode switch where applicable.
** CX is unmodified.  Uses 4 bytes of stack.
**
** This does not do any of the trace flag mojo, so be sure to check for it
** explicitly where applicable (hint: ret_timing_checkpoint).
*/
Read flags from CX into our SR, performing a mode switch where applicable.
CX is unmodified.  Uses 4 bytes of stack.

This does not do any of the trace flag mojo, so be sure to check for it
explicitly where applicable (hint: ret_timing_checkpoint).
Read flags from CX into our SR performing a mode switch where applicable . CX is unmodified . Uses 4 bytes of stack . This does not do any of the trace flag mojo so be sure to check for it explicitly where applicable ( hint : ret_timing_checkpoint ) .
static void cx2sr(void){
	int myline = linenum; linenum += 2;
	emit("push ecx\n");
	emit("mov cl,[__sr+1]\n");
	emit("and cx,2020h\n");
	emit("xor ch,cl\n");
	emit("jz near ln%d\n", myline);
	emit("mov ecx,[__a7]\n");
	emit("xchg ecx,[__asp]\n");
	emit("mov [__a7],ecx\n");
	emit("test byte[esp+1],20h\n");
	emit("jz short ln%d\n", myline + 1);
	copy_memory_map("s", "ecx");
	emit("jmp short ln%d\n", myline);
	emit("ln%d:\n", myline + 1);
	copy_memory_map("u", "ecx");
	emit("ln%d:\n", myline);
	emit("pop ecx\n");
	emit("mov [__sr+1],ch\n");
	emit("and byte[__sr+1],0A7h\n");
	cl2ccr();
}
static void cx2sr ( void ) { int myline = linenum ; linenum += 2 ; emit ( " \n " ) ; emit ( " \n " ) ; emit ( " \n " ) ; emit ( " \n " ) ; emit ( " \n " , myline ) ; emit ( " \n " ) ; emit ( " \n " ) ; emit ( " \n " ) ; emit ( " \n " ) ; emit ( " \n " , myline + 1 ) ; copy_memory_map ( " " , " " ) ; emit ( " \n " , myline ) ; emit ( " \n " , myline + 1 ) ; copy_memory_map ( " " , " " ) ; emit ( " \n " , myline ) ; emit ( " \n " ) ; emit ( " \n " ) ; emit ( " \n " ) ; cl2ccr ( ) ; }
Read flags from CX into our SR, performing a mode switch where applicable.
Read flags from CX into our SR performing a mode switch where applicable .
/* Step 1: switch supervisor mode */ /* Is the new mode different from the last? */ /* If so, swap stack pointers */ /* and copy the appropriate memory map */ /* Step 2: set new PPL / supervisor mode / trace flag */ /* Step 3: Store CL into CCR */