Browse code

Add source code of the assembler compiler

Pawel Jablonski authored on 14/12/2022 19:04:16
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,47 @@
1
+/*
2
+ * Author: Pawel Jablonski
3
+ * E-mail: pj@xirx.net
4
+ * WWW: xirx.net
5
+ * GIT: git.xirx.net
6
+ *
7
+ * License: You can use this code however you like
8
+ * but leave information about the original author.
9
+ * Code is free for non-commercial and commercial use.
10
+ */
11
+
12
+#ifndef FLASHITEM_H
13
+#define FLASHITEM_H
14
+
15
+#include <QString>
16
+#include <QList>
17
+#include <QVector>
18
+#include <QHash>
19
+
20
+//! This class contains a one initialized read-only data item stored in the flash
21
+class FlashItem
22
+{
23
+	public:
24
+		FlashItem(int line, const QString &name, const QList<QString> &valueList);
25
+
26
+		int getLine() const;
27
+		const QString &getName() const;
28
+
29
+		const QList<QString> &getValueList() const;
30
+
31
+		int getDataSize() const;
32
+		QVector<unsigned char> &getDataVector();
33
+
34
+		void setAddress(unsigned int address);
35
+		unsigned int getAddress() const;
36
+
37
+	private:
38
+		int line; //!< Line number from the source file
39
+		QString name; //!< Name of the data item
40
+
41
+		QList<QString> valueList; //!< List of data values in raw text format
42
+
43
+		QVector<unsigned char> dataVector;//!< List of bytes generated from the data declaration
44
+		unsigned int address; //!< Address in memory after linking
45
+};
46
+
47
+#endif