added M records

This commit is contained in:
zanostro 2025-12-21 17:17:52 +01:00
parent e0ce2fb3d0
commit a711223abf
11 changed files with 297 additions and 20 deletions

View file

@ -27,6 +27,7 @@ public:
enum class RecordType {
HEADER,
TEXT,
MODIFICATION,
END,
UNKNOWN
};
@ -40,6 +41,11 @@ public:
int start_address;
std::vector<uint8_t> data;
};
struct ModificationRecord {
int address; // Address to be modified
int length; // Length in nibbles
bool add; // true for +, false for -
};
struct EndRecord {
int execution_start_address;
};
@ -54,10 +60,13 @@ private :
shared_ptr<Machine> _machine;
string _filename;
shared_ptr<FileReader> _file_reader;
int _relocation_address;
HeaderMetadata readHeader();
TextRecord readTextRecord();
ModificationRecord readModificationRecord();
EndRecord readEndRecord();
bool load_into_memory(int start_address, const std::vector<uint8_t>& data);
void applyModification(const ModificationRecord& mod);
};