Compare commits
4 Commits
a4abd128f5
...
v1.3
| Author | SHA1 | Date | |
|---|---|---|---|
| 0dd3e6d83f | |||
| 35501025ff | |||
| cf1a4d00af | |||
| 785fb7a8e7 |
@@ -71,5 +71,5 @@ xmake
|
|||||||
## Run
|
## Run
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
xmake run
|
xmake run Assembleur [args]
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
#include "Assembleur.h"
|
#include "Assembleur.h"
|
||||||
|
|
||||||
|
#include <algorithm>
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
@@ -122,6 +123,9 @@ std::uint32_t Assembleur::ParseInstruction(const std::string& a_Str, std::uint32
|
|||||||
std::string ins;
|
std::string ins;
|
||||||
ss >> ins;
|
ss >> ins;
|
||||||
|
|
||||||
|
// to lower case
|
||||||
|
std::transform(ins.begin(), ins.end(), ins.begin(), [](unsigned char c) { return std::tolower(c); });
|
||||||
|
|
||||||
auto it = INSTRUCTION_KEYS.find(ins);
|
auto it = INSTRUCTION_KEYS.find(ins);
|
||||||
if (it == INSTRUCTION_KEYS.end()) {
|
if (it == INSTRUCTION_KEYS.end()) {
|
||||||
throw std::invalid_argument("[Line " + std::to_string(a_RealLine) + "] " + "Instruction \"" + ins + "\" not found !");
|
throw std::invalid_argument("[Line " + std::to_string(a_RealLine) + "] " + "Instruction \"" + ins + "\" not found !");
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
#include "IO.h"
|
#include "IO.h"
|
||||||
|
|
||||||
#define ASSEMBLEUR_VERSION "1.1"
|
#define ASSEMBLEUR_VERSION "1.3"
|
||||||
|
|
||||||
int main(int argc, char** argv) {
|
int main(int argc, char** argv) {
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user