/* @ 初始化寄存器 - SetupRegisters @ 分配寄存器 - AllocateReg */ void Compiler::SetupRegisters() { /* ESP, EBP are used for stack, so we don't have to CreateReg */ Regs[EAX] = CreateReg("%eax", EAX); Regs[EBX] = CreateReg("%ebx", EBX); Regs[ECX] = CreateReg("%ecx", ECX); Regs[EDX] = CreateReg("%edx", EDX); Regs[ESI] = CreateReg("%esi", ESI); Regs[EDI] = CreateReg("%edi", EDI); Regs[ESP] = NULL; Regs[EBP] = NULL; }
void SetupRegisters(void) { X86Regs[EAX] = CreateReg("%eax", "(%eax)", EAX); X86Regs[EBX] = CreateReg("%ebx", "(%ebx)", EBX); X86Regs[ECX] = CreateReg("%ecx", "(%ecx)", ECX); X86Regs[EDX] = CreateReg("%edx", "(%edx)", EDX); X86Regs[ESI] = CreateReg("%esi", "(%esi)", ESI); X86Regs[EDI] = CreateReg("%edi", "(%edi)", EDI); X86WordRegs[EAX] = CreateReg("%ax", NULL, EAX); X86WordRegs[EBX] = CreateReg("%bx", NULL, EBX); X86WordRegs[ECX] = CreateReg("%cx", NULL, ECX); X86WordRegs[EDX] = CreateReg("%dx", NULL, EDX); X86WordRegs[ESI] = CreateReg("%si", NULL, ESI); X86WordRegs[EDI] = CreateReg("%di", NULL, EDI); X86ByteRegs[EAX] = CreateReg("%al", NULL, EAX); X86ByteRegs[EBX] = CreateReg("%bl", NULL, EBX); X86ByteRegs[ECX] = CreateReg("%cl", NULL, ECX); X86ByteRegs[EDX] = CreateReg("%dl", NULL, EDX); }
void SetupRegisters(void) { X86Regs[EAX] = CreateReg("eax", "[eax]", EAX); X86Regs[EBX] = CreateReg("ebx", "[ebx]", EBX); X86Regs[ECX] = CreateReg("ecx", "[ecx]", ECX); X86Regs[EDX] = CreateReg("edx", "[edx]", EDX); X86Regs[ESI] = CreateReg("esi", "[esi]", ESI); X86Regs[EDI] = CreateReg("edi", "[edi]", EDI); X86WordRegs[EAX] = CreateReg("ax", NULL, EAX); X86WordRegs[EBX] = CreateReg("bx", NULL, EBX); X86WordRegs[ECX] = CreateReg("cx", NULL, ECX); X86WordRegs[EDX] = CreateReg("dx", NULL, EDX); X86WordRegs[ESI] = CreateReg("si", NULL, ESI); X86WordRegs[EDI] = CreateReg("di", NULL, EDI); X86ByteRegs[EAX] = CreateReg("al", NULL, EAX); X86ByteRegs[EBX] = CreateReg("bl", NULL, EBX); X86ByteRegs[ECX] = CreateReg("cl", NULL, ECX); X86ByteRegs[EDX] = CreateReg("dl", NULL, EDX); }