├── .gitignore ├── CHANGES ├── Makefile ├── README.md ├── codegen ├── Makefile ├── mktables.c ├── mktables.spec ├── opcodes.lst ├── opcodes_decl.h ├── opcodes_impl.c └── opcodes_table.h ├── fuse_tests ├── Makefile ├── README ├── coretest ├── coretest.c ├── fuse_files │ ├── COPYING │ ├── README │ ├── README.libz80 │ ├── tests.expected │ └── tests.in └── generate_expected.sh ├── z80.c └── z80.h /.gitignore: -------------------------------------------------------------------------------- 1 | codegen/mktables 2 | *.so 3 | *.d 4 | *.o 5 | fuse_tests/*.actual 6 | fuse_tests/*.expected 7 | 8 | -------------------------------------------------------------------------------- /CHANGES: -------------------------------------------------------------------------------- 1 | Changes to version 2.1.0 2 | 3 | Created CHANGES 4 | Added ExecuteTStates 5 | Working interrupts in all modes: 6 | Test libz80 against the fuse test suite. 7 | Fix suspicious line in Makefile 8 | Track t states 9 | Increment R on every M (opcode fetch) cycle. 10 | All block instructions execute one iteration per call to Z80Execute. 11 | Simplify DJNZ. 12 | Z80Debug no longer affects R register 13 | OUTD and OTDR set all flags 14 | IND and INDR set all flags 15 | CPD sets F5 16 | LDD sets F5 17 | INIR per FUSE and Undoc. Z80 Documented 18 | LDI and LDIR per FUSE. 19 | INI sets H, C and P flags per the MSB of (HL) + BC + 1. 20 | CPI and CPD set F3 and F5 21 | LDI sets F5 to bit 1 of A + (HL). 22 | OUT (C),0 puts B on the upper half of the address bus 23 | RLD sets F3 and F5 24 | IN r,(C) sets F3 and F5 25 | Indexed bit operations set f5 and f3 per the msb of the effective address 26 | Compile with -ansi and -Wall, then fix all resulting warnings. 27 | Fixed negative displacements for undocumented shift/rotate/bit instructions 28 | Fixed negative displacements for indexed SLL/SRL/SLA/SRA 29 | Fixed negative displacements for indexed RLC/RRC/RL/RR 30 | Fixed negative displacements for indexed CP 31 | Fixed negative displacements for ADD/ADC/SUB/SBB 32 | Fixed negative displacements for LD (ii+d),n 33 | Fixed negative displacements for LD (ii+d),r 34 | Fixed negative displacements for LD r,(ii+d) 35 | Fix negative displacements for indexed SET and RES 36 | Fix negative displacements with indexed BIT 37 | Fix negative displacements with indexed AND, XOR and OR 38 | Fix negative displacements with indexed INC/DEC 39 | 16-bit adds and subtracts no longer always use carry 40 | The BIT instruction always sets F3 and F5, not just when b=3 or b=5. 41 | 8-bit adds set f3 and f5 42 | CCF sets flags F3 and F5 43 | SCF sets f3 and f5 44 | CPL sets f3 and f5 45 | 8-bit increments and decrements set flags f3 and f5 46 | 16-bit adds set flags f3 and f5 47 | Created .dir-locals.el to set emacs style & indentation 48 | Add generated test and util files to .gitignore files 49 | Merge with 2.0 50 | HALT does not increment pc until an interrupt occurs. NMI and INT unhalt the processor 51 | INDR sets the negative flag 52 | INIR sets negative flag 53 | IN r,(C) sets flags 54 | OUTD places B on the top half of the address bus 55 | OUT (C),r places B on the top half of the address bus 56 | OUT (n),A places B on the top half of the address bus 57 | OUTI places B on the top half of the address bus 58 | INI places B on the top half of the address bus 59 | IND places B on to the top half of the address bus 60 | IN r,(C) places B on the top half of the address bus 61 | IN A(n) places A on the top half of the address bus 62 | For all conditional jumps, calls and returns: Swapped sense of Z and NZ; and of PE and PO. 63 | RRD computes correct value and sets flags appropriately 64 | RLD computes correct value and sets flags appropriately 65 | SRA preserves bit 7 66 | Fix RLC m, RRC m, RL m, RR m. They were doing a "rotate immediate," in effect. 67 | DEC ss and INC ss increment the proper register, and preserve flags. 68 | ADD IX,rr and ADD IY,rr set the flags propelry 69 | SBC HL,pp sets the flags properly 70 | ADC HL,pp and ADD HL,pp set the flags properly 71 | ADD HL,ss sets flags 72 | NEG sets flags properly 73 | Fix DAA instruction. It had a segfault for some arguments, and generated incorrect results for many others. 74 | eight-bit decrements set half-carry properly 75 | Parity is set when even, not odd 76 | Subtraction now sets overflow flag properly 77 | Arithmetic operations set zero flag properly 78 | CPDR leaves HL pointer to the byte before the target, and BC set to the number of bytes not searched. 79 | CPI and CPIR bug fix: Preserve carry flag 80 | Fix CPIR: HL now points to the byte after the match, rather than to the match; BC now contains the number of bytes not searched, rather than the number of bytes not searched plus one. 81 | Fix all pops. They were loading from (sp+1) and (sp+2) rather than (sp) and (sp + 1). 82 | Fix all pushes. They were storing at (sp) and (sp-1) rather than (sp-1) and (sp-2). 83 | Fix LD dd,(nn) and LD HL,(nn), which were performing an immediate load instead of a direct load. 84 | Fix order-of-evaluation bug in LD (IX|IY)+d,n 85 | Reset clears the R and I registers. 86 | .gitignore: Ignore generated files 87 | libz80-1.99.1 88 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | SOURCES = z80.c 2 | FLAGS = -fPIC -Wall -std=c89 -g 3 | 4 | force: clean all 5 | 6 | all: libz80.so 7 | 8 | libz80.so: z80.h $(OBJS) 9 | cd codegen && make opcodes 10 | $(CC) $(FLAGS) -shared -o libz80.so $(SOURCES) 11 | 12 | install: 13 | install -m 666 libz80.so /usr/lib 14 | install -m 666 z80.h /usr/include 15 | 16 | clean: 17 | rm -f *.o *.so core 18 | cd codegen && make clean 19 | 20 | realclean: clean 21 | rm -rf doc 22 | 23 | doc: *.h *.c 24 | doxygen 25 | 26 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | libz80 - Z80 emulation library 2 | =============================== 3 | 4 | *© Gabriel Gambetta (gabriel.gambetta@gmail.com) 2000 - 2014* 5 | 6 | *Version 2.1.1* 7 | 8 | Building and Installing 9 | ----------------------- 10 | 11 | The Makefile creates `libz80.so`, which together with `z80.h` make up the binary 12 | package. `make install` installs these files in `/usr/lib` and `/usr/include` 13 | respectively. 14 | 15 | Emulation code itself is generated by the `codegen` directory. `mktables.spec` 16 | includes a specification of the opcodes, using regular expressions to express 17 | similar opcodes in a compact way. Binary representation of the opcodes is listed 18 | in `opcodes.lst`. This makes tweaking the 'processor' relatively easy, as it 19 | isn't done manually. 20 | 21 | Pre-generated files are included - these are `opcodes_decl.h`, `opcodes_table.h` 22 | and `opcodes_impl.c` in the `codegen` directory. 23 | 24 | The `tests` directory includes a simple test framework and a few tests to ensure 25 | the current behavior of the processor. 26 | 27 | Authors 28 | ------- 29 | 30 | Gabriel Gambetta (gabriel.gambetta@gmail.com) 31 | 32 | Wayne Conrad (wconrad@yagni.com) - MAJOR fixes and emulation improvements. 33 | 34 | 35 | -------------------------------------------------------------------------------- /codegen/Makefile: -------------------------------------------------------------------------------- 1 | all: mktables 2 | 3 | mktables: mktables.c 4 | $(CC) -g -o mktables mktables.c 5 | 6 | force: clean opcodes 7 | 8 | opcodes: mktables opcodes.lst mktables.spec 9 | ./mktables 10 | cat opcodes_impl.c | grep "static void" | sed "s/)/);/g" >opcodes_decl.h 11 | 12 | clean: 13 | rm -f opcodes_impl.c opcodes_decl.h opcodes_table.h mktables 14 | -------------------------------------------------------------------------------- /codegen/mktables.c: -------------------------------------------------------------------------------- 1 | /* ========================================================= 2 | * libz80 - Z80 emulation library 3 | * ========================================================= 4 | * 5 | * (C) Gabriel Gambetta (gabriel.gambetta@gmail.com) 2000 - 2012 6 | * 7 | * Version 2.1.0 8 | * 9 | * --------------------------------------------------------- 10 | * 11 | * This utility generates most of the emulation code from the opcode specification 12 | * 13 | */ 14 | #include "stdio.h" 15 | #include "regex.h" 16 | #include "stdlib.h" 17 | #include "string.h" 18 | #include "ctype.h" 19 | 20 | 21 | /* ========================================================= 22 | * Parameters 23 | * ========================================================= */ 24 | #define MAX_REGEX 1000 /**< Max patterns. */ 25 | #define MAX_LINES 20 /**< Max code lines per pattern. */ 26 | #define MAX_MATCH 5 /**< Max parameters per matching opcode. */ 27 | #define MAX_LINE 100 /**< Max line length */ 28 | #define OPCODE_OFFSET 11 /**< Offset of an opcode from the list, from the start of the line */ 29 | 30 | #define OPCODES_SPEC "mktables.spec" 31 | #define OPCODES_LIST "opcodes.lst" 32 | #define OPCODES_HEADER "opcodes_decl.h" 33 | #define OPCODES_IMPL "opcodes_impl.c" 34 | #define OPCODES_TABLE "opcodes_table.h" 35 | 36 | 37 | /* ========================================================= 38 | * Helpers 39 | * ========================================================= */ 40 | typedef unsigned char byte; 41 | 42 | /** Print error and exit. */ 43 | void fatal(char* s) 44 | { 45 | printf("%s\n", s); 46 | exit(1); 47 | } 48 | 49 | 50 | /** Print error and exit. */ 51 | void fatal2(char* s, char* s2) 52 | { 53 | printf("%s%s\n", s, s2); 54 | exit(1); 55 | } 56 | 57 | 58 | /** Substitutes any of a set of characters for other character */ 59 | void substAny (char* str, char* set, char r) 60 | { 61 | while (*str) 62 | { 63 | if (strchr(set, *str)) 64 | *str = r; 65 | 66 | str++; 67 | } 68 | } 69 | 70 | 71 | /** Substitutes a string for another */ 72 | void substStr(char* str, char* src, char* rep) 73 | { 74 | char tmp[MAX_LINE]; 75 | char tmp1[MAX_LINE]; 76 | char* p; 77 | int l = strlen(src); 78 | 79 | strcpy(tmp, str); 80 | while ( (p = strstr(tmp, src)) != NULL) 81 | { 82 | *p = 0; 83 | strcpy(tmp1, tmp); 84 | strcat(tmp1, rep); 85 | strcat(tmp1, p + l); 86 | strcpy(tmp, tmp1); 87 | } 88 | 89 | strcpy(str, tmp); 90 | } 91 | 92 | 93 | /** Creates a function name from an opcode */ 94 | void fixName (char* opc, char* name) 95 | { 96 | char* p, *q, *r; 97 | int l; 98 | 99 | strcpy(name, opc); 100 | substAny(name, " +,'", '_'); 101 | substStr(name, "(", "off_"); 102 | substStr(name, ")", ""); 103 | } 104 | 105 | 106 | /** Removes trailing CR and LF. */ 107 | void trim (char* s) 108 | { 109 | while (*s) 110 | { 111 | if ((*s == 0x0D) || (*s == 0x0A)) 112 | *s = 0; 113 | s++; 114 | } 115 | } 116 | 117 | 118 | /** Opens a file or dies trying */ 119 | FILE* openOrDie(char* name, char* mode) 120 | { 121 | FILE* file = fopen(name, mode); 122 | if (!file) 123 | fatal2("Can't open ", name); 124 | 125 | return file; 126 | } 127 | 128 | /* ========================================================= 129 | * Specification structures 130 | * ========================================================= */ 131 | 132 | /** A pattern and its substitution. */ 133 | typedef struct 134 | { 135 | regex_t re; 136 | char* pat; 137 | char* line[MAX_LINES]; 138 | } Item; 139 | 140 | 141 | Item* items; /**< The patterns. */ 142 | int nItems; /**< Number of defined patterns. */ 143 | 144 | 145 | /** Reads the specification file. */ 146 | int readSpec (FILE* in) 147 | { 148 | char line[MAX_LINE]; 149 | int nLine; 150 | 151 | items = calloc(MAX_REGEX, sizeof(Item)); 152 | if (!items) 153 | fatal("Not enough memory"); 154 | 155 | nItems = -1; 156 | do 157 | { 158 | if (feof(in)) 159 | break; 160 | 161 | fgets(line, MAX_LINE, in); 162 | trim(line); 163 | if (line[0] == '#') /* Comment */ 164 | { 165 | 166 | } 167 | else if (line[0] != '\t') /* New pattern definition */ 168 | { 169 | strcat(line, "$"); 170 | nItems++; 171 | if (regcomp(&items[nItems].re, line, REG_EXTENDED)) 172 | fatal(line); 173 | nLine = 0; 174 | items[nItems].pat = strdup(line); 175 | } 176 | else /* A line in the current pattern */ 177 | { 178 | if (strlen(line) > 0) 179 | items[nItems].line[nLine++] = strdup(line); 180 | } 181 | } while(1); 182 | 183 | nItems++; 184 | 185 | return nItems+1; 186 | } 187 | 188 | 189 | 190 | /** Prints an item pattern and its substitution */ 191 | void printItem (Item* item) 192 | { 193 | char** s = item->line; 194 | 195 | printf("%s\n", item->pat); 196 | while (*s) 197 | { 198 | printf("[%s]\n", *s); 199 | s++; 200 | } 201 | } 202 | 203 | 204 | /* ========================================================= 205 | * Opcode implementation and declaration generator 206 | * ========================================================= */ 207 | 208 | /** Handles opcode-in-code */ 209 | int printCall (char* s, FILE* code) 210 | { 211 | char tmp[MAX_LINE]; 212 | char* p = tmp; 213 | 214 | strcpy(tmp, s); 215 | 216 | while (isspace(*p) && (*p)) 217 | p++; 218 | 219 | if (*p != '%') 220 | return 0; 221 | 222 | *p = 0; 223 | fprintf(code, "%s", tmp); 224 | p++; 225 | 226 | fixName(&s[p-tmp], tmp); 227 | fprintf(code, "%s(ctx);\n", tmp); 228 | return 1; 229 | } 230 | 231 | 232 | /** Reads the opcode list and generates output code based on the spec */ 233 | void generateCodeTable (FILE* opcodes, FILE* code) 234 | { 235 | char line[MAX_LINE]; 236 | char last[MAX_LINE]; 237 | char tmp[MAX_LINE]; 238 | char name[MAX_LINE]; 239 | char parm[5], subst[20]; 240 | int i; 241 | char* p, *q; 242 | char** cmds; 243 | regmatch_t matches[MAX_MATCH]; 244 | Item* item; 245 | 246 | printf("Generating opcode implementations..."); 247 | last[0] = 0; 248 | do 249 | { 250 | fgets(line, MAX_LINE, opcodes); 251 | trim(line); 252 | 253 | if (feof(opcodes)) 254 | break; 255 | 256 | for (q = line, p = q+OPCODE_OFFSET; *p; *q++ = *p++); /* Skip the hex part */ 257 | *q = 0; 258 | 259 | /* Avoid duplicate opcodes */ 260 | if (strcmp(last, line) == 0) 261 | continue; 262 | strcpy(last, line); 263 | 264 | /* Find the appropriate pattern */ 265 | for (i = 0; i < nItems; i++) 266 | { 267 | if (regexec(&items[i].re, line, MAX_MATCH, matches, REG_EXTENDED) == 0) 268 | { 269 | if (matches[0].rm_so == 0) /* Match only at beginning of line */ 270 | { 271 | /*printf("%s : match %s\n", &line, items[i].pat);*/ 272 | break; 273 | } 274 | } 275 | } 276 | 277 | if (i >= nItems) 278 | fatal2(line, " didn't match anything"); 279 | 280 | item = &items[i]; 281 | 282 | /* Print function stub */ 283 | fixName(line, name); 284 | fprintf(code, "static void %s (Z80Context* ctx)\n{\n", name); 285 | 286 | /* Substitute submatches in each output line and print the code */ 287 | cmds = item->line; 288 | strcpy(parm, "%0"); 289 | while (*cmds) 290 | { 291 | if (!printCall(*cmds, code)) 292 | { 293 | strncpy(tmp, *cmds, MAX_LINE); 294 | q = tmp; 295 | 296 | for (i = 1; i < MAX_MATCH; i++) 297 | { 298 | parm[1] = i + '0'; 299 | strncpy(subst, &line[matches[i].rm_so], matches[i].rm_eo - matches[i].rm_so); 300 | subst[matches[i].rm_eo - matches[i].rm_so] = 0; 301 | 302 | substStr(tmp, parm, subst); 303 | } 304 | fprintf(code, "%s\n", tmp); 305 | } 306 | 307 | cmds++; 308 | } 309 | 310 | fprintf(code, "}\n\n\n"); 311 | } while(1); 312 | printf("done\n"); 313 | } 314 | 315 | 316 | void generateCode (void) 317 | { 318 | FILE* spec, *opcodes, *code, *table; 319 | 320 | /* ----- Read the specification ----- */ 321 | printf("Reading specification..."); 322 | 323 | spec = openOrDie(OPCODES_SPEC, "rb"); 324 | if (!readSpec(spec)) 325 | fatal("Error reading the specification"); 326 | fclose(spec); 327 | printf("done\n"); 328 | 329 | opcodes = openOrDie(OPCODES_LIST, "rb"); 330 | code = openOrDie(OPCODES_IMPL, "wb"); 331 | 332 | generateCodeTable(opcodes, code); 333 | 334 | fclose(opcodes); 335 | fclose(code); 336 | } 337 | 338 | 339 | /* ========================================================= 340 | * Parser tables generator 341 | * ========================================================= */ 342 | 343 | void mkFormat(char* src, char* dst) 344 | { 345 | strcpy(dst, src); 346 | substStr(dst, "d", "0%02Xh"); 347 | substStr(dst, "e", "%d"); 348 | substStr(dst, "nn", "0%04Xh"); 349 | substStr(dst, "n", "0%02Xh"); 350 | } 351 | 352 | 353 | int isHex(char c) 354 | { 355 | return (isxdigit(c) && isupper(c)) || isdigit(c); 356 | } 357 | 358 | 359 | int hexVal(char c) 360 | { 361 | if (isdigit(c)) 362 | return c - '0'; 363 | return c - 'A' + 10; 364 | } 365 | 366 | 367 | /* --------------------------------------------------------- 368 | * Parser structures. Not exactly the same as in z80.c 369 | * --------------------------------------------------------- */ 370 | typedef enum 371 | { 372 | OP_NONE, 373 | OP_BYTE, 374 | OP_OFFSET, 375 | OP_WORD, 376 | OP_BYTE_BYTE 377 | } Z80OperandType; 378 | 379 | char* OpTypeName[] = { "OP_NONE", "OP_BYTE", "OP_OFFSET", "OP_WORD", "OP_BYTE_BYTE" }; 380 | 381 | struct Z80OpcodeTable; 382 | 383 | struct Z80OpcodeEntry 384 | { 385 | int pre_skip; 386 | int post_skip; 387 | char* func; /* Z80OpcodeFunc* func;*/ 388 | 389 | int operand_type; 390 | char* format; 391 | 392 | struct Z80OpcodeTable* table; 393 | }; 394 | 395 | 396 | struct Z80OpcodeTable 397 | { 398 | char* name; 399 | int opcode_offset; 400 | struct Z80OpcodeEntry entries[256]; 401 | }; 402 | 403 | 404 | typedef enum 405 | { 406 | TT_OPCODE, 407 | TT_D, 408 | TT_E, 409 | TT_N, 410 | TT_NN, 411 | TT_END 412 | } TokenType; 413 | 414 | 415 | char* nextToken(char* cur, byte* val, TokenType* ttype) 416 | { 417 | *ttype = TT_END; 418 | while (*cur) 419 | { 420 | if (*cur == ' ') 421 | { 422 | cur++; 423 | continue; 424 | } 425 | else if (isHex(*cur) && isHex(*(cur+1))) 426 | { 427 | *val = (hexVal(*cur) << 4) | hexVal(*(cur+1)); 428 | *ttype = TT_OPCODE; 429 | cur += 2; 430 | break; 431 | } 432 | else if (*cur == 'd') 433 | { 434 | *ttype = TT_D; 435 | cur++; 436 | break; 437 | } 438 | else if (*cur == 'e') 439 | { 440 | *ttype = TT_E; 441 | cur++; 442 | break; 443 | } 444 | else if ((*cur == 'n') && (*(cur+1) == 'n')) 445 | { 446 | *ttype = TT_NN; 447 | cur += 2; 448 | break; 449 | } 450 | else if (*cur == 'n') 451 | { 452 | *ttype = TT_N; 453 | cur++; 454 | break; 455 | } 456 | else 457 | { 458 | fatal2("Unknown char at ", cur); 459 | } 460 | }; 461 | 462 | return cur; 463 | } 464 | 465 | 466 | /** Creates the table tree implied by the prefixes */ 467 | struct Z80OpcodeTable* createTableTree(FILE* opcodes, FILE* table) 468 | { 469 | struct Z80OpcodeTable* mainTable; 470 | struct Z80OpcodeTable* current; 471 | char line[MAX_LINE]; 472 | char tmp[MAX_LINE]; 473 | char* cur; 474 | byte code; 475 | TokenType tt; 476 | byte prefix[10]; 477 | int prefixLen, i; 478 | int wasOperand; 479 | int opcodeOffset; 480 | 481 | mainTable = calloc(1, sizeof(struct Z80OpcodeTable)); 482 | mainTable->name = strdup(""); 483 | 484 | fprintf(table, "static const struct Z80OpcodeTable opcodes_main;\n"); 485 | 486 | rewind(opcodes); 487 | 488 | printf("Determining opcode prefixes..."); 489 | do 490 | { 491 | fgets(line, MAX_LINE, opcodes); 492 | trim(line); 493 | 494 | if (feof(opcodes)) 495 | break; 496 | 497 | prefixLen = 0; 498 | line[OPCODE_OFFSET - 1] = 0; 499 | 500 | /* Get the codes */ 501 | wasOperand = 0; 502 | opcodeOffset = 0; 503 | cur = line; 504 | do 505 | { 506 | cur = nextToken(cur, &code, &tt); 507 | if (tt == TT_END) 508 | { 509 | break; 510 | } 511 | else if (tt == TT_OPCODE) 512 | { 513 | prefix[prefixLen++] = code; 514 | if (wasOperand) 515 | opcodeOffset++; 516 | } 517 | else 518 | { 519 | wasOperand = 1; 520 | } 521 | } while(1); 522 | 523 | /* All hex codes except the last one form the prefix of the instruction */ 524 | current = mainTable; 525 | for (i = 0; i < prefixLen - 1; i++) 526 | { 527 | code = prefix[i]; 528 | /* Create a new node if it doesn't exist */ 529 | if (current->entries[code].table == NULL) 530 | { 531 | sprintf(tmp, "%s%02X", current->name, code); 532 | current->entries[code].table = calloc(1, sizeof(struct Z80OpcodeTable)); 533 | current = current->entries[code].table; 534 | current->name = strdup(tmp); 535 | fprintf(table, "static const struct Z80OpcodeTable opcodes_%s;\n", current->name); 536 | 537 | printf("%s ", tmp); 538 | } 539 | else 540 | { 541 | current = current->entries[code].table; 542 | } 543 | } 544 | 545 | current->opcode_offset = opcodeOffset; 546 | } while(1); 547 | 548 | printf("\n"); 549 | 550 | mainTable->name = strdup("main"); 551 | return mainTable; 552 | } 553 | 554 | 555 | void scanOpcodes(FILE* opcodes, struct Z80OpcodeTable* mainTable) 556 | { 557 | char line[MAX_LINE]; 558 | char name[MAX_LINE]; 559 | char fmt[MAX_LINE]; 560 | char* cur; 561 | byte code; 562 | TokenType tt; 563 | struct Z80OpcodeTable* current; 564 | struct Z80OpcodeEntry* ent; 565 | int opType; 566 | 567 | rewind(opcodes); 568 | do 569 | { 570 | fgets(line, MAX_LINE, opcodes); 571 | trim(line); 572 | 573 | if (feof(opcodes)) 574 | break; 575 | 576 | mkFormat(&line[OPCODE_OFFSET], fmt); 577 | fixName(&line[OPCODE_OFFSET], name); 578 | line[OPCODE_OFFSET] = 0; 579 | 580 | current = mainTable; 581 | cur = line; 582 | opType = OP_NONE; 583 | do 584 | { 585 | cur = nextToken(cur, &code, &tt); 586 | if (tt == TT_END) 587 | { 588 | break; 589 | } 590 | else if (tt == TT_OPCODE) 591 | { 592 | if (current->entries[code].table) 593 | { 594 | current = current->entries[code].table; 595 | continue; 596 | } 597 | 598 | ent = ¤t->entries[code]; 599 | ent->func = strdup(name); 600 | ent->format = strdup(fmt); 601 | } 602 | else if (tt == TT_NN) 603 | { 604 | opType = OP_WORD; 605 | } 606 | else if ((tt == TT_N) | (tt == TT_D)) 607 | { 608 | if (opType == OP_NONE) 609 | { 610 | opType = OP_BYTE; 611 | } 612 | else 613 | { 614 | opType = OP_BYTE_BYTE; 615 | } 616 | } 617 | else if (tt == TT_E) 618 | { 619 | opType = OP_OFFSET; 620 | } 621 | } while(1); 622 | 623 | ent->operand_type = opType; 624 | 625 | } while (1); 626 | } 627 | 628 | 629 | void outputTable(struct Z80OpcodeTable* table, FILE* file) 630 | { 631 | int i; 632 | struct Z80OpcodeEntry* opc; 633 | struct Z80OpcodeTable* tbl; 634 | char fmt[MAX_LINE]; 635 | 636 | printf("Outputting table %s...", table->name); 637 | 638 | fprintf(file, "static const struct Z80OpcodeTable opcodes_%s = { %d, {\n", table->name, table->opcode_offset); 639 | 640 | for (i = 0, opc = table->entries; i < 256; i++, opc++) 641 | { 642 | tbl = opc->table; 643 | 644 | strcpy(fmt, "NULL"); 645 | if (opc->format) 646 | sprintf(fmt, "\"%s\"", opc->format); 647 | 648 | fprintf(file, "\t{ %-20s, %-9s, %-20s, %s%s }%s\n", 649 | (opc->func ? opc->func : "NULL"), 650 | OpTypeName[opc->operand_type], 651 | fmt, 652 | (tbl ? "&opcodes_" : ""), 653 | (tbl ? tbl->name : "NULL"), 654 | (i == 255 ? "" : ",") 655 | ); 656 | 657 | } 658 | fprintf(file, "} };\n"); 659 | fprintf(file, "\n\n"); 660 | 661 | printf("done\n"); 662 | 663 | for (i = 0, opc = table->entries; i < 256; i++, opc++) 664 | { 665 | tbl = opc->table; 666 | if (tbl) 667 | outputTable(tbl, file); 668 | } 669 | } 670 | 671 | 672 | void generateParserTables(FILE* opcodes, FILE* table) 673 | { 674 | struct Z80OpcodeTable* mainTable = createTableTree(opcodes, table); 675 | scanOpcodes(opcodes, mainTable); 676 | fprintf(table, "\n\n"); 677 | outputTable(mainTable, table); 678 | } 679 | 680 | 681 | void generateParser(void) 682 | { 683 | FILE* table, *opcodes; 684 | 685 | opcodes = openOrDie(OPCODES_LIST, "rb"); 686 | table = openOrDie(OPCODES_TABLE, "wb"); 687 | 688 | generateParserTables(opcodes, table); 689 | 690 | fclose(table); 691 | fclose(opcodes); 692 | } 693 | 694 | 695 | int main (void) 696 | { 697 | generateCode(); 698 | generateParser(); 699 | return 0; 700 | } 701 | 702 | -------------------------------------------------------------------------------- /codegen/mktables.spec: -------------------------------------------------------------------------------- 1 | # 2 | # Z80 -> C specification 3 | 4 | 5 | # 6 | # Add / Sub / Adc / Sbc 7 | # 8 | (ADC|SBC|ADD|SUB) A,(A|B|C|D|E|H|L|IXh|IXl|IYh|IYl) 9 | BR.A = doArithmetic(ctx, BR.%2, F1_%1, F2_%1); 10 | 11 | (ADC|SBC|ADD|SUB) A,\(HL\) 12 | BR.A = doArithmetic(ctx, read8(ctx, WR.HL), F1_%1, F2_%1); 13 | 14 | (ADC|SBC|ADD|SUB) A,\((IX|IY)\+d\) 15 | ctx->tstates += 5; 16 | signed char displacement = read8(ctx, ctx->PC++); 17 | BR.A = doArithmetic(ctx, read8(ctx, WR.%2 + displacement), F1_%1, F2_%1); 18 | 19 | (ADC|SBC|ADD|SUB) A,n 20 | BR.A = doArithmetic(ctx, read8(ctx, ctx->PC++), F1_%1, F2_%1); 21 | 22 | 23 | # Particular cases 24 | (ADC|ADD|SBC) HL,(SP|BC|DE|HL) 25 | ctx->tstates += 7; 26 | WR.HL = doAddWord(ctx, WR.HL, WR.%2, F1_%1, F2_%1); 27 | 28 | ADD (IX|IY),(SP|BC|DE|IX|IY) 29 | ctx->tstates += 7; 30 | WR.%1 = doAddWord(ctx, WR.%1, WR.%2, 0, 0); 31 | 32 | # 33 | # Logic operations 34 | # 35 | (AND|XOR|OR) \(HL\) 36 | do%1(ctx, read8(ctx, WR.HL)); 37 | 38 | (AND|XOR|OR) \((IX|IY)\+d\) 39 | ctx->tstates += 5; 40 | do%1(ctx, read8(ctx, WR.%2 + (signed char) read8(ctx, ctx->PC++))); 41 | 42 | (AND|XOR|OR) (A|B|C|D|E|H|L|IXh|IXl|IYh|IYl) 43 | do%1(ctx, BR.%2); 44 | 45 | (AND|XOR|OR) n 46 | do%1(ctx, read8(ctx, ctx->PC++)); 47 | 48 | 49 | # 50 | # Bit operations 51 | # 52 | BIT ([0-7]),(A|B|C|D|E|H|L) 53 | doBIT_r(ctx, %1, BR.%2); 54 | 55 | BIT ([0-7]),\(HL\) 56 | ctx->tstates += 1; 57 | doBIT_r(ctx, %1, read8(ctx, WR.HL)); 58 | 59 | BIT ([0-7]),\((IX|IY)\+d\) 60 | ctx->tstates += 2; 61 | ushort address = WR.%2 + (signed char) read8(ctx, ctx->PC++); 62 | doBIT_indexed(ctx, %1, address); 63 | 64 | (SET|RES) ([0-7]),(A|B|C|D|E|H|L) 65 | BR.%3 = doSetRes(ctx, SR_%1, %2, BR.%3); 66 | 67 | (SET|RES) ([0-7]),\(HL\) 68 | ctx->tstates += 1; 69 | write8(ctx, WR.HL, doSetRes(ctx, SR_%1, %2, read8(ctx, WR.HL))); 70 | 71 | (SET|RES) ([0-7]),\((IX|IY)\+d\) 72 | ctx->tstates += 2; 73 | signed char off = read8(ctx, ctx->PC++); 74 | write8(ctx, WR.%3 + off, doSetRes(ctx, SR_%1, %2, read8(ctx, WR.%3 + off))); 75 | 76 | 77 | # 78 | # Jumps and calls 79 | # 80 | CALL (C|M|NZ|NC|P|PE|PO|Z)?,?\(nn\) 81 | ushort addr = read16(ctx, ctx->PC); 82 | ctx->PC += 2; 83 | if (condition(ctx, C_%1)) 84 | { 85 | ctx->tstates += 1; 86 | doPush(ctx, ctx->PC); 87 | ctx->PC = addr; 88 | } 89 | 90 | JP \((HL|IX|IY)\) 91 | ctx->PC = WR.%1; 92 | 93 | JP (C|M|NZ|NC|P|PE|PO|Z)?,?\(nn\) 94 | ushort addr = read16(ctx, ctx->PC); 95 | ctx->PC += 2; 96 | if (condition(ctx, C_%1)) 97 | ctx->PC = addr; 98 | 99 | JR (C|NZ|NC|Z)?,?\(PC\+e\) 100 | int off = doComplement(read8(ctx, ctx->PC++)); 101 | if (condition(ctx, C_%1)) 102 | { 103 | ctx->tstates += 5; 104 | ctx->PC += off; 105 | } 106 | 107 | RETI 108 | ctx->IFF1 = ctx->IFF2; 109 | %RET 110 | 111 | RETN 112 | ctx->IFF1 = ctx->IFF2; 113 | %RET 114 | 115 | 116 | RET (C|M|NZ|NC|P|PE|PO|Z) 117 | ctx->tstates += 1; 118 | if (condition(ctx, C_%1)) 119 | ctx->PC = doPop(ctx); 120 | 121 | RET 122 | ctx->PC = doPop(ctx); 123 | 124 | 125 | DJNZ \(PC\+e\) 126 | ctx->tstates += 1; 127 | signed char off = read8(ctx, ctx->PC++); 128 | BR.B--; 129 | if (BR.B) 130 | { 131 | ctx->tstates += 5; 132 | ctx->PC += off; 133 | } 134 | 135 | 136 | RST (0|8|10|18|20|28|30|38)H 137 | ctx->tstates += 1; 138 | doPush(ctx, ctx->PC); 139 | ctx->PC = 0x0%1; 140 | 141 | 142 | # 143 | # Misc 144 | # 145 | CCF 146 | VALFLAG(F_C, (1 - (byte)GETFLAG(F_C) != 0)); 147 | RESFLAG(F_N); 148 | adjustFlags(ctx, BR.A); 149 | 150 | SCF 151 | SETFLAG(F_C); 152 | RESFLAG(F_N | F_H); 153 | adjustFlags(ctx, BR.A); 154 | 155 | CPL 156 | BR.A = ~BR.A; 157 | SETFLAG(F_H | F_N); 158 | adjustFlags(ctx, BR.A); 159 | 160 | DAA 161 | doDAA(ctx); 162 | 163 | EX \(SP\),(HL|IX|IY) 164 | ctx->tstates += 3; 165 | ushort tmp = read16(ctx, WR.SP); 166 | write16(ctx, WR.SP, WR.%1); 167 | WR.%1 = tmp; 168 | 169 | EX AF,AF' 170 | ushort tmp = ctx->R1.wr.AF; 171 | ctx->R1.wr.AF = ctx->R2.wr.AF; 172 | ctx->R2.wr.AF = tmp; 173 | 174 | EX DE,HL 175 | ushort tmp = WR.DE; 176 | WR.DE = WR.HL; 177 | WR.HL = tmp; 178 | 179 | EXX 180 | ushort tmp; 181 | tmp = ctx->R1.wr.BC; 182 | ctx->R1.wr.BC = ctx->R2.wr.BC; 183 | ctx->R2.wr.BC = tmp; 184 | 185 | tmp = ctx->R1.wr.DE; 186 | ctx->R1.wr.DE = ctx->R2.wr.DE; 187 | ctx->R2.wr.DE = tmp; 188 | 189 | tmp = ctx->R1.wr.HL; 190 | ctx->R1.wr.HL = ctx->R2.wr.HL; 191 | ctx->R2.wr.HL = tmp; 192 | 193 | HALT 194 | ctx->halted = 1; 195 | ctx->PC--; 196 | 197 | # 198 | # Compare 199 | # 200 | CP \(HL\) 201 | doCP_HL(ctx); 202 | 203 | CP \((IX|IY)\+d\) 204 | ctx->tstates += 5; 205 | signed char displacement = read8(ctx, ctx->PC++); 206 | byte val = read8(ctx, WR.%1 + displacement); 207 | doArithmetic(ctx, val, 0, 1); 208 | adjustFlags(ctx, val); 209 | 210 | CP (A|B|C|D|E|H|L|IXh|IXl|IYh|IYl) 211 | doArithmetic(ctx, BR.%1, 0, 1); 212 | adjustFlags(ctx, BR.%1); 213 | 214 | CP n 215 | byte val = read8(ctx, ctx->PC++); 216 | doArithmetic(ctx, val, 0, 1); 217 | adjustFlags(ctx, val); 218 | 219 | CPDR 220 | %CPD 221 | if (WR.BC != 0 && !GETFLAG(F_Z)) 222 | { 223 | ctx->tstates += 5; 224 | ctx->PC -= 2; 225 | } 226 | 227 | CPD 228 | ctx->tstates += 5; 229 | int carry = GETFLAG(F_C); 230 | byte value = doCP_HL(ctx); 231 | if(GETFLAG(F_H)) 232 | value--; 233 | WR.HL--; 234 | WR.BC--; 235 | VALFLAG(F_PV, WR.BC != 0); 236 | if(carry) 237 | SETFLAG(F_C); 238 | else 239 | RESFLAG(F_C); 240 | VALFLAG(F_5, value & (1 << 1)); 241 | VALFLAG(F_3, value & (1 << 3)); 242 | 243 | CPIR 244 | %CPI 245 | if (WR.BC != 0 && !GETFLAG(F_Z)) 246 | { 247 | ctx->tstates += 5; 248 | ctx->PC -= 2; 249 | } 250 | 251 | CPI 252 | ctx->tstates += 5; 253 | int carry = GETFLAG(F_C); 254 | byte value = doCP_HL(ctx); 255 | if(GETFLAG(F_H)) 256 | value--; 257 | WR.HL++; 258 | WR.BC--; 259 | VALFLAG(F_PV, WR.BC != 0); 260 | VALFLAG(F_C, carry); 261 | VALFLAG(F_5, value & (1 << 2)); 262 | VALFLAG(F_3, value & (1 << 3)); 263 | 264 | # 265 | # INC and DEC 266 | # 267 | (INC|DEC) \(HL\) 268 | ctx->tstates += 1; 269 | byte value = read8(ctx, WR.HL); 270 | write8(ctx, WR.HL, doIncDec(ctx, value, ID_%1)); 271 | 272 | (INC|DEC) \((IX|IY)\+d\) 273 | ctx->tstates += 6; 274 | signed char off = read8(ctx, ctx->PC++); 275 | byte value = read8(ctx, WR.%2 + off); 276 | write8(ctx, WR.%2 + off, doIncDec(ctx, value, ID_%1)); 277 | 278 | (INC|DEC) (A|B|C|D|E|H|L|IXh|IXl|IYh|IYl) 279 | BR.%2 = doIncDec(ctx, BR.%2, ID_%1); 280 | 281 | INC (BC|DE|HL|SP|IX|IY) 282 | ctx->tstates += 2; 283 | WR.%1++; 284 | 285 | DEC (BC|DE|HL|SP|IX|IY) 286 | ctx->tstates += 2; 287 | WR.%1--; 288 | 289 | # 290 | # Interrupts 291 | # 292 | (EI|DI) 293 | ctx->IFF1 = ctx->IFF2 = IE_%1; 294 | ctx->defer_int = 1; 295 | 296 | IM ([012]) 297 | ctx->IM = %1; 298 | 299 | 300 | # 301 | # IO ports 302 | # 303 | IN (A|B|C|D|E|F|H|L),\(C\) 304 | BR.%1 = ioRead(ctx, WR.BC); 305 | RESFLAG(F_H | F_N); 306 | adjustFlagSZP(ctx, BR.%1); 307 | adjustFlags(ctx, BR.%1); 308 | 309 | IN A,\(n\) 310 | byte port = read8(ctx, ctx->PC++); 311 | BR.A = ioRead(ctx, BR.A << 8 | port); 312 | 313 | INDR 314 | %IND 315 | if (BR.B != 0) 316 | { 317 | ctx->tstates += 5; 318 | ctx->PC -= 2; 319 | } 320 | 321 | IND 322 | ctx->tstates += 1; 323 | byte val = ioRead(ctx, WR.BC); 324 | write8(ctx, WR.HL, val); 325 | WR.HL--; 326 | BR.B = doIncDec(ctx, BR.B, ID_DEC); 327 | VALFLAG(F_N, (val & 0x80) != 0); 328 | int flagval = val + ((BR.C - 1) & 0xff); 329 | VALFLAG(F_H, flagval > 0xff); 330 | VALFLAG(F_C, flagval > 0xff); 331 | VALFLAG(F_PV, parityBit[(flagval & 7) ^ BR.B]); 332 | 333 | INIR 334 | %INI 335 | if (BR.B != 0) 336 | { 337 | ctx->tstates += 5; 338 | ctx->PC -= 2; 339 | } 340 | 341 | INI 342 | ctx->tstates += 1; 343 | byte val = ioRead(ctx, WR.BC); 344 | write8(ctx, WR.HL, val); 345 | WR.HL++; 346 | BR.B = doIncDec(ctx, BR.B, ID_DEC); 347 | VALFLAG(F_N, (val & 0x80) != 0); 348 | int flagval = val + ((BR.C + 1) & 0xff); 349 | VALFLAG(F_H, flagval > 0xff); 350 | VALFLAG(F_C, flagval > 0xff); 351 | VALFLAG(F_PV, parityBit[(flagval & 7) ^ BR.B]); 352 | 353 | # 354 | # Loads 355 | # 356 | LD \((BC|DE|HL)\),A 357 | write8(ctx, WR.%1, BR.A); 358 | 359 | LD \(HL\),(B|C|D|E|H|L) 360 | write8(ctx, WR.HL, BR.%1); 361 | 362 | LD \(HL\),n 363 | write8(ctx, WR.HL, read8(ctx, ctx->PC++)); 364 | 365 | LD \((IX|IY)\+d\),(A|B|C|D|E|H|L) 366 | ctx->tstates += 5; 367 | write8(ctx, WR.%1 + (signed char) read8(ctx, ctx->PC++), BR.%2); 368 | 369 | LD \((IX|IY)\+d\),n 370 | ctx->tstates += 2; 371 | signed char offset = read8(ctx, ctx->PC++); 372 | byte n = read8(ctx, ctx->PC++); 373 | write8(ctx, WR.%1 + offset, n); 374 | 375 | LD \(nn\),A 376 | write8(ctx, read16(ctx, ctx->PC), BR.A); 377 | ctx->PC += 2; 378 | 379 | LD (BC|DE|HL|IX|IY|SP),(BC|DE|HL|IX|IY|SP) 380 | ctx->tstates += 2; 381 | WR.%1 = WR.%2; 382 | 383 | LD \(nn\),(BC|DE|HL|IX|IY|SP) 384 | write16(ctx, read16(ctx, ctx->PC), WR.%1); 385 | ctx->PC += 2; 386 | 387 | LD A,\((BC|DE)\) 388 | BR.A = read8(ctx, WR.%1); 389 | 390 | LD (A|B|C|D|E|H|L),\(HL\) 391 | BR.%1 = read8(ctx, WR.HL); 392 | 393 | LD (A|B|C|D|E|H|L),\((IX|IY)\+d\) 394 | ctx->tstates += 5; 395 | BR.%1 = read8(ctx, WR.%2 + (signed char) read8(ctx, ctx->PC++)); 396 | 397 | LD (A|B|C|D|E|H|L),\(nn\) 398 | BR.%1 = read8(ctx, read16(ctx, ctx->PC)); 399 | ctx->PC += 2; 400 | 401 | LD (A|B|C|D|E|H|L|IXh|IXl|IYh|IYl),(A|B|C|D|E|H|L|IXh|IXl|IYh|IYl) 402 | BR.%1 = BR.%2; 403 | 404 | LD (A|B|C|D|E|H|L),(SL|SR)A \((IX|IY)\+d\) 405 | ctx->tstates += 2; 406 | signed char off = read8(ctx, ctx->PC++); 407 | BR.%1 = do%2(ctx, read8(ctx, WR.%3 + off), 1); 408 | write8(ctx, WR.%3 + off, BR.%1); 409 | 410 | LD (A|B|C|D|E|H|L),(SL|SR)L \((IX|IY)\+d\) 411 | ctx->tstates += 2; 412 | signed char off = read8(ctx, ctx->PC++); 413 | BR.%1 = do%2(ctx, read8(ctx, WR.%3 + off), 0); 414 | write8(ctx, WR.%3 + off, BR.%1); 415 | 416 | LD (A|B|C|D|E|H|L),(RL|RLC|RR|RRC) \((IX|IY)\+d\) 417 | ctx->tstates += 2; 418 | signed char off = read8(ctx, ctx->PC++); 419 | BR.%1 = do%2(ctx, 1, read8(ctx, WR.%3 + off)); 420 | write8(ctx, WR.%3 + off, BR.%1); 421 | 422 | LD (A|B|C|D|E|H|L),(SET|RES) ([0-7]),\((IX|IY)\+d\) 423 | ctx->tstates += 2; 424 | signed char off = read8(ctx, ctx->PC++); 425 | BR.%1 = doSetRes(ctx, SR_%2, %3, read8(ctx, WR.%4 + off)); 426 | write8(ctx, WR.%4 + off, BR.%1); 427 | 428 | LD A,(I|R) 429 | ctx->tstates += 1; 430 | BR.A = ctx->%1; 431 | adjustFlags(ctx, BR.A); 432 | RESFLAG(F_H | F_N); 433 | VALFLAG(F_PV, ctx->IFF2); 434 | VALFLAG(F_S, (BR.A & 0x80) != 0); 435 | VALFLAG(F_Z, (BR.A == 0)); 436 | 437 | LD (I|R),A 438 | ctx->tstates += 1; 439 | ctx->%1 = BR.A; 440 | 441 | LD (A|B|C|D|E|H|L|IXh|IXl|IYh|IYl),n 442 | BR.%1 = read8(ctx, ctx->PC++); 443 | 444 | LD (BC|DE|HL|SP|IX|IY),\(nn\) 445 | ushort addr = read16(ctx, ctx->PC); 446 | ctx->PC += 2; 447 | WR.%1 = read16(ctx, addr); 448 | 449 | LD (BC|DE|HL|SP|IX|IY),nn 450 | WR.%1 = read16(ctx, ctx->PC); 451 | ctx->PC += 2; 452 | 453 | 454 | LDIR 455 | %LDI 456 | if (WR.BC != 0) 457 | { 458 | ctx->tstates += 5; 459 | ctx->PC -= 2; 460 | } 461 | 462 | LDI 463 | ctx->tstates += 2; 464 | byte val = read8(ctx, WR.HL); 465 | write8(ctx, WR.DE, val); 466 | WR.DE++; 467 | WR.HL++; 468 | WR.BC--; 469 | VALFLAG(F_5, (BR.A + val) & 0x02); 470 | VALFLAG(F_3, ((BR.A + val) & F_3) != 0); 471 | RESFLAG(F_H | F_N); 472 | VALFLAG(F_PV, WR.BC != 0); 473 | 474 | LDDR 475 | %LDD 476 | if (WR.BC != 0) 477 | { 478 | ctx->tstates += 5; 479 | ctx->PC -= 2; 480 | } 481 | 482 | LDD 483 | ctx->tstates += 2; 484 | byte val = read8(ctx, WR.HL); 485 | write8(ctx, WR.DE, val); 486 | WR.DE--; 487 | WR.HL--; 488 | WR.BC--; 489 | VALFLAG(F_5, ((BR.A + val) & 0x02) != 0); 490 | VALFLAG(F_3, ((BR.A + val) & F_3) != 0); 491 | RESFLAG(F_H | F_N); 492 | VALFLAG(F_PV, WR.BC != 0); 493 | 494 | NEG 495 | int temp = BR.A; 496 | BR.A = 0; 497 | BR.A = doArithmetic(ctx, temp, 0, 1); 498 | SETFLAG(F_N); 499 | 500 | NOP 501 | /* NOP */ 502 | 503 | 504 | OUTI 505 | ctx->tstates += 1; 506 | byte value = read8(ctx, WR.HL); 507 | BR.B = doIncDec(ctx, BR.B, 1); 508 | ioWrite(ctx, WR.BC, value); 509 | WR.HL++; 510 | int flag_value = value + BR.L; 511 | VALFLAG(F_N, value & 0x80); 512 | VALFLAG(F_H, flag_value > 0xff); 513 | VALFLAG(F_C, flag_value > 0xff); 514 | VALFLAG(F_PV, parityBit[(flag_value & 7) ^ BR.B]); 515 | adjustFlags(ctx, BR.B); 516 | 517 | OTIR 518 | %OUTI 519 | if (BR.B != 0) 520 | { 521 | ctx->tstates += 5; 522 | ctx->PC -= 2; 523 | } 524 | 525 | OUTD 526 | ctx->tstates += 1; 527 | byte value = read8(ctx, WR.HL); 528 | BR.B = doIncDec(ctx, BR.B, 1); 529 | ioWrite(ctx, WR.BC, value); 530 | WR.HL--; 531 | int flag_value = value + BR.L; 532 | VALFLAG(F_N, value & 0x80); 533 | VALFLAG(F_H, flag_value > 0xff); 534 | VALFLAG(F_C, flag_value > 0xff); 535 | VALFLAG(F_PV, parityBit[(flag_value & 7) ^ BR.B]); 536 | adjustFlags(ctx, BR.B); 537 | 538 | OTDR 539 | %OUTD 540 | if (BR.B != 0) 541 | { 542 | ctx->tstates += 5; 543 | ctx->PC -= 2; 544 | } 545 | 546 | OUT \(C\),0 547 | ioWrite(ctx, WR.BC, 0); 548 | 549 | OUT \(C\),(A|B|C|D|E|H|L) 550 | ioWrite(ctx, WR.BC, BR.%1); 551 | 552 | OUT \(n\),A 553 | ioWrite(ctx, BR.A << 8 | read8(ctx, ctx->PC++), BR.A); 554 | 555 | POP (AF|BC|DE|HL|IX|IY) 556 | WR.%1 = doPop(ctx); 557 | 558 | PUSH (AF|BC|DE|HL|IX|IY) 559 | ctx->tstates += 1; 560 | doPush(ctx, WR.%1); 561 | 562 | 563 | # 564 | # Rotate & shift 565 | # 566 | 567 | (RLC|RRC|RL|RR) \(HL\) 568 | ctx->tstates += 1; 569 | write8(ctx, WR.HL, do%1(ctx, 1, read8(ctx, WR.HL))); 570 | 571 | (RLC|RRC|RL|RR) (A|B|C|D|E|H|L|IXh|IXl|IYh|IYl) 572 | BR.%2 = do%1(ctx, 1, BR.%2); 573 | 574 | (RLC|RRC|RL|RR) \((IX|IY)\+d\) 575 | ctx->tstates += 2; 576 | signed char off = read8(ctx, ctx->PC++); 577 | write8(ctx, WR.%2 + off, do%1(ctx, 1, read8(ctx, WR.%2 + off))); 578 | 579 | (RL|RR|RLC|RRC)A 580 | BR.A = do%1(ctx, 0, BR.A); 581 | 582 | 583 | RLD 584 | ctx->tstates += 4; 585 | byte Ah = BR.A & 0x0f; 586 | byte hl = read8(ctx, WR.HL); 587 | BR.A = (BR.A & 0xf0) | ((hl & 0xf0) >> 4); 588 | hl = (hl << 4) | Ah; 589 | write8(ctx, WR.HL, hl); 590 | RESFLAG(F_H | F_N); 591 | adjustFlagSZP(ctx, BR.A); 592 | adjustFlags(ctx, BR.A); 593 | 594 | 595 | RRD 596 | ctx->tstates += 4; 597 | byte Ah = BR.A & 0x0f; 598 | byte hl = read8(ctx, WR.HL); 599 | BR.A = (BR.A & 0xf0) | (hl & 0x0f); 600 | hl = (hl >> 4) | (Ah << 4); 601 | write8(ctx, WR.HL, hl); 602 | RESFLAG(F_H | F_N); 603 | adjustFlagSZP(ctx, BR.A); 604 | 605 | 606 | (SL|SR)(L|A) \(HL\) 607 | ctx->tstates += 1; 608 | write8(ctx, WR.HL, do%1(ctx, read8(ctx, WR.HL), IA_%2)); 609 | 610 | 611 | (SL|SR)(L|A) \((IX|IY)\+d\) 612 | ctx->tstates += 2; 613 | signed char off = read8(ctx, ctx->PC++); 614 | write8(ctx, WR.%3 + off, do%1(ctx, read8(ctx, WR.%3 + off), IA_%2)); 615 | 616 | (SL|SR)(L|A) (A|B|C|D|E|H|L|IXh|IXl|IYh|IYl) 617 | BR.%3 = do%1(ctx, BR.%3, IA_%2); 618 | 619 | -------------------------------------------------------------------------------- /codegen/opcodes.lst: -------------------------------------------------------------------------------- 1 | 8E ADC A,(HL) 2 | DD8E d ADC A,(IX+d) 3 | FD8E d ADC A,(IY+d) 4 | 8F ADC A,A 5 | 88 ADC A,B 6 | 89 ADC A,C 7 | 8A ADC A,D 8 | 8B ADC A,E 9 | 8C ADC A,H 10 | DD8C ADC A,IXh 11 | DD8D ADC A,IXl 12 | FD8C ADC A,IYh 13 | FD8D ADC A,IYl 14 | 8D ADC A,L 15 | CE n ADC A,n 16 | ED4A ADC HL,BC 17 | ED5A ADC HL,DE 18 | ED6A ADC HL,HL 19 | ED7A ADC HL,SP 20 | 86 ADD A,(HL) 21 | DD86 d ADD A,(IX+d) 22 | FD86 d ADD A,(IY+d) 23 | 87 ADD A,A 24 | 80 ADD A,B 25 | 81 ADD A,C 26 | 82 ADD A,D 27 | 83 ADD A,E 28 | 84 ADD A,H 29 | DD84 ADD A,IXh 30 | DD85 ADD A,IXl 31 | FD84 ADD A,IYh 32 | FD85 ADD A,IYl 33 | 85 ADD A,L 34 | C6 n ADD A,n 35 | 09 ADD HL,BC 36 | 19 ADD HL,DE 37 | 29 ADD HL,HL 38 | 39 ADD HL,SP 39 | DD09 ADD IX,BC 40 | DD19 ADD IX,DE 41 | DD29 ADD IX,IX 42 | DD39 ADD IX,SP 43 | FD09 ADD IY,BC 44 | FD19 ADD IY,DE 45 | FD29 ADD IY,IY 46 | FD39 ADD IY,SP 47 | A6 AND (HL) 48 | DDA6 d AND (IX+d) 49 | FDA6 d AND (IY+d) 50 | A7 AND A 51 | A0 AND B 52 | A1 AND C 53 | A2 AND D 54 | A3 AND E 55 | A4 AND H 56 | DDA4 AND IXh 57 | DDA5 AND IXl 58 | FDA4 AND IYh 59 | FDA5 AND IYl 60 | A5 AND L 61 | E6 n AND n 62 | CB46 BIT 0,(HL) 63 | DDCB d 46 BIT 0,(IX+d) 64 | DDCB d 41 BIT 0,(IX+d) 65 | DDCB d 47 BIT 0,(IX+d) 66 | DDCB d 42 BIT 0,(IX+d) 67 | DDCB d 43 BIT 0,(IX+d) 68 | DDCB d 44 BIT 0,(IX+d) 69 | DDCB d 40 BIT 0,(IX+d) 70 | DDCB d 45 BIT 0,(IX+d) 71 | FDCB d 46 BIT 0,(IY+d) 72 | FDCB d 40 BIT 0,(IY+d) 73 | FDCB d 47 BIT 0,(IY+d) 74 | FDCB d 43 BIT 0,(IY+d) 75 | FDCB d 41 BIT 0,(IY+d) 76 | FDCB d 45 BIT 0,(IY+d) 77 | FDCB d 42 BIT 0,(IY+d) 78 | FDCB d 44 BIT 0,(IY+d) 79 | CB47 BIT 0,A 80 | CB40 BIT 0,B 81 | CB41 BIT 0,C 82 | CB42 BIT 0,D 83 | CB43 BIT 0,E 84 | CB44 BIT 0,H 85 | CB45 BIT 0,L 86 | CB4E BIT 1,(HL) 87 | DDCB d 4E BIT 1,(IX+d) 88 | DDCB d 4B BIT 1,(IX+d) 89 | DDCB d 4F BIT 1,(IX+d) 90 | DDCB d 4A BIT 1,(IX+d) 91 | DDCB d 4C BIT 1,(IX+d) 92 | DDCB d 49 BIT 1,(IX+d) 93 | DDCB d 48 BIT 1,(IX+d) 94 | DDCB d 4D BIT 1,(IX+d) 95 | FDCB d 4E BIT 1,(IY+d) 96 | FDCB d 48 BIT 1,(IY+d) 97 | FDCB d 4F BIT 1,(IY+d) 98 | FDCB d 4D BIT 1,(IY+d) 99 | FDCB d 4C BIT 1,(IY+d) 100 | FDCB d 4B BIT 1,(IY+d) 101 | FDCB d 4A BIT 1,(IY+d) 102 | FDCB d 49 BIT 1,(IY+d) 103 | CB4F BIT 1,A 104 | CB48 BIT 1,B 105 | CB49 BIT 1,C 106 | CB4A BIT 1,D 107 | CB4B BIT 1,E 108 | CB4C BIT 1,H 109 | CB4D BIT 1,L 110 | CB56 BIT 2,(HL) 111 | DDCB d 56 BIT 2,(IX+d) 112 | DDCB d 53 BIT 2,(IX+d) 113 | DDCB d 52 BIT 2,(IX+d) 114 | DDCB d 51 BIT 2,(IX+d) 115 | DDCB d 54 BIT 2,(IX+d) 116 | DDCB d 55 BIT 2,(IX+d) 117 | DDCB d 57 BIT 2,(IX+d) 118 | DDCB d 50 BIT 2,(IX+d) 119 | FDCB d 56 BIT 2,(IY+d) 120 | FDCB d 53 BIT 2,(IY+d) 121 | FDCB d 57 BIT 2,(IY+d) 122 | FDCB d 55 BIT 2,(IY+d) 123 | FDCB d 50 BIT 2,(IY+d) 124 | FDCB d 51 BIT 2,(IY+d) 125 | FDCB d 52 BIT 2,(IY+d) 126 | FDCB d 54 BIT 2,(IY+d) 127 | CB57 BIT 2,A 128 | CB50 BIT 2,B 129 | CB51 BIT 2,C 130 | CB52 BIT 2,D 131 | CB53 BIT 2,E 132 | CB54 BIT 2,H 133 | CB55 BIT 2,L 134 | CB5E BIT 3,(HL) 135 | DDCB d 5E BIT 3,(IX+d) 136 | DDCB d 58 BIT 3,(IX+d) 137 | DDCB d 5A BIT 3,(IX+d) 138 | DDCB d 59 BIT 3,(IX+d) 139 | DDCB d 5B BIT 3,(IX+d) 140 | DDCB d 5F BIT 3,(IX+d) 141 | DDCB d 5D BIT 3,(IX+d) 142 | DDCB d 5C BIT 3,(IX+d) 143 | FDCB d 5E BIT 3,(IY+d) 144 | FDCB d 5B BIT 3,(IY+d) 145 | FDCB d 5A BIT 3,(IY+d) 146 | FDCB d 5F BIT 3,(IY+d) 147 | FDCB d 58 BIT 3,(IY+d) 148 | FDCB d 5C BIT 3,(IY+d) 149 | FDCB d 59 BIT 3,(IY+d) 150 | FDCB d 5D BIT 3,(IY+d) 151 | CB5F BIT 3,A 152 | CB58 BIT 3,B 153 | CB59 BIT 3,C 154 | CB5A BIT 3,D 155 | CB5B BIT 3,E 156 | CB5C BIT 3,H 157 | CB5D BIT 3,L 158 | CB66 BIT 4,(HL) 159 | DDCB d 66 BIT 4,(IX+d) 160 | DDCB d 60 BIT 4,(IX+d) 161 | DDCB d 62 BIT 4,(IX+d) 162 | DDCB d 61 BIT 4,(IX+d) 163 | DDCB d 65 BIT 4,(IX+d) 164 | DDCB d 63 BIT 4,(IX+d) 165 | DDCB d 64 BIT 4,(IX+d) 166 | DDCB d 67 BIT 4,(IX+d) 167 | FDCB d 66 BIT 4,(IY+d) 168 | FDCB d 60 BIT 4,(IY+d) 169 | FDCB d 64 BIT 4,(IY+d) 170 | FDCB d 62 BIT 4,(IY+d) 171 | FDCB d 65 BIT 4,(IY+d) 172 | FDCB d 61 BIT 4,(IY+d) 173 | FDCB d 63 BIT 4,(IY+d) 174 | FDCB d 67 BIT 4,(IY+d) 175 | CB67 BIT 4,A 176 | CB60 BIT 4,B 177 | CB61 BIT 4,C 178 | CB62 BIT 4,D 179 | CB63 BIT 4,E 180 | CB64 BIT 4,H 181 | CB65 BIT 4,L 182 | CB6E BIT 5,(HL) 183 | DDCB d 6E BIT 5,(IX+d) 184 | DDCB d 69 BIT 5,(IX+d) 185 | DDCB d 6D BIT 5,(IX+d) 186 | DDCB d 6F BIT 5,(IX+d) 187 | DDCB d 68 BIT 5,(IX+d) 188 | DDCB d 6C BIT 5,(IX+d) 189 | DDCB d 6B BIT 5,(IX+d) 190 | DDCB d 6A BIT 5,(IX+d) 191 | FDCB d 6E BIT 5,(IY+d) 192 | FDCB d 69 BIT 5,(IY+d) 193 | FDCB d 68 BIT 5,(IY+d) 194 | FDCB d 6D BIT 5,(IY+d) 195 | FDCB d 6A BIT 5,(IY+d) 196 | FDCB d 6F BIT 5,(IY+d) 197 | FDCB d 6B BIT 5,(IY+d) 198 | FDCB d 6C BIT 5,(IY+d) 199 | CB6F BIT 5,A 200 | CB68 BIT 5,B 201 | CB69 BIT 5,C 202 | CB6A BIT 5,D 203 | CB6B BIT 5,E 204 | CB6C BIT 5,H 205 | CB6D BIT 5,L 206 | CB76 BIT 6,(HL) 207 | DDCB d 76 BIT 6,(IX+d) 208 | DDCB d 77 BIT 6,(IX+d) 209 | DDCB d 75 BIT 6,(IX+d) 210 | DDCB d 74 BIT 6,(IX+d) 211 | DDCB d 73 BIT 6,(IX+d) 212 | DDCB d 71 BIT 6,(IX+d) 213 | DDCB d 70 BIT 6,(IX+d) 214 | DDCB d 72 BIT 6,(IX+d) 215 | FDCB d 76 BIT 6,(IY+d) 216 | FDCB d 73 BIT 6,(IY+d) 217 | FDCB d 70 BIT 6,(IY+d) 218 | FDCB d 75 BIT 6,(IY+d) 219 | FDCB d 74 BIT 6,(IY+d) 220 | FDCB d 72 BIT 6,(IY+d) 221 | FDCB d 77 BIT 6,(IY+d) 222 | FDCB d 71 BIT 6,(IY+d) 223 | CB77 BIT 6,A 224 | CB70 BIT 6,B 225 | CB71 BIT 6,C 226 | CB72 BIT 6,D 227 | CB73 BIT 6,E 228 | CB74 BIT 6,H 229 | CB75 BIT 6,L 230 | CB7E BIT 7,(HL) 231 | DDCB d 7E BIT 7,(IX+d) 232 | DDCB d 7B BIT 7,(IX+d) 233 | DDCB d 79 BIT 7,(IX+d) 234 | DDCB d 7F BIT 7,(IX+d) 235 | DDCB d 7C BIT 7,(IX+d) 236 | DDCB d 7A BIT 7,(IX+d) 237 | DDCB d 7D BIT 7,(IX+d) 238 | DDCB d 78 BIT 7,(IX+d) 239 | FDCB d 7E BIT 7,(IY+d) 240 | FDCB d 78 BIT 7,(IY+d) 241 | FDCB d 7A BIT 7,(IY+d) 242 | FDCB d 7F BIT 7,(IY+d) 243 | FDCB d 7C BIT 7,(IY+d) 244 | FDCB d 7B BIT 7,(IY+d) 245 | FDCB d 79 BIT 7,(IY+d) 246 | FDCB d 7D BIT 7,(IY+d) 247 | CB7F BIT 7,A 248 | CB78 BIT 7,B 249 | CB79 BIT 7,C 250 | CB7A BIT 7,D 251 | CB7B BIT 7,E 252 | CB7C BIT 7,H 253 | CB7D BIT 7,L 254 | CD nn CALL (nn) 255 | DC nn CALL C,(nn) 256 | FC nn CALL M,(nn) 257 | D4 nn CALL NC,(nn) 258 | C4 nn CALL NZ,(nn) 259 | F4 nn CALL P,(nn) 260 | EC nn CALL PE,(nn) 261 | E4 nn CALL PO,(nn) 262 | CC nn CALL Z,(nn) 263 | 3F CCF 264 | BE CP (HL) 265 | DDBE d CP (IX+d) 266 | FDBE d CP (IY+d) 267 | BF CP A 268 | B8 CP B 269 | B9 CP C 270 | BA CP D 271 | BB CP E 272 | BC CP H 273 | DDBC CP IXh 274 | DDBD CP IXl 275 | FDBC CP IYh 276 | FDBD CP IYl 277 | BD CP L 278 | FE n CP n 279 | EDA9 CPD 280 | EDB9 CPDR 281 | EDA1 CPI 282 | EDB1 CPIR 283 | 2F CPL 284 | 27 DAA 285 | 35 DEC (HL) 286 | DD35 d DEC (IX+d) 287 | FD35 d DEC (IY+d) 288 | 3D DEC A 289 | 05 DEC B 290 | 0B DEC BC 291 | 0D DEC C 292 | 15 DEC D 293 | 1B DEC DE 294 | 1D DEC E 295 | 25 DEC H 296 | 2B DEC HL 297 | DD2B DEC IX 298 | DD25 DEC IXh 299 | DD2D DEC IXl 300 | FD2B DEC IY 301 | FD25 DEC IYh 302 | FD2D DEC IYl 303 | 2D DEC L 304 | 3B DEC SP 305 | F3 DI 306 | 10 e DJNZ (PC+e) 307 | FB EI 308 | E3 EX (SP),HL 309 | DDE3 EX (SP),IX 310 | FDE3 EX (SP),IY 311 | 08 EX AF,AF' 312 | EB EX DE,HL 313 | D9 EXX 314 | 76 HALT 315 | ED46 IM 0 316 | ED6E IM 0 317 | ED4E IM 0 318 | ED66 IM 0 319 | ED56 IM 1 320 | ED76 IM 1 321 | ED5E IM 2 322 | ED7E IM 2 323 | ED78 IN A,(C) 324 | DB n IN A,(n) 325 | ED40 IN B,(C) 326 | ED48 IN C,(C) 327 | ED50 IN D,(C) 328 | ED58 IN E,(C) 329 | ED70 IN F,(C) 330 | ED60 IN H,(C) 331 | ED68 IN L,(C) 332 | 34 INC (HL) 333 | DD34 d INC (IX+d) 334 | FD34 d INC (IY+d) 335 | 3C INC A 336 | 04 INC B 337 | 03 INC BC 338 | 0C INC C 339 | 14 INC D 340 | 13 INC DE 341 | 1C INC E 342 | 24 INC H 343 | 23 INC HL 344 | DD23 INC IX 345 | DD24 INC IXh 346 | DD2C INC IXl 347 | FD23 INC IY 348 | FD24 INC IYh 349 | FD2C INC IYl 350 | 2C INC L 351 | 33 INC SP 352 | EDAA IND 353 | EDBA INDR 354 | EDA2 INI 355 | EDB2 INIR 356 | E9 JP (HL) 357 | DDE9 JP (IX) 358 | FDE9 JP (IY) 359 | C3 nn JP (nn) 360 | DA nn JP C,(nn) 361 | FA nn JP M,(nn) 362 | D2 nn JP NC,(nn) 363 | C2 nn JP NZ,(nn) 364 | F2 nn JP P,(nn) 365 | EA nn JP PE,(nn) 366 | E2 nn JP PO,(nn) 367 | CA nn JP Z,(nn) 368 | 18 e JR (PC+e) 369 | 38 e JR C,(PC+e) 370 | 30 e JR NC,(PC+e) 371 | 20 e JR NZ,(PC+e) 372 | 28 e JR Z,(PC+e) 373 | 02 LD (BC),A 374 | 12 LD (DE),A 375 | 77 LD (HL),A 376 | 70 LD (HL),B 377 | 71 LD (HL),C 378 | 72 LD (HL),D 379 | 73 LD (HL),E 380 | 74 LD (HL),H 381 | 75 LD (HL),L 382 | 36 n LD (HL),n 383 | DD77 d LD (IX+d),A 384 | DD70 d LD (IX+d),B 385 | DD71 d LD (IX+d),C 386 | DD72 d LD (IX+d),D 387 | DD73 d LD (IX+d),E 388 | DD74 d LD (IX+d),H 389 | DD75 d LD (IX+d),L 390 | DD36 d n LD (IX+d),n 391 | FD77 d LD (IY+d),A 392 | FD70 d LD (IY+d),B 393 | FD71 d LD (IY+d),C 394 | FD72 d LD (IY+d),D 395 | FD73 d LD (IY+d),E 396 | FD74 d LD (IY+d),H 397 | FD75 d LD (IY+d),L 398 | FD36 d n LD (IY+d),n 399 | 32 nn LD (nn),A 400 | ED43 nn LD (nn),BC 401 | ED53 nn LD (nn),DE 402 | ED63 nn LD (nn),HL 403 | 22 nn LD (nn),HL 404 | DD22 nn LD (nn),IX 405 | FD22 nn LD (nn),IY 406 | ED73 nn LD (nn),SP 407 | 0A LD A,(BC) 408 | 1A LD A,(DE) 409 | 7E LD A,(HL) 410 | DD7E d LD A,(IX+d) 411 | FD7E d LD A,(IY+d) 412 | 3A nn LD A,(nn) 413 | 7F LD A,A 414 | 78 LD A,B 415 | 79 LD A,C 416 | 7A LD A,D 417 | 7B LD A,E 418 | 7C LD A,H 419 | ED57 LD A,I 420 | DD7C LD A,IXh 421 | DD7D LD A,IXl 422 | FD7C LD A,IYh 423 | FD7D LD A,IYl 424 | 7D LD A,L 425 | 3E n LD A,n 426 | ED5F LD A,R 427 | DDCB d 87 LD A,RES 0,(IX+d) 428 | FDCB d 87 LD A,RES 0,(IY+d) 429 | DDCB d 8F LD A,RES 1,(IX+d) 430 | FDCB d 8F LD A,RES 1,(IY+d) 431 | DDCB d 97 LD A,RES 2,(IX+d) 432 | FDCB d 97 LD A,RES 2,(IY+d) 433 | DDCB d 9F LD A,RES 3,(IX+d) 434 | FDCB d 9F LD A,RES 3,(IY+d) 435 | DDCB d A7 LD A,RES 4,(IX+d) 436 | FDCB d A7 LD A,RES 4,(IY+d) 437 | DDCB d AF LD A,RES 5,(IX+d) 438 | FDCB d AF LD A,RES 5,(IY+d) 439 | DDCB d B7 LD A,RES 6,(IX+d) 440 | FDCB d B7 LD A,RES 6,(IY+d) 441 | DDCB d BF LD A,RES 7,(IX+d) 442 | FDCB d BF LD A,RES 7,(IY+d) 443 | DDCB d 17 LD A,RL (IX+d) 444 | FDCB d 17 LD A,RL (IY+d) 445 | DDCB d 07 LD A,RLC (IX+d) 446 | FDCB d 07 LD A,RLC (IY+d) 447 | DDCB d 1F LD A,RR (IX+d) 448 | FDCB d 1F LD A,RR (IY+d) 449 | DDCB d 0F LD A,RRC (IX+d) 450 | FDCB d 0F LD A,RRC (IY+d) 451 | DDCB d C7 LD A,SET 0,(IX+d) 452 | FDCB d C7 LD A,SET 0,(IY+d) 453 | DDCB d CF LD A,SET 1,(IX+d) 454 | FDCB d CF LD A,SET 1,(IY+d) 455 | DDCB d D7 LD A,SET 2,(IX+d) 456 | FDCB d D7 LD A,SET 2,(IY+d) 457 | DDCB d DF LD A,SET 3,(IX+d) 458 | FDCB d DF LD A,SET 3,(IY+d) 459 | DDCB d E7 LD A,SET 4,(IX+d) 460 | FDCB d E7 LD A,SET 4,(IY+d) 461 | DDCB d EF LD A,SET 5,(IX+d) 462 | FDCB d EF LD A,SET 5,(IY+d) 463 | DDCB d F7 LD A,SET 6,(IX+d) 464 | FDCB d F7 LD A,SET 6,(IY+d) 465 | DDCB d FF LD A,SET 7,(IX+d) 466 | FDCB d FF LD A,SET 7,(IY+d) 467 | DDCB d 27 LD A,SLA (IX+d) 468 | FDCB d 27 LD A,SLA (IY+d) 469 | DDCB d 37 LD A,SLL (IX+d) 470 | FDCB d 37 LD A,SLL (IY+d) 471 | DDCB d 2F LD A,SRA (IX+d) 472 | FDCB d 2F LD A,SRA (IY+d) 473 | DDCB d 3F LD A,SRL (IX+d) 474 | FDCB d 3F LD A,SRL (IY+d) 475 | 46 LD B,(HL) 476 | DD46 d LD B,(IX+d) 477 | FD46 d LD B,(IY+d) 478 | 47 LD B,A 479 | 40 LD B,B 480 | 41 LD B,C 481 | 42 LD B,D 482 | 43 LD B,E 483 | 44 LD B,H 484 | DD44 LD B,IXh 485 | DD45 LD B,IXl 486 | FD44 LD B,IYh 487 | FD45 LD B,IYl 488 | 45 LD B,L 489 | 06 n LD B,n 490 | DDCB d 80 LD B,RES 0,(IX+d) 491 | FDCB d 80 LD B,RES 0,(IY+d) 492 | DDCB d 88 LD B,RES 1,(IX+d) 493 | FDCB d 88 LD B,RES 1,(IY+d) 494 | DDCB d 90 LD B,RES 2,(IX+d) 495 | FDCB d 90 LD B,RES 2,(IY+d) 496 | DDCB d 98 LD B,RES 3,(IX+d) 497 | FDCB d 98 LD B,RES 3,(IY+d) 498 | DDCB d A0 LD B,RES 4,(IX+d) 499 | FDCB d A0 LD B,RES 4,(IY+d) 500 | DDCB d A8 LD B,RES 5,(IX+d) 501 | FDCB d A8 LD B,RES 5,(IY+d) 502 | DDCB d B0 LD B,RES 6,(IX+d) 503 | FDCB d B0 LD B,RES 6,(IY+d) 504 | DDCB d B8 LD B,RES 7,(IX+d) 505 | FDCB d B8 LD B,RES 7,(IY+d) 506 | DDCB d 10 LD B,RL (IX+d) 507 | FDCB d 10 LD B,RL (IY+d) 508 | DDCB d 00 LD B,RLC (IX+d) 509 | FDCB d 00 LD B,RLC (IY+d) 510 | DDCB d 18 LD B,RR (IX+d) 511 | FDCB d 18 LD B,RR (IY+d) 512 | DDCB d 08 LD B,RRC (IX+d) 513 | FDCB d 08 LD B,RRC (IY+d) 514 | DDCB d C0 LD B,SET 0,(IX+d) 515 | FDCB d C0 LD B,SET 0,(IY+d) 516 | DDCB d C8 LD B,SET 1,(IX+d) 517 | FDCB d C8 LD B,SET 1,(IY+d) 518 | DDCB d D0 LD B,SET 2,(IX+d) 519 | FDCB d D0 LD B,SET 2,(IY+d) 520 | DDCB d D8 LD B,SET 3,(IX+d) 521 | FDCB d D8 LD B,SET 3,(IY+d) 522 | DDCB d E0 LD B,SET 4,(IX+d) 523 | FDCB d E0 LD B,SET 4,(IY+d) 524 | DDCB d E8 LD B,SET 5,(IX+d) 525 | FDCB d E8 LD B,SET 5,(IY+d) 526 | DDCB d F0 LD B,SET 6,(IX+d) 527 | FDCB d F0 LD B,SET 6,(IY+d) 528 | DDCB d F8 LD B,SET 7,(IX+d) 529 | FDCB d F8 LD B,SET 7,(IY+d) 530 | DDCB d 20 LD B,SLA (IX+d) 531 | FDCB d 20 LD B,SLA (IY+d) 532 | DDCB d 30 LD B,SLL (IX+d) 533 | FDCB d 30 LD B,SLL (IY+d) 534 | DDCB d 28 LD B,SRA (IX+d) 535 | FDCB d 28 LD B,SRA (IY+d) 536 | DDCB d 38 LD B,SRL (IX+d) 537 | FDCB d 38 LD B,SRL (IY+d) 538 | ED4B nn LD BC,(nn) 539 | 01 nn LD BC,nn 540 | 4E LD C,(HL) 541 | DD4E d LD C,(IX+d) 542 | FD4E d LD C,(IY+d) 543 | 4F LD C,A 544 | 48 LD C,B 545 | 49 LD C,C 546 | 4A LD C,D 547 | 4B LD C,E 548 | 4C LD C,H 549 | DD4C LD C,IXh 550 | DD4D LD C,IXl 551 | FD4C LD C,IYh 552 | FD4D LD C,IYl 553 | 4D LD C,L 554 | 0E n LD C,n 555 | DDCB d 81 LD C,RES 0,(IX+d) 556 | FDCB d 81 LD C,RES 0,(IY+d) 557 | DDCB d 89 LD C,RES 1,(IX+d) 558 | FDCB d 89 LD C,RES 1,(IY+d) 559 | DDCB d 91 LD C,RES 2,(IX+d) 560 | FDCB d 91 LD C,RES 2,(IY+d) 561 | DDCB d 99 LD C,RES 3,(IX+d) 562 | FDCB d 99 LD C,RES 3,(IY+d) 563 | DDCB d A1 LD C,RES 4,(IX+d) 564 | FDCB d A1 LD C,RES 4,(IY+d) 565 | DDCB d A9 LD C,RES 5,(IX+d) 566 | FDCB d A9 LD C,RES 5,(IY+d) 567 | DDCB d B1 LD C,RES 6,(IX+d) 568 | FDCB d B1 LD C,RES 6,(IY+d) 569 | DDCB d B9 LD C,RES 7,(IX+d) 570 | FDCB d B9 LD C,RES 7,(IY+d) 571 | DDCB d 11 LD C,RL (IX+d) 572 | FDCB d 11 LD C,RL (IY+d) 573 | DDCB d 01 LD C,RLC (IX+d) 574 | FDCB d 01 LD C,RLC (IY+d) 575 | DDCB d 19 LD C,RR (IX+d) 576 | FDCB d 19 LD C,RR (IY+d) 577 | DDCB d 09 LD C,RRC (IX+d) 578 | FDCB d 09 LD C,RRC (IY+d) 579 | DDCB d C1 LD C,SET 0,(IX+d) 580 | FDCB d C1 LD C,SET 0,(IY+d) 581 | DDCB d C9 LD C,SET 1,(IX+d) 582 | FDCB d C9 LD C,SET 1,(IY+d) 583 | DDCB d D1 LD C,SET 2,(IX+d) 584 | FDCB d D1 LD C,SET 2,(IY+d) 585 | DDCB d D9 LD C,SET 3,(IX+d) 586 | FDCB d D9 LD C,SET 3,(IY+d) 587 | DDCB d E1 LD C,SET 4,(IX+d) 588 | FDCB d E1 LD C,SET 4,(IY+d) 589 | DDCB d E9 LD C,SET 5,(IX+d) 590 | FDCB d E9 LD C,SET 5,(IY+d) 591 | DDCB d F1 LD C,SET 6,(IX+d) 592 | FDCB d F1 LD C,SET 6,(IY+d) 593 | DDCB d F9 LD C,SET 7,(IX+d) 594 | FDCB d F9 LD C,SET 7,(IY+d) 595 | DDCB d 21 LD C,SLA (IX+d) 596 | FDCB d 21 LD C,SLA (IY+d) 597 | DDCB d 31 LD C,SLL (IX+d) 598 | FDCB d 31 LD C,SLL (IY+d) 599 | DDCB d 29 LD C,SRA (IX+d) 600 | FDCB d 29 LD C,SRA (IY+d) 601 | DDCB d 39 LD C,SRL (IX+d) 602 | FDCB d 39 LD C,SRL (IY+d) 603 | 56 LD D,(HL) 604 | DD56 d LD D,(IX+d) 605 | FD56 d LD D,(IY+d) 606 | 57 LD D,A 607 | 50 LD D,B 608 | 51 LD D,C 609 | 52 LD D,D 610 | 53 LD D,E 611 | 54 LD D,H 612 | DD54 LD D,IXh 613 | DD55 LD D,IXl 614 | FD54 LD D,IYh 615 | FD55 LD D,IYl 616 | 55 LD D,L 617 | 16 n LD D,n 618 | DDCB d 82 LD D,RES 0,(IX+d) 619 | FDCB d 82 LD D,RES 0,(IY+d) 620 | DDCB d 8A LD D,RES 1,(IX+d) 621 | FDCB d 8A LD D,RES 1,(IY+d) 622 | DDCB d 92 LD D,RES 2,(IX+d) 623 | FDCB d 92 LD D,RES 2,(IY+d) 624 | DDCB d 9A LD D,RES 3,(IX+d) 625 | FDCB d 9A LD D,RES 3,(IY+d) 626 | DDCB d A2 LD D,RES 4,(IX+d) 627 | FDCB d A2 LD D,RES 4,(IY+d) 628 | DDCB d AA LD D,RES 5,(IX+d) 629 | FDCB d AA LD D,RES 5,(IY+d) 630 | DDCB d B2 LD D,RES 6,(IX+d) 631 | FDCB d B2 LD D,RES 6,(IY+d) 632 | DDCB d BA LD D,RES 7,(IX+d) 633 | FDCB d BA LD D,RES 7,(IY+d) 634 | DDCB d 12 LD D,RL (IX+d) 635 | FDCB d 12 LD D,RL (IY+d) 636 | DDCB d 02 LD D,RLC (IX+d) 637 | FDCB d 02 LD D,RLC (IY+d) 638 | DDCB d 1A LD D,RR (IX+d) 639 | FDCB d 1A LD D,RR (IY+d) 640 | DDCB d 0A LD D,RRC (IX+d) 641 | FDCB d 0A LD D,RRC (IY+d) 642 | DDCB d C2 LD D,SET 0,(IX+d) 643 | FDCB d C2 LD D,SET 0,(IY+d) 644 | DDCB d CA LD D,SET 1,(IX+d) 645 | FDCB d CA LD D,SET 1,(IY+d) 646 | DDCB d D2 LD D,SET 2,(IX+d) 647 | FDCB d D2 LD D,SET 2,(IY+d) 648 | DDCB d DA LD D,SET 3,(IX+d) 649 | FDCB d DA LD D,SET 3,(IY+d) 650 | DDCB d E2 LD D,SET 4,(IX+d) 651 | FDCB d E2 LD D,SET 4,(IY+d) 652 | DDCB d EA LD D,SET 5,(IX+d) 653 | FDCB d EA LD D,SET 5,(IY+d) 654 | DDCB d F2 LD D,SET 6,(IX+d) 655 | FDCB d F2 LD D,SET 6,(IY+d) 656 | DDCB d FA LD D,SET 7,(IX+d) 657 | FDCB d FA LD D,SET 7,(IY+d) 658 | DDCB d 22 LD D,SLA (IX+d) 659 | FDCB d 22 LD D,SLA (IY+d) 660 | DDCB d 32 LD D,SLL (IX+d) 661 | FDCB d 32 LD D,SLL (IY+d) 662 | DDCB d 2A LD D,SRA (IX+d) 663 | FDCB d 2A LD D,SRA (IY+d) 664 | DDCB d 3A LD D,SRL (IX+d) 665 | FDCB d 3A LD D,SRL (IY+d) 666 | ED5B nn LD DE,(nn) 667 | 11 nn LD DE,nn 668 | 5E LD E,(HL) 669 | DD5E d LD E,(IX+d) 670 | FD5E d LD E,(IY+d) 671 | 5F LD E,A 672 | 58 LD E,B 673 | 59 LD E,C 674 | 5A LD E,D 675 | 5B LD E,E 676 | 5C LD E,H 677 | DD5C LD E,IXh 678 | DD5D LD E,IXl 679 | FD5C LD E,IYh 680 | FD5D LD E,IYl 681 | 5D LD E,L 682 | 1E n LD E,n 683 | DDCB d 83 LD E,RES 0,(IX+d) 684 | FDCB d 83 LD E,RES 0,(IY+d) 685 | DDCB d 8B LD E,RES 1,(IX+d) 686 | FDCB d 8B LD E,RES 1,(IY+d) 687 | DDCB d 93 LD E,RES 2,(IX+d) 688 | FDCB d 93 LD E,RES 2,(IY+d) 689 | DDCB d 9B LD E,RES 3,(IX+d) 690 | FDCB d 9B LD E,RES 3,(IY+d) 691 | DDCB d A3 LD E,RES 4,(IX+d) 692 | FDCB d A3 LD E,RES 4,(IY+d) 693 | DDCB d AB LD E,RES 5,(IX+d) 694 | FDCB d AB LD E,RES 5,(IY+d) 695 | DDCB d B3 LD E,RES 6,(IX+d) 696 | FDCB d B3 LD E,RES 6,(IY+d) 697 | DDCB d BB LD E,RES 7,(IX+d) 698 | FDCB d BB LD E,RES 7,(IY+d) 699 | DDCB d 13 LD E,RL (IX+d) 700 | FDCB d 13 LD E,RL (IY+d) 701 | DDCB d 03 LD E,RLC (IX+d) 702 | FDCB d 03 LD E,RLC (IY+d) 703 | DDCB d 1B LD E,RR (IX+d) 704 | FDCB d 1B LD E,RR (IY+d) 705 | DDCB d 0B LD E,RRC (IX+d) 706 | FDCB d 0B LD E,RRC (IY+d) 707 | DDCB d C3 LD E,SET 0,(IX+d) 708 | FDCB d C3 LD E,SET 0,(IY+d) 709 | DDCB d CB LD E,SET 1,(IX+d) 710 | FDCB d CB LD E,SET 1,(IY+d) 711 | DDCB d D3 LD E,SET 2,(IX+d) 712 | FDCB d D3 LD E,SET 2,(IY+d) 713 | DDCB d DB LD E,SET 3,(IX+d) 714 | FDCB d DB LD E,SET 3,(IY+d) 715 | DDCB d E3 LD E,SET 4,(IX+d) 716 | FDCB d E3 LD E,SET 4,(IY+d) 717 | DDCB d EB LD E,SET 5,(IX+d) 718 | FDCB d EB LD E,SET 5,(IY+d) 719 | DDCB d F3 LD E,SET 6,(IX+d) 720 | FDCB d F3 LD E,SET 6,(IY+d) 721 | DDCB d FB LD E,SET 7,(IX+d) 722 | FDCB d FB LD E,SET 7,(IY+d) 723 | DDCB d 23 LD E,SLA (IX+d) 724 | FDCB d 23 LD E,SLA (IY+d) 725 | DDCB d 33 LD E,SLL (IX+d) 726 | FDCB d 33 LD E,SLL (IY+d) 727 | DDCB d 2B LD E,SRA (IX+d) 728 | FDCB d 2B LD E,SRA (IY+d) 729 | DDCB d 3B LD E,SRL (IX+d) 730 | FDCB d 3B LD E,SRL (IY+d) 731 | 66 LD H,(HL) 732 | DD66 d LD H,(IX+d) 733 | FD66 d LD H,(IY+d) 734 | 67 LD H,A 735 | 60 LD H,B 736 | 61 LD H,C 737 | 62 LD H,D 738 | 63 LD H,E 739 | 64 LD H,H 740 | 65 LD H,L 741 | 26 n LD H,n 742 | DDCB d 84 LD H,RES 0,(IX+d) 743 | FDCB d 84 LD H,RES 0,(IY+d) 744 | DDCB d 8C LD H,RES 1,(IX+d) 745 | FDCB d 8C LD H,RES 1,(IY+d) 746 | DDCB d 94 LD H,RES 2,(IX+d) 747 | FDCB d 94 LD H,RES 2,(IY+d) 748 | DDCB d 9C LD H,RES 3,(IX+d) 749 | FDCB d 9C LD H,RES 3,(IY+d) 750 | DDCB d A4 LD H,RES 4,(IX+d) 751 | FDCB d A4 LD H,RES 4,(IY+d) 752 | DDCB d AC LD H,RES 5,(IX+d) 753 | FDCB d AC LD H,RES 5,(IY+d) 754 | DDCB d B4 LD H,RES 6,(IX+d) 755 | FDCB d B4 LD H,RES 6,(IY+d) 756 | DDCB d BC LD H,RES 7,(IX+d) 757 | FDCB d BC LD H,RES 7,(IY+d) 758 | DDCB d 14 LD H,RL (IX+d) 759 | FDCB d 14 LD H,RL (IY+d) 760 | DDCB d 04 LD H,RLC (IX+d) 761 | FDCB d 04 LD H,RLC (IY+d) 762 | DDCB d 1C LD H,RR (IX+d) 763 | FDCB d 1C LD H,RR (IY+d) 764 | DDCB d 0C LD H,RRC (IX+d) 765 | FDCB d 0C LD H,RRC (IY+d) 766 | DDCB d C4 LD H,SET 0,(IX+d) 767 | FDCB d C4 LD H,SET 0,(IY+d) 768 | DDCB d CC LD H,SET 1,(IX+d) 769 | FDCB d CC LD H,SET 1,(IY+d) 770 | DDCB d D4 LD H,SET 2,(IX+d) 771 | FDCB d D4 LD H,SET 2,(IY+d) 772 | DDCB d DC LD H,SET 3,(IX+d) 773 | FDCB d DC LD H,SET 3,(IY+d) 774 | DDCB d E4 LD H,SET 4,(IX+d) 775 | FDCB d E4 LD H,SET 4,(IY+d) 776 | DDCB d EC LD H,SET 5,(IX+d) 777 | FDCB d EC LD H,SET 5,(IY+d) 778 | DDCB d F4 LD H,SET 6,(IX+d) 779 | FDCB d F4 LD H,SET 6,(IY+d) 780 | DDCB d FC LD H,SET 7,(IX+d) 781 | FDCB d FC LD H,SET 7,(IY+d) 782 | DDCB d 24 LD H,SLA (IX+d) 783 | FDCB d 24 LD H,SLA (IY+d) 784 | DDCB d 34 LD H,SLL (IX+d) 785 | FDCB d 34 LD H,SLL (IY+d) 786 | DDCB d 2C LD H,SRA (IX+d) 787 | FDCB d 2C LD H,SRA (IY+d) 788 | DDCB d 3C LD H,SRL (IX+d) 789 | FDCB d 3C LD H,SRL (IY+d) 790 | ED6B nn LD HL,(nn) 791 | 2A nn LD HL,(nn) 792 | 21 nn LD HL,nn 793 | ED47 LD I,A 794 | DD2A nn LD IX,(nn) 795 | DD21 nn LD IX,nn 796 | DD67 LD IXh,A 797 | DD60 LD IXh,B 798 | DD61 LD IXh,C 799 | DD62 LD IXh,D 800 | DD63 LD IXh,E 801 | DD64 LD IXh,IXh 802 | DD65 LD IXh,IXl 803 | DD26 n LD IXh,n 804 | DD6F LD IXl,A 805 | DD68 LD IXl,B 806 | DD69 LD IXl,C 807 | DD6A LD IXl,D 808 | DD6B LD IXl,E 809 | DD6C LD IXl,IXh 810 | DD6D LD IXl,IXl 811 | DD2E n LD IXl,n 812 | FD2A nn LD IY,(nn) 813 | FD21 nn LD IY,nn 814 | FD67 LD IYh,A 815 | FD60 LD IYh,B 816 | FD61 LD IYh,C 817 | FD62 LD IYh,D 818 | FD63 LD IYh,E 819 | FD64 LD IYh,IYh 820 | FD65 LD IYh,IYl 821 | FD26 n LD IYh,n 822 | FD6F LD IYl,A 823 | FD68 LD IYl,B 824 | FD69 LD IYl,C 825 | FD6A LD IYl,D 826 | FD6B LD IYl,E 827 | FD6C LD IYl,IYh 828 | FD6D LD IYl,IYl 829 | FD2E n LD IYl,n 830 | 6E LD L,(HL) 831 | DD6E d LD L,(IX+d) 832 | FD6E d LD L,(IY+d) 833 | 6F LD L,A 834 | 68 LD L,B 835 | 69 LD L,C 836 | 6A LD L,D 837 | 6B LD L,E 838 | 6C LD L,H 839 | 6D LD L,L 840 | 2E n LD L,n 841 | DDCB d 85 LD L,RES 0,(IX+d) 842 | FDCB d 85 LD L,RES 0,(IY+d) 843 | DDCB d 8D LD L,RES 1,(IX+d) 844 | FDCB d 8D LD L,RES 1,(IY+d) 845 | DDCB d 95 LD L,RES 2,(IX+d) 846 | FDCB d 95 LD L,RES 2,(IY+d) 847 | DDCB d 9D LD L,RES 3,(IX+d) 848 | FDCB d 9D LD L,RES 3,(IY+d) 849 | DDCB d A5 LD L,RES 4,(IX+d) 850 | FDCB d A5 LD L,RES 4,(IY+d) 851 | DDCB d AD LD L,RES 5,(IX+d) 852 | FDCB d AD LD L,RES 5,(IY+d) 853 | DDCB d B5 LD L,RES 6,(IX+d) 854 | FDCB d B5 LD L,RES 6,(IY+d) 855 | DDCB d BD LD L,RES 7,(IX+d) 856 | FDCB d BD LD L,RES 7,(IY+d) 857 | DDCB d 15 LD L,RL (IX+d) 858 | FDCB d 15 LD L,RL (IY+d) 859 | DDCB d 05 LD L,RLC (IX+d) 860 | FDCB d 05 LD L,RLC (IY+d) 861 | DDCB d 1D LD L,RR (IX+d) 862 | FDCB d 1D LD L,RR (IY+d) 863 | DDCB d 0D LD L,RRC (IX+d) 864 | FDCB d 0D LD L,RRC (IY+d) 865 | DDCB d C5 LD L,SET 0,(IX+d) 866 | FDCB d C5 LD L,SET 0,(IY+d) 867 | DDCB d CD LD L,SET 1,(IX+d) 868 | FDCB d CD LD L,SET 1,(IY+d) 869 | DDCB d D5 LD L,SET 2,(IX+d) 870 | FDCB d D5 LD L,SET 2,(IY+d) 871 | DDCB d DD LD L,SET 3,(IX+d) 872 | FDCB d DD LD L,SET 3,(IY+d) 873 | DDCB d E5 LD L,SET 4,(IX+d) 874 | FDCB d E5 LD L,SET 4,(IY+d) 875 | DDCB d ED LD L,SET 5,(IX+d) 876 | FDCB d ED LD L,SET 5,(IY+d) 877 | DDCB d F5 LD L,SET 6,(IX+d) 878 | FDCB d F5 LD L,SET 6,(IY+d) 879 | DDCB d FD LD L,SET 7,(IX+d) 880 | FDCB d FD LD L,SET 7,(IY+d) 881 | DDCB d 25 LD L,SLA (IX+d) 882 | FDCB d 25 LD L,SLA (IY+d) 883 | DDCB d 35 LD L,SLL (IX+d) 884 | FDCB d 35 LD L,SLL (IY+d) 885 | DDCB d 2D LD L,SRA (IX+d) 886 | FDCB d 2D LD L,SRA (IY+d) 887 | DDCB d 3D LD L,SRL (IX+d) 888 | FDCB d 3D LD L,SRL (IY+d) 889 | ED4F LD R,A 890 | ED7B nn LD SP,(nn) 891 | F9 LD SP,HL 892 | DDF9 LD SP,IX 893 | FDF9 LD SP,IY 894 | 31 nn LD SP,nn 895 | EDA8 LDD 896 | EDB8 LDDR 897 | EDA0 LDI 898 | EDB0 LDIR 899 | ED44 NEG 900 | ED64 NEG 901 | ED6C NEG 902 | ED74 NEG 903 | ED5C NEG 904 | ED7C NEG 905 | ED54 NEG 906 | ED4C NEG 907 | 00 NOP 908 | B6 OR (HL) 909 | DDB6 d OR (IX+d) 910 | FDB6 d OR (IY+d) 911 | B7 OR A 912 | B0 OR B 913 | B1 OR C 914 | B2 OR D 915 | B3 OR E 916 | B4 OR H 917 | DDB4 OR IXh 918 | DDB5 OR IXl 919 | FDB4 OR IYh 920 | FDB5 OR IYl 921 | B5 OR L 922 | F6 n OR n 923 | EDBB OTDR 924 | EDB3 OTIR 925 | ED71 OUT (C),0 926 | ED79 OUT (C),A 927 | ED41 OUT (C),B 928 | ED49 OUT (C),C 929 | ED51 OUT (C),D 930 | ED59 OUT (C),E 931 | ED61 OUT (C),H 932 | ED69 OUT (C),L 933 | D3 n OUT (n),A 934 | EDAB OUTD 935 | EDA3 OUTI 936 | F1 POP AF 937 | C1 POP BC 938 | D1 POP DE 939 | E1 POP HL 940 | DDE1 POP IX 941 | FDE1 POP IY 942 | F5 PUSH AF 943 | C5 PUSH BC 944 | D5 PUSH DE 945 | E5 PUSH HL 946 | DDE5 PUSH IX 947 | FDE5 PUSH IY 948 | CB86 RES 0,(HL) 949 | DDCB d 86 RES 0,(IX+d) 950 | FDCB d 86 RES 0,(IY+d) 951 | CB87 RES 0,A 952 | CB80 RES 0,B 953 | CB81 RES 0,C 954 | CB82 RES 0,D 955 | CB83 RES 0,E 956 | CB84 RES 0,H 957 | CB85 RES 0,L 958 | CB8E RES 1,(HL) 959 | DDCB d 8E RES 1,(IX+d) 960 | FDCB d 8E RES 1,(IY+d) 961 | CB8F RES 1,A 962 | CB88 RES 1,B 963 | CB89 RES 1,C 964 | CB8A RES 1,D 965 | CB8B RES 1,E 966 | CB8C RES 1,H 967 | CB8D RES 1,L 968 | CB96 RES 2,(HL) 969 | DDCB d 96 RES 2,(IX+d) 970 | FDCB d 96 RES 2,(IY+d) 971 | CB97 RES 2,A 972 | CB90 RES 2,B 973 | CB91 RES 2,C 974 | CB92 RES 2,D 975 | CB93 RES 2,E 976 | CB94 RES 2,H 977 | CB95 RES 2,L 978 | CB9E RES 3,(HL) 979 | DDCB d 9E RES 3,(IX+d) 980 | FDCB d 9E RES 3,(IY+d) 981 | CB9F RES 3,A 982 | CB98 RES 3,B 983 | CB99 RES 3,C 984 | CB9A RES 3,D 985 | CB9B RES 3,E 986 | CB9C RES 3,H 987 | CB9D RES 3,L 988 | CBA6 RES 4,(HL) 989 | DDCB d A6 RES 4,(IX+d) 990 | FDCB d A6 RES 4,(IY+d) 991 | CBA7 RES 4,A 992 | CBA0 RES 4,B 993 | CBA1 RES 4,C 994 | CBA2 RES 4,D 995 | CBA3 RES 4,E 996 | CBA4 RES 4,H 997 | CBA5 RES 4,L 998 | CBAE RES 5,(HL) 999 | DDCB d AE RES 5,(IX+d) 1000 | FDCB d AE RES 5,(IY+d) 1001 | CBAF RES 5,A 1002 | CBA8 RES 5,B 1003 | CBA9 RES 5,C 1004 | CBAA RES 5,D 1005 | CBAB RES 5,E 1006 | CBAC RES 5,H 1007 | CBAD RES 5,L 1008 | CBB6 RES 6,(HL) 1009 | DDCB d B6 RES 6,(IX+d) 1010 | FDCB d B6 RES 6,(IY+d) 1011 | CBB7 RES 6,A 1012 | CBB0 RES 6,B 1013 | CBB1 RES 6,C 1014 | CBB2 RES 6,D 1015 | CBB3 RES 6,E 1016 | CBB4 RES 6,H 1017 | CBB5 RES 6,L 1018 | CBBE RES 7,(HL) 1019 | DDCB d BE RES 7,(IX+d) 1020 | FDCB d BE RES 7,(IY+d) 1021 | CBBF RES 7,A 1022 | CBB8 RES 7,B 1023 | CBB9 RES 7,C 1024 | CBBA RES 7,D 1025 | CBBB RES 7,E 1026 | CBBC RES 7,H 1027 | CBBD RES 7,L 1028 | C9 RET 1029 | D8 RET C 1030 | F8 RET M 1031 | D0 RET NC 1032 | C0 RET NZ 1033 | F0 RET P 1034 | E8 RET PE 1035 | E0 RET PO 1036 | C8 RET Z 1037 | ED4D RETI 1038 | ED45 RETN 1039 | ED55 RETN 1040 | ED65 RETN 1041 | ED5D RETN 1042 | ED75 RETN 1043 | ED6D RETN 1044 | ED7D RETN 1045 | CB16 RL (HL) 1046 | DDCB d 16 RL (IX+d) 1047 | FDCB d 16 RL (IY+d) 1048 | CB17 RL A 1049 | CB10 RL B 1050 | CB11 RL C 1051 | CB12 RL D 1052 | CB13 RL E 1053 | CB14 RL H 1054 | CB15 RL L 1055 | 17 RLA 1056 | CB06 RLC (HL) 1057 | DDCB d 06 RLC (IX+d) 1058 | FDCB d 06 RLC (IY+d) 1059 | CB07 RLC A 1060 | CB00 RLC B 1061 | CB01 RLC C 1062 | CB02 RLC D 1063 | CB03 RLC E 1064 | CB04 RLC H 1065 | CB05 RLC L 1066 | 07 RLCA 1067 | ED6F RLD 1068 | CB1E RR (HL) 1069 | DDCB d 1E RR (IX+d) 1070 | FDCB d 1E RR (IY+d) 1071 | CB1F RR A 1072 | CB18 RR B 1073 | CB19 RR C 1074 | CB1A RR D 1075 | CB1B RR E 1076 | CB1C RR H 1077 | CB1D RR L 1078 | 1F RRA 1079 | CB0E RRC (HL) 1080 | DDCB d 0E RRC (IX+d) 1081 | FDCB d 0E RRC (IY+d) 1082 | CB0F RRC A 1083 | CB08 RRC B 1084 | CB09 RRC C 1085 | CB0A RRC D 1086 | CB0B RRC E 1087 | CB0C RRC H 1088 | CB0D RRC L 1089 | 0F RRCA 1090 | ED67 RRD 1091 | C7 RST 0H 1092 | D7 RST 10H 1093 | DF RST 18H 1094 | E7 RST 20H 1095 | EF RST 28H 1096 | F7 RST 30H 1097 | FF RST 38H 1098 | CF RST 8H 1099 | 9E SBC A,(HL) 1100 | DD9E d SBC A,(IX+d) 1101 | FD9E d SBC A,(IY+d) 1102 | 9F SBC A,A 1103 | 98 SBC A,B 1104 | 99 SBC A,C 1105 | 9A SBC A,D 1106 | 9B SBC A,E 1107 | 9C SBC A,H 1108 | DD9C SBC A,IXh 1109 | DD9D SBC A,IXl 1110 | FD9C SBC A,IYh 1111 | FD9D SBC A,IYl 1112 | 9D SBC A,L 1113 | DE n SBC A,n 1114 | ED42 SBC HL,BC 1115 | ED52 SBC HL,DE 1116 | ED62 SBC HL,HL 1117 | ED72 SBC HL,SP 1118 | 37 SCF 1119 | CBC6 SET 0,(HL) 1120 | DDCB d C6 SET 0,(IX+d) 1121 | FDCB d C6 SET 0,(IY+d) 1122 | CBC7 SET 0,A 1123 | CBC0 SET 0,B 1124 | CBC1 SET 0,C 1125 | CBC2 SET 0,D 1126 | CBC3 SET 0,E 1127 | CBC4 SET 0,H 1128 | CBC5 SET 0,L 1129 | CBCE SET 1,(HL) 1130 | DDCB d CE SET 1,(IX+d) 1131 | FDCB d CE SET 1,(IY+d) 1132 | CBCF SET 1,A 1133 | CBC8 SET 1,B 1134 | CBC9 SET 1,C 1135 | CBCA SET 1,D 1136 | CBCB SET 1,E 1137 | CBCC SET 1,H 1138 | CBCD SET 1,L 1139 | CBD6 SET 2,(HL) 1140 | DDCB d D6 SET 2,(IX+d) 1141 | FDCB d D6 SET 2,(IY+d) 1142 | CBD7 SET 2,A 1143 | CBD0 SET 2,B 1144 | CBD1 SET 2,C 1145 | CBD2 SET 2,D 1146 | CBD3 SET 2,E 1147 | CBD4 SET 2,H 1148 | CBD5 SET 2,L 1149 | CBDE SET 3,(HL) 1150 | DDCB d DE SET 3,(IX+d) 1151 | FDCB d DE SET 3,(IY+d) 1152 | CBDF SET 3,A 1153 | CBD8 SET 3,B 1154 | CBD9 SET 3,C 1155 | CBDA SET 3,D 1156 | CBDB SET 3,E 1157 | CBDC SET 3,H 1158 | CBDD SET 3,L 1159 | CBE6 SET 4,(HL) 1160 | DDCB d E6 SET 4,(IX+d) 1161 | FDCB d E6 SET 4,(IY+d) 1162 | CBE7 SET 4,A 1163 | CBE0 SET 4,B 1164 | CBE1 SET 4,C 1165 | CBE2 SET 4,D 1166 | CBE3 SET 4,E 1167 | CBE4 SET 4,H 1168 | CBE5 SET 4,L 1169 | CBEE SET 5,(HL) 1170 | DDCB d EE SET 5,(IX+d) 1171 | FDCB d EE SET 5,(IY+d) 1172 | CBEF SET 5,A 1173 | CBE8 SET 5,B 1174 | CBE9 SET 5,C 1175 | CBEA SET 5,D 1176 | CBEB SET 5,E 1177 | CBEC SET 5,H 1178 | CBED SET 5,L 1179 | CBF6 SET 6,(HL) 1180 | DDCB d F6 SET 6,(IX+d) 1181 | FDCB d F6 SET 6,(IY+d) 1182 | CBF7 SET 6,A 1183 | CBF0 SET 6,B 1184 | CBF1 SET 6,C 1185 | CBF2 SET 6,D 1186 | CBF3 SET 6,E 1187 | CBF4 SET 6,H 1188 | CBF5 SET 6,L 1189 | CBFE SET 7,(HL) 1190 | DDCB d FE SET 7,(IX+d) 1191 | FDCB d FE SET 7,(IY+d) 1192 | CBFF SET 7,A 1193 | CBF8 SET 7,B 1194 | CBF9 SET 7,C 1195 | CBFA SET 7,D 1196 | CBFB SET 7,E 1197 | CBFC SET 7,H 1198 | CBFD SET 7,L 1199 | CB26 SLA (HL) 1200 | DDCB d 26 SLA (IX+d) 1201 | FDCB d 26 SLA (IY+d) 1202 | CB27 SLA A 1203 | CB20 SLA B 1204 | CB21 SLA C 1205 | CB22 SLA D 1206 | CB23 SLA E 1207 | CB24 SLA H 1208 | CB25 SLA L 1209 | CB36 SLL (HL) 1210 | DDCB d 36 SLL (IX+d) 1211 | FDCB d 36 SLL (IY+d) 1212 | CB37 SLL A 1213 | CB30 SLL B 1214 | CB31 SLL C 1215 | CB32 SLL D 1216 | CB33 SLL E 1217 | CB34 SLL H 1218 | CB35 SLL L 1219 | CB2E SRA (HL) 1220 | DDCB d 2E SRA (IX+d) 1221 | FDCB d 2E SRA (IY+d) 1222 | CB2F SRA A 1223 | CB28 SRA B 1224 | CB29 SRA C 1225 | CB2A SRA D 1226 | CB2B SRA E 1227 | CB2C SRA H 1228 | CB2D SRA L 1229 | CB3E SRL (HL) 1230 | DDCB d 3E SRL (IX+d) 1231 | FDCB d 3E SRL (IY+d) 1232 | CB3F SRL A 1233 | CB38 SRL B 1234 | CB39 SRL C 1235 | CB3A SRL D 1236 | CB3B SRL E 1237 | CB3C SRL H 1238 | CB3D SRL L 1239 | 96 SUB A,(HL) 1240 | DD96 d SUB A,(IX+d) 1241 | FD96 d SUB A,(IY+d) 1242 | 97 SUB A,A 1243 | 90 SUB A,B 1244 | 91 SUB A,C 1245 | 92 SUB A,D 1246 | 93 SUB A,E 1247 | 94 SUB A,H 1248 | DD94 SUB A,IXh 1249 | DD95 SUB A,IXl 1250 | FD94 SUB A,IYh 1251 | FD95 SUB A,IYl 1252 | 95 SUB A,L 1253 | D6 n SUB A,n 1254 | AE XOR (HL) 1255 | DDAE d XOR (IX+d) 1256 | FDAE d XOR (IY+d) 1257 | AF XOR A 1258 | A8 XOR B 1259 | A9 XOR C 1260 | AA XOR D 1261 | AB XOR E 1262 | AC XOR H 1263 | DDAC XOR IXh 1264 | DDAD XOR IXl 1265 | FDAC XOR IYh 1266 | FDAD XOR IYl 1267 | AD XOR L 1268 | EE n XOR n 1269 | -------------------------------------------------------------------------------- /codegen/opcodes_decl.h: -------------------------------------------------------------------------------- 1 | static void ADC_A_off_HL (Z80Context* ctx); 2 | static void ADC_A_off_IX_d (Z80Context* ctx); 3 | static void ADC_A_off_IY_d (Z80Context* ctx); 4 | static void ADC_A_A (Z80Context* ctx); 5 | static void ADC_A_B (Z80Context* ctx); 6 | static void ADC_A_C (Z80Context* ctx); 7 | static void ADC_A_D (Z80Context* ctx); 8 | static void ADC_A_E (Z80Context* ctx); 9 | static void ADC_A_H (Z80Context* ctx); 10 | static void ADC_A_IXh (Z80Context* ctx); 11 | static void ADC_A_IXl (Z80Context* ctx); 12 | static void ADC_A_IYh (Z80Context* ctx); 13 | static void ADC_A_IYl (Z80Context* ctx); 14 | static void ADC_A_L (Z80Context* ctx); 15 | static void ADC_A_n (Z80Context* ctx); 16 | static void ADC_HL_BC (Z80Context* ctx); 17 | static void ADC_HL_DE (Z80Context* ctx); 18 | static void ADC_HL_HL (Z80Context* ctx); 19 | static void ADC_HL_SP (Z80Context* ctx); 20 | static void ADD_A_off_HL (Z80Context* ctx); 21 | static void ADD_A_off_IX_d (Z80Context* ctx); 22 | static void ADD_A_off_IY_d (Z80Context* ctx); 23 | static void ADD_A_A (Z80Context* ctx); 24 | static void ADD_A_B (Z80Context* ctx); 25 | static void ADD_A_C (Z80Context* ctx); 26 | static void ADD_A_D (Z80Context* ctx); 27 | static void ADD_A_E (Z80Context* ctx); 28 | static void ADD_A_H (Z80Context* ctx); 29 | static void ADD_A_IXh (Z80Context* ctx); 30 | static void ADD_A_IXl (Z80Context* ctx); 31 | static void ADD_A_IYh (Z80Context* ctx); 32 | static void ADD_A_IYl (Z80Context* ctx); 33 | static void ADD_A_L (Z80Context* ctx); 34 | static void ADD_A_n (Z80Context* ctx); 35 | static void ADD_HL_BC (Z80Context* ctx); 36 | static void ADD_HL_DE (Z80Context* ctx); 37 | static void ADD_HL_HL (Z80Context* ctx); 38 | static void ADD_HL_SP (Z80Context* ctx); 39 | static void ADD_IX_BC (Z80Context* ctx); 40 | static void ADD_IX_DE (Z80Context* ctx); 41 | static void ADD_IX_IX (Z80Context* ctx); 42 | static void ADD_IX_SP (Z80Context* ctx); 43 | static void ADD_IY_BC (Z80Context* ctx); 44 | static void ADD_IY_DE (Z80Context* ctx); 45 | static void ADD_IY_IY (Z80Context* ctx); 46 | static void ADD_IY_SP (Z80Context* ctx); 47 | static void AND_off_HL (Z80Context* ctx); 48 | static void AND_off_IX_d (Z80Context* ctx); 49 | static void AND_off_IY_d (Z80Context* ctx); 50 | static void AND_A (Z80Context* ctx); 51 | static void AND_B (Z80Context* ctx); 52 | static void AND_C (Z80Context* ctx); 53 | static void AND_D (Z80Context* ctx); 54 | static void AND_E (Z80Context* ctx); 55 | static void AND_H (Z80Context* ctx); 56 | static void AND_IXh (Z80Context* ctx); 57 | static void AND_IXl (Z80Context* ctx); 58 | static void AND_IYh (Z80Context* ctx); 59 | static void AND_IYl (Z80Context* ctx); 60 | static void AND_L (Z80Context* ctx); 61 | static void AND_n (Z80Context* ctx); 62 | static void BIT_0_off_HL (Z80Context* ctx); 63 | static void BIT_0_off_IX_d (Z80Context* ctx); 64 | static void BIT_0_off_IY_d (Z80Context* ctx); 65 | static void BIT_0_A (Z80Context* ctx); 66 | static void BIT_0_B (Z80Context* ctx); 67 | static void BIT_0_C (Z80Context* ctx); 68 | static void BIT_0_D (Z80Context* ctx); 69 | static void BIT_0_E (Z80Context* ctx); 70 | static void BIT_0_H (Z80Context* ctx); 71 | static void BIT_0_L (Z80Context* ctx); 72 | static void BIT_1_off_HL (Z80Context* ctx); 73 | static void BIT_1_off_IX_d (Z80Context* ctx); 74 | static void BIT_1_off_IY_d (Z80Context* ctx); 75 | static void BIT_1_A (Z80Context* ctx); 76 | static void BIT_1_B (Z80Context* ctx); 77 | static void BIT_1_C (Z80Context* ctx); 78 | static void BIT_1_D (Z80Context* ctx); 79 | static void BIT_1_E (Z80Context* ctx); 80 | static void BIT_1_H (Z80Context* ctx); 81 | static void BIT_1_L (Z80Context* ctx); 82 | static void BIT_2_off_HL (Z80Context* ctx); 83 | static void BIT_2_off_IX_d (Z80Context* ctx); 84 | static void BIT_2_off_IY_d (Z80Context* ctx); 85 | static void BIT_2_A (Z80Context* ctx); 86 | static void BIT_2_B (Z80Context* ctx); 87 | static void BIT_2_C (Z80Context* ctx); 88 | static void BIT_2_D (Z80Context* ctx); 89 | static void BIT_2_E (Z80Context* ctx); 90 | static void BIT_2_H (Z80Context* ctx); 91 | static void BIT_2_L (Z80Context* ctx); 92 | static void BIT_3_off_HL (Z80Context* ctx); 93 | static void BIT_3_off_IX_d (Z80Context* ctx); 94 | static void BIT_3_off_IY_d (Z80Context* ctx); 95 | static void BIT_3_A (Z80Context* ctx); 96 | static void BIT_3_B (Z80Context* ctx); 97 | static void BIT_3_C (Z80Context* ctx); 98 | static void BIT_3_D (Z80Context* ctx); 99 | static void BIT_3_E (Z80Context* ctx); 100 | static void BIT_3_H (Z80Context* ctx); 101 | static void BIT_3_L (Z80Context* ctx); 102 | static void BIT_4_off_HL (Z80Context* ctx); 103 | static void BIT_4_off_IX_d (Z80Context* ctx); 104 | static void BIT_4_off_IY_d (Z80Context* ctx); 105 | static void BIT_4_A (Z80Context* ctx); 106 | static void BIT_4_B (Z80Context* ctx); 107 | static void BIT_4_C (Z80Context* ctx); 108 | static void BIT_4_D (Z80Context* ctx); 109 | static void BIT_4_E (Z80Context* ctx); 110 | static void BIT_4_H (Z80Context* ctx); 111 | static void BIT_4_L (Z80Context* ctx); 112 | static void BIT_5_off_HL (Z80Context* ctx); 113 | static void BIT_5_off_IX_d (Z80Context* ctx); 114 | static void BIT_5_off_IY_d (Z80Context* ctx); 115 | static void BIT_5_A (Z80Context* ctx); 116 | static void BIT_5_B (Z80Context* ctx); 117 | static void BIT_5_C (Z80Context* ctx); 118 | static void BIT_5_D (Z80Context* ctx); 119 | static void BIT_5_E (Z80Context* ctx); 120 | static void BIT_5_H (Z80Context* ctx); 121 | static void BIT_5_L (Z80Context* ctx); 122 | static void BIT_6_off_HL (Z80Context* ctx); 123 | static void BIT_6_off_IX_d (Z80Context* ctx); 124 | static void BIT_6_off_IY_d (Z80Context* ctx); 125 | static void BIT_6_A (Z80Context* ctx); 126 | static void BIT_6_B (Z80Context* ctx); 127 | static void BIT_6_C (Z80Context* ctx); 128 | static void BIT_6_D (Z80Context* ctx); 129 | static void BIT_6_E (Z80Context* ctx); 130 | static void BIT_6_H (Z80Context* ctx); 131 | static void BIT_6_L (Z80Context* ctx); 132 | static void BIT_7_off_HL (Z80Context* ctx); 133 | static void BIT_7_off_IX_d (Z80Context* ctx); 134 | static void BIT_7_off_IY_d (Z80Context* ctx); 135 | static void BIT_7_A (Z80Context* ctx); 136 | static void BIT_7_B (Z80Context* ctx); 137 | static void BIT_7_C (Z80Context* ctx); 138 | static void BIT_7_D (Z80Context* ctx); 139 | static void BIT_7_E (Z80Context* ctx); 140 | static void BIT_7_H (Z80Context* ctx); 141 | static void BIT_7_L (Z80Context* ctx); 142 | static void CALL_off_nn (Z80Context* ctx); 143 | static void CALL_C_off_nn (Z80Context* ctx); 144 | static void CALL_M_off_nn (Z80Context* ctx); 145 | static void CALL_NC_off_nn (Z80Context* ctx); 146 | static void CALL_NZ_off_nn (Z80Context* ctx); 147 | static void CALL_P_off_nn (Z80Context* ctx); 148 | static void CALL_PE_off_nn (Z80Context* ctx); 149 | static void CALL_PO_off_nn (Z80Context* ctx); 150 | static void CALL_Z_off_nn (Z80Context* ctx); 151 | static void CCF (Z80Context* ctx); 152 | static void CP_off_HL (Z80Context* ctx); 153 | static void CP_off_IX_d (Z80Context* ctx); 154 | static void CP_off_IY_d (Z80Context* ctx); 155 | static void CP_A (Z80Context* ctx); 156 | static void CP_B (Z80Context* ctx); 157 | static void CP_C (Z80Context* ctx); 158 | static void CP_D (Z80Context* ctx); 159 | static void CP_E (Z80Context* ctx); 160 | static void CP_H (Z80Context* ctx); 161 | static void CP_IXh (Z80Context* ctx); 162 | static void CP_IXl (Z80Context* ctx); 163 | static void CP_IYh (Z80Context* ctx); 164 | static void CP_IYl (Z80Context* ctx); 165 | static void CP_L (Z80Context* ctx); 166 | static void CP_n (Z80Context* ctx); 167 | static void CPD (Z80Context* ctx); 168 | static void CPDR (Z80Context* ctx); 169 | static void CPI (Z80Context* ctx); 170 | static void CPIR (Z80Context* ctx); 171 | static void CPL (Z80Context* ctx); 172 | static void DAA (Z80Context* ctx); 173 | static void DEC_off_HL (Z80Context* ctx); 174 | static void DEC_off_IX_d (Z80Context* ctx); 175 | static void DEC_off_IY_d (Z80Context* ctx); 176 | static void DEC_A (Z80Context* ctx); 177 | static void DEC_B (Z80Context* ctx); 178 | static void DEC_BC (Z80Context* ctx); 179 | static void DEC_C (Z80Context* ctx); 180 | static void DEC_D (Z80Context* ctx); 181 | static void DEC_DE (Z80Context* ctx); 182 | static void DEC_E (Z80Context* ctx); 183 | static void DEC_H (Z80Context* ctx); 184 | static void DEC_HL (Z80Context* ctx); 185 | static void DEC_IX (Z80Context* ctx); 186 | static void DEC_IXh (Z80Context* ctx); 187 | static void DEC_IXl (Z80Context* ctx); 188 | static void DEC_IY (Z80Context* ctx); 189 | static void DEC_IYh (Z80Context* ctx); 190 | static void DEC_IYl (Z80Context* ctx); 191 | static void DEC_L (Z80Context* ctx); 192 | static void DEC_SP (Z80Context* ctx); 193 | static void DI (Z80Context* ctx); 194 | static void DJNZ_off_PC_e (Z80Context* ctx); 195 | static void EI (Z80Context* ctx); 196 | static void EX_off_SP_HL (Z80Context* ctx); 197 | static void EX_off_SP_IX (Z80Context* ctx); 198 | static void EX_off_SP_IY (Z80Context* ctx); 199 | static void EX_AF_AF_ (Z80Context* ctx); 200 | static void EX_DE_HL (Z80Context* ctx); 201 | static void EXX (Z80Context* ctx); 202 | static void HALT (Z80Context* ctx); 203 | static void IM_0 (Z80Context* ctx); 204 | static void IM_1 (Z80Context* ctx); 205 | static void IM_2 (Z80Context* ctx); 206 | static void IN_A_off_C (Z80Context* ctx); 207 | static void IN_A_off_n (Z80Context* ctx); 208 | static void IN_B_off_C (Z80Context* ctx); 209 | static void IN_C_off_C (Z80Context* ctx); 210 | static void IN_D_off_C (Z80Context* ctx); 211 | static void IN_E_off_C (Z80Context* ctx); 212 | static void IN_F_off_C (Z80Context* ctx); 213 | static void IN_H_off_C (Z80Context* ctx); 214 | static void IN_L_off_C (Z80Context* ctx); 215 | static void INC_off_HL (Z80Context* ctx); 216 | static void INC_off_IX_d (Z80Context* ctx); 217 | static void INC_off_IY_d (Z80Context* ctx); 218 | static void INC_A (Z80Context* ctx); 219 | static void INC_B (Z80Context* ctx); 220 | static void INC_BC (Z80Context* ctx); 221 | static void INC_C (Z80Context* ctx); 222 | static void INC_D (Z80Context* ctx); 223 | static void INC_DE (Z80Context* ctx); 224 | static void INC_E (Z80Context* ctx); 225 | static void INC_H (Z80Context* ctx); 226 | static void INC_HL (Z80Context* ctx); 227 | static void INC_IX (Z80Context* ctx); 228 | static void INC_IXh (Z80Context* ctx); 229 | static void INC_IXl (Z80Context* ctx); 230 | static void INC_IY (Z80Context* ctx); 231 | static void INC_IYh (Z80Context* ctx); 232 | static void INC_IYl (Z80Context* ctx); 233 | static void INC_L (Z80Context* ctx); 234 | static void INC_SP (Z80Context* ctx); 235 | static void IND (Z80Context* ctx); 236 | static void INDR (Z80Context* ctx); 237 | static void INI (Z80Context* ctx); 238 | static void INIR (Z80Context* ctx); 239 | static void JP_off_HL (Z80Context* ctx); 240 | static void JP_off_IX (Z80Context* ctx); 241 | static void JP_off_IY (Z80Context* ctx); 242 | static void JP_off_nn (Z80Context* ctx); 243 | static void JP_C_off_nn (Z80Context* ctx); 244 | static void JP_M_off_nn (Z80Context* ctx); 245 | static void JP_NC_off_nn (Z80Context* ctx); 246 | static void JP_NZ_off_nn (Z80Context* ctx); 247 | static void JP_P_off_nn (Z80Context* ctx); 248 | static void JP_PE_off_nn (Z80Context* ctx); 249 | static void JP_PO_off_nn (Z80Context* ctx); 250 | static void JP_Z_off_nn (Z80Context* ctx); 251 | static void JR_off_PC_e (Z80Context* ctx); 252 | static void JR_C_off_PC_e (Z80Context* ctx); 253 | static void JR_NC_off_PC_e (Z80Context* ctx); 254 | static void JR_NZ_off_PC_e (Z80Context* ctx); 255 | static void JR_Z_off_PC_e (Z80Context* ctx); 256 | static void LD_off_BC_A (Z80Context* ctx); 257 | static void LD_off_DE_A (Z80Context* ctx); 258 | static void LD_off_HL_A (Z80Context* ctx); 259 | static void LD_off_HL_B (Z80Context* ctx); 260 | static void LD_off_HL_C (Z80Context* ctx); 261 | static void LD_off_HL_D (Z80Context* ctx); 262 | static void LD_off_HL_E (Z80Context* ctx); 263 | static void LD_off_HL_H (Z80Context* ctx); 264 | static void LD_off_HL_L (Z80Context* ctx); 265 | static void LD_off_HL_n (Z80Context* ctx); 266 | static void LD_off_IX_d_A (Z80Context* ctx); 267 | static void LD_off_IX_d_B (Z80Context* ctx); 268 | static void LD_off_IX_d_C (Z80Context* ctx); 269 | static void LD_off_IX_d_D (Z80Context* ctx); 270 | static void LD_off_IX_d_E (Z80Context* ctx); 271 | static void LD_off_IX_d_H (Z80Context* ctx); 272 | static void LD_off_IX_d_L (Z80Context* ctx); 273 | static void LD_off_IX_d_n (Z80Context* ctx); 274 | static void LD_off_IY_d_A (Z80Context* ctx); 275 | static void LD_off_IY_d_B (Z80Context* ctx); 276 | static void LD_off_IY_d_C (Z80Context* ctx); 277 | static void LD_off_IY_d_D (Z80Context* ctx); 278 | static void LD_off_IY_d_E (Z80Context* ctx); 279 | static void LD_off_IY_d_H (Z80Context* ctx); 280 | static void LD_off_IY_d_L (Z80Context* ctx); 281 | static void LD_off_IY_d_n (Z80Context* ctx); 282 | static void LD_off_nn_A (Z80Context* ctx); 283 | static void LD_off_nn_BC (Z80Context* ctx); 284 | static void LD_off_nn_DE (Z80Context* ctx); 285 | static void LD_off_nn_HL (Z80Context* ctx); 286 | static void LD_off_nn_IX (Z80Context* ctx); 287 | static void LD_off_nn_IY (Z80Context* ctx); 288 | static void LD_off_nn_SP (Z80Context* ctx); 289 | static void LD_A_off_BC (Z80Context* ctx); 290 | static void LD_A_off_DE (Z80Context* ctx); 291 | static void LD_A_off_HL (Z80Context* ctx); 292 | static void LD_A_off_IX_d (Z80Context* ctx); 293 | static void LD_A_off_IY_d (Z80Context* ctx); 294 | static void LD_A_off_nn (Z80Context* ctx); 295 | static void LD_A_A (Z80Context* ctx); 296 | static void LD_A_B (Z80Context* ctx); 297 | static void LD_A_C (Z80Context* ctx); 298 | static void LD_A_D (Z80Context* ctx); 299 | static void LD_A_E (Z80Context* ctx); 300 | static void LD_A_H (Z80Context* ctx); 301 | static void LD_A_I (Z80Context* ctx); 302 | static void LD_A_IXh (Z80Context* ctx); 303 | static void LD_A_IXl (Z80Context* ctx); 304 | static void LD_A_IYh (Z80Context* ctx); 305 | static void LD_A_IYl (Z80Context* ctx); 306 | static void LD_A_L (Z80Context* ctx); 307 | static void LD_A_n (Z80Context* ctx); 308 | static void LD_A_R (Z80Context* ctx); 309 | static void LD_A_RES_0_off_IX_d (Z80Context* ctx); 310 | static void LD_A_RES_0_off_IY_d (Z80Context* ctx); 311 | static void LD_A_RES_1_off_IX_d (Z80Context* ctx); 312 | static void LD_A_RES_1_off_IY_d (Z80Context* ctx); 313 | static void LD_A_RES_2_off_IX_d (Z80Context* ctx); 314 | static void LD_A_RES_2_off_IY_d (Z80Context* ctx); 315 | static void LD_A_RES_3_off_IX_d (Z80Context* ctx); 316 | static void LD_A_RES_3_off_IY_d (Z80Context* ctx); 317 | static void LD_A_RES_4_off_IX_d (Z80Context* ctx); 318 | static void LD_A_RES_4_off_IY_d (Z80Context* ctx); 319 | static void LD_A_RES_5_off_IX_d (Z80Context* ctx); 320 | static void LD_A_RES_5_off_IY_d (Z80Context* ctx); 321 | static void LD_A_RES_6_off_IX_d (Z80Context* ctx); 322 | static void LD_A_RES_6_off_IY_d (Z80Context* ctx); 323 | static void LD_A_RES_7_off_IX_d (Z80Context* ctx); 324 | static void LD_A_RES_7_off_IY_d (Z80Context* ctx); 325 | static void LD_A_RL_off_IX_d (Z80Context* ctx); 326 | static void LD_A_RL_off_IY_d (Z80Context* ctx); 327 | static void LD_A_RLC_off_IX_d (Z80Context* ctx); 328 | static void LD_A_RLC_off_IY_d (Z80Context* ctx); 329 | static void LD_A_RR_off_IX_d (Z80Context* ctx); 330 | static void LD_A_RR_off_IY_d (Z80Context* ctx); 331 | static void LD_A_RRC_off_IX_d (Z80Context* ctx); 332 | static void LD_A_RRC_off_IY_d (Z80Context* ctx); 333 | static void LD_A_SET_0_off_IX_d (Z80Context* ctx); 334 | static void LD_A_SET_0_off_IY_d (Z80Context* ctx); 335 | static void LD_A_SET_1_off_IX_d (Z80Context* ctx); 336 | static void LD_A_SET_1_off_IY_d (Z80Context* ctx); 337 | static void LD_A_SET_2_off_IX_d (Z80Context* ctx); 338 | static void LD_A_SET_2_off_IY_d (Z80Context* ctx); 339 | static void LD_A_SET_3_off_IX_d (Z80Context* ctx); 340 | static void LD_A_SET_3_off_IY_d (Z80Context* ctx); 341 | static void LD_A_SET_4_off_IX_d (Z80Context* ctx); 342 | static void LD_A_SET_4_off_IY_d (Z80Context* ctx); 343 | static void LD_A_SET_5_off_IX_d (Z80Context* ctx); 344 | static void LD_A_SET_5_off_IY_d (Z80Context* ctx); 345 | static void LD_A_SET_6_off_IX_d (Z80Context* ctx); 346 | static void LD_A_SET_6_off_IY_d (Z80Context* ctx); 347 | static void LD_A_SET_7_off_IX_d (Z80Context* ctx); 348 | static void LD_A_SET_7_off_IY_d (Z80Context* ctx); 349 | static void LD_A_SLA_off_IX_d (Z80Context* ctx); 350 | static void LD_A_SLA_off_IY_d (Z80Context* ctx); 351 | static void LD_A_SLL_off_IX_d (Z80Context* ctx); 352 | static void LD_A_SLL_off_IY_d (Z80Context* ctx); 353 | static void LD_A_SRA_off_IX_d (Z80Context* ctx); 354 | static void LD_A_SRA_off_IY_d (Z80Context* ctx); 355 | static void LD_A_SRL_off_IX_d (Z80Context* ctx); 356 | static void LD_A_SRL_off_IY_d (Z80Context* ctx); 357 | static void LD_B_off_HL (Z80Context* ctx); 358 | static void LD_B_off_IX_d (Z80Context* ctx); 359 | static void LD_B_off_IY_d (Z80Context* ctx); 360 | static void LD_B_A (Z80Context* ctx); 361 | static void LD_B_B (Z80Context* ctx); 362 | static void LD_B_C (Z80Context* ctx); 363 | static void LD_B_D (Z80Context* ctx); 364 | static void LD_B_E (Z80Context* ctx); 365 | static void LD_B_H (Z80Context* ctx); 366 | static void LD_B_IXh (Z80Context* ctx); 367 | static void LD_B_IXl (Z80Context* ctx); 368 | static void LD_B_IYh (Z80Context* ctx); 369 | static void LD_B_IYl (Z80Context* ctx); 370 | static void LD_B_L (Z80Context* ctx); 371 | static void LD_B_n (Z80Context* ctx); 372 | static void LD_B_RES_0_off_IX_d (Z80Context* ctx); 373 | static void LD_B_RES_0_off_IY_d (Z80Context* ctx); 374 | static void LD_B_RES_1_off_IX_d (Z80Context* ctx); 375 | static void LD_B_RES_1_off_IY_d (Z80Context* ctx); 376 | static void LD_B_RES_2_off_IX_d (Z80Context* ctx); 377 | static void LD_B_RES_2_off_IY_d (Z80Context* ctx); 378 | static void LD_B_RES_3_off_IX_d (Z80Context* ctx); 379 | static void LD_B_RES_3_off_IY_d (Z80Context* ctx); 380 | static void LD_B_RES_4_off_IX_d (Z80Context* ctx); 381 | static void LD_B_RES_4_off_IY_d (Z80Context* ctx); 382 | static void LD_B_RES_5_off_IX_d (Z80Context* ctx); 383 | static void LD_B_RES_5_off_IY_d (Z80Context* ctx); 384 | static void LD_B_RES_6_off_IX_d (Z80Context* ctx); 385 | static void LD_B_RES_6_off_IY_d (Z80Context* ctx); 386 | static void LD_B_RES_7_off_IX_d (Z80Context* ctx); 387 | static void LD_B_RES_7_off_IY_d (Z80Context* ctx); 388 | static void LD_B_RL_off_IX_d (Z80Context* ctx); 389 | static void LD_B_RL_off_IY_d (Z80Context* ctx); 390 | static void LD_B_RLC_off_IX_d (Z80Context* ctx); 391 | static void LD_B_RLC_off_IY_d (Z80Context* ctx); 392 | static void LD_B_RR_off_IX_d (Z80Context* ctx); 393 | static void LD_B_RR_off_IY_d (Z80Context* ctx); 394 | static void LD_B_RRC_off_IX_d (Z80Context* ctx); 395 | static void LD_B_RRC_off_IY_d (Z80Context* ctx); 396 | static void LD_B_SET_0_off_IX_d (Z80Context* ctx); 397 | static void LD_B_SET_0_off_IY_d (Z80Context* ctx); 398 | static void LD_B_SET_1_off_IX_d (Z80Context* ctx); 399 | static void LD_B_SET_1_off_IY_d (Z80Context* ctx); 400 | static void LD_B_SET_2_off_IX_d (Z80Context* ctx); 401 | static void LD_B_SET_2_off_IY_d (Z80Context* ctx); 402 | static void LD_B_SET_3_off_IX_d (Z80Context* ctx); 403 | static void LD_B_SET_3_off_IY_d (Z80Context* ctx); 404 | static void LD_B_SET_4_off_IX_d (Z80Context* ctx); 405 | static void LD_B_SET_4_off_IY_d (Z80Context* ctx); 406 | static void LD_B_SET_5_off_IX_d (Z80Context* ctx); 407 | static void LD_B_SET_5_off_IY_d (Z80Context* ctx); 408 | static void LD_B_SET_6_off_IX_d (Z80Context* ctx); 409 | static void LD_B_SET_6_off_IY_d (Z80Context* ctx); 410 | static void LD_B_SET_7_off_IX_d (Z80Context* ctx); 411 | static void LD_B_SET_7_off_IY_d (Z80Context* ctx); 412 | static void LD_B_SLA_off_IX_d (Z80Context* ctx); 413 | static void LD_B_SLA_off_IY_d (Z80Context* ctx); 414 | static void LD_B_SLL_off_IX_d (Z80Context* ctx); 415 | static void LD_B_SLL_off_IY_d (Z80Context* ctx); 416 | static void LD_B_SRA_off_IX_d (Z80Context* ctx); 417 | static void LD_B_SRA_off_IY_d (Z80Context* ctx); 418 | static void LD_B_SRL_off_IX_d (Z80Context* ctx); 419 | static void LD_B_SRL_off_IY_d (Z80Context* ctx); 420 | static void LD_BC_off_nn (Z80Context* ctx); 421 | static void LD_BC_nn (Z80Context* ctx); 422 | static void LD_C_off_HL (Z80Context* ctx); 423 | static void LD_C_off_IX_d (Z80Context* ctx); 424 | static void LD_C_off_IY_d (Z80Context* ctx); 425 | static void LD_C_A (Z80Context* ctx); 426 | static void LD_C_B (Z80Context* ctx); 427 | static void LD_C_C (Z80Context* ctx); 428 | static void LD_C_D (Z80Context* ctx); 429 | static void LD_C_E (Z80Context* ctx); 430 | static void LD_C_H (Z80Context* ctx); 431 | static void LD_C_IXh (Z80Context* ctx); 432 | static void LD_C_IXl (Z80Context* ctx); 433 | static void LD_C_IYh (Z80Context* ctx); 434 | static void LD_C_IYl (Z80Context* ctx); 435 | static void LD_C_L (Z80Context* ctx); 436 | static void LD_C_n (Z80Context* ctx); 437 | static void LD_C_RES_0_off_IX_d (Z80Context* ctx); 438 | static void LD_C_RES_0_off_IY_d (Z80Context* ctx); 439 | static void LD_C_RES_1_off_IX_d (Z80Context* ctx); 440 | static void LD_C_RES_1_off_IY_d (Z80Context* ctx); 441 | static void LD_C_RES_2_off_IX_d (Z80Context* ctx); 442 | static void LD_C_RES_2_off_IY_d (Z80Context* ctx); 443 | static void LD_C_RES_3_off_IX_d (Z80Context* ctx); 444 | static void LD_C_RES_3_off_IY_d (Z80Context* ctx); 445 | static void LD_C_RES_4_off_IX_d (Z80Context* ctx); 446 | static void LD_C_RES_4_off_IY_d (Z80Context* ctx); 447 | static void LD_C_RES_5_off_IX_d (Z80Context* ctx); 448 | static void LD_C_RES_5_off_IY_d (Z80Context* ctx); 449 | static void LD_C_RES_6_off_IX_d (Z80Context* ctx); 450 | static void LD_C_RES_6_off_IY_d (Z80Context* ctx); 451 | static void LD_C_RES_7_off_IX_d (Z80Context* ctx); 452 | static void LD_C_RES_7_off_IY_d (Z80Context* ctx); 453 | static void LD_C_RL_off_IX_d (Z80Context* ctx); 454 | static void LD_C_RL_off_IY_d (Z80Context* ctx); 455 | static void LD_C_RLC_off_IX_d (Z80Context* ctx); 456 | static void LD_C_RLC_off_IY_d (Z80Context* ctx); 457 | static void LD_C_RR_off_IX_d (Z80Context* ctx); 458 | static void LD_C_RR_off_IY_d (Z80Context* ctx); 459 | static void LD_C_RRC_off_IX_d (Z80Context* ctx); 460 | static void LD_C_RRC_off_IY_d (Z80Context* ctx); 461 | static void LD_C_SET_0_off_IX_d (Z80Context* ctx); 462 | static void LD_C_SET_0_off_IY_d (Z80Context* ctx); 463 | static void LD_C_SET_1_off_IX_d (Z80Context* ctx); 464 | static void LD_C_SET_1_off_IY_d (Z80Context* ctx); 465 | static void LD_C_SET_2_off_IX_d (Z80Context* ctx); 466 | static void LD_C_SET_2_off_IY_d (Z80Context* ctx); 467 | static void LD_C_SET_3_off_IX_d (Z80Context* ctx); 468 | static void LD_C_SET_3_off_IY_d (Z80Context* ctx); 469 | static void LD_C_SET_4_off_IX_d (Z80Context* ctx); 470 | static void LD_C_SET_4_off_IY_d (Z80Context* ctx); 471 | static void LD_C_SET_5_off_IX_d (Z80Context* ctx); 472 | static void LD_C_SET_5_off_IY_d (Z80Context* ctx); 473 | static void LD_C_SET_6_off_IX_d (Z80Context* ctx); 474 | static void LD_C_SET_6_off_IY_d (Z80Context* ctx); 475 | static void LD_C_SET_7_off_IX_d (Z80Context* ctx); 476 | static void LD_C_SET_7_off_IY_d (Z80Context* ctx); 477 | static void LD_C_SLA_off_IX_d (Z80Context* ctx); 478 | static void LD_C_SLA_off_IY_d (Z80Context* ctx); 479 | static void LD_C_SLL_off_IX_d (Z80Context* ctx); 480 | static void LD_C_SLL_off_IY_d (Z80Context* ctx); 481 | static void LD_C_SRA_off_IX_d (Z80Context* ctx); 482 | static void LD_C_SRA_off_IY_d (Z80Context* ctx); 483 | static void LD_C_SRL_off_IX_d (Z80Context* ctx); 484 | static void LD_C_SRL_off_IY_d (Z80Context* ctx); 485 | static void LD_D_off_HL (Z80Context* ctx); 486 | static void LD_D_off_IX_d (Z80Context* ctx); 487 | static void LD_D_off_IY_d (Z80Context* ctx); 488 | static void LD_D_A (Z80Context* ctx); 489 | static void LD_D_B (Z80Context* ctx); 490 | static void LD_D_C (Z80Context* ctx); 491 | static void LD_D_D (Z80Context* ctx); 492 | static void LD_D_E (Z80Context* ctx); 493 | static void LD_D_H (Z80Context* ctx); 494 | static void LD_D_IXh (Z80Context* ctx); 495 | static void LD_D_IXl (Z80Context* ctx); 496 | static void LD_D_IYh (Z80Context* ctx); 497 | static void LD_D_IYl (Z80Context* ctx); 498 | static void LD_D_L (Z80Context* ctx); 499 | static void LD_D_n (Z80Context* ctx); 500 | static void LD_D_RES_0_off_IX_d (Z80Context* ctx); 501 | static void LD_D_RES_0_off_IY_d (Z80Context* ctx); 502 | static void LD_D_RES_1_off_IX_d (Z80Context* ctx); 503 | static void LD_D_RES_1_off_IY_d (Z80Context* ctx); 504 | static void LD_D_RES_2_off_IX_d (Z80Context* ctx); 505 | static void LD_D_RES_2_off_IY_d (Z80Context* ctx); 506 | static void LD_D_RES_3_off_IX_d (Z80Context* ctx); 507 | static void LD_D_RES_3_off_IY_d (Z80Context* ctx); 508 | static void LD_D_RES_4_off_IX_d (Z80Context* ctx); 509 | static void LD_D_RES_4_off_IY_d (Z80Context* ctx); 510 | static void LD_D_RES_5_off_IX_d (Z80Context* ctx); 511 | static void LD_D_RES_5_off_IY_d (Z80Context* ctx); 512 | static void LD_D_RES_6_off_IX_d (Z80Context* ctx); 513 | static void LD_D_RES_6_off_IY_d (Z80Context* ctx); 514 | static void LD_D_RES_7_off_IX_d (Z80Context* ctx); 515 | static void LD_D_RES_7_off_IY_d (Z80Context* ctx); 516 | static void LD_D_RL_off_IX_d (Z80Context* ctx); 517 | static void LD_D_RL_off_IY_d (Z80Context* ctx); 518 | static void LD_D_RLC_off_IX_d (Z80Context* ctx); 519 | static void LD_D_RLC_off_IY_d (Z80Context* ctx); 520 | static void LD_D_RR_off_IX_d (Z80Context* ctx); 521 | static void LD_D_RR_off_IY_d (Z80Context* ctx); 522 | static void LD_D_RRC_off_IX_d (Z80Context* ctx); 523 | static void LD_D_RRC_off_IY_d (Z80Context* ctx); 524 | static void LD_D_SET_0_off_IX_d (Z80Context* ctx); 525 | static void LD_D_SET_0_off_IY_d (Z80Context* ctx); 526 | static void LD_D_SET_1_off_IX_d (Z80Context* ctx); 527 | static void LD_D_SET_1_off_IY_d (Z80Context* ctx); 528 | static void LD_D_SET_2_off_IX_d (Z80Context* ctx); 529 | static void LD_D_SET_2_off_IY_d (Z80Context* ctx); 530 | static void LD_D_SET_3_off_IX_d (Z80Context* ctx); 531 | static void LD_D_SET_3_off_IY_d (Z80Context* ctx); 532 | static void LD_D_SET_4_off_IX_d (Z80Context* ctx); 533 | static void LD_D_SET_4_off_IY_d (Z80Context* ctx); 534 | static void LD_D_SET_5_off_IX_d (Z80Context* ctx); 535 | static void LD_D_SET_5_off_IY_d (Z80Context* ctx); 536 | static void LD_D_SET_6_off_IX_d (Z80Context* ctx); 537 | static void LD_D_SET_6_off_IY_d (Z80Context* ctx); 538 | static void LD_D_SET_7_off_IX_d (Z80Context* ctx); 539 | static void LD_D_SET_7_off_IY_d (Z80Context* ctx); 540 | static void LD_D_SLA_off_IX_d (Z80Context* ctx); 541 | static void LD_D_SLA_off_IY_d (Z80Context* ctx); 542 | static void LD_D_SLL_off_IX_d (Z80Context* ctx); 543 | static void LD_D_SLL_off_IY_d (Z80Context* ctx); 544 | static void LD_D_SRA_off_IX_d (Z80Context* ctx); 545 | static void LD_D_SRA_off_IY_d (Z80Context* ctx); 546 | static void LD_D_SRL_off_IX_d (Z80Context* ctx); 547 | static void LD_D_SRL_off_IY_d (Z80Context* ctx); 548 | static void LD_DE_off_nn (Z80Context* ctx); 549 | static void LD_DE_nn (Z80Context* ctx); 550 | static void LD_E_off_HL (Z80Context* ctx); 551 | static void LD_E_off_IX_d (Z80Context* ctx); 552 | static void LD_E_off_IY_d (Z80Context* ctx); 553 | static void LD_E_A (Z80Context* ctx); 554 | static void LD_E_B (Z80Context* ctx); 555 | static void LD_E_C (Z80Context* ctx); 556 | static void LD_E_D (Z80Context* ctx); 557 | static void LD_E_E (Z80Context* ctx); 558 | static void LD_E_H (Z80Context* ctx); 559 | static void LD_E_IXh (Z80Context* ctx); 560 | static void LD_E_IXl (Z80Context* ctx); 561 | static void LD_E_IYh (Z80Context* ctx); 562 | static void LD_E_IYl (Z80Context* ctx); 563 | static void LD_E_L (Z80Context* ctx); 564 | static void LD_E_n (Z80Context* ctx); 565 | static void LD_E_RES_0_off_IX_d (Z80Context* ctx); 566 | static void LD_E_RES_0_off_IY_d (Z80Context* ctx); 567 | static void LD_E_RES_1_off_IX_d (Z80Context* ctx); 568 | static void LD_E_RES_1_off_IY_d (Z80Context* ctx); 569 | static void LD_E_RES_2_off_IX_d (Z80Context* ctx); 570 | static void LD_E_RES_2_off_IY_d (Z80Context* ctx); 571 | static void LD_E_RES_3_off_IX_d (Z80Context* ctx); 572 | static void LD_E_RES_3_off_IY_d (Z80Context* ctx); 573 | static void LD_E_RES_4_off_IX_d (Z80Context* ctx); 574 | static void LD_E_RES_4_off_IY_d (Z80Context* ctx); 575 | static void LD_E_RES_5_off_IX_d (Z80Context* ctx); 576 | static void LD_E_RES_5_off_IY_d (Z80Context* ctx); 577 | static void LD_E_RES_6_off_IX_d (Z80Context* ctx); 578 | static void LD_E_RES_6_off_IY_d (Z80Context* ctx); 579 | static void LD_E_RES_7_off_IX_d (Z80Context* ctx); 580 | static void LD_E_RES_7_off_IY_d (Z80Context* ctx); 581 | static void LD_E_RL_off_IX_d (Z80Context* ctx); 582 | static void LD_E_RL_off_IY_d (Z80Context* ctx); 583 | static void LD_E_RLC_off_IX_d (Z80Context* ctx); 584 | static void LD_E_RLC_off_IY_d (Z80Context* ctx); 585 | static void LD_E_RR_off_IX_d (Z80Context* ctx); 586 | static void LD_E_RR_off_IY_d (Z80Context* ctx); 587 | static void LD_E_RRC_off_IX_d (Z80Context* ctx); 588 | static void LD_E_RRC_off_IY_d (Z80Context* ctx); 589 | static void LD_E_SET_0_off_IX_d (Z80Context* ctx); 590 | static void LD_E_SET_0_off_IY_d (Z80Context* ctx); 591 | static void LD_E_SET_1_off_IX_d (Z80Context* ctx); 592 | static void LD_E_SET_1_off_IY_d (Z80Context* ctx); 593 | static void LD_E_SET_2_off_IX_d (Z80Context* ctx); 594 | static void LD_E_SET_2_off_IY_d (Z80Context* ctx); 595 | static void LD_E_SET_3_off_IX_d (Z80Context* ctx); 596 | static void LD_E_SET_3_off_IY_d (Z80Context* ctx); 597 | static void LD_E_SET_4_off_IX_d (Z80Context* ctx); 598 | static void LD_E_SET_4_off_IY_d (Z80Context* ctx); 599 | static void LD_E_SET_5_off_IX_d (Z80Context* ctx); 600 | static void LD_E_SET_5_off_IY_d (Z80Context* ctx); 601 | static void LD_E_SET_6_off_IX_d (Z80Context* ctx); 602 | static void LD_E_SET_6_off_IY_d (Z80Context* ctx); 603 | static void LD_E_SET_7_off_IX_d (Z80Context* ctx); 604 | static void LD_E_SET_7_off_IY_d (Z80Context* ctx); 605 | static void LD_E_SLA_off_IX_d (Z80Context* ctx); 606 | static void LD_E_SLA_off_IY_d (Z80Context* ctx); 607 | static void LD_E_SLL_off_IX_d (Z80Context* ctx); 608 | static void LD_E_SLL_off_IY_d (Z80Context* ctx); 609 | static void LD_E_SRA_off_IX_d (Z80Context* ctx); 610 | static void LD_E_SRA_off_IY_d (Z80Context* ctx); 611 | static void LD_E_SRL_off_IX_d (Z80Context* ctx); 612 | static void LD_E_SRL_off_IY_d (Z80Context* ctx); 613 | static void LD_H_off_HL (Z80Context* ctx); 614 | static void LD_H_off_IX_d (Z80Context* ctx); 615 | static void LD_H_off_IY_d (Z80Context* ctx); 616 | static void LD_H_A (Z80Context* ctx); 617 | static void LD_H_B (Z80Context* ctx); 618 | static void LD_H_C (Z80Context* ctx); 619 | static void LD_H_D (Z80Context* ctx); 620 | static void LD_H_E (Z80Context* ctx); 621 | static void LD_H_H (Z80Context* ctx); 622 | static void LD_H_L (Z80Context* ctx); 623 | static void LD_H_n (Z80Context* ctx); 624 | static void LD_H_RES_0_off_IX_d (Z80Context* ctx); 625 | static void LD_H_RES_0_off_IY_d (Z80Context* ctx); 626 | static void LD_H_RES_1_off_IX_d (Z80Context* ctx); 627 | static void LD_H_RES_1_off_IY_d (Z80Context* ctx); 628 | static void LD_H_RES_2_off_IX_d (Z80Context* ctx); 629 | static void LD_H_RES_2_off_IY_d (Z80Context* ctx); 630 | static void LD_H_RES_3_off_IX_d (Z80Context* ctx); 631 | static void LD_H_RES_3_off_IY_d (Z80Context* ctx); 632 | static void LD_H_RES_4_off_IX_d (Z80Context* ctx); 633 | static void LD_H_RES_4_off_IY_d (Z80Context* ctx); 634 | static void LD_H_RES_5_off_IX_d (Z80Context* ctx); 635 | static void LD_H_RES_5_off_IY_d (Z80Context* ctx); 636 | static void LD_H_RES_6_off_IX_d (Z80Context* ctx); 637 | static void LD_H_RES_6_off_IY_d (Z80Context* ctx); 638 | static void LD_H_RES_7_off_IX_d (Z80Context* ctx); 639 | static void LD_H_RES_7_off_IY_d (Z80Context* ctx); 640 | static void LD_H_RL_off_IX_d (Z80Context* ctx); 641 | static void LD_H_RL_off_IY_d (Z80Context* ctx); 642 | static void LD_H_RLC_off_IX_d (Z80Context* ctx); 643 | static void LD_H_RLC_off_IY_d (Z80Context* ctx); 644 | static void LD_H_RR_off_IX_d (Z80Context* ctx); 645 | static void LD_H_RR_off_IY_d (Z80Context* ctx); 646 | static void LD_H_RRC_off_IX_d (Z80Context* ctx); 647 | static void LD_H_RRC_off_IY_d (Z80Context* ctx); 648 | static void LD_H_SET_0_off_IX_d (Z80Context* ctx); 649 | static void LD_H_SET_0_off_IY_d (Z80Context* ctx); 650 | static void LD_H_SET_1_off_IX_d (Z80Context* ctx); 651 | static void LD_H_SET_1_off_IY_d (Z80Context* ctx); 652 | static void LD_H_SET_2_off_IX_d (Z80Context* ctx); 653 | static void LD_H_SET_2_off_IY_d (Z80Context* ctx); 654 | static void LD_H_SET_3_off_IX_d (Z80Context* ctx); 655 | static void LD_H_SET_3_off_IY_d (Z80Context* ctx); 656 | static void LD_H_SET_4_off_IX_d (Z80Context* ctx); 657 | static void LD_H_SET_4_off_IY_d (Z80Context* ctx); 658 | static void LD_H_SET_5_off_IX_d (Z80Context* ctx); 659 | static void LD_H_SET_5_off_IY_d (Z80Context* ctx); 660 | static void LD_H_SET_6_off_IX_d (Z80Context* ctx); 661 | static void LD_H_SET_6_off_IY_d (Z80Context* ctx); 662 | static void LD_H_SET_7_off_IX_d (Z80Context* ctx); 663 | static void LD_H_SET_7_off_IY_d (Z80Context* ctx); 664 | static void LD_H_SLA_off_IX_d (Z80Context* ctx); 665 | static void LD_H_SLA_off_IY_d (Z80Context* ctx); 666 | static void LD_H_SLL_off_IX_d (Z80Context* ctx); 667 | static void LD_H_SLL_off_IY_d (Z80Context* ctx); 668 | static void LD_H_SRA_off_IX_d (Z80Context* ctx); 669 | static void LD_H_SRA_off_IY_d (Z80Context* ctx); 670 | static void LD_H_SRL_off_IX_d (Z80Context* ctx); 671 | static void LD_H_SRL_off_IY_d (Z80Context* ctx); 672 | static void LD_HL_off_nn (Z80Context* ctx); 673 | static void LD_HL_nn (Z80Context* ctx); 674 | static void LD_I_A (Z80Context* ctx); 675 | static void LD_IX_off_nn (Z80Context* ctx); 676 | static void LD_IX_nn (Z80Context* ctx); 677 | static void LD_IXh_A (Z80Context* ctx); 678 | static void LD_IXh_B (Z80Context* ctx); 679 | static void LD_IXh_C (Z80Context* ctx); 680 | static void LD_IXh_D (Z80Context* ctx); 681 | static void LD_IXh_E (Z80Context* ctx); 682 | static void LD_IXh_IXh (Z80Context* ctx); 683 | static void LD_IXh_IXl (Z80Context* ctx); 684 | static void LD_IXh_n (Z80Context* ctx); 685 | static void LD_IXl_A (Z80Context* ctx); 686 | static void LD_IXl_B (Z80Context* ctx); 687 | static void LD_IXl_C (Z80Context* ctx); 688 | static void LD_IXl_D (Z80Context* ctx); 689 | static void LD_IXl_E (Z80Context* ctx); 690 | static void LD_IXl_IXh (Z80Context* ctx); 691 | static void LD_IXl_IXl (Z80Context* ctx); 692 | static void LD_IXl_n (Z80Context* ctx); 693 | static void LD_IY_off_nn (Z80Context* ctx); 694 | static void LD_IY_nn (Z80Context* ctx); 695 | static void LD_IYh_A (Z80Context* ctx); 696 | static void LD_IYh_B (Z80Context* ctx); 697 | static void LD_IYh_C (Z80Context* ctx); 698 | static void LD_IYh_D (Z80Context* ctx); 699 | static void LD_IYh_E (Z80Context* ctx); 700 | static void LD_IYh_IYh (Z80Context* ctx); 701 | static void LD_IYh_IYl (Z80Context* ctx); 702 | static void LD_IYh_n (Z80Context* ctx); 703 | static void LD_IYl_A (Z80Context* ctx); 704 | static void LD_IYl_B (Z80Context* ctx); 705 | static void LD_IYl_C (Z80Context* ctx); 706 | static void LD_IYl_D (Z80Context* ctx); 707 | static void LD_IYl_E (Z80Context* ctx); 708 | static void LD_IYl_IYh (Z80Context* ctx); 709 | static void LD_IYl_IYl (Z80Context* ctx); 710 | static void LD_IYl_n (Z80Context* ctx); 711 | static void LD_L_off_HL (Z80Context* ctx); 712 | static void LD_L_off_IX_d (Z80Context* ctx); 713 | static void LD_L_off_IY_d (Z80Context* ctx); 714 | static void LD_L_A (Z80Context* ctx); 715 | static void LD_L_B (Z80Context* ctx); 716 | static void LD_L_C (Z80Context* ctx); 717 | static void LD_L_D (Z80Context* ctx); 718 | static void LD_L_E (Z80Context* ctx); 719 | static void LD_L_H (Z80Context* ctx); 720 | static void LD_L_L (Z80Context* ctx); 721 | static void LD_L_n (Z80Context* ctx); 722 | static void LD_L_RES_0_off_IX_d (Z80Context* ctx); 723 | static void LD_L_RES_0_off_IY_d (Z80Context* ctx); 724 | static void LD_L_RES_1_off_IX_d (Z80Context* ctx); 725 | static void LD_L_RES_1_off_IY_d (Z80Context* ctx); 726 | static void LD_L_RES_2_off_IX_d (Z80Context* ctx); 727 | static void LD_L_RES_2_off_IY_d (Z80Context* ctx); 728 | static void LD_L_RES_3_off_IX_d (Z80Context* ctx); 729 | static void LD_L_RES_3_off_IY_d (Z80Context* ctx); 730 | static void LD_L_RES_4_off_IX_d (Z80Context* ctx); 731 | static void LD_L_RES_4_off_IY_d (Z80Context* ctx); 732 | static void LD_L_RES_5_off_IX_d (Z80Context* ctx); 733 | static void LD_L_RES_5_off_IY_d (Z80Context* ctx); 734 | static void LD_L_RES_6_off_IX_d (Z80Context* ctx); 735 | static void LD_L_RES_6_off_IY_d (Z80Context* ctx); 736 | static void LD_L_RES_7_off_IX_d (Z80Context* ctx); 737 | static void LD_L_RES_7_off_IY_d (Z80Context* ctx); 738 | static void LD_L_RL_off_IX_d (Z80Context* ctx); 739 | static void LD_L_RL_off_IY_d (Z80Context* ctx); 740 | static void LD_L_RLC_off_IX_d (Z80Context* ctx); 741 | static void LD_L_RLC_off_IY_d (Z80Context* ctx); 742 | static void LD_L_RR_off_IX_d (Z80Context* ctx); 743 | static void LD_L_RR_off_IY_d (Z80Context* ctx); 744 | static void LD_L_RRC_off_IX_d (Z80Context* ctx); 745 | static void LD_L_RRC_off_IY_d (Z80Context* ctx); 746 | static void LD_L_SET_0_off_IX_d (Z80Context* ctx); 747 | static void LD_L_SET_0_off_IY_d (Z80Context* ctx); 748 | static void LD_L_SET_1_off_IX_d (Z80Context* ctx); 749 | static void LD_L_SET_1_off_IY_d (Z80Context* ctx); 750 | static void LD_L_SET_2_off_IX_d (Z80Context* ctx); 751 | static void LD_L_SET_2_off_IY_d (Z80Context* ctx); 752 | static void LD_L_SET_3_off_IX_d (Z80Context* ctx); 753 | static void LD_L_SET_3_off_IY_d (Z80Context* ctx); 754 | static void LD_L_SET_4_off_IX_d (Z80Context* ctx); 755 | static void LD_L_SET_4_off_IY_d (Z80Context* ctx); 756 | static void LD_L_SET_5_off_IX_d (Z80Context* ctx); 757 | static void LD_L_SET_5_off_IY_d (Z80Context* ctx); 758 | static void LD_L_SET_6_off_IX_d (Z80Context* ctx); 759 | static void LD_L_SET_6_off_IY_d (Z80Context* ctx); 760 | static void LD_L_SET_7_off_IX_d (Z80Context* ctx); 761 | static void LD_L_SET_7_off_IY_d (Z80Context* ctx); 762 | static void LD_L_SLA_off_IX_d (Z80Context* ctx); 763 | static void LD_L_SLA_off_IY_d (Z80Context* ctx); 764 | static void LD_L_SLL_off_IX_d (Z80Context* ctx); 765 | static void LD_L_SLL_off_IY_d (Z80Context* ctx); 766 | static void LD_L_SRA_off_IX_d (Z80Context* ctx); 767 | static void LD_L_SRA_off_IY_d (Z80Context* ctx); 768 | static void LD_L_SRL_off_IX_d (Z80Context* ctx); 769 | static void LD_L_SRL_off_IY_d (Z80Context* ctx); 770 | static void LD_R_A (Z80Context* ctx); 771 | static void LD_SP_off_nn (Z80Context* ctx); 772 | static void LD_SP_HL (Z80Context* ctx); 773 | static void LD_SP_IX (Z80Context* ctx); 774 | static void LD_SP_IY (Z80Context* ctx); 775 | static void LD_SP_nn (Z80Context* ctx); 776 | static void LDD (Z80Context* ctx); 777 | static void LDDR (Z80Context* ctx); 778 | static void LDI (Z80Context* ctx); 779 | static void LDIR (Z80Context* ctx); 780 | static void NEG (Z80Context* ctx); 781 | static void NOP (Z80Context* ctx); 782 | static void OR_off_HL (Z80Context* ctx); 783 | static void OR_off_IX_d (Z80Context* ctx); 784 | static void OR_off_IY_d (Z80Context* ctx); 785 | static void OR_A (Z80Context* ctx); 786 | static void OR_B (Z80Context* ctx); 787 | static void OR_C (Z80Context* ctx); 788 | static void OR_D (Z80Context* ctx); 789 | static void OR_E (Z80Context* ctx); 790 | static void OR_H (Z80Context* ctx); 791 | static void OR_IXh (Z80Context* ctx); 792 | static void OR_IXl (Z80Context* ctx); 793 | static void OR_IYh (Z80Context* ctx); 794 | static void OR_IYl (Z80Context* ctx); 795 | static void OR_L (Z80Context* ctx); 796 | static void OR_n (Z80Context* ctx); 797 | static void OTDR (Z80Context* ctx); 798 | static void OTIR (Z80Context* ctx); 799 | static void OUT_off_C_0 (Z80Context* ctx); 800 | static void OUT_off_C_A (Z80Context* ctx); 801 | static void OUT_off_C_B (Z80Context* ctx); 802 | static void OUT_off_C_C (Z80Context* ctx); 803 | static void OUT_off_C_D (Z80Context* ctx); 804 | static void OUT_off_C_E (Z80Context* ctx); 805 | static void OUT_off_C_H (Z80Context* ctx); 806 | static void OUT_off_C_L (Z80Context* ctx); 807 | static void OUT_off_n_A (Z80Context* ctx); 808 | static void OUTD (Z80Context* ctx); 809 | static void OUTI (Z80Context* ctx); 810 | static void POP_AF (Z80Context* ctx); 811 | static void POP_BC (Z80Context* ctx); 812 | static void POP_DE (Z80Context* ctx); 813 | static void POP_HL (Z80Context* ctx); 814 | static void POP_IX (Z80Context* ctx); 815 | static void POP_IY (Z80Context* ctx); 816 | static void PUSH_AF (Z80Context* ctx); 817 | static void PUSH_BC (Z80Context* ctx); 818 | static void PUSH_DE (Z80Context* ctx); 819 | static void PUSH_HL (Z80Context* ctx); 820 | static void PUSH_IX (Z80Context* ctx); 821 | static void PUSH_IY (Z80Context* ctx); 822 | static void RES_0_off_HL (Z80Context* ctx); 823 | static void RES_0_off_IX_d (Z80Context* ctx); 824 | static void RES_0_off_IY_d (Z80Context* ctx); 825 | static void RES_0_A (Z80Context* ctx); 826 | static void RES_0_B (Z80Context* ctx); 827 | static void RES_0_C (Z80Context* ctx); 828 | static void RES_0_D (Z80Context* ctx); 829 | static void RES_0_E (Z80Context* ctx); 830 | static void RES_0_H (Z80Context* ctx); 831 | static void RES_0_L (Z80Context* ctx); 832 | static void RES_1_off_HL (Z80Context* ctx); 833 | static void RES_1_off_IX_d (Z80Context* ctx); 834 | static void RES_1_off_IY_d (Z80Context* ctx); 835 | static void RES_1_A (Z80Context* ctx); 836 | static void RES_1_B (Z80Context* ctx); 837 | static void RES_1_C (Z80Context* ctx); 838 | static void RES_1_D (Z80Context* ctx); 839 | static void RES_1_E (Z80Context* ctx); 840 | static void RES_1_H (Z80Context* ctx); 841 | static void RES_1_L (Z80Context* ctx); 842 | static void RES_2_off_HL (Z80Context* ctx); 843 | static void RES_2_off_IX_d (Z80Context* ctx); 844 | static void RES_2_off_IY_d (Z80Context* ctx); 845 | static void RES_2_A (Z80Context* ctx); 846 | static void RES_2_B (Z80Context* ctx); 847 | static void RES_2_C (Z80Context* ctx); 848 | static void RES_2_D (Z80Context* ctx); 849 | static void RES_2_E (Z80Context* ctx); 850 | static void RES_2_H (Z80Context* ctx); 851 | static void RES_2_L (Z80Context* ctx); 852 | static void RES_3_off_HL (Z80Context* ctx); 853 | static void RES_3_off_IX_d (Z80Context* ctx); 854 | static void RES_3_off_IY_d (Z80Context* ctx); 855 | static void RES_3_A (Z80Context* ctx); 856 | static void RES_3_B (Z80Context* ctx); 857 | static void RES_3_C (Z80Context* ctx); 858 | static void RES_3_D (Z80Context* ctx); 859 | static void RES_3_E (Z80Context* ctx); 860 | static void RES_3_H (Z80Context* ctx); 861 | static void RES_3_L (Z80Context* ctx); 862 | static void RES_4_off_HL (Z80Context* ctx); 863 | static void RES_4_off_IX_d (Z80Context* ctx); 864 | static void RES_4_off_IY_d (Z80Context* ctx); 865 | static void RES_4_A (Z80Context* ctx); 866 | static void RES_4_B (Z80Context* ctx); 867 | static void RES_4_C (Z80Context* ctx); 868 | static void RES_4_D (Z80Context* ctx); 869 | static void RES_4_E (Z80Context* ctx); 870 | static void RES_4_H (Z80Context* ctx); 871 | static void RES_4_L (Z80Context* ctx); 872 | static void RES_5_off_HL (Z80Context* ctx); 873 | static void RES_5_off_IX_d (Z80Context* ctx); 874 | static void RES_5_off_IY_d (Z80Context* ctx); 875 | static void RES_5_A (Z80Context* ctx); 876 | static void RES_5_B (Z80Context* ctx); 877 | static void RES_5_C (Z80Context* ctx); 878 | static void RES_5_D (Z80Context* ctx); 879 | static void RES_5_E (Z80Context* ctx); 880 | static void RES_5_H (Z80Context* ctx); 881 | static void RES_5_L (Z80Context* ctx); 882 | static void RES_6_off_HL (Z80Context* ctx); 883 | static void RES_6_off_IX_d (Z80Context* ctx); 884 | static void RES_6_off_IY_d (Z80Context* ctx); 885 | static void RES_6_A (Z80Context* ctx); 886 | static void RES_6_B (Z80Context* ctx); 887 | static void RES_6_C (Z80Context* ctx); 888 | static void RES_6_D (Z80Context* ctx); 889 | static void RES_6_E (Z80Context* ctx); 890 | static void RES_6_H (Z80Context* ctx); 891 | static void RES_6_L (Z80Context* ctx); 892 | static void RES_7_off_HL (Z80Context* ctx); 893 | static void RES_7_off_IX_d (Z80Context* ctx); 894 | static void RES_7_off_IY_d (Z80Context* ctx); 895 | static void RES_7_A (Z80Context* ctx); 896 | static void RES_7_B (Z80Context* ctx); 897 | static void RES_7_C (Z80Context* ctx); 898 | static void RES_7_D (Z80Context* ctx); 899 | static void RES_7_E (Z80Context* ctx); 900 | static void RES_7_H (Z80Context* ctx); 901 | static void RES_7_L (Z80Context* ctx); 902 | static void RET (Z80Context* ctx); 903 | static void RET_C (Z80Context* ctx); 904 | static void RET_M (Z80Context* ctx); 905 | static void RET_NC (Z80Context* ctx); 906 | static void RET_NZ (Z80Context* ctx); 907 | static void RET_P (Z80Context* ctx); 908 | static void RET_PE (Z80Context* ctx); 909 | static void RET_PO (Z80Context* ctx); 910 | static void RET_Z (Z80Context* ctx); 911 | static void RETI (Z80Context* ctx); 912 | static void RETN (Z80Context* ctx); 913 | static void RL_off_HL (Z80Context* ctx); 914 | static void RL_off_IX_d (Z80Context* ctx); 915 | static void RL_off_IY_d (Z80Context* ctx); 916 | static void RL_A (Z80Context* ctx); 917 | static void RL_B (Z80Context* ctx); 918 | static void RL_C (Z80Context* ctx); 919 | static void RL_D (Z80Context* ctx); 920 | static void RL_E (Z80Context* ctx); 921 | static void RL_H (Z80Context* ctx); 922 | static void RL_L (Z80Context* ctx); 923 | static void RLA (Z80Context* ctx); 924 | static void RLC_off_HL (Z80Context* ctx); 925 | static void RLC_off_IX_d (Z80Context* ctx); 926 | static void RLC_off_IY_d (Z80Context* ctx); 927 | static void RLC_A (Z80Context* ctx); 928 | static void RLC_B (Z80Context* ctx); 929 | static void RLC_C (Z80Context* ctx); 930 | static void RLC_D (Z80Context* ctx); 931 | static void RLC_E (Z80Context* ctx); 932 | static void RLC_H (Z80Context* ctx); 933 | static void RLC_L (Z80Context* ctx); 934 | static void RLCA (Z80Context* ctx); 935 | static void RLD (Z80Context* ctx); 936 | static void RR_off_HL (Z80Context* ctx); 937 | static void RR_off_IX_d (Z80Context* ctx); 938 | static void RR_off_IY_d (Z80Context* ctx); 939 | static void RR_A (Z80Context* ctx); 940 | static void RR_B (Z80Context* ctx); 941 | static void RR_C (Z80Context* ctx); 942 | static void RR_D (Z80Context* ctx); 943 | static void RR_E (Z80Context* ctx); 944 | static void RR_H (Z80Context* ctx); 945 | static void RR_L (Z80Context* ctx); 946 | static void RRA (Z80Context* ctx); 947 | static void RRC_off_HL (Z80Context* ctx); 948 | static void RRC_off_IX_d (Z80Context* ctx); 949 | static void RRC_off_IY_d (Z80Context* ctx); 950 | static void RRC_A (Z80Context* ctx); 951 | static void RRC_B (Z80Context* ctx); 952 | static void RRC_C (Z80Context* ctx); 953 | static void RRC_D (Z80Context* ctx); 954 | static void RRC_E (Z80Context* ctx); 955 | static void RRC_H (Z80Context* ctx); 956 | static void RRC_L (Z80Context* ctx); 957 | static void RRCA (Z80Context* ctx); 958 | static void RRD (Z80Context* ctx); 959 | static void RST_0H (Z80Context* ctx); 960 | static void RST_10H (Z80Context* ctx); 961 | static void RST_18H (Z80Context* ctx); 962 | static void RST_20H (Z80Context* ctx); 963 | static void RST_28H (Z80Context* ctx); 964 | static void RST_30H (Z80Context* ctx); 965 | static void RST_38H (Z80Context* ctx); 966 | static void RST_8H (Z80Context* ctx); 967 | static void SBC_A_off_HL (Z80Context* ctx); 968 | static void SBC_A_off_IX_d (Z80Context* ctx); 969 | static void SBC_A_off_IY_d (Z80Context* ctx); 970 | static void SBC_A_A (Z80Context* ctx); 971 | static void SBC_A_B (Z80Context* ctx); 972 | static void SBC_A_C (Z80Context* ctx); 973 | static void SBC_A_D (Z80Context* ctx); 974 | static void SBC_A_E (Z80Context* ctx); 975 | static void SBC_A_H (Z80Context* ctx); 976 | static void SBC_A_IXh (Z80Context* ctx); 977 | static void SBC_A_IXl (Z80Context* ctx); 978 | static void SBC_A_IYh (Z80Context* ctx); 979 | static void SBC_A_IYl (Z80Context* ctx); 980 | static void SBC_A_L (Z80Context* ctx); 981 | static void SBC_A_n (Z80Context* ctx); 982 | static void SBC_HL_BC (Z80Context* ctx); 983 | static void SBC_HL_DE (Z80Context* ctx); 984 | static void SBC_HL_HL (Z80Context* ctx); 985 | static void SBC_HL_SP (Z80Context* ctx); 986 | static void SCF (Z80Context* ctx); 987 | static void SET_0_off_HL (Z80Context* ctx); 988 | static void SET_0_off_IX_d (Z80Context* ctx); 989 | static void SET_0_off_IY_d (Z80Context* ctx); 990 | static void SET_0_A (Z80Context* ctx); 991 | static void SET_0_B (Z80Context* ctx); 992 | static void SET_0_C (Z80Context* ctx); 993 | static void SET_0_D (Z80Context* ctx); 994 | static void SET_0_E (Z80Context* ctx); 995 | static void SET_0_H (Z80Context* ctx); 996 | static void SET_0_L (Z80Context* ctx); 997 | static void SET_1_off_HL (Z80Context* ctx); 998 | static void SET_1_off_IX_d (Z80Context* ctx); 999 | static void SET_1_off_IY_d (Z80Context* ctx); 1000 | static void SET_1_A (Z80Context* ctx); 1001 | static void SET_1_B (Z80Context* ctx); 1002 | static void SET_1_C (Z80Context* ctx); 1003 | static void SET_1_D (Z80Context* ctx); 1004 | static void SET_1_E (Z80Context* ctx); 1005 | static void SET_1_H (Z80Context* ctx); 1006 | static void SET_1_L (Z80Context* ctx); 1007 | static void SET_2_off_HL (Z80Context* ctx); 1008 | static void SET_2_off_IX_d (Z80Context* ctx); 1009 | static void SET_2_off_IY_d (Z80Context* ctx); 1010 | static void SET_2_A (Z80Context* ctx); 1011 | static void SET_2_B (Z80Context* ctx); 1012 | static void SET_2_C (Z80Context* ctx); 1013 | static void SET_2_D (Z80Context* ctx); 1014 | static void SET_2_E (Z80Context* ctx); 1015 | static void SET_2_H (Z80Context* ctx); 1016 | static void SET_2_L (Z80Context* ctx); 1017 | static void SET_3_off_HL (Z80Context* ctx); 1018 | static void SET_3_off_IX_d (Z80Context* ctx); 1019 | static void SET_3_off_IY_d (Z80Context* ctx); 1020 | static void SET_3_A (Z80Context* ctx); 1021 | static void SET_3_B (Z80Context* ctx); 1022 | static void SET_3_C (Z80Context* ctx); 1023 | static void SET_3_D (Z80Context* ctx); 1024 | static void SET_3_E (Z80Context* ctx); 1025 | static void SET_3_H (Z80Context* ctx); 1026 | static void SET_3_L (Z80Context* ctx); 1027 | static void SET_4_off_HL (Z80Context* ctx); 1028 | static void SET_4_off_IX_d (Z80Context* ctx); 1029 | static void SET_4_off_IY_d (Z80Context* ctx); 1030 | static void SET_4_A (Z80Context* ctx); 1031 | static void SET_4_B (Z80Context* ctx); 1032 | static void SET_4_C (Z80Context* ctx); 1033 | static void SET_4_D (Z80Context* ctx); 1034 | static void SET_4_E (Z80Context* ctx); 1035 | static void SET_4_H (Z80Context* ctx); 1036 | static void SET_4_L (Z80Context* ctx); 1037 | static void SET_5_off_HL (Z80Context* ctx); 1038 | static void SET_5_off_IX_d (Z80Context* ctx); 1039 | static void SET_5_off_IY_d (Z80Context* ctx); 1040 | static void SET_5_A (Z80Context* ctx); 1041 | static void SET_5_B (Z80Context* ctx); 1042 | static void SET_5_C (Z80Context* ctx); 1043 | static void SET_5_D (Z80Context* ctx); 1044 | static void SET_5_E (Z80Context* ctx); 1045 | static void SET_5_H (Z80Context* ctx); 1046 | static void SET_5_L (Z80Context* ctx); 1047 | static void SET_6_off_HL (Z80Context* ctx); 1048 | static void SET_6_off_IX_d (Z80Context* ctx); 1049 | static void SET_6_off_IY_d (Z80Context* ctx); 1050 | static void SET_6_A (Z80Context* ctx); 1051 | static void SET_6_B (Z80Context* ctx); 1052 | static void SET_6_C (Z80Context* ctx); 1053 | static void SET_6_D (Z80Context* ctx); 1054 | static void SET_6_E (Z80Context* ctx); 1055 | static void SET_6_H (Z80Context* ctx); 1056 | static void SET_6_L (Z80Context* ctx); 1057 | static void SET_7_off_HL (Z80Context* ctx); 1058 | static void SET_7_off_IX_d (Z80Context* ctx); 1059 | static void SET_7_off_IY_d (Z80Context* ctx); 1060 | static void SET_7_A (Z80Context* ctx); 1061 | static void SET_7_B (Z80Context* ctx); 1062 | static void SET_7_C (Z80Context* ctx); 1063 | static void SET_7_D (Z80Context* ctx); 1064 | static void SET_7_E (Z80Context* ctx); 1065 | static void SET_7_H (Z80Context* ctx); 1066 | static void SET_7_L (Z80Context* ctx); 1067 | static void SLA_off_HL (Z80Context* ctx); 1068 | static void SLA_off_IX_d (Z80Context* ctx); 1069 | static void SLA_off_IY_d (Z80Context* ctx); 1070 | static void SLA_A (Z80Context* ctx); 1071 | static void SLA_B (Z80Context* ctx); 1072 | static void SLA_C (Z80Context* ctx); 1073 | static void SLA_D (Z80Context* ctx); 1074 | static void SLA_E (Z80Context* ctx); 1075 | static void SLA_H (Z80Context* ctx); 1076 | static void SLA_L (Z80Context* ctx); 1077 | static void SLL_off_HL (Z80Context* ctx); 1078 | static void SLL_off_IX_d (Z80Context* ctx); 1079 | static void SLL_off_IY_d (Z80Context* ctx); 1080 | static void SLL_A (Z80Context* ctx); 1081 | static void SLL_B (Z80Context* ctx); 1082 | static void SLL_C (Z80Context* ctx); 1083 | static void SLL_D (Z80Context* ctx); 1084 | static void SLL_E (Z80Context* ctx); 1085 | static void SLL_H (Z80Context* ctx); 1086 | static void SLL_L (Z80Context* ctx); 1087 | static void SRA_off_HL (Z80Context* ctx); 1088 | static void SRA_off_IX_d (Z80Context* ctx); 1089 | static void SRA_off_IY_d (Z80Context* ctx); 1090 | static void SRA_A (Z80Context* ctx); 1091 | static void SRA_B (Z80Context* ctx); 1092 | static void SRA_C (Z80Context* ctx); 1093 | static void SRA_D (Z80Context* ctx); 1094 | static void SRA_E (Z80Context* ctx); 1095 | static void SRA_H (Z80Context* ctx); 1096 | static void SRA_L (Z80Context* ctx); 1097 | static void SRL_off_HL (Z80Context* ctx); 1098 | static void SRL_off_IX_d (Z80Context* ctx); 1099 | static void SRL_off_IY_d (Z80Context* ctx); 1100 | static void SRL_A (Z80Context* ctx); 1101 | static void SRL_B (Z80Context* ctx); 1102 | static void SRL_C (Z80Context* ctx); 1103 | static void SRL_D (Z80Context* ctx); 1104 | static void SRL_E (Z80Context* ctx); 1105 | static void SRL_H (Z80Context* ctx); 1106 | static void SRL_L (Z80Context* ctx); 1107 | static void SUB_A_off_HL (Z80Context* ctx); 1108 | static void SUB_A_off_IX_d (Z80Context* ctx); 1109 | static void SUB_A_off_IY_d (Z80Context* ctx); 1110 | static void SUB_A_A (Z80Context* ctx); 1111 | static void SUB_A_B (Z80Context* ctx); 1112 | static void SUB_A_C (Z80Context* ctx); 1113 | static void SUB_A_D (Z80Context* ctx); 1114 | static void SUB_A_E (Z80Context* ctx); 1115 | static void SUB_A_H (Z80Context* ctx); 1116 | static void SUB_A_IXh (Z80Context* ctx); 1117 | static void SUB_A_IXl (Z80Context* ctx); 1118 | static void SUB_A_IYh (Z80Context* ctx); 1119 | static void SUB_A_IYl (Z80Context* ctx); 1120 | static void SUB_A_L (Z80Context* ctx); 1121 | static void SUB_A_n (Z80Context* ctx); 1122 | static void XOR_off_HL (Z80Context* ctx); 1123 | static void XOR_off_IX_d (Z80Context* ctx); 1124 | static void XOR_off_IY_d (Z80Context* ctx); 1125 | static void XOR_A (Z80Context* ctx); 1126 | static void XOR_B (Z80Context* ctx); 1127 | static void XOR_C (Z80Context* ctx); 1128 | static void XOR_D (Z80Context* ctx); 1129 | static void XOR_E (Z80Context* ctx); 1130 | static void XOR_H (Z80Context* ctx); 1131 | static void XOR_IXh (Z80Context* ctx); 1132 | static void XOR_IXl (Z80Context* ctx); 1133 | static void XOR_IYh (Z80Context* ctx); 1134 | static void XOR_IYl (Z80Context* ctx); 1135 | static void XOR_L (Z80Context* ctx); 1136 | static void XOR_n (Z80Context* ctx); 1137 | -------------------------------------------------------------------------------- /fuse_tests/Makefile: -------------------------------------------------------------------------------- 1 | .DEFAULT: check 2 | 3 | check: tests.expected coretest 4 | ./coretest fuse_files/tests.in >tests.actual 5 | diff -u tests.expected tests.actual 6 | 7 | clean: 8 | rm -rf tests.expected tests.actual 9 | 10 | tests.expected: fuse_files/tests.expected 11 | ./generate_expected.sh $< $@ 12 | 13 | coretest: coretest.c 14 | $(CC) -Wall -std=c89 -g -o $@ $< ../libz80.so 15 | -------------------------------------------------------------------------------- /fuse_tests/README: -------------------------------------------------------------------------------- 1 | This directory contains a test to exercise libz80 using the test suite 2 | from FUSE. 3 | 4 | "make" will create and run the test, comparing the expected and actual 5 | output using diff. A successful run will show no diff output. 6 | 7 | The directory fuse_files contains files from FUSE. If FUSE releases a 8 | newer version of its test suite, copy the updated tests.in and 9 | tests.expected files into fuse_files. 10 | 11 | We do not check the order or timing of memory accesses, nor the timing 12 | of i/o accesses. The overall timing of each instruction sequence is 13 | still checked. 14 | -------------------------------------------------------------------------------- /fuse_tests/coretest: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ggambetta/libz80/7371ee85a17576bb618ef91795fbfc8be07743d9/fuse_tests/coretest -------------------------------------------------------------------------------- /fuse_tests/coretest.c: -------------------------------------------------------------------------------- 1 | /* coretest.c: Test program for Fuse's Z80 core 2 | Copyright (c) 2003 Philip Kendall 3 | Modified for libz80 by Wayne Conrad 4 | 5 | $Id: coretest.c 4060 2009-07-30 13:21:38Z fredm $ 6 | 7 | This program is free software; you can redistribute it and/or modify 8 | it under the terms of the GNU General Public License as published by 9 | the Free Software Foundation; either version 2 of the License, or 10 | (at your option) any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License along 18 | with this program; if not, write to the Free Software Foundation, Inc., 19 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 20 | 21 | Author contact information: 22 | 23 | E-mail: philip-fuse@shadowmagic.org.uk 24 | 25 | */ 26 | 27 | #include 28 | #include 29 | #include 30 | #include 31 | 32 | #include "../z80.h" 33 | 34 | static const char *progname; /* argv[0] */ 35 | static const char *testsfile; /* argv[1] */ 36 | 37 | /* 64Kb of RAM */ 38 | static byte initial_memory[ 0x10000 ], memory[ 0x10000 ]; 39 | 40 | static Z80Context context; 41 | 42 | static byte context_mem_read_callback(size_t param, ushort address) 43 | { 44 | return memory[address]; 45 | } 46 | 47 | static void context_mem_write_callback(size_t param, ushort address, byte data) 48 | { 49 | memory[address] = data; 50 | } 51 | 52 | static byte context_io_read_callback(size_t param, ushort address) 53 | { 54 | byte data = address >> 8; 55 | printf("PR %04x %02x\n", address, data); 56 | return data; 57 | } 58 | 59 | static void context_io_write_callback(size_t param, ushort address, byte data) 60 | { 61 | printf("PW %04x %02x\n", address, data); 62 | } 63 | 64 | void init_emulator() 65 | { 66 | context.memRead = context_mem_read_callback; 67 | context.memWrite = context_mem_write_callback; 68 | context.ioRead = context_io_read_callback; 69 | context.ioWrite = context_io_write_callback; 70 | } 71 | 72 | #define AF1 context.R1.wr.AF 73 | #define BC1 context.R1.wr.BC 74 | #define DE1 context.R1.wr.DE 75 | #define HL1 context.R1.wr.HL 76 | #define AF2 context.R2.wr.AF 77 | #define BC2 context.R2.wr.BC 78 | #define DE2 context.R2.wr.DE 79 | #define HL2 context.R2.wr.HL 80 | #define IX context.R1.wr.IX 81 | #define IY context.R1.wr.IY 82 | #define SP context.R1.wr.SP 83 | #define PC context.PC 84 | #define I context.I 85 | #define R context.R 86 | #define IFF1 context.IFF1 87 | #define IFF2 context.IFF2 88 | #define IM context.IM 89 | 90 | static void fill_memory() 91 | { 92 | size_t i; 93 | for( i = 0; i < 0x10000; i += 4 ) { 94 | memory[ i ] = 0xde; memory[ i + 1 ] = 0xad; 95 | memory[ i + 2 ] = 0xbe; memory[ i + 3 ] = 0xef; 96 | } 97 | } 98 | 99 | static void reset() 100 | { 101 | Z80RESET(&context); 102 | fill_memory(); 103 | } 104 | 105 | static int 106 | read_test( FILE *f, unsigned *end_tstates ) 107 | { 108 | unsigned af, bc, de, hl, af_, bc_, de_, hl_, ix, iy, sp, pc; 109 | unsigned i, r, iff1, iff2, im; 110 | unsigned end_tstates2; 111 | unsigned address; 112 | char test_name[ 80 ]; 113 | do { 114 | if( !fgets( test_name, sizeof( test_name ), f ) ) { 115 | if( feof( f ) ) return 1; 116 | fprintf( stderr, "%s: error reading test description from `%s': %s\n", 117 | progname, testsfile, strerror( errno ) ); 118 | return 1; 119 | } 120 | } while( test_name[0] == '\n' ); 121 | if( fscanf( f, "%x %x %x %x %x %x %x %x %x %x %x %x", &af, &bc, 122 | &de, &hl, &af_, &bc_, &de_, &hl_, &ix, &iy, &sp, &pc ) != 12 ) { 123 | fprintf( stderr, "%s: first registers line in `%s' corrupt\n", progname, 124 | testsfile ); 125 | return 1; 126 | } 127 | AF1 = af; BC1 = bc; DE1 = de; HL1 = hl; 128 | AF2 = af_; BC2 = bc_; DE2 = de_; HL2 = hl_; 129 | IX = ix; IY = iy; SP = sp; PC = pc; 130 | int halted; 131 | if( fscanf( f, "%x %x %u %u %u %d %d", &i, &r, &iff1, &iff2, &im, 132 | &halted, &end_tstates2 ) != 7 ) { 133 | fprintf( stderr, "%s: second registers line in `%s' corrupt\n", progname, 134 | testsfile ); 135 | return 1; 136 | } 137 | context.halted = halted; 138 | I = i; R = r; IFF1 = iff1; IFF2 = iff2; IM = im; 139 | *end_tstates = end_tstates2; 140 | while( 1 ) { 141 | if( fscanf( f, "%x", &address ) != 1 ) { 142 | fprintf( stderr, "%s: no address found in `%s'\n", progname, testsfile ); 143 | return 1; 144 | } 145 | if( address >= 0x10000 ) break; 146 | while( 1 ) { 147 | unsigned byte; 148 | if( fscanf( f, "%x", &byte ) != 1 ) { 149 | fprintf( stderr, "%s: no data byte found in `%s'\n", progname, 150 | testsfile ); 151 | return 1; 152 | } 153 | if( byte >= 0x100 ) break; 154 | memory[ address++ ] = byte; 155 | } 156 | } 157 | printf( "%s", test_name ); 158 | return 0; 159 | } 160 | 161 | static void 162 | dump_z80_state( void ) 163 | { 164 | printf( "%04x %04x %04x %04x %04x %04x %04x %04x %04x %04x %04x %04x\n", 165 | AF1, BC1, DE1, HL1, AF2, BC2, DE2, HL2, IX, IY, SP, PC ); 166 | printf( "%02x %02x %d %d %d %d %d\n", I, R, 167 | IFF1, IFF2, IM, context.halted, context.tstates ); 168 | } 169 | 170 | static void 171 | dump_memory_state( void ) 172 | { 173 | size_t i; 174 | for( i = 0; i < 0x10000; i++ ) { 175 | if( memory[ i ] == initial_memory[ i ] ) continue; 176 | printf( "%04x ", (unsigned)i ); 177 | while( i < 0x10000 && memory[ i ] != initial_memory[ i ] ) 178 | printf( "%02x ", memory[ i++ ] ); 179 | printf( "-1\n" ); 180 | } 181 | } 182 | 183 | static int 184 | run_test( FILE *f ) 185 | { 186 | unsigned end_tstates; 187 | reset(); 188 | if( read_test( f, &end_tstates ) ) return 0; 189 | memcpy( initial_memory, memory, 0x10000 ); 190 | while(context.tstates < end_tstates) 191 | Z80Execute(&context); 192 | dump_z80_state(); 193 | dump_memory_state(); 194 | printf( "\n" ); 195 | return 1; 196 | } 197 | 198 | int parse_args(int argc, char **argv) 199 | { 200 | progname = argv[0]; 201 | if( argc < 2 ) { 202 | fprintf( stderr, "Usage: %s \n", progname ); 203 | return 1; 204 | } 205 | testsfile = argv[1]; 206 | return 0; 207 | } 208 | 209 | int 210 | main( int argc, char **argv ) 211 | { 212 | FILE *f; 213 | if(parse_args(argc, argv)) 214 | return 1; 215 | f = fopen( testsfile, "r" ); 216 | if( !f ) { 217 | fprintf( stderr, "%s: couldn't open tests file `%s': %s\n", progname, 218 | testsfile, strerror( errno ) ); 219 | return 1; 220 | } 221 | init_emulator(); 222 | while( run_test( f ) ) { 223 | /* Do nothing */ 224 | } 225 | if( fclose( f ) ) { 226 | fprintf( stderr, "%s: couldn't close `%s': %s\n", progname, testsfile, 227 | strerror( errno ) ); 228 | return 1; 229 | } 230 | return 0; 231 | } 232 | -------------------------------------------------------------------------------- /fuse_tests/fuse_files/COPYING: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 2, June 1991 3 | 4 | Copyright (C) 1989, 1991 Free Software Foundation, Inc., 5 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 6 | Everyone is permitted to copy and distribute verbatim copies 7 | of this license document, but changing it is not allowed. 8 | 9 | Preamble 10 | 11 | The licenses for most software are designed to take away your 12 | freedom to share and change it. By contrast, the GNU General Public 13 | License is intended to guarantee your freedom to share and change free 14 | software--to make sure the software is free for all its users. This 15 | General Public License applies to most of the Free Software 16 | Foundation's software and to any other program whose authors commit to 17 | using it. (Some other Free Software Foundation software is covered by 18 | the GNU Lesser General Public License instead.) You can apply it to 19 | your programs, too. 20 | 21 | When we speak of free software, we are referring to freedom, not 22 | price. Our General Public Licenses are designed to make sure that you 23 | have the freedom to distribute copies of free software (and charge for 24 | this service if you wish), that you receive source code or can get it 25 | if you want it, that you can change the software or use pieces of it 26 | in new free programs; and that you know you can do these things. 27 | 28 | To protect your rights, we need to make restrictions that forbid 29 | anyone to deny you these rights or to ask you to surrender the rights. 30 | These restrictions translate to certain responsibilities for you if you 31 | distribute copies of the software, or if you modify it. 32 | 33 | For example, if you distribute copies of such a program, whether 34 | gratis or for a fee, you must give the recipients all the rights that 35 | you have. You must make sure that they, too, receive or can get the 36 | source code. And you must show them these terms so they know their 37 | rights. 38 | 39 | We protect your rights with two steps: (1) copyright the software, and 40 | (2) offer you this license which gives you legal permission to copy, 41 | distribute and/or modify the software. 42 | 43 | Also, for each author's protection and ours, we want to make certain 44 | that everyone understands that there is no warranty for this free 45 | software. If the software is modified by someone else and passed on, we 46 | want its recipients to know that what they have is not the original, so 47 | that any problems introduced by others will not reflect on the original 48 | authors' reputations. 49 | 50 | Finally, any free program is threatened constantly by software 51 | patents. We wish to avoid the danger that redistributors of a free 52 | program will individually obtain patent licenses, in effect making the 53 | program proprietary. To prevent this, we have made it clear that any 54 | patent must be licensed for everyone's free use or not licensed at all. 55 | 56 | The precise terms and conditions for copying, distribution and 57 | modification follow. 58 | 59 | GNU GENERAL PUBLIC LICENSE 60 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 61 | 62 | 0. This License applies to any program or other work which contains 63 | a notice placed by the copyright holder saying it may be distributed 64 | under the terms of this General Public License. The "Program", below, 65 | refers to any such program or work, and a "work based on the Program" 66 | means either the Program or any derivative work under copyright law: 67 | that is to say, a work containing the Program or a portion of it, 68 | either verbatim or with modifications and/or translated into another 69 | language. (Hereinafter, translation is included without limitation in 70 | the term "modification".) Each licensee is addressed as "you". 71 | 72 | Activities other than copying, distribution and modification are not 73 | covered by this License; they are outside its scope. The act of 74 | running the Program is not restricted, and the output from the Program 75 | is covered only if its contents constitute a work based on the 76 | Program (independent of having been made by running the Program). 77 | Whether that is true depends on what the Program does. 78 | 79 | 1. You may copy and distribute verbatim copies of the Program's 80 | source code as you receive it, in any medium, provided that you 81 | conspicuously and appropriately publish on each copy an appropriate 82 | copyright notice and disclaimer of warranty; keep intact all the 83 | notices that refer to this License and to the absence of any warranty; 84 | and give any other recipients of the Program a copy of this License 85 | along with the Program. 86 | 87 | You may charge a fee for the physical act of transferring a copy, and 88 | you may at your option offer warranty protection in exchange for a fee. 89 | 90 | 2. You may modify your copy or copies of the Program or any portion 91 | of it, thus forming a work based on the Program, and copy and 92 | distribute such modifications or work under the terms of Section 1 93 | above, provided that you also meet all of these conditions: 94 | 95 | a) You must cause the modified files to carry prominent notices 96 | stating that you changed the files and the date of any change. 97 | 98 | b) You must cause any work that you distribute or publish, that in 99 | whole or in part contains or is derived from the Program or any 100 | part thereof, to be licensed as a whole at no charge to all third 101 | parties under the terms of this License. 102 | 103 | c) If the modified program normally reads commands interactively 104 | when run, you must cause it, when started running for such 105 | interactive use in the most ordinary way, to print or display an 106 | announcement including an appropriate copyright notice and a 107 | notice that there is no warranty (or else, saying that you provide 108 | a warranty) and that users may redistribute the program under 109 | these conditions, and telling the user how to view a copy of this 110 | License. (Exception: if the Program itself is interactive but 111 | does not normally print such an announcement, your work based on 112 | the Program is not required to print an announcement.) 113 | 114 | These requirements apply to the modified work as a whole. If 115 | identifiable sections of that work are not derived from the Program, 116 | and can be reasonably considered independent and separate works in 117 | themselves, then this License, and its terms, do not apply to those 118 | sections when you distribute them as separate works. But when you 119 | distribute the same sections as part of a whole which is a work based 120 | on the Program, the distribution of the whole must be on the terms of 121 | this License, whose permissions for other licensees extend to the 122 | entire whole, and thus to each and every part regardless of who wrote it. 123 | 124 | Thus, it is not the intent of this section to claim rights or contest 125 | your rights to work written entirely by you; rather, the intent is to 126 | exercise the right to control the distribution of derivative or 127 | collective works based on the Program. 128 | 129 | In addition, mere aggregation of another work not based on the Program 130 | with the Program (or with a work based on the Program) on a volume of 131 | a storage or distribution medium does not bring the other work under 132 | the scope of this License. 133 | 134 | 3. You may copy and distribute the Program (or a work based on it, 135 | under Section 2) in object code or executable form under the terms of 136 | Sections 1 and 2 above provided that you also do one of the following: 137 | 138 | a) Accompany it with the complete corresponding machine-readable 139 | source code, which must be distributed under the terms of Sections 140 | 1 and 2 above on a medium customarily used for software interchange; or, 141 | 142 | b) Accompany it with a written offer, valid for at least three 143 | years, to give any third party, for a charge no more than your 144 | cost of physically performing source distribution, a complete 145 | machine-readable copy of the corresponding source code, to be 146 | distributed under the terms of Sections 1 and 2 above on a medium 147 | customarily used for software interchange; or, 148 | 149 | c) Accompany it with the information you received as to the offer 150 | to distribute corresponding source code. (This alternative is 151 | allowed only for noncommercial distribution and only if you 152 | received the program in object code or executable form with such 153 | an offer, in accord with Subsection b above.) 154 | 155 | The source code for a work means the preferred form of the work for 156 | making modifications to it. For an executable work, complete source 157 | code means all the source code for all modules it contains, plus any 158 | associated interface definition files, plus the scripts used to 159 | control compilation and installation of the executable. However, as a 160 | special exception, the source code distributed need not include 161 | anything that is normally distributed (in either source or binary 162 | form) with the major components (compiler, kernel, and so on) of the 163 | operating system on which the executable runs, unless that component 164 | itself accompanies the executable. 165 | 166 | If distribution of executable or object code is made by offering 167 | access to copy from a designated place, then offering equivalent 168 | access to copy the source code from the same place counts as 169 | distribution of the source code, even though third parties are not 170 | compelled to copy the source along with the object code. 171 | 172 | 4. You may not copy, modify, sublicense, or distribute the Program 173 | except as expressly provided under this License. Any attempt 174 | otherwise to copy, modify, sublicense or distribute the Program is 175 | void, and will automatically terminate your rights under this License. 176 | However, parties who have received copies, or rights, from you under 177 | this License will not have their licenses terminated so long as such 178 | parties remain in full compliance. 179 | 180 | 5. You are not required to accept this License, since you have not 181 | signed it. However, nothing else grants you permission to modify or 182 | distribute the Program or its derivative works. These actions are 183 | prohibited by law if you do not accept this License. Therefore, by 184 | modifying or distributing the Program (or any work based on the 185 | Program), you indicate your acceptance of this License to do so, and 186 | all its terms and conditions for copying, distributing or modifying 187 | the Program or works based on it. 188 | 189 | 6. Each time you redistribute the Program (or any work based on the 190 | Program), the recipient automatically receives a license from the 191 | original licensor to copy, distribute or modify the Program subject to 192 | these terms and conditions. You may not impose any further 193 | restrictions on the recipients' exercise of the rights granted herein. 194 | You are not responsible for enforcing compliance by third parties to 195 | this License. 196 | 197 | 7. If, as a consequence of a court judgment or allegation of patent 198 | infringement or for any other reason (not limited to patent issues), 199 | conditions are imposed on you (whether by court order, agreement or 200 | otherwise) that contradict the conditions of this License, they do not 201 | excuse you from the conditions of this License. If you cannot 202 | distribute so as to satisfy simultaneously your obligations under this 203 | License and any other pertinent obligations, then as a consequence you 204 | may not distribute the Program at all. For example, if a patent 205 | license would not permit royalty-free redistribution of the Program by 206 | all those who receive copies directly or indirectly through you, then 207 | the only way you could satisfy both it and this License would be to 208 | refrain entirely from distribution of the Program. 209 | 210 | If any portion of this section is held invalid or unenforceable under 211 | any particular circumstance, the balance of the section is intended to 212 | apply and the section as a whole is intended to apply in other 213 | circumstances. 214 | 215 | It is not the purpose of this section to induce you to infringe any 216 | patents or other property right claims or to contest validity of any 217 | such claims; this section has the sole purpose of protecting the 218 | integrity of the free software distribution system, which is 219 | implemented by public license practices. Many people have made 220 | generous contributions to the wide range of software distributed 221 | through that system in reliance on consistent application of that 222 | system; it is up to the author/donor to decide if he or she is willing 223 | to distribute software through any other system and a licensee cannot 224 | impose that choice. 225 | 226 | This section is intended to make thoroughly clear what is believed to 227 | be a consequence of the rest of this License. 228 | 229 | 8. If the distribution and/or use of the Program is restricted in 230 | certain countries either by patents or by copyrighted interfaces, the 231 | original copyright holder who places the Program under this License 232 | may add an explicit geographical distribution limitation excluding 233 | those countries, so that distribution is permitted only in or among 234 | countries not thus excluded. In such case, this License incorporates 235 | the limitation as if written in the body of this License. 236 | 237 | 9. The Free Software Foundation may publish revised and/or new versions 238 | of the General Public License from time to time. Such new versions will 239 | be similar in spirit to the present version, but may differ in detail to 240 | address new problems or concerns. 241 | 242 | Each version is given a distinguishing version number. If the Program 243 | specifies a version number of this License which applies to it and "any 244 | later version", you have the option of following the terms and conditions 245 | either of that version or of any later version published by the Free 246 | Software Foundation. If the Program does not specify a version number of 247 | this License, you may choose any version ever published by the Free Software 248 | Foundation. 249 | 250 | 10. If you wish to incorporate parts of the Program into other free 251 | programs whose distribution conditions are different, write to the author 252 | to ask for permission. For software which is copyrighted by the Free 253 | Software Foundation, write to the Free Software Foundation; we sometimes 254 | make exceptions for this. Our decision will be guided by the two goals 255 | of preserving the free status of all derivatives of our free software and 256 | of promoting the sharing and reuse of software generally. 257 | 258 | NO WARRANTY 259 | 260 | 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY 261 | FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN 262 | OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES 263 | PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED 264 | OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 265 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS 266 | TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE 267 | PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, 268 | REPAIR OR CORRECTION. 269 | 270 | 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 271 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR 272 | REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, 273 | INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING 274 | OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED 275 | TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY 276 | YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER 277 | PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE 278 | POSSIBILITY OF SUCH DAMAGES. 279 | 280 | END OF TERMS AND CONDITIONS 281 | 282 | How to Apply These Terms to Your New Programs 283 | 284 | If you develop a new program, and you want it to be of the greatest 285 | possible use to the public, the best way to achieve this is to make it 286 | free software which everyone can redistribute and change under these terms. 287 | 288 | To do so, attach the following notices to the program. It is safest 289 | to attach them to the start of each source file to most effectively 290 | convey the exclusion of warranty; and each file should have at least 291 | the "copyright" line and a pointer to where the full notice is found. 292 | 293 | 294 | Copyright (C) 295 | 296 | This program is free software; you can redistribute it and/or modify 297 | it under the terms of the GNU General Public License as published by 298 | the Free Software Foundation; either version 2 of the License, or 299 | (at your option) any later version. 300 | 301 | This program is distributed in the hope that it will be useful, 302 | but WITHOUT ANY WARRANTY; without even the implied warranty of 303 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 304 | GNU General Public License for more details. 305 | 306 | You should have received a copy of the GNU General Public License along 307 | with this program; if not, write to the Free Software Foundation, Inc., 308 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 309 | 310 | Also add information on how to contact you by electronic and paper mail. 311 | 312 | If the program is interactive, make it output a short notice like this 313 | when it starts in an interactive mode: 314 | 315 | Gnomovision version 69, Copyright (C) year name of author 316 | Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 317 | This is free software, and you are welcome to redistribute it 318 | under certain conditions; type `show c' for details. 319 | 320 | The hypothetical commands `show w' and `show c' should show the appropriate 321 | parts of the General Public License. Of course, the commands you use may 322 | be called something other than `show w' and `show c'; they could even be 323 | mouse-clicks or menu items--whatever suits your program. 324 | 325 | You should also get your employer (if you work as a programmer) or your 326 | school, if any, to sign a "copyright disclaimer" for the program, if 327 | necessary. Here is a sample; alter the names: 328 | 329 | Yoyodyne, Inc., hereby disclaims all copyright interest in the program 330 | `Gnomovision' (which makes passes at compilers) written by James Hacker. 331 | 332 | , 1 April 1989 333 | Ty Coon, President of Vice 334 | 335 | This General Public License does not permit incorporating your program into 336 | proprietary programs. If your program is a subroutine library, you may 337 | consider it more useful to permit linking proprietary applications with the 338 | library. If this is what you want to do, use the GNU Lesser General 339 | Public License instead of this License. 340 | -------------------------------------------------------------------------------- /fuse_tests/fuse_files/README: -------------------------------------------------------------------------------- 1 | File formats 2 | ============ 3 | 4 | tests.in 5 | -------- 6 | 7 | Each test has the format: 8 | 9 | 10 | AF BC DE HL AF' BC' DE' HL' IX IY SP PC 11 | I R IFF1 IFF2 IM 12 | 13 | specifies whether the Z80 is halted. 14 | specifies the number of tstates to run the test for, in 15 | decimal; the number actually executed may be higher, as the final 16 | instruction is allowed to complete. 17 | 18 | Then followed by lines specifying the initial memory setup. Each has 19 | the format: 20 | 21 | ... -1 22 | 23 | eg 24 | 25 | 1234 56 78 9a -1 26 | 27 | says to put 0x56 at 0x1234, 0x78 at 0x1235 and 0x9a at 0x1236. 28 | 29 | Finally, -1 to end the test. Blank lines may follow before the next test. 30 | 31 | tests.expected 32 | -------------- 33 | 34 | Each test output starts with the test description, followed by a list 35 | of 'events': each has the format 36 | 37 |