mirror of
https://github.com/raspberrypi/pico-sdk.git
synced 2025-08-06 06:02:39 +03:00
SDK 2.0.0 release
This commit is contained in:
@@ -97,7 +97,7 @@ struct python_output : public output_format {
|
||||
std::map<uint, std::string> jmp_labels;
|
||||
// for now just use numeric labels
|
||||
for (int i = 0; i < (int)program.instructions.size(); i++) {
|
||||
const auto &inst = program.instructions[i];
|
||||
const auto &inst = (uint16_t)program.instructions[i];
|
||||
if (!(inst >> 13u)) {
|
||||
// a jump
|
||||
uint target = inst &0x1fu;
|
||||
@@ -105,9 +105,9 @@ struct python_output : public output_format {
|
||||
}
|
||||
}
|
||||
|
||||
for (uint i = 0; i < (int)program.instructions.size(); i++) {
|
||||
for (uint i = 0; i < (uint)program.instructions.size(); i++) {
|
||||
const auto &inst = program.instructions[i];
|
||||
if (i == program.wrap_target) {
|
||||
if (i == (uint)program.wrap_target) {
|
||||
fprintf(out, " wrap_target()\n");
|
||||
}
|
||||
auto it = jmp_labels.find(i);
|
||||
@@ -115,7 +115,7 @@ struct python_output : public output_format {
|
||||
fprintf(out, " label(\"%s\")\n", it->second.c_str());
|
||||
}
|
||||
fprintf(out, " %s # %d\n", disassemble(jmp_labels, inst, program.sideset_bits_including_opt.get(), program.sideset_opt).c_str(), i);
|
||||
if (i == program.wrap) {
|
||||
if (i == (uint)program.wrap) {
|
||||
fprintf(out, " wrap()\n");
|
||||
}
|
||||
}
|
||||
@@ -151,11 +151,11 @@ struct python_output : public output_format {
|
||||
return 0;
|
||||
}
|
||||
|
||||
static std::string disassemble(const std::map<uint, std::string>& jmp_labels, uint16_t inst, uint sideset_bits_including_opt, bool sideset_opt) {
|
||||
static std::string disassemble(const std::map<uint, std::string>& jmp_labels, uint inst, uint sideset_bits_including_opt, bool sideset_opt) {
|
||||
std::stringstream ss;
|
||||
uint major = inst >> 13u;
|
||||
uint major = (inst >> 13u) & 0x7;
|
||||
uint arg1 = ((uint) inst >> 5u) & 0x7u;
|
||||
uint arg2 = inst & 0x1fu;
|
||||
uint arg2 = (inst & 0x1fu) | ((inst & 0x10000) >> 11);
|
||||
std::string op_string;
|
||||
auto op = [&](const std::string &s) {
|
||||
op_string = s;
|
||||
|
Reference in New Issue
Block a user