Baldaux preta

This commit is contained in:
Turingon 2024-09-05 13:45:12 +02:00
parent 494b59bcd2
commit ae867cde3a

View file

@ -151,6 +151,7 @@ int disassemble8080(buffer* b, int pc, cJSON* json) {
for (int i = 0; i < operand_count; i++) {
cJSON *operand = cJSON_GetArrayItem(operands, i);
cJSON *name = cJSON_GetObjectItem(operand, "name");
cJSON *immediate = cJSON_GetObjectItem(operand, "immediate");
cJSON *bytes = cJSON_GetObjectItem(operand, "bytes");
if (name != NULL && cJSON_IsString(name)) {
printf("Operand %d: %s", i + 1, name->valuestring);
@ -158,6 +159,9 @@ int disassemble8080(buffer* b, int pc, cJSON* json) {
if (bytes != NULL && cJSON_IsNumber(bytes)) {
printf(", Bytes: %d", bytes->valueint);
}
if (immediate != NULL && cJSON_IsBool(immediate)) {
printf(", Immediate: %s", cJSON_IsTrue(immediate) ? "true" : "false");
}
printf("\n");
}
}