User:Superleaf1995
Hello I'm Superleaf1995, a C and Assembly coder that has build a lot of MS-DOS programs.
Userpages:
- Explaining the architectures
- Arbitrary File Position File System
- Code of PCI article translated into Intel Assembly
- lowFS specification
- Compile GCCMVS under MVS3.8j
Send a happy face to COM1:
typedef int i;typedef void v;typedef char c;i z(){return inb(0x3F8+5)&32;}w(c a){while(!z()){}outb(0x3F8,a);}u(){w(':');w(')');}
390 Bits
/* follows MVS calling convention (used by gccmvs) */
void prepare_thread_task(struct thread* thread)
{
/* R13 is used as a stack pointer, now we have to setup a few things up */
thread->context.r15 = (unsigned int)thread->stack + stack_size;
/* stack+76 should point to stack+180 (because this would be the next frame!) */
*((uint32_t *)(&((uint8_t *)thread->stack)[76])) = (&((uint8_t *)thread->stack)[180]);
*((uint32_t *)(&((uint8_t *)thread->stack)[8])) = (&((uint8_t *)thread->stack)[180]);
/* Set backchain to 0 for stack unwinding */
*((uint32_t *)(&((uint8_t *)thread->stack)[4])) = NULL;
*((uint32_t *)(&((uint8_t *)thread->stack)[8])) = NULL;
return;
}