diff options
| author | Amlal El Mahrouss <amlal.elmahrouss@icloud.com> | 2024-01-27 23:28:15 +0100 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal.elmahrouss@icloud.com> | 2024-01-27 23:29:11 +0100 |
| commit | 73482b5dd2f8bacc019c8db2a563f45f81961686 (patch) | |
| tree | 128fe2d2180553e297ec56cca1f00cff8bccea8a /Private/CompilerKit | |
| parent | 5b49ce381c840a14b2e5a493d471bd2e378e5db6 (diff) | |
Asm86: Add support for mov instructions.
Signed-off-by: Amlal El Mahrouss <amlal.elmahrouss@icloud.com>
Diffstat (limited to 'Private/CompilerKit')
| -rw-r--r-- | Private/CompilerKit/AsmKit/Arch/amd64.hpp | 15 | ||||
| -rw-r--r-- | Private/CompilerKit/AsmKit/AsmKit.hpp | 11 | ||||
| -rw-r--r-- | Private/CompilerKit/Defines.hpp | 4 |
3 files changed, 25 insertions, 5 deletions
diff --git a/Private/CompilerKit/AsmKit/Arch/amd64.hpp b/Private/CompilerKit/AsmKit/Arch/amd64.hpp index 78007b1..239bdca 100644 --- a/Private/CompilerKit/AsmKit/Arch/amd64.hpp +++ b/Private/CompilerKit/AsmKit/Arch/amd64.hpp @@ -45,10 +45,21 @@ struct CpuCodeAMD64 #define kJumpLimitStandardLimit 0xEB inline std::vector<CpuCodeAMD64> kOpcodesAMD64 = { - kAsmOpcodeDecl("int", kAsmIntOpcode) - kAsmOpcodeDecl("int", kasmIntOpcodeAlt) + kAsmOpcodeDecl("int", 0xE3) kAsmOpcodeDecl("into", 0xCE) kAsmOpcodeDecl("iret", 0xCF) + kAsmOpcodeDecl("ret", 0xC3) + kAsmOpcodeDecl("sti", 0xfb) + kAsmOpcodeDecl("cli", 0xfa) + kAsmOpcodeDecl("mov eax", 0xb8) + kAsmOpcodeDecl("mov ecx", 0xb9) + kAsmOpcodeDecl("mov edx", 0xba) + kAsmOpcodeDecl("mov ebx", 0xbb) + kAsmOpcodeDecl("mov esp", 0xbc) + kAsmOpcodeDecl("mov ebp", 0xbd) + kAsmOpcodeDecl("mov esi", 0xbe) + kAsmOpcodeDecl("jmp", 0xE9) + kAsmOpcodeDecl("call", 0xE9) }; // \brief 64x0 register prefix diff --git a/Private/CompilerKit/AsmKit/AsmKit.hpp b/Private/CompilerKit/AsmKit/AsmKit.hpp index e85b5d6..cc8940e 100644 --- a/Private/CompilerKit/AsmKit/AsmKit.hpp +++ b/Private/CompilerKit/AsmKit/AsmKit.hpp @@ -134,8 +134,17 @@ namespace CompilerKit explicit NumberCast(UInt64 raw) : raw(raw) {} ~NumberCast() { raw = 0; } - char number[8]; + CharType number[8]; UInt64 raw; }; + + union NumberCast32 final + { + explicit NumberCast32(UInt32 raw) : raw(raw) {} + ~NumberCast32() { raw = 0; } + + CharType number[4]; + UInt32 raw; + }; } diff --git a/Private/CompilerKit/Defines.hpp b/Private/CompilerKit/Defines.hpp index 33fca43..568e024 100644 --- a/Private/CompilerKit/Defines.hpp +++ b/Private/CompilerKit/Defines.hpp @@ -30,8 +30,8 @@ #define Int64 int64_t #define UInt64 uint64_t -#define Int32 int32_t -#define UInt32 uint32_t +#define Int32 int +#define UInt32 unsigned #define Bool bool |
