Compare commits
3 Commits
v1.5
...
ade88faa0b
| Author | SHA1 | Date | |
|---|---|---|---|
| ade88faa0b | |||
| 99a7e32269 | |||
| 348f7bf720 |
@@ -91,8 +91,8 @@ std::uint32_t Assembleur::ParseJump(Instruction a_Instruction) {
|
||||
return IToInt(a_Instruction);
|
||||
}
|
||||
|
||||
std::uint32_t Assembleur::ParseIO(Instruction a_Instruction, std::uint32_t a_R1, std::uint32_t a_R2, std::uint32_t a_R3) {
|
||||
return IToInt(a_Instruction) | a_R1 << 23 | a_R2 << 20 | a_R3 << 17;
|
||||
std::uint32_t Assembleur::ParseIO(Instruction a_Instruction, std::uint32_t a_R1, std::uint32_t a_R2) {
|
||||
return IToInt(a_Instruction) | a_R1 << 23 | a_R2 << 20;
|
||||
}
|
||||
|
||||
|
||||
@@ -146,9 +146,9 @@ std::uint32_t Assembleur::ParseInstruction(const std::string& a_Str, std::uint32
|
||||
}
|
||||
|
||||
case Memoire: {
|
||||
std::string R1, R2, R3;
|
||||
ss >> R1 >> R2 >> R3;
|
||||
return ParseIO(instruction, ParseRegistry(R1), ParseRegistry(R2), ParseRegistry(R3));
|
||||
std::string R1, R2;
|
||||
ss >> R1 >> R2;
|
||||
return ParseIO(instruction, ParseRegistry(R1), ParseRegistry(R2));
|
||||
}
|
||||
|
||||
case SautControle: {
|
||||
|
||||
@@ -39,5 +39,5 @@ class Assembleur {
|
||||
|
||||
std::uint32_t ParseJump(Instruction a_Instruction);
|
||||
|
||||
std::uint32_t ParseIO(Instruction a_Instruction, std::uint32_t a_R1, std::uint32_t a_R2, std::uint32_t a_R3);
|
||||
std::uint32_t ParseIO(Instruction a_Instruction, std::uint32_t a_R1, std::uint32_t a_R2);
|
||||
};
|
||||
@@ -99,12 +99,8 @@ void OutputFileLogisim(BinaryData& a_Data, const std::string& fileName, const st
|
||||
for (std::uint32_t number : a_Data) {
|
||||
if (cursor % 8 == 0) {
|
||||
file << std::setfill('0') << std::setw(4) << std::hex << cursor << std::dec << ": ";
|
||||
file << std::bitset<8>(number >> 24) << " " << std::bitset<8>(number >> 16) << " " << std::bitset<8>(number >> 8) << " "
|
||||
<< std::bitset<8>(number) << " ";
|
||||
} else {
|
||||
file << std::bitset<8>(number >> 24) << " " << std::bitset<8>(number >> 16) << " " << std::bitset<8>(number >> 8) << " "
|
||||
<< std::bitset<8>(number) << "\n";
|
||||
}
|
||||
cursor += 4;
|
||||
file << std::hex << number << std::dec << (((cursor + 1) % 8 == 0) ? "\n" : " ");
|
||||
cursor++;
|
||||
}
|
||||
}
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
#include "IO.h"
|
||||
|
||||
#define ASSEMBLEUR_VERSION "1.5"
|
||||
#define ASSEMBLEUR_VERSION "1.6"
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user