mirror of
https://github.com/ProgramSnail/Lama.git
synced 2025-12-08 07:48:47 +00:00
fixes, ifdefs for different byterun versions
This commit is contained in:
parent
5a6dbe3692
commit
2589f6166f
11 changed files with 244 additions and 58 deletions
|
|
@ -1,5 +1,6 @@
|
|||
#include <cassert>
|
||||
#include <errno.h>
|
||||
#include <iomanip>
|
||||
#include <iostream>
|
||||
#include <malloc.h>
|
||||
#include <string.h>
|
||||
|
|
@ -574,3 +575,18 @@ std::pair<Cmd, uint8_t> parse_command(char **ip, const Bytefile &bf,
|
|||
std::ostream &out) {
|
||||
return parse_command_impl<true>(ip, bf, out);
|
||||
}
|
||||
|
||||
void print_file(const Bytefile &bf, std::ostream &out) {
|
||||
char *ip = bf.code_ptr;
|
||||
|
||||
while (true) {
|
||||
out << std::setfill('0') << std::setw(8) << std::hex << ip - bf.code_ptr
|
||||
<< ": ";
|
||||
const auto [cmd, l] = parse_command(&ip, bf, out);
|
||||
out << '\n';
|
||||
|
||||
if (cmd == Cmd::EXIT) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue