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,42 @@
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 CODESECTION_H
13
+#define CODESECTION_H
14
+
15
+#include <QString>
16
+#include <QList>
17
+#include <QSharedPointer>
18
+
19
+#include "codeitem.h"
20
+
21
+//! This class contains a one code section set by each label
22
+class CodeSection
23
+{
24
+	public:
25
+		CodeSection(const QString &name);
26
+
27
+		void addCodeItem(const QSharedPointer<CodeItem> &codeItem);
28
+
29
+		const QString &getName() const;
30
+		QList<QSharedPointer<CodeItem>> &getCodeItemList();
31
+
32
+		void setAddress(unsigned int address);
33
+		unsigned int getAddress() const;
34
+
35
+	private:
36
+		QString name; //!< Label name of the code section
37
+
38
+		QList<QSharedPointer<CodeItem>> codeItemList; //!< Instruction list attached to the code section
39
+		unsigned int address; //!< Address in the memory of the code section
40
+};
41
+
42
+#endif