diff --git a/.gitignore b/.gitignore index 2d8c460..9b5a26c 100644 --- a/.gitignore +++ b/.gitignore @@ -8,11 +8,14 @@ unittests salink saimport saexport +specasm-bare +test_content_zx SAIMPORT SAEXPORT SAIMPORT.X SAEXPORT.X build.sh compile.sh -build/specasm +build/release +build/unitzx .DS_Store diff --git a/Makefile b/Makefile index 250f0b5..92d80f5 100644 --- a/Makefile +++ b/Makefile @@ -11,14 +11,18 @@ COMMON =\ SRCS =\ editor.c \ editor_tests.c \ + editor_test_content.c \ peer_unit.c \ peer_posix_screen.c \ + peer_text_screen.c \ + test_content.c \ unittests.c POSIX = \ peer_posix.c \ peer_file_posix.c \ - peer_posix_screen.c + peer_posix_screen.c \ + peer_text_screen.c SAIMPORT =\ saimport.c @@ -29,6 +33,10 @@ SAEXPORT =\ SALINK =\ salink.c +TEST_CONTENT_ZX =\ + test_content.c \ + test_content_zx.c + CFLAGS += -Wall -MMD -DUNITTESTS -Isrc all: unittests saimport saexport salink @@ -45,6 +53,9 @@ saexport: $(BASE:%.c=%.o) $(COMMON:%.c=%.o) $(POSIX:%.c=%.o) $(SAEXPORT:%.c=%.o) salink: $(BASE:%.c=%.o) $(POSIX:%.c=%.o) $(SALINK:%.c=%.o) $(CC) $(CFLAGS) -o $@ $^ +test_content_zx: $(TEST_CONTENT_ZX:%.c=%.o) + $(CC) $(CFLAGS) -o $@ $^ + clean: - rm *.d *.o unittests saimport saexport salink @@ -55,3 +66,4 @@ clean: -include $(SAIMPORT:%.c=%.d) -include $(SAEXPORT:%.c=%.d) -include $(SALINK:%.c=%.d) +-include $(TEST_CONTENT_ZX:%.c=%.d) diff --git a/README.md b/README.md index d595a90..caed720 100644 --- a/README.md +++ b/README.md @@ -71,8 +71,44 @@ make -j And then wait. All the tap and dotx files will be created in the build directory. +To create a zip file with all the files that need to be copied onto the spectrum, type + +``` +make release +``` + +from the same directory. The specasm.zip file can be found in the build/release folder. + The saexport, saimport and salink commands can be built and run on POSIX compatible systems. Simply type make from the main Specasm directory. The saimport is essentially the assembler without the editor, so can be used in conjunction with salink to assemble and build Spectrum programs directly on a modern machine, but where's the fun in that? +## Tests + +To run the unit tests simply type + +``` +make +./unittests +``` + +from the project's top level folder. + +To run the linker tests perform the following steps + +``` +make +cd tests +./tests.sh +``` + +A large proportion (but not all) of the unit tests can be run on the spectrum itself. To build these tests type + +``` +cd unitzx +make +make tests +``` + +This will create a folder called unitzx in the unitzx folder. Inside this folder are 3 files that need to be copied to the same directory on your spectrum. Run the unizx.tap file to run the tests. diff --git a/bas/SPECLD.TAP b/bas/SPECLD.TAP index 47ead86..9f0d052 100755 Binary files a/bas/SPECLD.TAP and b/bas/SPECLD.TAP differ diff --git a/build/Make.include b/build/Make.include index 7fb8366..a7b2466 100644 --- a/build/Make.include +++ b/build/Make.include @@ -6,16 +6,21 @@ state.o: ../src/state.c ../src/state.h ../src/state_base.h ../src/line.h ../src/ line.o: ../src/line.c ../src/peer.h ../src/error.h ../src/peer_zx.h ../src/line.h \ ../src/state.h ../src/state_base.h ../src/strings.h editor.o: ../src/editor.c ../src/editor.h ../src/peer.h ../src/error.h \ - ../src/peer_zx.h ../src/line.h ../src/state.h ../src/state_base.h ../src/strings.h + ../src/peer_zx.h ../src/line.h ../src/state.h ../src/state_base.h ../src/strings.h \ + ../src/util_print_zx.h saimport.o: ../src/saimport.c ../src/peer.h ../src/error.h ../src/peer_zx.h \ - ../src/line.h ../src/peer_file.h ../src/state.h ../src/state_base.h ../src/strings.h + ../src/line.h ../src/peer_file.h ../src/state.h ../src/state_base.h ../src/strings.h \ + ../src/util_print_zx.h saexport.o: ../src/saexport.c ../src/peer.h ../src/error.h ../src/peer_zx.h \ - ../src/line.h ../src/peer_file.h ../src/state.h ../src/state_base.h ../src/strings.h + ../src/line.h ../src/peer_file.h ../src/state.h ../src/state_base.h ../src/strings.h \ + ../src/util_print_zx.h salink.o: ../src/salink.c ../src/peer.h ../src/error.h ../src/peer_zx.h ../src/line.h \ - ../src/peer_file.h ../src/state_base.h ../src/strings.h + ../src/peer_file.h ../src/state_base.h ../src/strings.h \ + ../src/util_print_zx.h peer_zx.o: ../src/peer_zx.c ../src/peer.h ../src/state.h ../src/state_base.h ../src/line.h \ - ../src/strings.h ../src/error.h + ../src/strings.h ../src/error.h ../src/util_print_zx.h peer_file_zx.o: ../src/peer_file_zx.c ../src/error.h ../src/peer_file.h +util_print_zx.o: ../src/util_print_zx.h %.o: %.c zcc $(CFLAGS) -o $@ -c $< diff --git a/build/Makefile b/build/Makefile index dda5129..5204b54 100644 --- a/build/Makefile +++ b/build/Makefile @@ -4,7 +4,7 @@ VPATH=../src all: specasm.tap salink.tap SAEXPORT SAIMPORT CC=zcc -CFLAGS=+zx -SO2 --opt-code-size --max-allocs-per-node200000 -Cs "--disable-warning 85" -clib=sdcc_iy +CFLAGS=+zx -SO3 --opt-code-size --max-allocs-per-node200000 -Cs "--disable-warning 85" -clib=sdcc_iy include Make.include @@ -15,35 +15,40 @@ SPECASM = \ state_base.o \ state.o \ editor.o \ + util_print_zx.o \ peer_zx.o SALINK = \ - salink.o \ - error.o \ - state_base.o \ - peer_file_zx.o \ - peer_zx.o + salink.o \ + error.o \ + state_base.o \ + peer_file_zx.o \ + util_print_zx.o \ + peer_zx.o SAEXPORT = \ - error.o \ - state_base.o \ - line.o \ - state.o \ - peer_file_zx.o \ - peer_zx.o \ - saexport.o + error.o \ + state_base.o \ + line.o \ + state.o \ + peer_file_zx.o \ + util_print_zx.o \ + peer_zx.o \ + saexport.o SAIMPORT = \ - error.o \ - state_base.o \ - line.o \ - state.o \ - peer_file_zx.o \ - peer_zx.o \ - saimport.o + error.o \ + state_base.o \ + line.o \ + state.o \ + peer_file_zx.o \ + util_print_zx.o \ + peer_zx.o \ + saimport.o specasm.tap: $(SPECASM) - $(CC) $(CFLAGS) -zorg=24550 -startup=31 -o specasm $^ -create-app -Cz--merge=../bas/SPECLD.TAP + $(CC) $(CFLAGS) -zorg=24310 -startup=31 -o specasm-bare $^ -create-app + cat ../bas/SPECLD.TAP specasm-bare.tap > specasm.tap salink.tap: $(SALINK) $(CC) $(CFLAGS) -zorg=24000 -startup=31 -o salink $^ -create-app @@ -55,14 +60,14 @@ SAIMPORT: $(SAIMPORT) $(CC) $(CFLAGS) -startup=30 -o $@ $(SAIMPORT) -subtype=dotx -Cz"--clean" -create-app clean: - - rm -rf specasm *.zip + - rm -rf specasm *.zip -rf unitzx - rm *.X *.o *.bin *.tap SAIMPORT SAEXPORT .PHONY: release release: - rm -rf release mkdir -p release/specasm - cp *.tap release/specasm + cp specasm.tap salink.tap release/specasm cp SAIMPORT SAEXPORT *.X release/specasm cp ../bas/INSTALL release/specasm cp ../bas/REMOVE release/specasm diff --git a/src/editor_test_content.c b/src/editor_test_content.c new file mode 100644 index 0000000..cfa9171 --- /dev/null +++ b/src/editor_test_content.c @@ -0,0 +1,1225 @@ +/* + * Copyright contributors to Specasm + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. +*/ + + +#include "editor.h" +#include "editor_test_content.h" + +/* clang-format off */ + +#define EDITOR_BUF_START "\x7" +#define EDITOR_KEY_LEFT "\x8" +#define EDITOR_KEY_RIGHT "\x9" +#define EDITOR_BUF_END "\x6" +#define EDITOR_PAGE_DOWN "\x81" +#define EDITOR_PAGE_UP "\x80" +#define EDITOR_KEY_DOWN "\xa" +#define EDITOR_KEY_UP "\xb" +#define EDITOR_KEY_DELETE "\xc" +#define EDITOR_KEY_ENTER "\xd" +#define EDITOR_KEY_LINE_END "\x85" +#define EDITOR_KEY_INSERT "\x82" +#define EDITOR_KEY_LINE_START "\x83" +#define EDITOR_KEY_COMMAND "\x84" + + +#define FORMATTED_TEST_DATA \ + "; Here's an example hello the co"\ + "; program with some "\ + "; comments "\ + "; "\ + " "\ + ".this_is_the_main_loop "\ + " halt ; here "\ + " halt ; next "\ + " halt "\ + " scf "\ + ".end "\ + " rla "\ + ";1 "\ + ";2 "\ + ";3 "\ + ".four "\ + ".five "\ + ".six "\ + "; seven "\ + "; 8 "\ + "; nine "\ + "; ten "\ + "; 11 "\ + "; )-: "\ + "; (-: "\ + ";-) " + +const char *const formatted_test_data = FORMATTED_TEST_DATA + " "; +const char *const formatted_test_data2x = FORMATTED_TEST_DATA + FORMATTED_TEST_DATA + " "; + +const char *const formatted_last_deleted = + " " + ".this_is_the_main_loop " + " halt ; here " + " halt ; next " + " halt " + " scf " + ".end " + " rla " + ";1 " + ";2 " + ";3 " + ".four " + ".five " + ".six " + "; seven " + "; 8 " + "; nine " + "; ten " + "; 11 " + "; )-: " + "; (-: " + " " + " "; + +#define test_data "; Here's an example hello the co"\ + " ; program with some" EDITOR_KEY_ENTER\ + " ; comments" EDITOR_KEY_ENTER\ + ";" EDITOR_KEY_ENTER\ + "" EDITOR_KEY_ENTER\ + ".this_is_the_main_loop" EDITOR_KEY_ENTER\ + "halt ; here" EDITOR_KEY_ENTER\ + "halt ; next" EDITOR_KEY_ENTER\ + "halt" EDITOR_KEY_ENTER\ + "scf" EDITOR_KEY_ENTER\ + ".end" EDITOR_KEY_ENTER\ + "rla" EDITOR_KEY_ENTER\ + ";1" EDITOR_KEY_ENTER\ + ";2" EDITOR_KEY_ENTER\ + ";3" EDITOR_KEY_ENTER\ + ".four" EDITOR_KEY_ENTER\ + ".five"EDITOR_KEY_ENTER\ + ".six" EDITOR_KEY_ENTER\ + "; seven" EDITOR_KEY_ENTER\ + "; 8" EDITOR_KEY_ENTER\ + "; nine" EDITOR_KEY_ENTER\ + "; ten" EDITOR_KEY_ENTER\ + "; 11" EDITOR_KEY_ENTER\ + "; )-:" EDITOR_KEY_ENTER\ + "; (-:" EDITOR_KEY_ENTER\ + ";-)" EDITOR_KEY_ENTER + +#define EDITOR_BLANK_LINE " " + +const editor_test_t editor_tests[] = { + { + "reset", + "", + EDITOR_BLANK_LINE, + "", + { 0 }, + 1, + }, + { + "add_empty", + EDITOR_KEY_ENTER, + EDITOR_BLANK_LINE EDITOR_BLANK_LINE, + "", + { .line = 1, .row = 1, }, + 2, + }, + { + "blank_line_0", + EDITOR_KEY_ENTER "0", + EDITOR_BLANK_LINE + "0 ", + "", + { .line = 1, .row = 1, .col = 1, .editing = 1 }, + 2, + }, + { + "two_empty_delete", + EDITOR_KEY_ENTER EDITOR_KEY_ENTER EDITOR_KEY_DELETE, + EDITOR_BLANK_LINE EDITOR_BLANK_LINE, + "", + { .line = 1, .row = 1 }, + 2, + }, + { + "delete_empty", + EDITOR_KEY_DELETE, + EDITOR_BLANK_LINE, + "", + { 0 }, + 1, + }, + { + "add_empty_ovr", + EDITOR_KEY_INSERT EDITOR_KEY_ENTER, + EDITOR_BLANK_LINE EDITOR_BLANK_LINE, + "", + { .line = 1, .row = 1, .ovr = 1}, + 2, + }, + { + "blank_line_0_ovr", + EDITOR_KEY_INSERT EDITOR_KEY_ENTER "0", + EDITOR_BLANK_LINE + "0 ", + "", + { .line = 1, .row = 1, .col = 1, .editing = 1, .ovr = 1 }, + 2, + }, + { + "two_empty_delete_ovr", + EDITOR_KEY_INSERT EDITOR_KEY_ENTER EDITOR_KEY_ENTER + EDITOR_KEY_DELETE, + EDITOR_BLANK_LINE EDITOR_BLANK_LINE EDITOR_BLANK_LINE, + "", + { .line = 1, .row = 1, .ovr = 1 }, + 3, + }, + { + "test_data", + test_data, + &formatted_test_data[4 * SPECASM_LINE_MAX_LEN], + "", + { .line = 26, .row = 22 }, + 27, + }, + { + "test_new", + test_data EDITOR_KEY_COMMAND "n" EDITOR_KEY_ENTER, + EDITOR_BLANK_LINE, + "", + { .row = 0 }, + 1, + }, + { + "test_up", + test_data EDITOR_KEY_UP, + &formatted_test_data[4 * SPECASM_LINE_MAX_LEN], + "", + { .line = 25, .row = 21 }, + 27, + }, + { + "scroll_up", + test_data EDITOR_KEY_UP EDITOR_KEY_UP EDITOR_KEY_UP + EDITOR_KEY_UP EDITOR_KEY_UP EDITOR_KEY_UP EDITOR_KEY_UP + EDITOR_KEY_UP EDITOR_KEY_UP EDITOR_KEY_UP EDITOR_KEY_UP + EDITOR_KEY_UP EDITOR_KEY_UP EDITOR_KEY_UP EDITOR_KEY_UP + EDITOR_KEY_UP EDITOR_KEY_UP EDITOR_KEY_UP EDITOR_KEY_UP + EDITOR_KEY_UP EDITOR_KEY_UP EDITOR_KEY_UP EDITOR_KEY_UP, + &formatted_test_data[3 * SPECASM_LINE_MAX_LEN], + "", + { .line = 3, .row = 0 }, + 27, + }, + { + "page_up", + test_data EDITOR_PAGE_UP, + formatted_test_data, + "", + { .line = 0, .row = 0 }, + 27, + }, + { + "scroll_down", + test_data EDITOR_PAGE_UP EDITOR_KEY_DOWN EDITOR_KEY_DOWN + EDITOR_KEY_DOWN EDITOR_KEY_DOWN EDITOR_KEY_DOWN EDITOR_KEY_DOWN + EDITOR_KEY_DOWN EDITOR_KEY_DOWN EDITOR_KEY_DOWN EDITOR_KEY_DOWN + EDITOR_KEY_DOWN EDITOR_KEY_DOWN EDITOR_KEY_DOWN EDITOR_KEY_DOWN + EDITOR_KEY_DOWN EDITOR_KEY_DOWN EDITOR_KEY_DOWN EDITOR_KEY_DOWN + EDITOR_KEY_DOWN EDITOR_KEY_DOWN EDITOR_KEY_DOWN EDITOR_KEY_DOWN + EDITOR_KEY_DOWN, + &formatted_test_data[1 * SPECASM_LINE_MAX_LEN], + "", + { .line = 23, .row = 22 }, + 27, + }, + { + "page_up_page_up", + test_data EDITOR_PAGE_UP EDITOR_PAGE_UP, + formatted_test_data, + "", + { .line = 0, .row = 0 }, + 27, + }, + { + "page_down", + test_data EDITOR_PAGE_DOWN, + &formatted_test_data[4 * SPECASM_LINE_MAX_LEN], + "", + { .line = 26, .row = 22 }, + 27, + }, + { + "up4_page_down", + test_data EDITOR_KEY_UP EDITOR_KEY_UP + EDITOR_KEY_UP EDITOR_KEY_UP EDITOR_PAGE_DOWN, + &formatted_test_data[4 * SPECASM_LINE_MAX_LEN], + "", + { .line = 22, .row = 18 }, + 27, + }, + { + "page_up_page_down", + test_data EDITOR_PAGE_UP EDITOR_PAGE_DOWN, + &formatted_test_data[4 * SPECASM_LINE_MAX_LEN], + "", + { .line = 4, .row = 0 }, + 27, + }, + { + "page_up_big", + test_data test_data EDITOR_PAGE_UP, + &formatted_test_data2x[7 * SPECASM_LINE_MAX_LEN], + "", + { .line = 7, .row = 0 }, + 53, + }, + { + "page_down_big", + test_data test_data test_data EDITOR_BUF_START EDITOR_PAGE_DOWN, + &formatted_test_data2x[23 * SPECASM_LINE_MAX_LEN], + "", + { .line = 23, .row = 0 }, + 79, + }, + { + "top", + test_data test_data EDITOR_BUF_START, + formatted_test_data2x, + "", + { .line = 0, .row = 0 }, + 53, + }, + { + "top_bottom", + test_data test_data EDITOR_BUF_START EDITOR_BUF_END, + &formatted_test_data2x[30 * SPECASM_LINE_MAX_LEN], + "", + { .line = 52, .row = 22 }, + 53, + }, + { + "bottom_top_bottom", + "ld a, 10" EDITOR_KEY_ENTER EDITOR_BUF_END EDITOR_BUF_START + EDITOR_BUF_END, + " ld a, 10 " + EDITOR_BLANK_LINE, + "", + { .line = 1, .row = 1 }, + 2, + }, + { + "delete", + "1234" EDITOR_KEY_DELETE EDITOR_KEY_DELETE EDITOR_KEY_DELETE + EDITOR_KEY_DELETE EDITOR_KEY_DELETE, + EDITOR_BLANK_LINE, + "", + { .line = 0, .row = 0, .editing = 1 }, + 1, + }, + { + "delete_ovr", + "1234" EDITOR_KEY_INSERT EDITOR_KEY_DELETE EDITOR_KEY_DELETE + EDITOR_KEY_DELETE EDITOR_KEY_DELETE EDITOR_KEY_DELETE, + EDITOR_BLANK_LINE, + "", + { .line = 0, .row = 0, .editing = 1, .ovr = 1 }, + 1, + }, + { + "delete_cmd_ovr", + EDITOR_KEY_COMMAND "1234" EDITOR_KEY_INSERT EDITOR_KEY_DELETE + EDITOR_KEY_DELETE + EDITOR_KEY_DELETE EDITOR_KEY_DELETE EDITOR_KEY_DELETE, + "> ", + "", + { .line = 0, .row = 0, .ovr = 1, .command_col = 2, + .mode = SPECASM_MODE_COMMAND }, + 1, + 1, + }, + { + "delete_ovr2", + "1234" EDITOR_KEY_INSERT EDITOR_KEY_LEFT EDITOR_KEY_DELETE, + "12 4 ", + "", + { .line = 0, .row = 0, .col = 2, .editing = 1, .ovr = 1 }, + 1, + }, + { + "delete_cmd_ovr2", + EDITOR_KEY_COMMAND "1234" EDITOR_KEY_INSERT EDITOR_KEY_LEFT + EDITOR_KEY_DELETE, + "> 12 4 ", + "", + { .line = 0, .row = 0, .command_col = 4, .ovr = 1, + .mode = SPECASM_MODE_COMMAND }, + 1, + 1, + }, + { + "delete_all", + test_data EDITOR_BUF_START EDITOR_KEY_COMMAND "sel" + EDITOR_KEY_ENTER "a" EDITOR_KEY_ENTER + EDITOR_KEY_COMMAND "d" EDITOR_KEY_ENTER, + EDITOR_BLANK_LINE, + "", + { .line = 0, .row = 0 }, + 1, + }, + { + "delete_nothing", + test_data EDITOR_KEY_COMMAND "d" EDITOR_KEY_ENTER, + &formatted_test_data[4 * SPECASM_LINE_MAX_LEN], + "", + { .line = 26, .row = 22, .command_col = 3 }, + 27, + }, + { + "delete_almost_all", + test_data EDITOR_BUF_START EDITOR_KEY_COMMAND "sel" + EDITOR_KEY_ENTER EDITOR_KEY_DOWN EDITOR_KEY_DOWN EDITOR_KEY_DOWN + EDITOR_KEY_DOWN EDITOR_KEY_DOWN EDITOR_KEY_DOWN EDITOR_KEY_DOWN + EDITOR_KEY_DOWN EDITOR_KEY_DOWN EDITOR_KEY_DOWN EDITOR_KEY_DOWN + EDITOR_KEY_DOWN EDITOR_KEY_DOWN EDITOR_KEY_DOWN EDITOR_KEY_DOWN + EDITOR_KEY_DOWN EDITOR_KEY_DOWN EDITOR_KEY_DOWN EDITOR_KEY_DOWN + EDITOR_KEY_DOWN EDITOR_KEY_DOWN EDITOR_KEY_DOWN EDITOR_KEY_DOWN + EDITOR_KEY_DOWN EDITOR_KEY_DOWN EDITOR_KEY_DOWN + EDITOR_KEY_ENTER EDITOR_KEY_COMMAND "d" EDITOR_KEY_ENTER, + EDITOR_BLANK_LINE, + "", + { .line = 0, .row = 0, .command_col = 3 }, + 1, + }, + { + "delete_almost_all_select", + test_data EDITOR_BUF_START EDITOR_KEY_COMMAND "sel" + EDITOR_KEY_ENTER EDITOR_KEY_DOWN EDITOR_KEY_DOWN EDITOR_KEY_DOWN + EDITOR_KEY_DOWN EDITOR_KEY_DOWN EDITOR_KEY_DOWN EDITOR_KEY_DOWN + EDITOR_KEY_DOWN EDITOR_KEY_DOWN EDITOR_KEY_DOWN EDITOR_KEY_DOWN + EDITOR_KEY_DOWN EDITOR_KEY_DOWN EDITOR_KEY_DOWN EDITOR_KEY_DOWN + EDITOR_KEY_DOWN EDITOR_KEY_DOWN EDITOR_KEY_DOWN EDITOR_KEY_DOWN + EDITOR_KEY_DOWN EDITOR_KEY_DOWN EDITOR_KEY_DOWN EDITOR_KEY_DOWN + EDITOR_KEY_DOWN EDITOR_KEY_DOWN EDITOR_KEY_DOWN + EDITOR_KEY_DELETE, + EDITOR_BLANK_LINE, + "", + { .line = 0, .row = 0, .command_col = 5 }, + 1, + }, + { + "delete_nothing_select", + test_data EDITOR_BUF_START EDITOR_KEY_COMMAND "sel" + EDITOR_KEY_ENTER EDITOR_KEY_DELETE, + formatted_test_data, + "", + { .line = 0, .row = 0, .command_col = 5 }, + 27, + }, + { + "delete_all_select_up", + test_data EDITOR_KEY_COMMAND "sel" + EDITOR_KEY_ENTER EDITOR_KEY_UP EDITOR_KEY_UP EDITOR_KEY_UP + EDITOR_KEY_UP EDITOR_KEY_UP EDITOR_KEY_UP EDITOR_KEY_UP + EDITOR_KEY_UP EDITOR_KEY_UP EDITOR_KEY_UP EDITOR_KEY_UP + EDITOR_KEY_UP EDITOR_KEY_UP EDITOR_KEY_UP EDITOR_KEY_UP + EDITOR_KEY_UP EDITOR_KEY_UP EDITOR_KEY_UP EDITOR_KEY_UP + EDITOR_KEY_UP EDITOR_KEY_UP EDITOR_KEY_UP EDITOR_KEY_UP + EDITOR_KEY_UP EDITOR_KEY_UP EDITOR_KEY_UP + EDITOR_KEY_ENTER EDITOR_KEY_COMMAND "d" EDITOR_KEY_ENTER, + EDITOR_BLANK_LINE, + "", + { .line = 0, .row = 0, .command_col = 3 }, + 1, + }, + { + "delete_almost_all_select_up", + test_data EDITOR_KEY_COMMAND "sel" + EDITOR_KEY_ENTER EDITOR_KEY_UP EDITOR_KEY_UP EDITOR_KEY_UP + EDITOR_KEY_UP EDITOR_KEY_UP EDITOR_KEY_UP EDITOR_KEY_UP + EDITOR_KEY_UP EDITOR_KEY_UP EDITOR_KEY_UP EDITOR_KEY_UP + EDITOR_KEY_UP EDITOR_KEY_UP EDITOR_KEY_UP EDITOR_KEY_UP + EDITOR_KEY_UP EDITOR_KEY_UP EDITOR_KEY_UP EDITOR_KEY_UP + EDITOR_KEY_UP EDITOR_KEY_UP EDITOR_KEY_UP EDITOR_KEY_UP + EDITOR_KEY_UP EDITOR_KEY_UP + EDITOR_KEY_ENTER EDITOR_KEY_COMMAND "d" EDITOR_KEY_ENTER, + "; Here's an example hello the co" + EDITOR_BLANK_LINE, + "", + { .line = 1, .row = 1, .command_col = 3 }, + 2, + }, + { + "start_line", + "123456" EDITOR_KEY_LINE_START, + "123456 ", + "", + { .line = 0, .row = 0, .editing = 1 }, + 1, + }, + { + "end_line", + ";12345" EDITOR_KEY_ENTER EDITOR_KEY_UP EDITOR_KEY_LINE_END, + ";12345 " + EDITOR_BLANK_LINE, + "", + { .line = 0, .row = 0, .col = 6 }, + 2, + }, + { + "end_full_line", + "; Here's an example hello the co" + EDITOR_KEY_UP EDITOR_KEY_LINE_END, + "; Here's an example hello the co" + EDITOR_BLANK_LINE, + "", + { .line = 0, .row = 0, .col = 31 }, + 2, + }, + { + "insert_editing", + "; Here's an example hello the c" + EDITOR_KEY_LEFT EDITOR_KEY_LEFT " ", + "; Here's an example hello the c", + "", + { .line = 0, .row = 0, .col = 30, .editing = 1 }, + 1, + }, + { + "insert_full_editing", + "; Here's an example hello the c" + EDITOR_KEY_LEFT EDITOR_KEY_LEFT " ", + "; Here's an example hello the c", + "", + { .line = 0, .row = 0, .col = 30, .editing = 1 }, + 1, + }, + { + "insert_not_editing", + "; Here's an example hello the c" + EDITOR_KEY_ENTER EDITOR_KEY_UP EDITOR_KEY_LEFT " ", + " ; Here's an example hello the c" + EDITOR_BLANK_LINE, + "", + { .line = 0, .row = 0, .col = 1, .editing = 1 }, + 2, + }, + { + "navigate", + test_data + EDITOR_KEY_UP EDITOR_KEY_UP EDITOR_KEY_UP EDITOR_KEY_DOWN + EDITOR_KEY_RIGHT EDITOR_KEY_RIGHT EDITOR_KEY_RIGHT + EDITOR_KEY_DOWN, + &formatted_test_data[4 * SPECASM_LINE_MAX_LEN], + "", + { .line = 25, .row = 21, .col = 3 }, + 27, + }, + { + "cant_go_down", + EDITOR_KEY_DOWN, + EDITOR_BLANK_LINE, + "", + { 0 }, + 1, + }, + { + "right_update", + "; Here's an example hello the c" + EDITOR_KEY_RIGHT, + "; Here's an example hello the c " + EDITOR_BLANK_LINE, + "", + { .line = 1, .row = 1, .col = 0, .editing = 0 }, + 2, + }, + { + "command_left", + EDITOR_KEY_COMMAND "1234" EDITOR_KEY_LEFT EDITOR_KEY_LEFT, + "> 1234 ", + "", + { .command_col = 4, .mode = SPECASM_MODE_COMMAND }, + 1, + 1, + }, + { + "command_right", + EDITOR_KEY_COMMAND "1234" EDITOR_KEY_LEFT EDITOR_KEY_LEFT + EDITOR_KEY_RIGHT, + "> 1234 ", + "", + { .command_col = 5, .mode = SPECASM_MODE_COMMAND}, + 1, + 1, + }, + { + "command_noright", + EDITOR_KEY_COMMAND "1234" EDITOR_KEY_RIGHT, + "> 1234 ", + "", + { .command_col = 6, .mode = SPECASM_MODE_COMMAND}, + 1, + 1, + }, + { + "quitting", + EDITOR_KEY_COMMAND "q" EDITOR_KEY_ENTER, + EDITOR_BLANK_LINE, + "", + { .command_col = 3, .quitting =1 }, + 1, + }, + { + "command_delete", + EDITOR_KEY_COMMAND "qw" EDITOR_KEY_DELETE EDITOR_KEY_ENTER, + EDITOR_BLANK_LINE, + "", + { .command_col = 3, .quitting =1 }, + 1, + }, + { + "command_overwrite", + EDITOR_KEY_COMMAND "set" EDITOR_KEY_INSERT EDITOR_KEY_LEFT "l" + EDITOR_KEY_ENTER, + EDITOR_BLANK_LINE, + "", + { .command_col = 5, .mode = SPECASM_MODE_SELECT, .ovr = 1 }, + 1, + }, + { + "select_last_up", + test_data EDITOR_KEY_UP EDITOR_KEY_UP EDITOR_KEY_COMMAND "sel" + EDITOR_KEY_ENTER EDITOR_KEY_DOWN EDITOR_KEY_DOWN + EDITOR_KEY_DOWN EDITOR_KEY_UP, + &formatted_test_data[4 * SPECASM_LINE_MAX_LEN], + "", + { .line = 26, .row = 22, .command_col = 5, + .mode = SPECASM_MODE_SELECT, .select_start = 24, + .select_end = 26}, + 27, + }, + { + "select_deselect", + test_data EDITOR_KEY_UP EDITOR_KEY_UP EDITOR_KEY_COMMAND "sel" + EDITOR_KEY_ENTER EDITOR_KEY_DOWN EDITOR_KEY_DOWN + EDITOR_KEY_UP EDITOR_KEY_UP, + &formatted_test_data[4 * SPECASM_LINE_MAX_LEN], + "", + { .line = 24, .row = 20, .command_col = 5, + .mode = SPECASM_MODE_SELECT, .select_start = 24, + .select_end = 24}, + 27, + }, + { + "bad_command", + EDITOR_KEY_COMMAND "selt" EDITOR_KEY_ENTER, + EDITOR_BLANK_LINE, + "", + { .command_col = 6, .mode = SPECASM_MODE_COMMAND }, + 1, + }, + { + "delete_select_last", + test_data EDITOR_KEY_COMMAND "sel" + EDITOR_KEY_ENTER EDITOR_KEY_UP EDITOR_KEY_ENTER + EDITOR_KEY_COMMAND "d" EDITOR_KEY_ENTER, + formatted_last_deleted, + "", + { .line = 25, .row = 21, .command_col = 3 }, + 26, + }, + { + "overwrite_end_of_line", + EDITOR_KEY_INSERT "; Here's an example hello the co", + "; Here's an example hello the co" + EDITOR_BLANK_LINE, + "", + { .line = 1, .row = 1, .ovr = 1}, + 2, + }, + { + "bad enter", + "1" EDITOR_KEY_ENTER, + "1 ", + "", + { .line = 0, .row = 0, .col = 1, .editing = 1}, + 1, + }, + { + "bad enter_ovr", + "1" EDITOR_KEY_INSERT EDITOR_KEY_ENTER, + "1 ", + "", + { .line = 0, .row = 0, .col = 1, .editing = 1, .ovr = 1}, + 1, + }, + { + "bad down", + EDITOR_KEY_ENTER EDITOR_KEY_UP "1" EDITOR_KEY_DOWN, + "1 " + EDITOR_BLANK_LINE, + "", + { .line = 0, .row = 0, .col = 1, .editing = 1}, + 2, + }, + { + "load_save", + test_data EDITOR_KEY_COMMAND "s file" EDITOR_KEY_ENTER + EDITOR_KEY_COMMAND "l file" EDITOR_KEY_ENTER, + formatted_test_data, + "", + { .command_col = 8 }, + 27, + }, + { + "load_save2", + test_data EDITOR_KEY_COMMAND "s file.x" EDITOR_KEY_ENTER + EDITOR_KEY_COMMAND "l file.x" EDITOR_KEY_ENTER, + formatted_test_data, + "", + { .command_col = 10 }, + 27, + }, + { + "up_empty", + EDITOR_KEY_UP, + EDITOR_BLANK_LINE, + "", + { 0 }, + 1, + }, + { + "bad_up", + EDITOR_KEY_ENTER "1" EDITOR_KEY_UP, + EDITOR_BLANK_LINE + "1 ", + "", + { .col = 1, .line = 1, .row = 1, .editing = 1 }, + 2, + }, + { + "empty_command", + EDITOR_KEY_COMMAND EDITOR_KEY_ENTER, + EDITOR_BLANK_LINE, + "", + { .line = 0, .row = 0, .command_col = 2 }, + 1, + }, + { + "select_no_up", + EDITOR_KEY_COMMAND "sel" EDITOR_KEY_ENTER EDITOR_KEY_UP, + EDITOR_BLANK_LINE, + "", + { .line = 0, .row = 0, .command_col = 5, + .mode = SPECASM_MODE_SELECT }, + 1, + }, + { + "delete_edit", + "; 1245" EDITOR_KEY_ENTER EDITOR_KEY_DELETE, + "; 1245 ", + "", + { .line = 0, .row = 0, .col = 6, .editing = 1 }, + 1, + }, + { + "delete_edit_2", + EDITOR_KEY_ENTER "; 1245" EDITOR_KEY_ENTER EDITOR_KEY_DELETE + EDITOR_KEY_DELETE EDITOR_KEY_DELETE EDITOR_KEY_DELETE + EDITOR_KEY_DELETE EDITOR_KEY_DELETE EDITOR_KEY_DELETE + EDITOR_KEY_DELETE, + EDITOR_BLANK_LINE, + "", + { .line = 0, .row = 0, .col = 0, .editing = 0 }, + 1, + }, + { + "delete_line_0", + EDITOR_KEY_ENTER "; 1245" EDITOR_KEY_ENTER EDITOR_KEY_UP + EDITOR_KEY_UP EDITOR_KEY_DELETE, + "; 1245 " + EDITOR_BLANK_LINE, + "", + { .line = 0, .row = 0, .col = 0, .editing = 0 }, + 2, + }, + { + "delete_ovr_move_up", + "; 1245" EDITOR_KEY_ENTER EDITOR_KEY_INSERT + EDITOR_KEY_DELETE, + "; 1245 " + EDITOR_BLANK_LINE, + "", + { .line = 0, .row = 0, .col = 6, .editing = 1, .ovr = 1 }, + 2, + }, + { + "delete_ovr_cant_move_up", + "; 1245" EDITOR_KEY_ENTER "1" EDITOR_KEY_INSERT EDITOR_KEY_LEFT + EDITOR_KEY_DELETE, + "; 1245 " + "1 ", + "", + { .line = 1, .row = 1, .col = 0, .editing = 1, .ovr = 1 }, + 2, + }, + { + "goto_neg", + test_data EDITOR_KEY_COMMAND "g -1" EDITOR_KEY_ENTER, + formatted_test_data, + "", + { .line = 0, .row = 0, .col = 0, .command_col = 6 }, + 27, + }, + { + "goto_same_screen", + test_data EDITOR_BUF_START EDITOR_KEY_COMMAND "g 7" + EDITOR_KEY_ENTER, + formatted_test_data, + "", + { .line = 7, .row = 7, .col = 0, .command_col = 5 }, + 27, + }, + { + "goto_almost_end", + test_data EDITOR_BUF_START EDITOR_KEY_COMMAND "g $18" + EDITOR_KEY_ENTER, + &formatted_test_data[4 * SPECASM_LINE_MAX_LEN], + "", + { .line = 24, .row = 20, .col = 0, .command_col = 7 }, + 27, + }, + { + "goto_too_big", + test_data EDITOR_BUF_START EDITOR_KEY_COMMAND "g $fff" + EDITOR_KEY_ENTER, + &formatted_test_data[4 * SPECASM_LINE_MAX_LEN], + "", + { .line = 26, .row = 22, .col = 0, .command_col = 8 }, + 27, + }, + { + "go_nowhere", + test_data EDITOR_BUF_START EDITOR_KEY_DOWN EDITOR_KEY_COMMAND + "g 1" EDITOR_KEY_ENTER, + formatted_test_data, + "", + { .line = 1, .row = 1, .col = 0, .command_col = 5 }, + 27, + }, + { + "empty_count", + EDITOR_KEY_COMMAND "c" EDITOR_KEY_ENTER, + EDITOR_BLANK_LINE, + "", + { .command_col = 3 }, + 1, + }, + /* + * Unfotunately, there's no way to check the count is correct as this + * information is flashed briefly and overwritten. We'll need to test + * the byte count in the linker tests. + */ + { + "byte_count", + "ld a, 10" EDITOR_KEY_ENTER + "db 10" EDITOR_KEY_ENTER + "bit 3, (ix + 127)" EDITOR_KEY_ENTER + "@hello" EDITOR_KEY_ENTER + EDITOR_KEY_COMMAND "sel" EDITOR_KEY_ENTER + EDITOR_KEY_UP EDITOR_KEY_UP EDITOR_KEY_UP EDITOR_KEY_UP + EDITOR_KEY_ENTER + EDITOR_KEY_COMMAND "b" EDITOR_KEY_ENTER, + " ld a, 10 " + "db 10 " + " bit 3, (ix+127) " + "@hello " + EDITOR_BLANK_LINE, + "", + { .command_col = 3 }, + 5, + }, + { + "copy_into_selected_area", + "ld a, 10" EDITOR_KEY_ENTER + "db 10" EDITOR_KEY_ENTER + "bit 3, (ix + 127)" EDITOR_KEY_ENTER + "@hello" EDITOR_KEY_ENTER + EDITOR_KEY_UP EDITOR_KEY_UP + EDITOR_KEY_COMMAND "sel" EDITOR_KEY_ENTER + EDITOR_KEY_UP EDITOR_KEY_UP EDITOR_KEY_ENTER + EDITOR_KEY_DOWN + EDITOR_KEY_COMMAND "c" EDITOR_KEY_ENTER, + " ld a, 10 " + " ld a, 10 " + "db 10 " + "db 10 " + " bit 3, (ix+127) " + "@hello " + EDITOR_BLANK_LINE, + "", + { .row = 1, .line = 1, .command_col = 3 }, + 7, + }, + { + "copy_above_selected_area", + "ld a, 10" EDITOR_KEY_ENTER + "db 10" EDITOR_KEY_ENTER + "bit 3, (ix + 127)" EDITOR_KEY_ENTER + "@hello" EDITOR_KEY_ENTER + EDITOR_KEY_UP + EDITOR_KEY_COMMAND "sel" EDITOR_KEY_ENTER + EDITOR_KEY_UP EDITOR_KEY_UP EDITOR_KEY_ENTER + EDITOR_KEY_UP EDITOR_KEY_UP + EDITOR_KEY_COMMAND "c" EDITOR_KEY_ENTER, + "db 10 " + " bit 3, (ix+127) " + " ld a, 10 " + "db 10 " + " bit 3, (ix+127) " + "@hello " + EDITOR_BLANK_LINE, + "", + { .row = 0, .line = 0, .command_col = 3 }, + 7, + }, + { + "copy_below_selected_area", + "ld a, 10" EDITOR_KEY_ENTER + "db 10" EDITOR_KEY_ENTER + "bit 3, (ix + 127)" EDITOR_KEY_ENTER + "@hello" EDITOR_KEY_ENTER + EDITOR_BUF_START + EDITOR_KEY_COMMAND "sel" EDITOR_KEY_ENTER + EDITOR_KEY_DOWN EDITOR_KEY_DOWN EDITOR_KEY_ENTER + EDITOR_BUF_END + EDITOR_KEY_COMMAND "c" EDITOR_KEY_ENTER, + " ld a, 10 " + "db 10 " + " bit 3, (ix+127) " + "@hello " + " ld a, 10 " + "db 10 " + EDITOR_BLANK_LINE, + "", + { .row = 4, .line = 4, .command_col = 3 }, + 7, + }, + { + "copy_whole_buffer", + test_data EDITOR_KEY_COMMAND "a" EDITOR_KEY_ENTER + EDITOR_KEY_COMMAND "c" EDITOR_KEY_ENTER, + &formatted_test_data2x[4 * SPECASM_LINE_MAX_LEN], + "", + { .line = 26, .row = 22, .command_col = 3 }, + 54, + }, + { + "copy_oom", + test_data EDITOR_KEY_COMMAND "a" EDITOR_KEY_ENTER + EDITOR_KEY_COMMAND "c" EDITOR_KEY_ENTER + EDITOR_KEY_COMMAND "a" EDITOR_KEY_ENTER + EDITOR_KEY_COMMAND "c" EDITOR_KEY_ENTER + EDITOR_KEY_COMMAND "a" EDITOR_KEY_ENTER + EDITOR_KEY_COMMAND "c" EDITOR_KEY_ENTER + EDITOR_KEY_COMMAND "a" EDITOR_KEY_ENTER + EDITOR_KEY_COMMAND "c" EDITOR_KEY_ENTER + EDITOR_KEY_COMMAND "a" EDITOR_KEY_ENTER + EDITOR_KEY_COMMAND "c" EDITOR_KEY_ENTER, + &formatted_test_data2x[4 * SPECASM_LINE_MAX_LEN], + "", + { .line = 26, .row = 22, .command_col = 3, .select_end = 432 }, + 432, + }, + { + "move_on_top", + test_data EDITOR_KEY_UP EDITOR_KEY_UP + EDITOR_KEY_COMMAND"sel" EDITOR_KEY_ENTER + EDITOR_KEY_UP EDITOR_KEY_UP EDITOR_KEY_UP EDITOR_KEY_UP + EDITOR_KEY_ENTER + EDITOR_KEY_DOWN EDITOR_KEY_DOWN + EDITOR_KEY_COMMAND "m" EDITOR_KEY_ENTER, + &formatted_test_data[4 * SPECASM_LINE_MAX_LEN], + "", + { .line = 22, .command_col = 3, .row = 18 }, + 27, + }, + { + "move_below", + ";1" EDITOR_KEY_ENTER + ";2" EDITOR_KEY_ENTER + ";3" EDITOR_KEY_ENTER + ";4" EDITOR_KEY_ENTER + ";5" EDITOR_KEY_ENTER + ";6" EDITOR_KEY_ENTER + ";7" EDITOR_KEY_ENTER + ";8" EDITOR_KEY_ENTER + ";9" EDITOR_KEY_ENTER + ";10" EDITOR_KEY_ENTER + ";11" EDITOR_KEY_ENTER + ";12" EDITOR_KEY_ENTER + ";13" EDITOR_KEY_ENTER + ";14" EDITOR_KEY_ENTER + EDITOR_BUF_START EDITOR_KEY_DOWN + EDITOR_KEY_COMMAND"sel" EDITOR_KEY_ENTER + EDITOR_KEY_DOWN EDITOR_KEY_DOWN EDITOR_KEY_DOWN + EDITOR_KEY_ENTER + EDITOR_BUF_END + EDITOR_KEY_COMMAND "m" EDITOR_KEY_ENTER, + ";1 " + ";5 " + ";6 " + ";7 " + ";8 " + ";9 " + ";10 " + ";11 " + ";12 " + ";13 " + ";14 " + ";2 " + ";3 " + ";4 " + EDITOR_BLANK_LINE, + "", + { .line = 14, .command_col = 3, .row = 14 }, + 15, + }, + { + "move_above", + ";1" EDITOR_KEY_ENTER + ";2" EDITOR_KEY_ENTER + ";3" EDITOR_KEY_ENTER + ";4" EDITOR_KEY_ENTER + ";5" EDITOR_KEY_ENTER + ";6" EDITOR_KEY_ENTER + ";7" EDITOR_KEY_ENTER + ";8" EDITOR_KEY_ENTER + ";9" EDITOR_KEY_ENTER + ";10" EDITOR_KEY_ENTER + ";11" EDITOR_KEY_ENTER + ";12" EDITOR_KEY_ENTER + ";13" EDITOR_KEY_ENTER + ";14" EDITOR_KEY_ENTER + EDITOR_BUF_END EDITOR_KEY_UP + EDITOR_KEY_COMMAND"sel" EDITOR_KEY_ENTER + EDITOR_KEY_UP EDITOR_KEY_UP EDITOR_KEY_UP + EDITOR_KEY_ENTER + EDITOR_BUF_START EDITOR_KEY_DOWN + EDITOR_KEY_COMMAND "m" EDITOR_KEY_ENTER, + ";1 " + ";11 " + ";12 " + ";13 " + ";2 " + ";3 " + ";4 " + ";5 " + ";6 " + ";7 " + ";8 " + ";9 " + ";10 " + ";14 " + EDITOR_BLANK_LINE, + "", + { .line = 1, .command_col = 3, .row = 1 }, + 15, + }, + { + "blank_line_bug", + ";1" EDITOR_KEY_ENTER + ";2" EDITOR_KEY_ENTER + EDITOR_KEY_ENTER EDITOR_KEY_ENTER + ";3" EDITOR_KEY_UP EDITOR_KEY_LINE_START + EDITOR_KEY_DELETE, + ";1 " + ";2 " + EDITOR_BLANK_LINE + ";3 " + EDITOR_BLANK_LINE, + "", + { .line = 2, .row = 2 }, + 4, + }, + { + "copy_overwrite_1", + ";1" EDITOR_KEY_ENTER + ";2" EDITOR_KEY_ENTER + ";3" EDITOR_KEY_ENTER + ";4" EDITOR_KEY_ENTER + ";5" EDITOR_KEY_ENTER + ";6" EDITOR_KEY_ENTER + ";7" EDITOR_KEY_ENTER + ";8" EDITOR_KEY_ENTER + ";9" EDITOR_KEY_ENTER + ";10" EDITOR_KEY_ENTER + ";11" EDITOR_KEY_ENTER + ";12" EDITOR_KEY_ENTER + ";13" EDITOR_KEY_ENTER + ";14" EDITOR_KEY_ENTER + EDITOR_KEY_COMMAND "sel" EDITOR_KEY_ENTER + EDITOR_KEY_UP EDITOR_KEY_UP EDITOR_KEY_UP + EDITOR_KEY_UP EDITOR_KEY_ENTER EDITOR_KEY_INSERT + EDITOR_BUF_START EDITOR_KEY_DOWN + EDITOR_KEY_COMMAND "c" EDITOR_KEY_ENTER, + ";1 " + ";11 " + ";12 " + ";13 " + ";14 " + ";6 " + ";7 " + ";8 " + ";9 " + ";10 " + ";11 " + ";12 " + ";13 " + ";14 " + EDITOR_BLANK_LINE, + "", + { .line = 1, .command_col = 3, .row = 1, .ovr = 1 }, + 15, + }, + { + "copy_overwrite_2", + ";1" EDITOR_KEY_ENTER + ";2" EDITOR_KEY_ENTER + ";3" EDITOR_KEY_ENTER + ";4" EDITOR_KEY_ENTER + ";5" EDITOR_KEY_ENTER + ";6" EDITOR_KEY_ENTER + ";7" EDITOR_KEY_ENTER + ";8" EDITOR_KEY_ENTER + ";9" EDITOR_KEY_ENTER + ";10" EDITOR_KEY_ENTER + ";11" EDITOR_KEY_ENTER + ";12" EDITOR_KEY_ENTER + ";13" EDITOR_KEY_ENTER + ";14" EDITOR_KEY_ENTER + EDITOR_BUF_START + EDITOR_KEY_COMMAND "sel" EDITOR_KEY_ENTER + EDITOR_KEY_DOWN EDITOR_KEY_DOWN EDITOR_KEY_DOWN + EDITOR_KEY_DOWN EDITOR_KEY_ENTER EDITOR_KEY_INSERT + EDITOR_BUF_END EDITOR_KEY_UP + EDITOR_KEY_COMMAND "c" EDITOR_KEY_ENTER, + ";1 " + ";2 " + ";3 " + ";4 " + ";5 " + ";6 " + ";7 " + ";8 " + ";9 " + ";10 " + ";11 " + ";12 " + ";13 " + ";1 " + ";2 " + ";3 " + ";4 ", + "", + { .line = 13, .command_col = 3, .row = 13, .ovr = 1 }, + 17, + }, + { + "find", + test_data EDITOR_BUF_START EDITOR_KEY_COMMAND "f next" + EDITOR_KEY_ENTER, + formatted_test_data, + "", + { .line = 7, .row = 7, .col = 0, .command_col = 8 }, + 27, + }, + { + "no find", + test_data EDITOR_BUF_START EDITOR_KEY_COMMAND "f nothere" + EDITOR_KEY_ENTER, + formatted_test_data, + "", + { .line = 0, .row = 0, .col = 0, .command_col = 11 }, + 27, + }, + { + "invalidate_select", + ";1" EDITOR_KEY_ENTER + ";2" EDITOR_KEY_ENTER + ";3" EDITOR_KEY_ENTER + ";4" EDITOR_KEY_ENTER + ";5" EDITOR_KEY_ENTER + ";6" EDITOR_KEY_ENTER + ";7" EDITOR_KEY_ENTER + ";8" EDITOR_KEY_ENTER + ";9" EDITOR_KEY_ENTER + EDITOR_KEY_UP EDITOR_KEY_UP EDITOR_KEY_COMMAND "sel" + EDITOR_KEY_ENTER EDITOR_KEY_DOWN EDITOR_KEY_DOWN + EDITOR_KEY_ENTER EDITOR_BUF_START EDITOR_KEY_ENTER, + " " + ";1 " + ";2 " + ";3 " + ";4 " + ";5 " + ";6 " + ";7 " + ";8 " + ";9 " + " ", + "", + { .line = 1, .row = 1, .command_col = 5}, + 11, + }, + { + "dont_invalidate_select", + ";1" EDITOR_KEY_ENTER + ";2" EDITOR_KEY_ENTER + ";3" EDITOR_KEY_ENTER + ";4" EDITOR_KEY_ENTER + ";5" EDITOR_KEY_ENTER + ";6" EDITOR_KEY_ENTER + ";7" EDITOR_KEY_ENTER + ";8" EDITOR_KEY_ENTER + ";9" EDITOR_KEY_ENTER + EDITOR_BUF_START EDITOR_KEY_COMMAND "sel" + EDITOR_KEY_ENTER EDITOR_KEY_DOWN EDITOR_KEY_DOWN + EDITOR_KEY_ENTER EDITOR_KEY_ENTER, + ";1 " + ";2 " + " " + ";3 " + ";4 " + ";5 " + ";6 " + ";7 " + ";8 " + ";9 " + " ", + "", + { .line = 3, .row = 3, .command_col = 5, .select_start = 0, + .select_end = 2 }, + 11, + }, +}; + +const size_t editor_tests_count = sizeof(editor_tests) / sizeof(editor_test_t); diff --git a/src/editor_test_content.h b/src/editor_test_content.h new file mode 100644 index 0000000..09a7b86 --- /dev/null +++ b/src/editor_test_content.h @@ -0,0 +1,51 @@ +/* + * Copyright contributors to Specasm + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. +*/ + +#ifndef EDITOR_TEST_CONTENT_H +#define EDITOR_TEST_CONTENT_H + +#include +#include + +struct editor_test_state_t_ { + unsigned int line; + uint8_t col; + uint8_t row; + uint8_t command_col; + uint8_t ovr; + uint8_t editing; + uint8_t quitting; + uint8_t mode; + unsigned int select_start; + unsigned int select_end; +}; +typedef struct editor_test_state_t_ editor_test_state_t; + +struct editor_test_t_ { + const char *name; + const char *input; + const char *screen; + const char *atts; + editor_test_state_t state; + unsigned int num_lines; + unsigned int command_test; +}; +typedef struct editor_test_t_ editor_test_t; + +extern const editor_test_t editor_tests[]; +extern const size_t editor_tests_count; + +#endif diff --git a/src/editor_tests.c b/src/editor_tests.c index 8711137..49a86c7 100644 --- a/src/editor_tests.c +++ b/src/editor_tests.c @@ -14,119 +14,13 @@ * limitations under the License. */ -#include #include #include #include "editor.h" +#include "editor_test_content.h" #include "state.h" -/* clang-format off */ - -#define EDITOR_BUF_START "\x7" -#define EDITOR_KEY_LEFT "\x8" -#define EDITOR_KEY_RIGHT "\x9" -#define EDITOR_BUF_END "\x6" -#define EDITOR_PAGE_DOWN "\x81" -#define EDITOR_PAGE_UP "\x80" -#define EDITOR_KEY_DOWN "\xa" -#define EDITOR_KEY_UP "\xb" -#define EDITOR_KEY_DELETE "\xc" -#define EDITOR_KEY_ENTER "\xd" -#define EDITOR_KEY_LINE_END "\x85" -#define EDITOR_KEY_INSERT "\x82" -#define EDITOR_KEY_LINE_START "\x83" -#define EDITOR_KEY_COMMAND "\x84" - - -#define FORMATTED_TEST_DATA \ - "; Here's an example hello the co"\ - "; program with some "\ - "; comments "\ - "; "\ - " "\ - ".this_is_the_main_loop "\ - " halt ; here "\ - " halt ; next "\ - " halt "\ - " scf "\ - ".end "\ - " rla "\ - ";1 "\ - ";2 "\ - ";3 "\ - ".four "\ - ".five "\ - ".six "\ - "; seven "\ - "; 8 "\ - "; nine "\ - "; ten "\ - "; 11 "\ - "; )-: "\ - "; (-: "\ - ";-) " - -const char *const formatted_test_data = FORMATTED_TEST_DATA - " "; -const char *const formatted_test_data2x = FORMATTED_TEST_DATA - FORMATTED_TEST_DATA - " "; - -const char *const formatted_last_deleted = - " " - ".this_is_the_main_loop " - " halt ; here " - " halt ; next " - " halt " - " scf " - ".end " - " rla " - ";1 " - ";2 " - ";3 " - ".four " - ".five " - ".six " - "; seven " - "; 8 " - "; nine " - "; ten " - "; 11 " - "; )-: " - "; (-: " - " " - " "; - -#define test_data "; Here's an example hello the co"\ - " ; program with some" EDITOR_KEY_ENTER\ - " ; comments" EDITOR_KEY_ENTER\ - ";" EDITOR_KEY_ENTER\ - "" EDITOR_KEY_ENTER\ - ".this_is_the_main_loop" EDITOR_KEY_ENTER\ - "halt ; here" EDITOR_KEY_ENTER\ - "halt ; next" EDITOR_KEY_ENTER\ - "halt" EDITOR_KEY_ENTER\ - "scf" EDITOR_KEY_ENTER\ - ".end" EDITOR_KEY_ENTER\ - "rla" EDITOR_KEY_ENTER\ - ";1" EDITOR_KEY_ENTER\ - ";2" EDITOR_KEY_ENTER\ - ";3" EDITOR_KEY_ENTER\ - ".four" EDITOR_KEY_ENTER\ - ".five"EDITOR_KEY_ENTER\ - ".six" EDITOR_KEY_ENTER\ - "; seven" EDITOR_KEY_ENTER\ - "; 8" EDITOR_KEY_ENTER\ - "; nine" EDITOR_KEY_ENTER\ - "; ten" EDITOR_KEY_ENTER\ - "; 11" EDITOR_KEY_ENTER\ - "; )-:" EDITOR_KEY_ENTER\ - "; (-:" EDITOR_KEY_ENTER\ - ";-)" EDITOR_KEY_ENTER - -/* clang-format on */ - extern uint8_t row; extern uint8_t command_col; extern uint8_t ovr; @@ -135,1137 +29,6 @@ extern uint8_t mode; extern unsigned int select_start; extern unsigned int select_end; -struct editor_test_state_t_ { - unsigned int line; - uint8_t col; - uint8_t row; - uint8_t command_col; - uint8_t ovr; - uint8_t editing; - uint8_t quitting; - uint8_t mode; - unsigned int select_start; - unsigned int select_end; -}; -typedef struct editor_test_state_t_ editor_test_state_t; - -struct editor_test_t_ { - const char *name; - const char *input; - const char *screen; - const char *atts; - editor_test_state_t state; - unsigned int num_lines; - unsigned int command_test; -}; - -typedef struct editor_test_t_ editor_test_t; - -/* clang-format off */ - -#define EDITOR_BLANK_LINE " " - - -const editor_test_t editor_tests[] = { - { - "reset", - "", - EDITOR_BLANK_LINE, - "", - { 0 }, - 1, - }, - { - "add_empty", - EDITOR_KEY_ENTER, - EDITOR_BLANK_LINE EDITOR_BLANK_LINE, - "", - { .line = 1, .row = 1, }, - 2, - }, - { - "blank_line_0", - EDITOR_KEY_ENTER "0", - EDITOR_BLANK_LINE - "0 ", - "", - { .line = 1, .row = 1, .col = 1, .editing = 1 }, - 2, - }, - { - "two_empty_delete", - EDITOR_KEY_ENTER EDITOR_KEY_ENTER EDITOR_KEY_DELETE, - EDITOR_BLANK_LINE EDITOR_BLANK_LINE, - "", - { .line = 1, .row = 1 }, - 2, - }, - { - "delete_empty", - EDITOR_KEY_DELETE, - EDITOR_BLANK_LINE, - "", - { 0 }, - 1, - }, - { - "add_empty_ovr", - EDITOR_KEY_INSERT EDITOR_KEY_ENTER, - EDITOR_BLANK_LINE EDITOR_BLANK_LINE, - "", - { .line = 1, .row = 1, .ovr = 1}, - 2, - }, - { - "blank_line_0_ovr", - EDITOR_KEY_INSERT EDITOR_KEY_ENTER "0", - EDITOR_BLANK_LINE - "0 ", - "", - { .line = 1, .row = 1, .col = 1, .editing = 1, .ovr = 1 }, - 2, - }, - { - "two_empty_delete_ovr", - EDITOR_KEY_INSERT EDITOR_KEY_ENTER EDITOR_KEY_ENTER - EDITOR_KEY_DELETE, - EDITOR_BLANK_LINE EDITOR_BLANK_LINE EDITOR_BLANK_LINE, - "", - { .line = 1, .row = 1, .ovr = 1 }, - 3, - }, - { - "test_data", - test_data, - &formatted_test_data[4 * SPECASM_LINE_MAX_LEN], - "", - { .line = 26, .row = 22 }, - 27, - }, - { - "test_new", - test_data EDITOR_KEY_COMMAND "n" EDITOR_KEY_ENTER, - EDITOR_BLANK_LINE, - "", - { .row = 0 }, - 1, - }, - { - "test_up", - test_data EDITOR_KEY_UP, - &formatted_test_data[4 * SPECASM_LINE_MAX_LEN], - "", - { .line = 25, .row = 21 }, - 27, - }, - { - "scroll_up", - test_data EDITOR_KEY_UP EDITOR_KEY_UP EDITOR_KEY_UP - EDITOR_KEY_UP EDITOR_KEY_UP EDITOR_KEY_UP EDITOR_KEY_UP - EDITOR_KEY_UP EDITOR_KEY_UP EDITOR_KEY_UP EDITOR_KEY_UP - EDITOR_KEY_UP EDITOR_KEY_UP EDITOR_KEY_UP EDITOR_KEY_UP - EDITOR_KEY_UP EDITOR_KEY_UP EDITOR_KEY_UP EDITOR_KEY_UP - EDITOR_KEY_UP EDITOR_KEY_UP EDITOR_KEY_UP EDITOR_KEY_UP, - &formatted_test_data[3 * SPECASM_LINE_MAX_LEN], - "", - { .line = 3, .row = 0 }, - 27, - }, - { - "page_up", - test_data EDITOR_PAGE_UP, - formatted_test_data, - "", - { .line = 0, .row = 0 }, - 27, - }, - { - "scroll_down", - test_data EDITOR_PAGE_UP EDITOR_KEY_DOWN EDITOR_KEY_DOWN - EDITOR_KEY_DOWN EDITOR_KEY_DOWN EDITOR_KEY_DOWN EDITOR_KEY_DOWN - EDITOR_KEY_DOWN EDITOR_KEY_DOWN EDITOR_KEY_DOWN EDITOR_KEY_DOWN - EDITOR_KEY_DOWN EDITOR_KEY_DOWN EDITOR_KEY_DOWN EDITOR_KEY_DOWN - EDITOR_KEY_DOWN EDITOR_KEY_DOWN EDITOR_KEY_DOWN EDITOR_KEY_DOWN - EDITOR_KEY_DOWN EDITOR_KEY_DOWN EDITOR_KEY_DOWN EDITOR_KEY_DOWN - EDITOR_KEY_DOWN, - &formatted_test_data[1 * SPECASM_LINE_MAX_LEN], - "", - { .line = 23, .row = 22 }, - 27, - }, - { - "page_up_page_up", - test_data EDITOR_PAGE_UP EDITOR_PAGE_UP, - formatted_test_data, - "", - { .line = 0, .row = 0 }, - 27, - }, - { - "page_down", - test_data EDITOR_PAGE_DOWN, - &formatted_test_data[4 * SPECASM_LINE_MAX_LEN], - "", - { .line = 26, .row = 22 }, - 27, - }, - { - "up4_page_down", - test_data EDITOR_KEY_UP EDITOR_KEY_UP - EDITOR_KEY_UP EDITOR_KEY_UP EDITOR_PAGE_DOWN, - &formatted_test_data[4 * SPECASM_LINE_MAX_LEN], - "", - { .line = 22, .row = 18 }, - 27, - }, - { - "page_up_page_down", - test_data EDITOR_PAGE_UP EDITOR_PAGE_DOWN, - &formatted_test_data[4 * SPECASM_LINE_MAX_LEN], - "", - { .line = 4, .row = 0 }, - 27, - }, - { - "page_up_big", - test_data test_data EDITOR_PAGE_UP, - &formatted_test_data2x[7 * SPECASM_LINE_MAX_LEN], - "", - { .line = 7, .row = 0 }, - 53, - }, - { - "page_down_big", - test_data test_data test_data EDITOR_BUF_START EDITOR_PAGE_DOWN, - &formatted_test_data2x[23 * SPECASM_LINE_MAX_LEN], - "", - { .line = 23, .row = 0 }, - 79, - }, - { - "top", - test_data test_data EDITOR_BUF_START, - formatted_test_data2x, - "", - { .line = 0, .row = 0 }, - 53, - }, - { - "top_bottom", - test_data test_data EDITOR_BUF_START EDITOR_BUF_END, - &formatted_test_data2x[30 * SPECASM_LINE_MAX_LEN], - "", - { .line = 52, .row = 22 }, - 53, - }, - { - "bottom_top_bottom", - "ld a, 10" EDITOR_KEY_ENTER EDITOR_BUF_END EDITOR_BUF_START - EDITOR_BUF_END, - " ld a, 10 " - EDITOR_BLANK_LINE, - "", - { .line = 1, .row = 1 }, - 2, - }, - { - "delete", - "1234" EDITOR_KEY_DELETE EDITOR_KEY_DELETE EDITOR_KEY_DELETE - EDITOR_KEY_DELETE EDITOR_KEY_DELETE, - EDITOR_BLANK_LINE, - "", - { .line = 0, .row = 0, .editing = 1 }, - 1, - }, - { - "delete_ovr", - "1234" EDITOR_KEY_INSERT EDITOR_KEY_DELETE EDITOR_KEY_DELETE - EDITOR_KEY_DELETE EDITOR_KEY_DELETE EDITOR_KEY_DELETE, - EDITOR_BLANK_LINE, - "", - { .line = 0, .row = 0, .editing = 1, .ovr = 1 }, - 1, - }, - { - "delete_cmd_ovr", - EDITOR_KEY_COMMAND "1234" EDITOR_KEY_INSERT EDITOR_KEY_DELETE - EDITOR_KEY_DELETE - EDITOR_KEY_DELETE EDITOR_KEY_DELETE EDITOR_KEY_DELETE, - "> ", - "", - { .line = 0, .row = 0, .ovr = 1, .command_col = 2, - .mode = SPECASM_MODE_COMMAND }, - 1, - 1, - }, - { - "delete_ovr2", - "1234" EDITOR_KEY_INSERT EDITOR_KEY_LEFT EDITOR_KEY_DELETE, - "12 4 ", - "", - { .line = 0, .row = 0, .col = 2, .editing = 1, .ovr = 1 }, - 1, - }, - { - "delete_cmd_ovr2", - EDITOR_KEY_COMMAND "1234" EDITOR_KEY_INSERT EDITOR_KEY_LEFT - EDITOR_KEY_DELETE, - "> 12 4 ", - "", - { .line = 0, .row = 0, .command_col = 4, .ovr = 1, - .mode = SPECASM_MODE_COMMAND }, - 1, - 1, - }, - { - "delete_all", - test_data EDITOR_BUF_START EDITOR_KEY_COMMAND "sel" - EDITOR_KEY_ENTER "a" EDITOR_KEY_ENTER - EDITOR_KEY_COMMAND "d" EDITOR_KEY_ENTER, - EDITOR_BLANK_LINE, - "", - { .line = 0, .row = 0 }, - 1, - }, - { - "delete_nothing", - test_data EDITOR_KEY_COMMAND "d" EDITOR_KEY_ENTER, - &formatted_test_data[4 * SPECASM_LINE_MAX_LEN], - "", - { .line = 26, .row = 22, .command_col = 3 }, - 27, - }, - { - "delete_almost_all", - test_data EDITOR_BUF_START EDITOR_KEY_COMMAND "sel" - EDITOR_KEY_ENTER EDITOR_KEY_DOWN EDITOR_KEY_DOWN EDITOR_KEY_DOWN - EDITOR_KEY_DOWN EDITOR_KEY_DOWN EDITOR_KEY_DOWN EDITOR_KEY_DOWN - EDITOR_KEY_DOWN EDITOR_KEY_DOWN EDITOR_KEY_DOWN EDITOR_KEY_DOWN - EDITOR_KEY_DOWN EDITOR_KEY_DOWN EDITOR_KEY_DOWN EDITOR_KEY_DOWN - EDITOR_KEY_DOWN EDITOR_KEY_DOWN EDITOR_KEY_DOWN EDITOR_KEY_DOWN - EDITOR_KEY_DOWN EDITOR_KEY_DOWN EDITOR_KEY_DOWN EDITOR_KEY_DOWN - EDITOR_KEY_DOWN EDITOR_KEY_DOWN EDITOR_KEY_DOWN - EDITOR_KEY_ENTER EDITOR_KEY_COMMAND "d" EDITOR_KEY_ENTER, - EDITOR_BLANK_LINE, - "", - { .line = 0, .row = 0, .command_col = 3 }, - 1, - }, - { - "delete_almost_all_select", - test_data EDITOR_BUF_START EDITOR_KEY_COMMAND "sel" - EDITOR_KEY_ENTER EDITOR_KEY_DOWN EDITOR_KEY_DOWN EDITOR_KEY_DOWN - EDITOR_KEY_DOWN EDITOR_KEY_DOWN EDITOR_KEY_DOWN EDITOR_KEY_DOWN - EDITOR_KEY_DOWN EDITOR_KEY_DOWN EDITOR_KEY_DOWN EDITOR_KEY_DOWN - EDITOR_KEY_DOWN EDITOR_KEY_DOWN EDITOR_KEY_DOWN EDITOR_KEY_DOWN - EDITOR_KEY_DOWN EDITOR_KEY_DOWN EDITOR_KEY_DOWN EDITOR_KEY_DOWN - EDITOR_KEY_DOWN EDITOR_KEY_DOWN EDITOR_KEY_DOWN EDITOR_KEY_DOWN - EDITOR_KEY_DOWN EDITOR_KEY_DOWN EDITOR_KEY_DOWN - EDITOR_KEY_DELETE, - EDITOR_BLANK_LINE, - "", - { .line = 0, .row = 0, .command_col = 5 }, - 1, - }, - { - "delete_nothing_select", - test_data EDITOR_BUF_START EDITOR_KEY_COMMAND "sel" - EDITOR_KEY_ENTER EDITOR_KEY_DELETE, - formatted_test_data, - "", - { .line = 0, .row = 0, .command_col = 5 }, - 27, - }, - { - "delete_all_select_up", - test_data EDITOR_KEY_COMMAND "sel" - EDITOR_KEY_ENTER EDITOR_KEY_UP EDITOR_KEY_UP EDITOR_KEY_UP - EDITOR_KEY_UP EDITOR_KEY_UP EDITOR_KEY_UP EDITOR_KEY_UP - EDITOR_KEY_UP EDITOR_KEY_UP EDITOR_KEY_UP EDITOR_KEY_UP - EDITOR_KEY_UP EDITOR_KEY_UP EDITOR_KEY_UP EDITOR_KEY_UP - EDITOR_KEY_UP EDITOR_KEY_UP EDITOR_KEY_UP EDITOR_KEY_UP - EDITOR_KEY_UP EDITOR_KEY_UP EDITOR_KEY_UP EDITOR_KEY_UP - EDITOR_KEY_UP EDITOR_KEY_UP EDITOR_KEY_UP - EDITOR_KEY_ENTER EDITOR_KEY_COMMAND "d" EDITOR_KEY_ENTER, - EDITOR_BLANK_LINE, - "", - { .line = 0, .row = 0, .command_col = 3 }, - 1, - }, - { - "delete_almost_all_select_up", - test_data EDITOR_KEY_COMMAND "sel" - EDITOR_KEY_ENTER EDITOR_KEY_UP EDITOR_KEY_UP EDITOR_KEY_UP - EDITOR_KEY_UP EDITOR_KEY_UP EDITOR_KEY_UP EDITOR_KEY_UP - EDITOR_KEY_UP EDITOR_KEY_UP EDITOR_KEY_UP EDITOR_KEY_UP - EDITOR_KEY_UP EDITOR_KEY_UP EDITOR_KEY_UP EDITOR_KEY_UP - EDITOR_KEY_UP EDITOR_KEY_UP EDITOR_KEY_UP EDITOR_KEY_UP - EDITOR_KEY_UP EDITOR_KEY_UP EDITOR_KEY_UP EDITOR_KEY_UP - EDITOR_KEY_UP EDITOR_KEY_UP - EDITOR_KEY_ENTER EDITOR_KEY_COMMAND "d" EDITOR_KEY_ENTER, - "; Here's an example hello the co" - EDITOR_BLANK_LINE, - "", - { .line = 1, .row = 1, .command_col = 3 }, - 2, - }, - { - "start_line", - "123456" EDITOR_KEY_LINE_START, - "123456 ", - "", - { .line = 0, .row = 0, .editing = 1 }, - 1, - }, - { - "end_line", - ";12345" EDITOR_KEY_ENTER EDITOR_KEY_UP EDITOR_KEY_LINE_END, - ";12345 " - EDITOR_BLANK_LINE, - "", - { .line = 0, .row = 0, .col = 6 }, - 2, - }, - { - "end_full_line", - "; Here's an example hello the co" - EDITOR_KEY_UP EDITOR_KEY_LINE_END, - "; Here's an example hello the co" - EDITOR_BLANK_LINE, - "", - { .line = 0, .row = 0, .col = 31 }, - 2, - }, - { - "insert_editing", - "; Here's an example hello the c" - EDITOR_KEY_LEFT EDITOR_KEY_LEFT " ", - "; Here's an example hello the c", - "", - { .line = 0, .row = 0, .col = 30, .editing = 1 }, - 1, - }, - { - "insert_full_editing", - "; Here's an example hello the c" - EDITOR_KEY_LEFT EDITOR_KEY_LEFT " ", - "; Here's an example hello the c", - "", - { .line = 0, .row = 0, .col = 30, .editing = 1 }, - 1, - }, - { - "insert_not_editing", - "; Here's an example hello the c" - EDITOR_KEY_ENTER EDITOR_KEY_UP EDITOR_KEY_LEFT " ", - " ; Here's an example hello the c" - EDITOR_BLANK_LINE, - "", - { .line = 0, .row = 0, .col = 1, .editing = 1 }, - 2, - }, - { - "navigate", - test_data - EDITOR_KEY_UP EDITOR_KEY_UP EDITOR_KEY_UP EDITOR_KEY_DOWN - EDITOR_KEY_RIGHT EDITOR_KEY_RIGHT EDITOR_KEY_RIGHT - EDITOR_KEY_DOWN, - &formatted_test_data[4 * SPECASM_LINE_MAX_LEN], - "", - { .line = 25, .row = 21, .col = 3 }, - 27, - }, - { - "cant_go_down", - EDITOR_KEY_DOWN, - EDITOR_BLANK_LINE, - "", - { 0 }, - 1, - }, - { - "right_update", - "; Here's an example hello the c" - EDITOR_KEY_RIGHT, - "; Here's an example hello the c " - EDITOR_BLANK_LINE, - "", - { .line = 1, .row = 1, .col = 0, .editing = 0 }, - 2, - }, - { - "command_left", - EDITOR_KEY_COMMAND "1234" EDITOR_KEY_LEFT EDITOR_KEY_LEFT, - "> 1234 ", - "", - { .command_col = 4, .mode = SPECASM_MODE_COMMAND }, - 1, - 1, - }, - { - "command_right", - EDITOR_KEY_COMMAND "1234" EDITOR_KEY_LEFT EDITOR_KEY_LEFT - EDITOR_KEY_RIGHT, - "> 1234 ", - "", - { .command_col = 5, .mode = SPECASM_MODE_COMMAND}, - 1, - 1, - }, - { - "command_noright", - EDITOR_KEY_COMMAND "1234" EDITOR_KEY_RIGHT, - "> 1234 ", - "", - { .command_col = 6, .mode = SPECASM_MODE_COMMAND}, - 1, - 1, - }, - { - "quitting", - EDITOR_KEY_COMMAND "q" EDITOR_KEY_ENTER, - EDITOR_BLANK_LINE, - "", - { .command_col = 3, .quitting =1 }, - 1, - }, - { - "command_delete", - EDITOR_KEY_COMMAND "qw" EDITOR_KEY_DELETE EDITOR_KEY_ENTER, - EDITOR_BLANK_LINE, - "", - { .command_col = 3, .quitting =1 }, - 1, - }, - { - "command_overwrite", - EDITOR_KEY_COMMAND "set" EDITOR_KEY_INSERT EDITOR_KEY_LEFT "l" - EDITOR_KEY_ENTER, - EDITOR_BLANK_LINE, - "", - { .command_col = 5, .mode = SPECASM_MODE_SELECT, .ovr = 1 }, - 1, - }, - { - "select_last_up", - test_data EDITOR_KEY_UP EDITOR_KEY_UP EDITOR_KEY_COMMAND "sel" - EDITOR_KEY_ENTER EDITOR_KEY_DOWN EDITOR_KEY_DOWN - EDITOR_KEY_DOWN EDITOR_KEY_UP, - &formatted_test_data[4 * SPECASM_LINE_MAX_LEN], - "", - { .line = 26, .row = 22, .command_col = 5, - .mode = SPECASM_MODE_SELECT, .select_start = 24, - .select_end = 26}, - 27, - }, - { - "select_deselect", - test_data EDITOR_KEY_UP EDITOR_KEY_UP EDITOR_KEY_COMMAND "sel" - EDITOR_KEY_ENTER EDITOR_KEY_DOWN EDITOR_KEY_DOWN - EDITOR_KEY_UP EDITOR_KEY_UP, - &formatted_test_data[4 * SPECASM_LINE_MAX_LEN], - "", - { .line = 24, .row = 20, .command_col = 5, - .mode = SPECASM_MODE_SELECT, .select_start = 24, - .select_end = 24}, - 27, - }, - { - "bad_command", - EDITOR_KEY_COMMAND "selt" EDITOR_KEY_ENTER, - EDITOR_BLANK_LINE, - "", - { .command_col = 6, .mode = SPECASM_MODE_COMMAND }, - 1, - }, - { - "delete_select_last", - test_data EDITOR_KEY_COMMAND "sel" - EDITOR_KEY_ENTER EDITOR_KEY_UP EDITOR_KEY_ENTER - EDITOR_KEY_COMMAND "d" EDITOR_KEY_ENTER, - formatted_last_deleted, - "", - { .line = 25, .row = 21, .command_col = 3 }, - 26, - }, - { - "overwrite_end_of_line", - EDITOR_KEY_INSERT "; Here's an example hello the co", - "; Here's an example hello the co" - EDITOR_BLANK_LINE, - "", - { .line = 1, .row = 1, .ovr = 1}, - 2, - }, - { - "bad enter", - "1" EDITOR_KEY_ENTER, - "1 ", - "", - { .line = 0, .row = 0, .col = 1, .editing = 1}, - 1, - }, - { - "bad enter_ovr", - "1" EDITOR_KEY_INSERT EDITOR_KEY_ENTER, - "1 ", - "", - { .line = 0, .row = 0, .col = 1, .editing = 1, .ovr = 1}, - 1, - }, - { - "bad down", - EDITOR_KEY_ENTER EDITOR_KEY_UP "1" EDITOR_KEY_DOWN, - "1 " - EDITOR_BLANK_LINE, - "", - { .line = 0, .row = 0, .col = 1, .editing = 1}, - 2, - }, - { - "load_save", - test_data EDITOR_KEY_COMMAND "s file" EDITOR_KEY_ENTER - EDITOR_KEY_COMMAND "l file" EDITOR_KEY_ENTER, - formatted_test_data, - "", - { .command_col = 8 }, - 27, - }, - { - "load_save2", - test_data EDITOR_KEY_COMMAND "s file.x" EDITOR_KEY_ENTER - EDITOR_KEY_COMMAND "l file.x" EDITOR_KEY_ENTER, - formatted_test_data, - "", - { .command_col = 10 }, - 27, - }, - { - "up_empty", - EDITOR_KEY_UP, - EDITOR_BLANK_LINE, - "", - { 0 }, - 1, - }, - { - "bad_up", - EDITOR_KEY_ENTER "1" EDITOR_KEY_UP, - EDITOR_BLANK_LINE - "1 ", - "", - { .col = 1, .line = 1, .row = 1, .editing = 1 }, - 2, - }, - { - "empty_command", - EDITOR_KEY_COMMAND EDITOR_KEY_ENTER, - EDITOR_BLANK_LINE, - "", - { .line = 0, .row = 0, .command_col = 2 }, - 1, - }, - { - "select_no_up", - EDITOR_KEY_COMMAND "sel" EDITOR_KEY_ENTER EDITOR_KEY_UP, - EDITOR_BLANK_LINE, - "", - { .line = 0, .row = 0, .command_col = 5, - .mode = SPECASM_MODE_SELECT }, - 1, - }, - { - "delete_edit", - "; 1245" EDITOR_KEY_ENTER EDITOR_KEY_DELETE, - "; 1245 ", - "", - { .line = 0, .row = 0, .col = 6, .editing = 1 }, - 1, - }, - { - "delete_edit_2", - EDITOR_KEY_ENTER "; 1245" EDITOR_KEY_ENTER EDITOR_KEY_DELETE - EDITOR_KEY_DELETE EDITOR_KEY_DELETE EDITOR_KEY_DELETE - EDITOR_KEY_DELETE EDITOR_KEY_DELETE EDITOR_KEY_DELETE - EDITOR_KEY_DELETE, - EDITOR_BLANK_LINE, - "", - { .line = 0, .row = 0, .col = 0, .editing = 0 }, - 1, - }, - { - "delete_line_0", - EDITOR_KEY_ENTER "; 1245" EDITOR_KEY_ENTER EDITOR_KEY_UP - EDITOR_KEY_UP EDITOR_KEY_DELETE, - "; 1245 " - EDITOR_BLANK_LINE, - "", - { .line = 0, .row = 0, .col = 0, .editing = 0 }, - 2, - }, - { - "delete_ovr_move_up", - "; 1245" EDITOR_KEY_ENTER EDITOR_KEY_INSERT - EDITOR_KEY_DELETE, - "; 1245 " - EDITOR_BLANK_LINE, - "", - { .line = 0, .row = 0, .col = 6, .editing = 1, .ovr = 1 }, - 2, - }, - { - "delete_ovr_cant_move_up", - "; 1245" EDITOR_KEY_ENTER "1" EDITOR_KEY_INSERT EDITOR_KEY_LEFT - EDITOR_KEY_DELETE, - "; 1245 " - "1 ", - "", - { .line = 1, .row = 1, .col = 0, .editing = 1, .ovr = 1 }, - 2, - }, - { - "goto_neg", - test_data EDITOR_KEY_COMMAND "g -1" EDITOR_KEY_ENTER, - formatted_test_data, - "", - { .line = 0, .row = 0, .col = 0, .command_col = 6 }, - 27, - }, - { - "goto_same_screen", - test_data EDITOR_BUF_START EDITOR_KEY_COMMAND "g 7" - EDITOR_KEY_ENTER, - formatted_test_data, - "", - { .line = 7, .row = 7, .col = 0, .command_col = 5 }, - 27, - }, - { - "goto_almost_end", - test_data EDITOR_BUF_START EDITOR_KEY_COMMAND "g $18" - EDITOR_KEY_ENTER, - &formatted_test_data[4 * SPECASM_LINE_MAX_LEN], - "", - { .line = 24, .row = 20, .col = 0, .command_col = 7 }, - 27, - }, - { - "goto_too_big", - test_data EDITOR_BUF_START EDITOR_KEY_COMMAND "g $fff" - EDITOR_KEY_ENTER, - &formatted_test_data[4 * SPECASM_LINE_MAX_LEN], - "", - { .line = 26, .row = 22, .col = 0, .command_col = 8 }, - 27, - }, - { - "go_nowhere", - test_data EDITOR_BUF_START EDITOR_KEY_DOWN EDITOR_KEY_COMMAND - "g 1" EDITOR_KEY_ENTER, - formatted_test_data, - "", - { .line = 1, .row = 1, .col = 0, .command_col = 5 }, - 27, - }, - { - "empty_count", - EDITOR_KEY_COMMAND "c" EDITOR_KEY_ENTER, - EDITOR_BLANK_LINE, - "", - { .command_col = 3 }, - 1, - }, - /* - * Unfotunately, there's no way to check the count is correct as this - * information is flashed briefly and overwritten. We'll need to test - * the byte count in the linker tests. - */ - { - "byte_count", - "ld a, 10" EDITOR_KEY_ENTER - "db 10" EDITOR_KEY_ENTER - "bit 3, (ix + 127)" EDITOR_KEY_ENTER - "@hello" EDITOR_KEY_ENTER - EDITOR_KEY_COMMAND "sel" EDITOR_KEY_ENTER - EDITOR_KEY_UP EDITOR_KEY_UP EDITOR_KEY_UP EDITOR_KEY_UP - EDITOR_KEY_ENTER - EDITOR_KEY_COMMAND "b" EDITOR_KEY_ENTER, - " ld a, 10 " - "db 10 " - " bit 3, (ix+127) " - "@hello " - EDITOR_BLANK_LINE, - "", - { .command_col = 3 }, - 5, - }, - { - "copy_into_selected_area", - "ld a, 10" EDITOR_KEY_ENTER - "db 10" EDITOR_KEY_ENTER - "bit 3, (ix + 127)" EDITOR_KEY_ENTER - "@hello" EDITOR_KEY_ENTER - EDITOR_KEY_UP EDITOR_KEY_UP - EDITOR_KEY_COMMAND "sel" EDITOR_KEY_ENTER - EDITOR_KEY_UP EDITOR_KEY_UP EDITOR_KEY_ENTER - EDITOR_KEY_DOWN - EDITOR_KEY_COMMAND "c" EDITOR_KEY_ENTER, - " ld a, 10 " - " ld a, 10 " - "db 10 " - "db 10 " - " bit 3, (ix+127) " - "@hello " - EDITOR_BLANK_LINE, - "", - { .row = 1, .line = 1, .command_col = 3 }, - 7, - }, - { - "copy_above_selected_area", - "ld a, 10" EDITOR_KEY_ENTER - "db 10" EDITOR_KEY_ENTER - "bit 3, (ix + 127)" EDITOR_KEY_ENTER - "@hello" EDITOR_KEY_ENTER - EDITOR_KEY_UP - EDITOR_KEY_COMMAND "sel" EDITOR_KEY_ENTER - EDITOR_KEY_UP EDITOR_KEY_UP EDITOR_KEY_ENTER - EDITOR_KEY_UP EDITOR_KEY_UP - EDITOR_KEY_COMMAND "c" EDITOR_KEY_ENTER, - "db 10 " - " bit 3, (ix+127) " - " ld a, 10 " - "db 10 " - " bit 3, (ix+127) " - "@hello " - EDITOR_BLANK_LINE, - "", - { .row = 0, .line = 0, .command_col = 3 }, - 7, - }, - { - "copy_below_selected_area", - "ld a, 10" EDITOR_KEY_ENTER - "db 10" EDITOR_KEY_ENTER - "bit 3, (ix + 127)" EDITOR_KEY_ENTER - "@hello" EDITOR_KEY_ENTER - EDITOR_BUF_START - EDITOR_KEY_COMMAND "sel" EDITOR_KEY_ENTER - EDITOR_KEY_DOWN EDITOR_KEY_DOWN EDITOR_KEY_ENTER - EDITOR_BUF_END - EDITOR_KEY_COMMAND "c" EDITOR_KEY_ENTER, - " ld a, 10 " - "db 10 " - " bit 3, (ix+127) " - "@hello " - " ld a, 10 " - "db 10 " - EDITOR_BLANK_LINE, - "", - { .row = 4, .line = 4, .command_col = 3 }, - 7, - }, - { - "copy_whole_buffer", - test_data EDITOR_KEY_COMMAND "a" EDITOR_KEY_ENTER - EDITOR_KEY_COMMAND "c" EDITOR_KEY_ENTER, - &formatted_test_data2x[4 * SPECASM_LINE_MAX_LEN], - "", - { .line = 26, .row = 22, .command_col = 3 }, - 54, - }, - { - "copy_oom", - test_data EDITOR_KEY_COMMAND "a" EDITOR_KEY_ENTER - EDITOR_KEY_COMMAND "c" EDITOR_KEY_ENTER - EDITOR_KEY_COMMAND "a" EDITOR_KEY_ENTER - EDITOR_KEY_COMMAND "c" EDITOR_KEY_ENTER - EDITOR_KEY_COMMAND "a" EDITOR_KEY_ENTER - EDITOR_KEY_COMMAND "c" EDITOR_KEY_ENTER - EDITOR_KEY_COMMAND "a" EDITOR_KEY_ENTER - EDITOR_KEY_COMMAND "c" EDITOR_KEY_ENTER - EDITOR_KEY_COMMAND "a" EDITOR_KEY_ENTER - EDITOR_KEY_COMMAND "c" EDITOR_KEY_ENTER, - &formatted_test_data2x[4 * SPECASM_LINE_MAX_LEN], - "", - { .line = 26, .row = 22, .command_col = 3, .select_end = 432 }, - 432, - }, - { - "move_on_top", - test_data EDITOR_KEY_UP EDITOR_KEY_UP - EDITOR_KEY_COMMAND"sel" EDITOR_KEY_ENTER - EDITOR_KEY_UP EDITOR_KEY_UP EDITOR_KEY_UP EDITOR_KEY_UP - EDITOR_KEY_ENTER - EDITOR_KEY_DOWN EDITOR_KEY_DOWN - EDITOR_KEY_COMMAND "m" EDITOR_KEY_ENTER, - &formatted_test_data[4 * SPECASM_LINE_MAX_LEN], - "", - { .line = 22, .command_col = 3, .row = 18 }, - 27, - }, - { - "move_below", - ";1" EDITOR_KEY_ENTER - ";2" EDITOR_KEY_ENTER - ";3" EDITOR_KEY_ENTER - ";4" EDITOR_KEY_ENTER - ";5" EDITOR_KEY_ENTER - ";6" EDITOR_KEY_ENTER - ";7" EDITOR_KEY_ENTER - ";8" EDITOR_KEY_ENTER - ";9" EDITOR_KEY_ENTER - ";10" EDITOR_KEY_ENTER - ";11" EDITOR_KEY_ENTER - ";12" EDITOR_KEY_ENTER - ";13" EDITOR_KEY_ENTER - ";14" EDITOR_KEY_ENTER - EDITOR_BUF_START EDITOR_KEY_DOWN - EDITOR_KEY_COMMAND"sel" EDITOR_KEY_ENTER - EDITOR_KEY_DOWN EDITOR_KEY_DOWN EDITOR_KEY_DOWN - EDITOR_KEY_ENTER - EDITOR_BUF_END - EDITOR_KEY_COMMAND "m" EDITOR_KEY_ENTER, - ";1 " - ";5 " - ";6 " - ";7 " - ";8 " - ";9 " - ";10 " - ";11 " - ";12 " - ";13 " - ";14 " - ";2 " - ";3 " - ";4 " - EDITOR_BLANK_LINE, - "", - { .line = 14, .command_col = 3, .row = 14 }, - 15, - }, - { - "move_above", - ";1" EDITOR_KEY_ENTER - ";2" EDITOR_KEY_ENTER - ";3" EDITOR_KEY_ENTER - ";4" EDITOR_KEY_ENTER - ";5" EDITOR_KEY_ENTER - ";6" EDITOR_KEY_ENTER - ";7" EDITOR_KEY_ENTER - ";8" EDITOR_KEY_ENTER - ";9" EDITOR_KEY_ENTER - ";10" EDITOR_KEY_ENTER - ";11" EDITOR_KEY_ENTER - ";12" EDITOR_KEY_ENTER - ";13" EDITOR_KEY_ENTER - ";14" EDITOR_KEY_ENTER - EDITOR_BUF_END EDITOR_KEY_UP - EDITOR_KEY_COMMAND"sel" EDITOR_KEY_ENTER - EDITOR_KEY_UP EDITOR_KEY_UP EDITOR_KEY_UP - EDITOR_KEY_ENTER - EDITOR_BUF_START EDITOR_KEY_DOWN - EDITOR_KEY_COMMAND "m" EDITOR_KEY_ENTER, - ";1 " - ";11 " - ";12 " - ";13 " - ";2 " - ";3 " - ";4 " - ";5 " - ";6 " - ";7 " - ";8 " - ";9 " - ";10 " - ";14 " - EDITOR_BLANK_LINE, - "", - { .line = 1, .command_col = 3, .row = 1 }, - 15, - }, - { - "blank_line_bug", - ";1" EDITOR_KEY_ENTER - ";2" EDITOR_KEY_ENTER - EDITOR_KEY_ENTER EDITOR_KEY_ENTER - ";3" EDITOR_KEY_UP EDITOR_KEY_LINE_START - EDITOR_KEY_DELETE, - ";1 " - ";2 " - EDITOR_BLANK_LINE - ";3 " - EDITOR_BLANK_LINE, - "", - { .line = 2, .row = 2 }, - 4, - }, - { - "copy_overwrite_1", - ";1" EDITOR_KEY_ENTER - ";2" EDITOR_KEY_ENTER - ";3" EDITOR_KEY_ENTER - ";4" EDITOR_KEY_ENTER - ";5" EDITOR_KEY_ENTER - ";6" EDITOR_KEY_ENTER - ";7" EDITOR_KEY_ENTER - ";8" EDITOR_KEY_ENTER - ";9" EDITOR_KEY_ENTER - ";10" EDITOR_KEY_ENTER - ";11" EDITOR_KEY_ENTER - ";12" EDITOR_KEY_ENTER - ";13" EDITOR_KEY_ENTER - ";14" EDITOR_KEY_ENTER - EDITOR_KEY_COMMAND "sel" EDITOR_KEY_ENTER - EDITOR_KEY_UP EDITOR_KEY_UP EDITOR_KEY_UP - EDITOR_KEY_UP EDITOR_KEY_ENTER EDITOR_KEY_INSERT - EDITOR_BUF_START EDITOR_KEY_DOWN - EDITOR_KEY_COMMAND "c" EDITOR_KEY_ENTER, - ";1 " - ";11 " - ";12 " - ";13 " - ";14 " - ";6 " - ";7 " - ";8 " - ";9 " - ";10 " - ";11 " - ";12 " - ";13 " - ";14 " - EDITOR_BLANK_LINE, - "", - { .line = 1, .command_col = 3, .row = 1, .ovr = 1 }, - 15, - }, - { - "copy_overwrite_2", - ";1" EDITOR_KEY_ENTER - ";2" EDITOR_KEY_ENTER - ";3" EDITOR_KEY_ENTER - ";4" EDITOR_KEY_ENTER - ";5" EDITOR_KEY_ENTER - ";6" EDITOR_KEY_ENTER - ";7" EDITOR_KEY_ENTER - ";8" EDITOR_KEY_ENTER - ";9" EDITOR_KEY_ENTER - ";10" EDITOR_KEY_ENTER - ";11" EDITOR_KEY_ENTER - ";12" EDITOR_KEY_ENTER - ";13" EDITOR_KEY_ENTER - ";14" EDITOR_KEY_ENTER - EDITOR_BUF_START - EDITOR_KEY_COMMAND "sel" EDITOR_KEY_ENTER - EDITOR_KEY_DOWN EDITOR_KEY_DOWN EDITOR_KEY_DOWN - EDITOR_KEY_DOWN EDITOR_KEY_ENTER EDITOR_KEY_INSERT - EDITOR_BUF_END EDITOR_KEY_UP - EDITOR_KEY_COMMAND "c" EDITOR_KEY_ENTER, - ";1 " - ";2 " - ";3 " - ";4 " - ";5 " - ";6 " - ";7 " - ";8 " - ";9 " - ";10 " - ";11 " - ";12 " - ";13 " - ";1 " - ";2 " - ";3 " - ";4 ", - "", - { .line = 13, .command_col = 3, .row = 13, .ovr = 1 }, - 17, - }, - { - "find", - test_data EDITOR_BUF_START EDITOR_KEY_COMMAND "f next" - EDITOR_KEY_ENTER, - formatted_test_data, - "", - { .line = 7, .row = 7, .col = 0, .command_col = 8 }, - 27, - }, - { - "no find", - test_data EDITOR_BUF_START EDITOR_KEY_COMMAND "f nothere" - EDITOR_KEY_ENTER, - formatted_test_data, - "", - { .line = 0, .row = 0, .col = 0, .command_col = 11 }, - 27, - }, - { - "invalidate_select", - ";1" EDITOR_KEY_ENTER - ";2" EDITOR_KEY_ENTER - ";3" EDITOR_KEY_ENTER - ";4" EDITOR_KEY_ENTER - ";5" EDITOR_KEY_ENTER - ";6" EDITOR_KEY_ENTER - ";7" EDITOR_KEY_ENTER - ";8" EDITOR_KEY_ENTER - ";9" EDITOR_KEY_ENTER - EDITOR_KEY_UP EDITOR_KEY_UP EDITOR_KEY_COMMAND "sel" - EDITOR_KEY_ENTER EDITOR_KEY_DOWN EDITOR_KEY_DOWN - EDITOR_KEY_ENTER EDITOR_BUF_START EDITOR_KEY_ENTER, - " " - ";1 " - ";2 " - ";3 " - ";4 " - ";5 " - ";6 " - ";7 " - ";8 " - ";9 " - " ", - "", - { .line = 1, .row = 1, .command_col = 5}, - 11, - }, - { - "dont_invalidate_select", - ";1" EDITOR_KEY_ENTER - ";2" EDITOR_KEY_ENTER - ";3" EDITOR_KEY_ENTER - ";4" EDITOR_KEY_ENTER - ";5" EDITOR_KEY_ENTER - ";6" EDITOR_KEY_ENTER - ";7" EDITOR_KEY_ENTER - ";8" EDITOR_KEY_ENTER - ";9" EDITOR_KEY_ENTER - EDITOR_BUF_START EDITOR_KEY_COMMAND "sel" - EDITOR_KEY_ENTER EDITOR_KEY_DOWN EDITOR_KEY_DOWN - EDITOR_KEY_ENTER EDITOR_KEY_ENTER, - ";1 " - ";2 " - " " - ";3 " - ";4 " - ";5 " - ";6 " - ";7 " - ";8 " - ";9 " - " ", - "", - { .line = 3, .row = 3, .command_col = 5, .select_start = 0, - .select_end = 2 }, - 11, - }, -}; - -/* clang-format on */ - static int prv_check_state(const editor_test_t *t) { if (line != t->state.line) { @@ -1384,8 +147,7 @@ static int prv_run_test(const editor_test_t *t) int run_editor_tests(void) { - for (size_t i = 0; i < sizeof(editor_tests) / sizeof(editor_test_t); - i++) + for (size_t i = 0; i < editor_tests_count; i++) if (prv_run_test(&editor_tests[i])) return 1; diff --git a/src/peer.h b/src/peer.h index 76b57b8..17e131f 100644 --- a/src/peer.h +++ b/src/peer.h @@ -21,10 +21,10 @@ #include "error.h" -#ifdef SPECTRUM -#include "peer_zx.h" -#elif defined(UNITTESTS) +#ifdef UNITTESTS #include "peer_unit.h" +#elif defined(SPECTRUM) +#include "peer_zx.h" #endif void specasm_peer_write_state_e(const char *fname, uint16_t checksum); @@ -34,6 +34,12 @@ uint16_t specasm_peer_read_state_e(const char *fname); void specasm_text_set_flash(uint8_t x, uint8_t y, uint8_t attr); void specasm_text_printch(char ch, uint8_t x, uint8_t y, uint8_t attr); + +#ifndef SPECTRUM +int itoa(int n, char *s, unsigned char radix); +int utoa(int n, char *s, unsigned char radix); +#endif + uint8_t specasm_text_print(const char *str, uint8_t x, uint8_t y, uint8_t attr); void specasm_text_clear(uint8_t x, uint8_t y, uint8_t l, uint8_t attr); diff --git a/src/peer_posix_screen.c b/src/peer_posix_screen.c index 44135b4..0b78135 100644 --- a/src/peer_posix_screen.c +++ b/src/peer_posix_screen.c @@ -20,58 +20,6 @@ #include "peer.h" -char peer_unit_screen[SPECASM_UNIT_BUF_SZ]; -uint8_t peer_unit_atts[SPECASM_UNIT_BUF_SZ]; - -void specasm_text_set_flash(uint8_t x, uint8_t y, uint8_t attr) -{ - uint8_t *aptr = &peer_unit_atts[(y * SPECASM_LINE_MAX_LEN) + x]; - - *aptr &= ~((uint8_t)SPECASM_FLASH); - *aptr |= attr; -} - -void specasm_text_printch(char ch, uint8_t x, uint8_t y, uint8_t attr) -{ - size_t offset = (y * SPECASM_LINE_MAX_LEN) + x; - char *cptr = &peer_unit_screen[offset]; - uint8_t *aptr = &peer_unit_atts[offset]; - - *cptr = ch; - *aptr = attr; -} - -uint8_t specasm_text_print(const char *str, uint8_t x, uint8_t y, uint8_t attr) -{ - size_t offset = (y * SPECASM_LINE_MAX_LEN) + x; - size_t len = strlen(str); - char *cptr = &peer_unit_screen[offset]; - uint8_t *aptr = &peer_unit_atts[offset]; - - memcpy(cptr, str, len); - memset(aptr, attr, len); - - return (uint8_t)len; -} - -void specasm_text_clear(uint8_t x, uint8_t y, uint8_t l, uint8_t attr) -{ - size_t offset = (y * SPECASM_LINE_MAX_LEN) + x; - char *cptr = &peer_unit_screen[offset]; - uint8_t *aptr = &peer_unit_atts[offset]; - - memset(cptr, ' ', l); - memset(aptr, attr, l); -} - -void specasm_cls(uint8_t a) -{ - memset(peer_unit_screen, ' ', sizeof(peer_unit_screen) - 1); - memset(peer_unit_atts, a, sizeof(peer_unit_atts) - 1); -} - -void specasm_border(uint8_t a) {} - void specasm_screen_flush(uint16_t peer_last_row) { char line[SPECASM_LINE_MAX_LEN + 1]; @@ -86,9 +34,10 @@ void specasm_screen_flush(uint16_t peer_last_row) int itoa(int n, char *s, unsigned char radix) { - return sprintf(s, radix == 16 ? "%" PRIx16 : "%" PRId16, (int16_t)n); + return sprintf(s, radix == 16 ? "%" PRIX16 : "%" PRId16, (int16_t)n); } int utoa(int n, char *s, unsigned char radix) { - return sprintf(s, radix == 16 ? "%" PRIx16 : "%" PRIu16, (uint16_t)n); + return sprintf(s, radix == 16 ? "%" PRIX16 : "%" PRIu16, (uint16_t)n); } + diff --git a/src/peer_text_screen.c b/src/peer_text_screen.c new file mode 100644 index 0000000..4f6ae63 --- /dev/null +++ b/src/peer_text_screen.c @@ -0,0 +1,72 @@ +/* + * Copyright contributors to Specasm + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. +*/ + +#include +#include + +#include "peer.h" + +char peer_unit_screen[SPECASM_UNIT_BUF_SZ]; +uint8_t peer_unit_atts[SPECASM_UNIT_BUF_SZ]; + +void specasm_text_set_flash(uint8_t x, uint8_t y, uint8_t attr) +{ + uint8_t *aptr = &peer_unit_atts[(y * SPECASM_LINE_MAX_LEN) + x]; + + *aptr &= ~((uint8_t)SPECASM_FLASH); + *aptr |= attr; +} + +void specasm_text_printch(char ch, uint8_t x, uint8_t y, uint8_t attr) +{ + size_t offset = (y * SPECASM_LINE_MAX_LEN) + x; + char *cptr = &peer_unit_screen[offset]; + uint8_t *aptr = &peer_unit_atts[offset]; + + *cptr = ch; + *aptr = attr; +} + +uint8_t specasm_text_print(const char *str, uint8_t x, uint8_t y, uint8_t attr) +{ + size_t offset = (y * SPECASM_LINE_MAX_LEN) + x; + size_t len = strlen(str); + char *cptr = &peer_unit_screen[offset]; + uint8_t *aptr = &peer_unit_atts[offset]; + + memcpy(cptr, str, len); + memset(aptr, attr, len); + + return (uint8_t)len; +} + +void specasm_text_clear(uint8_t x, uint8_t y, uint8_t l, uint8_t attr) +{ + size_t offset = (y * SPECASM_LINE_MAX_LEN) + x; + char *cptr = &peer_unit_screen[offset]; + uint8_t *aptr = &peer_unit_atts[offset]; + + memset(cptr, ' ', l); + memset(aptr, attr, l); +} + +void specasm_cls(uint8_t a) +{ + memset(peer_unit_screen, ' ', sizeof(peer_unit_screen) - 1); + memset(peer_unit_atts, a, sizeof(peer_unit_atts) - 1); +} + +void specasm_border(uint8_t a) {} diff --git a/src/peer_unit.h b/src/peer_unit.h index e57076e..b957a38 100644 --- a/src/peer_unit.h +++ b/src/peer_unit.h @@ -44,7 +44,4 @@ extern uint8_t peer_unit_atts[SPECASM_UNIT_BUF_SZ]; void specasm_cls(uint8_t a); void specasm_border(uint8_t a); -int itoa(int n, char *s, unsigned char radix); -int utoa(int n, char *s, unsigned char radix); - #endif diff --git a/src/peer_zx.c b/src/peer_zx.c index b95e1cb..291f07a 100644 --- a/src/peer_zx.c +++ b/src/peer_zx.c @@ -94,57 +94,6 @@ void specasm_text_printch(char ch, uint8_t x, uint8_t y, uint8_t attr) } while (i != 0); } -uint8_t specasm_text_print(const char *str, uint8_t x, uint8_t y, uint8_t attr) -{ - uint8_t *cptr; - uint8_t *aptr = zx_cxy2aaddr(x, y); - uint8_t *bsptr; - uint8_t *sptr; - uint8_t i; - uint8_t old_x = x; - - bsptr = zx_cxy2saddr(x, y); - while (*str) { - *aptr++ = attr; - cptr = (uint8_t *)15360 + (*((uint8_t *)str) * 8); - sptr = bsptr; - i = 8; - do { - *sptr = *cptr++; - sptr += 256; - i--; - } while (i != 0); - str++; - x++; - bsptr++; - } - - return x - old_x; -} - -void specasm_text_clear(uint8_t x, uint8_t y, uint8_t l, uint8_t attr) -{ - uint8_t *aptr = zx_cxy2aaddr(x, y); - uint8_t *sptr; - uint8_t *bsptr; - uint8_t i; - - bsptr = zx_cxy2saddr(x, y); - while (l > 0) { - *aptr++ = attr; - sptr = bsptr; - i = 8; - do { - *sptr = 0; - sptr += 256; - i--; - } while (i != 0); - x++; - l--; - bsptr++; - } -} - void specasm_screen_flush(uint16_t peer_last_row) { uint8_t *posn_x = (uint8_t *)23688; diff --git a/src/peer_zx.h b/src/peer_zx.h index 28583cf..01f541a 100644 --- a/src/peer_zx.h +++ b/src/peer_zx.h @@ -20,6 +20,8 @@ #include #include +#include "util_print_zx.h" + #define SPECASM_SALINK_BACKGROUND PAPER_WHITE #define SPECASM_SALINK_BORDER INK_WHITE #define SPECASM_LABEL_BORDER INK_BLACK @@ -38,5 +40,7 @@ #define specasm_cls(a) zx_cls(a) #define specasm_border(a) zx_border(a) #define specasm_sleep_ms(a) z80_delay_ms(a) +#define specasm_text_print specasm_util_print +#define specasm_text_clear specasm_util_clear #endif diff --git a/src/state_base.h b/src/state_base.h index 04ab930..195d80a 100644 --- a/src/state_base.h +++ b/src/state_base.h @@ -17,8 +17,8 @@ #ifndef SPECASM_STATE_READ_H #define SPECASM_STATE_READ_H -#define SPECASM_VERSION 3 -#define SPECASM_VERSION_STR "v3" +#define SPECASM_VERSION 4 +#define SPECASM_VERSION_STR "v4" #include diff --git a/src/test_content.c b/src/test_content.c new file mode 100644 index 0000000..697632e --- /dev/null +++ b/src/test_content.c @@ -0,0 +1,2801 @@ +/* + * Copyright contributors to Specasm + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. +*/ + +#include "test_content.h" + +#include "line.h" + +/* clang-format off */ + +const test_t opcode_tests[] = { + {"adc a, (hl)", "adc a, (hl)", 1, { 0x8e }}, + {"adc a,( hl)", "adc a, (hl)", 1, { 0x8e }}, + {"adc a, (ix+15)", "adc a, (ix+15)", 3, { 0xdd, 0x8e, 0xf}}, + {"adc a,( ix + 15 )", "adc a, (ix+15)", 3, { 0xdd, 0x8e, 0xf}}, + {"adc a, (iy+15)", "adc a, (iy+15)", 3, { 0xfd, 0x8e, 0xf}}, + {"adc a,( iy + 15 )", "adc a, (iy+15)", 3, { 0xfd, 0x8e, 0xf}}, + {"adc a,( iy + 0)", "adc a, (iy+0)", 3, { 0xfd, 0x8e, 0x0}}, + {"adc a,( iy + 0)", "adc a, (iy+0)", 3, { 0xfd, 0x8e, 0x0}}, + {"adc a,(ix+$1C)", "adc a, (ix+$1C)", 3, { 0xdd, 0x8e, 0x1c}}, + {"adc a,(iy+$1C)", "adc a, (iy+$1C)", 3, { 0xfd, 0x8e, 0x1c}}, + {"adc a,(ix+-2)", "adc a, (ix+-2)", 3, { 0xdd, 0x8e, 0xfe}}, + {"adc a,(iy+-2)", "adc a, (iy+-2)", 3, { 0xfd, 0x8e, 0xfe}}, + {"adc a, a", "adc a, a", 1, { 0x8f }}, + {"adc a,a", "adc a, a", 1, { 0x8f }}, + {"adc a, b", "adc a, b", 1, { 0x88 }}, + {"adc a,b", "adc a, b", 1, { 0x88 }}, + {"adc a, c", "adc a, c", 1, { 0x89 }}, + {"adc a , c", "adc a, c", 1, { 0x89 }}, + {"adc a, d", "adc a, d", 1, { 0x8A }}, + {"adc a , d", "adc a, d", 1, { 0x8A }}, + {"adc a, e", "adc a, e", 1, { 0x8B }}, + {"adc a , e", "adc a, e", 1, { 0x8B }}, + {"adc a, h", "adc a, h", 1, { 0x8C }}, + {"adc a , h", "adc a, h", 1, { 0x8C }}, + {"adc a, l", "adc a, l", 1, { 0x8D }}, + {"adc a , l", "adc a, l", 1, { 0x8D }}, + {"adc a, 40", "adc a, 40", 2, { 0xCE, 0x28 }}, + {"adc a , 40", "adc a, 40", 2, { 0xCE, 0x28 }}, + {"adc a, 'A'", "adc a, 'A'", 2, { 0xCE, 0x41 }}, + {"adc a , 'A'", "adc a, 'A'", 2, { 0xCE, 0x41 }}, + {"adc a, 128", "adc a, 128", 2, { 0xCE, 0x80 }}, + {"adc a , 128", "adc a, 128", 2, { 0xCE, 0x80 }}, + {"adc a, $20", "adc a, $20", 2, { 0xCE, 0x20 }}, + {"adc a, $ff", "adc a, $FF", 2, { 0xCE, 0xff }}, + {"adc a, -1", "adc a, -1", 2, { 0xCE, 0xff }}, + {"adc hl, bc", "adc hl, bc", 2, { 0xed, 0x4a }}, + {"adc hl, bc", "adc hl, bc", 2, { 0xed, 0x4a }}, + {"adc hl, de", "adc hl, de", 2, { 0xed, 0x5a }}, + {"adc hl, de", "adc hl, de", 2, { 0xed, 0x5a }}, + {"adc hl, hl", "adc hl, hl", 2, { 0xed, 0x6a }}, + {"adc hl, hl", "adc hl, hl", 2, { 0xed, 0x6a }}, + {"adc hl, sp", "adc hl, sp", 2, { 0xed, 0x7a }}, + {"adc hl, sp", "adc hl, sp", 2, { 0xed, 0x7a }}, + + {"add a, (hl)", "add a, (hl)", 1, { 0x86 }}, + {"add a, ( hl )", "add a, (hl)", 1, { 0x86 }}, + {"add a, a", "add a, a", 1, { 0x87 }}, + {"add a , a", "add a, a", 1, { 0x87 }}, + {"add a, b", "add a, b", 1, { 0x80 }}, + {"add a , b", "add a, b", 1, { 0x80 }}, + {"add a, c", "add a, c", 1, { 0x81 }}, + {"add a , c", "add a, c", 1, { 0x81 }}, + {"add a, d", "add a, d", 1, { 0x82 }}, + {"add a , d", "add a, d", 1, { 0x82 }}, + {"add a, e", "add a, e", 1, { 0x83 }}, + {"add a , e", "add a, e", 1, { 0x83 }}, + {"add a, h", "add a, h", 1, { 0x84 }}, + {"add a , h", "add a, h", 1, { 0x84 }}, + {"add a, l", "add a, l", 1, { 0x85 }}, + {"add a , l", "add a, l", 1, { 0x85 }}, + {"add a, 32", "add a, 32", 2, { 0xC6, 0x20 }}, + {"add a , 32", "add a, 32", 2, { 0xC6, 0x20 }}, + {"add a, ' '", "add a, ' '", 2, { 0xC6, 0x20 }}, + {"add a , ' '", "add a, ' '", 2, { 0xC6, 0x20 }}, + {"add a, $20", "add a, $20", 2, { 0xC6, 0x20 }}, + {"add a, -128", "add a, -128", 2, { 0xC6, 0x80 }}, + {"add a, 255", "add a, 255", 2, { 0xC6, 0xFF }}, + {"add a , 255", "add a, 255", 2, { 0xC6, 0xFF }}, + {"add hl, bc", "add hl, bc", 1, { 0x09 }}, + {"add hl, bc", "add hl, bc", 1, { 0x09 }}, + {"add hl, de", "add hl, de", 1, { 0x19 }}, + {"add hl, de", "add hl, de", 1, { 0x19 }}, + {"add hl, hl", "add hl, hl", 1, { 0x29 }}, + {"add hl, hl", "add hl, hl", 1, { 0x29 }}, + {"add hl, sp", "add hl, sp", 1, { 0x39 }}, + {"add hl, sp", "add hl, sp", 1, { 0x39 }}, + {"add ix, bc", "add ix, bc", 2, { 0xDD, 0x09 }}, + {"add ix, bc", "add ix, bc", 2, { 0xDD, 0x09 }}, + {"add ix, de", "add ix, de", 2, { 0xDD, 0x19 }}, + {"add ix, de", "add ix, de", 2, { 0xDD, 0x19 }}, + {"add ix, ix", "add ix, ix", 2, { 0xDD, 0x29 }}, + {"add ix, ix", "add ix, ix", 2, { 0xDD, 0x29 }}, + {"add ix, sp", "add ix, sp", 2, { 0xDD, 0x39 }}, + {"add ix, sp", "add ix, sp", 2, { 0xDD, 0x39 }}, + {"add iy, bc", "add iy, bc", 2, { 0xFD, 0x09 }}, + {"add iy, bc", "add iy, bc", 2, { 0xFD, 0x09 }}, + {"add iy, de", "add iy, de", 2, { 0xFD, 0x19 }}, + {"add iy, de", "add iy, de", 2, { 0xFD, 0x19 }}, + {"add iy, iy", "add iy, iy", 2, { 0xFD, 0x29 }}, + {"add iy, iy", "add iy, iy", 2, { 0xFD, 0x29 }}, + {"add iy, sp", "add iy, sp", 2, { 0xFD, 0x39 }}, + {"add iy, sp", "add iy, sp", 2, { 0xFD, 0x39 }}, + + {"align 4", "align 4", 1, {0x2}}, + {"align 16", "align 16", 1, {0x4}}, + {"align $20", "align $20", 1, {0x5}}, + {"align 256", "align 256", 1, {0x8}}, + + {"and (hl)", "and (hl)", 1, { 0xA6 }}, + {"and ( hl )", "and (hl)", 1, { 0xA6 }}, + {"and (ix + 127)", "and (ix+127)", 3, { 0xDD, 0xA6, 0x7f }}, + {"and ( ix + 127 )", "and (ix+127)", 3, { 0xDD, 0xA6, 0x7f }}, + {"and (iy + 127)", "and (iy+127)", 3, { 0xFD, 0xA6, 0x7f }}, + {"and ( iy + 127 )", "and (iy+127)", 3, { 0xFD, 0xA6, 0x7f }}, + {"and (ix+$ff)", "and (ix+$FF)", 3, { 0xDD, 0xA6, 0xff }}, + {"and (iy+$7F)", "and (iy+$7F)", 3, { 0xFD, 0xA6, 0x7f }}, + {"and (ix+127)", "and (ix+127)", 3, { 0xDD, 0xA6, 0x7f }}, + {"and (iy+-128)", "and (iy+-128)", 3, { 0xFD, 0xA6, 0x80 }}, + {"and a", "and a", 1, { 0xA7 }}, + {"and a", "and a", 1, { 0xA7 }}, + {"and b", "and b", 1, { 0xA0 }}, + {"and b", "and b", 1, { 0xA0 }}, + {"and c", "and c", 1, { 0xA1 }}, + {"and c", "and c", 1, { 0xA1 }}, + {"and d", "and d", 1, { 0xA2 }}, + {"and d", "and d", 1, { 0xA2 }}, + {"and e", "and e", 1, { 0xA3 }}, + {"and e", "and e", 1, { 0xA3 }}, + {"and h", "and h", 1, { 0xA4 }}, + {"and h", "and h", 1, { 0xA4 }}, + {"and l", "and l", 1, { 0xA5 }}, + {"and l", "and l", 1, { 0xA5 }}, + {"and 127", "and 127", 2, { 0xE6, 0x7f }}, + {"and 127", "and 127", 2, { 0xE6, 0x7f }}, + {"and $Ff", "and $FF", 2, { 0xE6, 0xff }}, + {"and $ff", "and $FF", 2, { 0xE6, 0xff }}, + {"and 255", "and 255", 2, { 0xE6, 0xff }}, + {"and 255", "and 255", 2, { 0xE6, 0xff }}, + {"and -2", "and -2", 2, { 0xE6, 0xfe }}, + {"and -2", "and -2", 2, { 0xE6, 0xfe }}, + {"and 'A'", "and 'A'", 2, { 0xE6, 0x41 }}, + {"and 'A'", "and 'A'", 2, { 0xE6, 0x41 }}, + + {"bit 0, (hl)", "bit 0, (hl)", 2, { 0xCB, 0x46 }}, + {"bit 0 , (hl)", "bit 0, (hl)", 2, { 0xCB, 0x46 }}, + {"bit 0, ( hl )", "bit 0, (hl)", 2, { 0xCB, 0x46 }}, + {"bit 0, (ix + 127)", "bit 0, (ix+127)", 4, { 0xDD, 0xCB, 0x7f, 0x46 }}, + {"bit 0, ( ix + 127 )", "bit 0, (ix+127)", 4, { 0xDD, 0xCB, 0x7f, 0x46 }}, + {"bit 0, (iy + 127)", "bit 0, (iy+127)", 4, { 0xFD, 0xCB, 0x7f, 0x46 }}, + {"bit 0, ( iy + 127 )", "bit 0, (iy+127)", 4, { 0xFD, 0xCB, 0x7f, 0x46 }}, + {"bit 0, (iy + -128)", "bit 0, (iy+-128)", 4, { 0xFD, 0xCB, 0x80, 0x46 }}, + {"bit 0, (ix+$FE )", "bit 0, (ix+$FE)", 4, { 0xDD, 0xCB, 0xfe, 0x46 }}, + {"bit 0, (iy+$FE )", "bit 0, (iy+$FE)", 4, { 0xFD, 0xCB, 0xfe, 0x46 }}, + {"bit 0, a", "bit 0, a", 2, { 0xCB, 0X47 }}, + {"bit 0, a", "bit 0, a", 2, { 0xCB, 0X47 }}, + {"bit 0, b", "bit 0, b", 2, { 0xCB, 0X40 }}, + {"bit 0, b", "bit 0, b", 2, { 0xCB, 0X40 }}, + {"bit 0, c", "bit 0, c", 2, { 0xCB, 0X41 }}, + {"bit 0, c", "bit 0, c", 2, { 0xCB, 0X41 }}, + {"bit 0, d", "bit 0, d", 2, { 0xCB, 0X42 }}, + {"bit 0, d", "bit 0, d", 2, { 0xCB, 0X42 }}, + {"bit 0, e", "bit 0, e", 2, { 0xCB, 0X43 }}, + {"bit 0, e", "bit 0, e", 2, { 0xCB, 0X43 }}, + {"bit 0, h", "bit 0, h", 2, { 0xCB, 0X44 }}, + {"bit 0, h", "bit 0, h", 2, { 0xCB, 0X44 }}, + {"bit 0, l", "bit 0, l", 2, { 0xCB, 0X45 }}, + {"bit 0, l", "bit 0, l", 2, { 0xCB, 0X45 }}, + {"bit $0, l", "bit 0, l", 2, { 0xCB, 0X45 }}, + + {"bit 1, (hl)", "bit 1, (hl)", 2, { 0xCB, 0x4E }}, + {"bit 1, ( hl )", "bit 1, (hl)", 2, { 0xCB, 0x4E }}, + {"bit 1, (ix + 127)", "bit 1, (ix+127)", 4, { 0xDD, 0xCB, 0x7f, 0x4E }}, + {"bit 1, ( ix + 127 )", "bit 1, (ix+127)", 4, { 0xDD, 0xCB, 0x7f, 0x4E }}, + {"bit 1, (iy + 127)", "bit 1, (iy+127)", 4, { 0xFD, 0xCB, 0x7f, 0x4E }}, + {"bit 1, ( iy + 127 )", "bit 1, (iy+127)", 4, { 0xFD, 0xCB, 0x7f, 0x4E }}, + {"bit 1, (iy + -128)", "bit 1, (iy+-128)", 4, { 0xFD, 0xCB, 0x80, 0x4E }}, + {"bit 1, (ix+$FE )", "bit 1, (ix+$FE)", 4, { 0xDD, 0xCB, 0xfe, 0x4E }}, + {"bit 1, (iy+$FE )", "bit 1, (iy+$FE)", 4, { 0xFD, 0xCB, 0xfe, 0x4E }}, + {"bit 1, a", "bit 1, a", 2, { 0xCB, 0X4F }}, + {"bit 1, a", "bit 1, a", 2, { 0xCB, 0X4F }}, + {"bit 1, b", "bit 1, b", 2, { 0xCB, 0X48 }}, + {"bit 1, b", "bit 1, b", 2, { 0xCB, 0X48 }}, + {"bit 1, c", "bit 1, c", 2, { 0xCB, 0X49 }}, + {"bit 1, c", "bit 1, c", 2, { 0xCB, 0X49 }}, + {"bit 1, d", "bit 1, d", 2, { 0xCB, 0X4A }}, + {"bit 1, d", "bit 1, d", 2, { 0xCB, 0X4A }}, + {"bit 1, e", "bit 1, e", 2, { 0xCB, 0X4B }}, + {"bit 1, e", "bit 1, e", 2, { 0xCB, 0X4B }}, + {"bit 1, h", "bit 1, h", 2, { 0xCB, 0X4C }}, + {"bit 1, h", "bit 1, h", 2, { 0xCB, 0X4C }}, + {"bit 1, l", "bit 1, l", 2, { 0xCB, 0X4D }}, + {"bit 1, l", "bit 1, l", 2, { 0xCB, 0X4D }}, + {"bit $1, l", "bit 1, l", 2, { 0xCB, 0X4D }}, + + {"bit 2, (hl)", "bit 2, (hl)", 2, { 0xCB, 0x56 }}, + {"bit 2, ( hl )", "bit 2, (hl)", 2, { 0xCB, 0x56 }}, + {"bit 2, (ix + 127)", "bit 2, (ix+127)", 4, { 0xDD, 0xCB, 0x7f, 0x56 }}, + {"bit 2, ( ix + 127 )", "bit 2, (ix+127)", 4, { 0xDD, 0xCB, 0x7f, 0x56 }}, + {"bit 2, (iy + 127)", "bit 2, (iy+127)", 4, { 0xFD, 0xCB, 0x7f, 0x56 }}, + {"bit 2, ( iy + 127 )", "bit 2, (iy+127)", 4, { 0xFD, 0xCB, 0x7f, 0x56 }}, + {"bit 2, (iy + -128)", "bit 2, (iy+-128)", 4, { 0xFD, 0xCB, 0x80, 0x56 }}, + {"bit 2, (ix+$FE )", "bit 2, (ix+$FE)", 4, { 0xDD, 0xCB, 0xfe, 0x56 }}, + {"bit 2, (iy+$FE )", "bit 2, (iy+$FE)", 4, { 0xFD, 0xCB, 0xfe, 0x56 }}, + {"bit 2, a", "bit 2, a", 2, { 0xCB, 0X57 }}, + {"bit 2, a", "bit 2, a", 2, { 0xCB, 0X57 }}, + {"bit 2, b", "bit 2, b", 2, { 0xCB, 0X50 }}, + {"bit 2, b", "bit 2, b", 2, { 0xCB, 0X50 }}, + {"bit 2, c", "bit 2, c", 2, { 0xCB, 0X51 }}, + {"bit 2, c", "bit 2, c", 2, { 0xCB, 0X51 }}, + {"bit 2, d", "bit 2, d", 2, { 0xCB, 0X52 }}, + {"bit 2, d", "bit 2, d", 2, { 0xCB, 0X52 }}, + {"bit 2, e", "bit 2, e", 2, { 0xCB, 0X53 }}, + {"bit 2, e", "bit 2, e", 2, { 0xCB, 0X53 }}, + {"bit 2, h", "bit 2, h", 2, { 0xCB, 0X54 }}, + {"bit 2, h", "bit 2, h", 2, { 0xCB, 0X54 }}, + {"bit 2, l", "bit 2, l", 2, { 0xCB, 0X55 }}, + {"bit 2, l", "bit 2, l", 2, { 0xCB, 0X55 }}, + + {"bit 3, (hl)", "bit 3, (hl)", 2, { 0xCB, 0x5E }}, + {"bit 3, ( hl )", "bit 3, (hl)", 2, { 0xCB, 0x5E }}, + {"bit 3, (ix + 127)", "bit 3, (ix+127)", 4, { 0xDD, 0xCB, 0x7f, 0x5E }}, + {"bit 3, ( ix + 127 )", "bit 3, (ix+127)", 4, { 0xDD, 0xCB, 0x7f, 0x5E }}, + {"bit 3, (iy + 127)", "bit 3, (iy+127)", 4, { 0xFD, 0xCB, 0x7f, 0x5E }}, + {"bit 3, ( iy + 127 )", "bit 3, (iy+127)", 4, { 0xFD, 0xCB, 0x7f, 0x5E }}, + {"bit 3, (iy + -128)", "bit 3, (iy+-128)", 4, { 0xFD, 0xCB, 0x80, 0x5E }}, + {"bit 3, (ix+$FE )", "bit 3, (ix+$FE)", 4, { 0xDD, 0xCB, 0xfe, 0x5E }}, + {"bit 3, (iy+$FE )", "bit 3, (iy+$FE)", 4, { 0xFD, 0xCB, 0xfe, 0x5E }}, + {"bit 3, a", "bit 3, a", 2, { 0xCB, 0X5F }}, + {"bit 3, a", "bit 3, a", 2, { 0xCB, 0X5F }}, + {"bit 3, b", "bit 3, b", 2, { 0xCB, 0X58 }}, + {"bit 3, b", "bit 3, b", 2, { 0xCB, 0X58 }}, + {"bit 3, c", "bit 3, c", 2, { 0xCB, 0X59 }}, + {"bit 3, c", "bit 3, c", 2, { 0xCB, 0X59 }}, + {"bit 3, d", "bit 3, d", 2, { 0xCB, 0X5A }}, + {"bit 3, d", "bit 3, d", 2, { 0xCB, 0X5A }}, + {"bit 3, e", "bit 3, e", 2, { 0xCB, 0X5B }}, + {"bit 3, e", "bit 3, e", 2, { 0xCB, 0X5B }}, + {"bit 3, h", "bit 3, h", 2, { 0xCB, 0X5C }}, + {"bit 3, h", "bit 3, h", 2, { 0xCB, 0X5C }}, + {"bit 3, l", "bit 3, l", 2, { 0xCB, 0X5D }}, + {"bit 3, l", "bit 3, l", 2, { 0xCB, 0X5D }}, + {"bit $3, l", "bit 3, l", 2, { 0xCB, 0X5D }}, + + {"bit 4, (hl)", "bit 4, (hl)", 2, { 0xCB, 0x66 }}, + {"bit 4, ( hl )", "bit 4, (hl)", 2, { 0xCB, 0x66 }}, + {"bit 4, (ix + 127)", "bit 4, (ix+127)", 4, { 0xDD, 0xCB, 0x7f, 0x66 }}, + {"bit 4, ( ix + 127 )", "bit 4, (ix+127)", 4, { 0xDD, 0xCB, 0x7f, 0x66 }}, + {"bit 4, (iy + 127)", "bit 4, (iy+127)", 4, { 0xFD, 0xCB, 0x7f, 0x66 }}, + {"bit 4, ( iy + 127 )", "bit 4, (iy+127)", 4, { 0xFD, 0xCB, 0x7f, 0x66 }}, + {"bit 4, (iy + -128)", "bit 4, (iy+-128)", 4, { 0xFD, 0xCB, 0x80, 0x66 }}, + {"bit 4, (ix+$FE )", "bit 4, (ix+$FE)", 4, { 0xDD, 0xCB, 0xfe, 0x66 }}, + {"bit 4, (iy+$FE )", "bit 4, (iy+$FE)", 4, { 0xFD, 0xCB, 0xfe, 0x66 }}, + {"bit 4, a", "bit 4, a", 2, { 0xCB, 0X67 }}, + {"bit 4, a", "bit 4, a", 2, { 0xCB, 0X67 }}, + {"bit 4, b", "bit 4, b", 2, { 0xCB, 0X60 }}, + {"bit 4, b", "bit 4, b", 2, { 0xCB, 0X60 }}, + {"bit 4, c", "bit 4, c", 2, { 0xCB, 0X61 }}, + {"bit 4, c", "bit 4, c", 2, { 0xCB, 0X61 }}, + {"bit 4, d", "bit 4, d", 2, { 0xCB, 0X62 }}, + {"bit 4, d", "bit 4, d", 2, { 0xCB, 0X62 }}, + {"bit 4, e", "bit 4, e", 2, { 0xCB, 0X63 }}, + {"bit 4, e", "bit 4, e", 2, { 0xCB, 0X63 }}, + {"bit 4, h", "bit 4, h", 2, { 0xCB, 0X64 }}, + {"bit 4, h", "bit 4, h", 2, { 0xCB, 0X64 }}, + {"bit 4, l", "bit 4, l", 2, { 0xCB, 0X65 }}, + {"bit 4, l", "bit 4, l", 2, { 0xCB, 0X65 }}, + {"bit $4, l", "bit 4, l", 2, { 0xCB, 0X65 }}, + + {"bit 5, (hl)", "bit 5, (hl)", 2, { 0xCB, 0x6E }}, + {"bit 5, ( hl )", "bit 5, (hl)", 2, { 0xCB, 0x6E }}, + {"bit 5, (ix + 127)", "bit 5, (ix+127)", 4, { 0xDD, 0xCB, 0x7f, 0x6E }}, + {"bit 5, ( ix + 127 )", "bit 5, (ix+127)", 4, { 0xDD, 0xCB, 0x7f, 0x6E }}, + {"bit 5, (iy + 127)", "bit 5, (iy+127)", 4, { 0xFD, 0xCB, 0x7f, 0x6E }}, + {"bit 5, ( iy + 127 )", "bit 5, (iy+127)", 4, { 0xFD, 0xCB, 0x7f, 0x6E }}, + {"bit 5, (iy + -128)", "bit 5, (iy+-128)", 4, { 0xFD, 0xCB, 0x80, 0x6E }}, + {"bit 5, (ix+$FE )", "bit 5, (ix+$FE)", 4, { 0xDD, 0xCB, 0xfe, 0x6E }}, + {"bit 5, (iy+$FE )", "bit 5, (iy+$FE)", 4, { 0xFD, 0xCB, 0xfe, 0x6E }}, + {"bit 5, a", "bit 5, a", 2, { 0xCB, 0X6F }}, + {"bit 5, a", "bit 5, a", 2, { 0xCB, 0X6F }}, + {"bit 5, b", "bit 5, b", 2, { 0xCB, 0X68 }}, + {"bit 5, b", "bit 5, b", 2, { 0xCB, 0X68 }}, + {"bit 5, c", "bit 5, c", 2, { 0xCB, 0X69 }}, + {"bit 5, c", "bit 5, c", 2, { 0xCB, 0X69 }}, + {"bit 5, d", "bit 5, d", 2, { 0xCB, 0X6A }}, + {"bit 5, d", "bit 5, d", 2, { 0xCB, 0X6A }}, + {"bit 5, e", "bit 5, e", 2, { 0xCB, 0X6B }}, + {"bit 5, e", "bit 5, e", 2, { 0xCB, 0X6B }}, + {"bit 5, h", "bit 5, h", 2, { 0xCB, 0X6C }}, + {"bit 5, h", "bit 5, h", 2, { 0xCB, 0X6C }}, + {"bit 5, l", "bit 5, l", 2, { 0xCB, 0X6D }}, + {"bit 5, l", "bit 5, l", 2, { 0xCB, 0X6D }}, + {"bit $5, l", "bit 5, l", 2, { 0xCB, 0X6D }}, + + {"bit 6, (hl)", "bit 6, (hl)", 2, { 0xCB, 0x76 }}, + {"bit 6, ( hl )", "bit 6, (hl)", 2, { 0xCB, 0x76 }}, + {"bit 6, (ix + 127)", "bit 6, (ix+127)", 4, { 0xDD, 0xCB, 0x7f, 0x76 }}, + {"bit 6, ( ix + 127 )", "bit 6, (ix+127)", 4, { 0xDD, 0xCB, 0x7f, 0x76 }}, + {"bit 6, (iy + 127)", "bit 6, (iy+127)", 4, { 0xFD, 0xCB, 0x7f, 0x76 }}, + {"bit 6, ( iy + 127 )", "bit 6, (iy+127)", 4, { 0xFD, 0xCB, 0x7f, 0x76 }}, + {"bit 6, (iy + -128)", "bit 6, (iy+-128)", 4, { 0xFD, 0xCB, 0x80, 0x76 }}, + {"bit 6, (ix+$FE )", "bit 6, (ix+$FE)", 4, { 0xDD, 0xCB, 0xfe, 0x76 }}, + {"bit 6, (iy+$FE )", "bit 6, (iy+$FE)", 4, { 0xFD, 0xCB, 0xfe, 0x76 }}, + {"bit 6, a", "bit 6, a", 2, { 0xCB, 0X77 }}, + {"bit 6, a", "bit 6, a", 2, { 0xCB, 0X77 }}, + {"bit 6, b", "bit 6, b", 2, { 0xCB, 0X70 }}, + {"bit 6, b", "bit 6, b", 2, { 0xCB, 0X70 }}, + {"bit 6, c", "bit 6, c", 2, { 0xCB, 0X71 }}, + {"bit 6, c", "bit 6, c", 2, { 0xCB, 0X71 }}, + {"bit 6, d", "bit 6, d", 2, { 0xCB, 0X72 }}, + {"bit 6, d", "bit 6, d", 2, { 0xCB, 0X72 }}, + {"bit 6, e", "bit 6, e", 2, { 0xCB, 0X73 }}, + {"bit 6, e", "bit 6, e", 2, { 0xCB, 0X73 }}, + {"bit 6, h", "bit 6, h", 2, { 0xCB, 0X74 }}, + {"bit 6, h", "bit 6, h", 2, { 0xCB, 0X74 }}, + {"bit 6, l", "bit 6, l", 2, { 0xCB, 0X75 }}, + {"bit 6, l", "bit 6, l", 2, { 0xCB, 0X75 }}, + + {"bit 7, (hl)", "bit 7, (hl)", 2, { 0xCB, 0x7E }}, + {"bit 7, ( hl )", "bit 7, (hl)", 2, { 0xCB, 0x7E }}, + {"bit 7, (ix + 127)", "bit 7, (ix+127)", 4, { 0xDD, 0xCB, 0x7f, 0x7E }}, + {"bit 7, ( ix + 127 )", "bit 7, (ix+127)", 4, { 0xDD, 0xCB, 0x7f, 0x7E }}, + {"bit 7, (iy + 127)", "bit 7, (iy+127)", 4, { 0xFD, 0xCB, 0x7f, 0x7E }}, + {"bit 7, ( iy + 127 )", "bit 7, (iy+127)", 4, { 0xFD, 0xCB, 0x7f, 0x7E }}, + {"bit 7, (iy + -128)", "bit 7, (iy+-128)", 4, { 0xFD, 0xCB, 0x80, 0x7E }}, + {"bit 7, (ix+$FE )", "bit 7, (ix+$FE)", 4, { 0xDD, 0xCB, 0xfe, 0x7E }}, + {"bit 7, (iy+$FE )", "bit 7, (iy+$FE)", 4, { 0xFD, 0xCB, 0xfe, 0x7E }}, + {"bit 7, a", "bit 7, a", 2, { 0xCB, 0X7F }}, + {"bit 7, a", "bit 7, a", 2, { 0xCB, 0X7F }}, + {"bit 7, b", "bit 7, b", 2, { 0xCB, 0X78 }}, + {"bit 7, b", "bit 7, b", 2, { 0xCB, 0X78 }}, + {"bit 7, c", "bit 7, c", 2, { 0xCB, 0X79 }}, + {"bit 7, c", "bit 7, c", 2, { 0xCB, 0X79 }}, + {"bit 7, d", "bit 7, d", 2, { 0xCB, 0X7A }}, + {"bit 7, d", "bit 7, d", 2, { 0xCB, 0X7A }}, + {"bit 7, e", "bit 7, e", 2, { 0xCB, 0X7B }}, + {"bit 7, e", "bit 7, e", 2, { 0xCB, 0X7B }}, + {"bit 7, h", "bit 7, h", 2, { 0xCB, 0X7C }}, + {"bit 7, h", "bit 7, h", 2, { 0xCB, 0X7C }}, + {"bit 7, l", "bit 7, l", 2, { 0xCB, 0X7D }}, + {"bit 7, l", "bit 7, l", 2, { 0xCB, 0X7D }}, + {"bit $7, l", "bit 7, l", 2, { 0xCB, 0X7D }}, + + {"call c, label", "call c, label", 3, {0xDC, 0x00, 0x00}}, + {"call c,label", "call c, label", 3, {0xDC, 0x00, 0x00}}, + {"call m, label", "call m, label", 3, {0xFC, 0x00, 0x00}}, + {"call m , label", "call m, label", 3, {0xFC, 0x00, 0x00}}, + {"call nc, label", "call nc, label", 3, {0xD4, 0x00, 0x00}}, + {"call nc , label", "call nc, label", 3, {0xD4, 0x00, 0x00}}, + {"call label", "call label", 3, {0xCD, 0x00, 0x00}}, + {"call label", "call label", 3, {0xCD, 0x00, 0x00}}, + {"call no", "call no", 3, {0xCD, 0x01, 0x0}}, + {"call no", "call no", 3, {0xCD, 0x01, 0x0}}, + {"call nz, label", "call nz, label", 3, {0xC4, 0x00, 0x00}}, + {"call nz , label", "call nz, label", 3, {0xC4, 0x00, 0x00}}, + {"call p, label", "call p, label", 3, {0xF4, 0x00, 0x00}}, + {"call p , label", "call p, label", 3, {0xF4, 0x00, 0x00}}, + {"call pe, label", "call pe, label", 3, {0xEC, 0x00, 0x00}}, + {"call pe , label", "call pe, label", 3, {0xEC, 0x00, 0x00}}, + {"call po, label", "call po, label", 3, {0xE4, 0x00, 0x00}}, + {"call po, label", "call po, label", 3, {0xE4, 0x00, 0x00}}, + {"call pc", "call pc", 3, {0xCD, 0x02, 0x00}}, + {"call pc", "call pc", 3, {0xCD, 0x02, 0x00}}, + {"call z, label", "call z, label", 3, {0xCC, 0x00, 0x00}}, + {"call z, label", "call z, label", 3, {0xCC, 0x00, 0x00}}, + {"call 100", "call 100", 3, {0xCD, 0x64, 0x00}}, + {"call 100", "call 100", 3, {0xCD, 0x64, 0x00}}, + {"call $dead", "call $DEAD", 3, {0xCD, 0xAD, 0xDE}}, + {"call $dead", "call $DEAD", 3, {0xCD, 0xAD, 0xDE}}, + {"call c, 4096", "call c, 4096", 3, {0xDC, 0x00, 0x10} }, + {"call c , 4096", "call c, 4096", 3, {0xDC, 0x00, 0x10} }, + {"call 60000", "call 60000", 3, {0xCD, 0x60, 0xEA} }, + + {"ccf", "ccf", 1, {0x3F}}, + + {"cp (hl)", "cp (hl)", 1, {0xBE}}, + {"cp ( hl )", "cp (hl)", 1, {0xBE}}, + {"cp (ix+77)", "cp (ix+77)", 3, {0xDD, 0xBE, 0x4D}}, + {"cp ( ix+ 77 )", "cp (ix+77)", 3, {0xDD, 0xBE, 0x4D}}, + {"cp (iy+77)", "cp (iy+77)", 3, {0xFD, 0xBE, 0x4D}}, + {"cp ( iy+ 77 )", "cp (iy+77)", 3, {0xFD, 0xBE, 0x4D}}, + {"cp (iy+$ff)", "cp (iy+$FF)", 3, {0xFD, 0xBE, 0xFF}}, + {"cp ( iy+ $ff )", "cp (iy+$FF)", 3, {0xFD, 0xBE, 0xFF}}, + {"cp (iy+-1)", "cp (iy+-1)", 3, {0xFD, 0xBE, 0xFF}}, + {"cp ( iy+ -1 )", "cp (iy+-1)", 3, {0xFD, 0xBE, 0xFF}}, + {"cp a", "cp a", 1, {0xBF}}, + {"cp a", "cp a", 1, {0xBF}}, + {"cp b", "cp b", 1, {0xB8}}, + {"cp b", "cp b", 1, {0xB8}}, + {"cp c", "cp c", 1, {0xB9}}, + {"cp c", "cp c", 1, {0xB9}}, + {"cp d", "cp d", 1, {0xBA}}, + {"cp d", "cp d", 1, {0xBA}}, + {"cp e", "cp e", 1, {0xBB}}, + {"cp e", "cp e", 1, {0xBB}}, + {"cp h", "cp h", 1, {0xBC}}, + {"cp h", "cp h", 1, {0xBC}}, + {"cp l", "cp l", 1, {0xBD}}, + {"cp l", "cp l", 1, {0xBD}}, + {"cp 101", "cp 101", 2, {0xFE, 0x65}}, + {"cp 101", "cp 101", 2, {0xFE, 0x65}}, + {"cp $65", "cp $65", 2, {0xFE, 0x65}}, + {"cp 'A'", "cp 'A'", 2, {0xFE, 0x41}}, + {"cp 'A'", "cp 'A'", 2, {0xFE, 0x41}}, + {"cp $65", "cp $65", 2, {0xFE, 0x65}}, + {"cp -128", "cp -128", 2, {0xFE, 0x80}}, + {"cp -128", "cp -128", 2, {0xFE, 0x80}}, + + {"cpd", "cpd", 2, {0xED, 0xA9}}, + + {"cpdr", "cpdr", 2, {0xED, 0xB9}}, + + {"cpi", "cpi", 2, {0xED, 0xA1}}, + + {"cpir", "cpir", 2, {0xED, 0xB1}}, + + {"cpl", "cpl", 1, {0x2f}}, + + {"daa", "daa", 1, {0x27}}, + + {"dec (hl)", "dec (hl)", 1, {0x35}}, + {"dec ( hl)", "dec (hl)", 1, {0x35}}, + {"dec (ix+3)", "dec (ix+3)", 3, {0xDD, 0x35, 0x3}}, + {"dec ( ix + 3 )", "dec (ix+3)", 3, {0xDD, 0x35, 0x3}}, + {"dec (iy+5)", "dec (iy+5)", 3, {0xFD, 0x35, 0x5}}, + {"dec ( iy + 5 )", "dec (iy+5)", 3, {0xFD, 0x35, 0x5}}, + {"dec a", "dec a", 1, {0x3D}}, + {"dec a", "dec a", 1, {0x3D}}, + {"dec b", "dec b", 1, {0x05}}, + {"dec b", "dec b", 1, {0x05}}, + {"dec bc", "dec bc", 1, {0x0B}}, + {"dec bc", "dec bc", 1, {0x0B}}, + {"dec c", "dec c", 1, {0x0D}}, + {"dec c", "dec c", 1, {0x0D}}, + {"dec d", "dec d", 1, {0x15}}, + {"dec d", "dec d", 1, {0x15}}, + {"dec de", "dec de", 1, {0x1B}}, + {"dec de", "dec de", 1, {0x1B}}, + {"dec e", "dec e", 1, {0x1D}}, + {"dec e", "dec e", 1, {0x1D}}, + {"dec h", "dec h", 1, {0x25}}, + {"dec h", "dec h", 1, {0x25}}, + {"dec hl", "dec hl", 1, {0x2B}}, + {"dec hl", "dec hl", 1, {0x2B}}, + {"dec ix", "dec ix", 2, {0xDD, 0x2B}}, + {"dec iy", "dec iy", 2, {0xFD, 0x2B}}, + {"dec l", "dec l", 1, {0x2D}}, + {"dec sp", "dec sp", 1, {0x3B}}, + + {"di", "di", 1, {0xF3}}, + + {"djnz label", "djnz label", 2, {0x10,0x0}}, + {"djnz label", "djnz label", 2, {0x10,0x0}}, + + {"ei", "ei", 1, {0xFB}}, + + {"ex (sp), hl", "ex (sp), hl", 1, {0xE3}}, + {"ex ( sp ) , hl", "ex (sp), hl", 1, {0xE3}}, + {"ex (sp), ix", "ex (sp), ix", 2, {0xDD, 0xE3}}, + {"ex ( sp ) , ix", "ex (sp), ix", 2, {0xDD, 0xE3}}, + {"ex (sp), iy", "ex (sp), iy", 2, {0xFD, 0xE3}}, + {"ex ( sp ) , iy", "ex (sp), iy", 2, {0xFD, 0xE3}}, + {"ex af, af'", "ex af, af'", 1, {0x08}}, + {"ex af,af'", "ex af, af'", 1, {0x08}}, + {"ex de, hl", "ex de, hl", 1, {0xEB}}, + {"ex de,hl", "ex de, hl", 1, {0xEB}}, + + {"exx", "exx", 1, {0xD9}}, + + {"halt", "halt", 1, {0x76}}, + + {"im 0", "im 0", 2, {0xED, 0x46}}, + {"im 0", "im 0", 2, {0xED, 0x46}}, + {"im 1", "im 1", 2, {0xED, 0x56}}, + {"im 1", "im 1", 2, {0xED, 0x56}}, + {"im 2", "im 2", 2, {0xED, 0x5E}}, + {"im 2", "im 2", 2, {0xED, 0x5E}}, + {"im $2", "im 2", 2, {0xED, 0x5E}}, + {"im $2", "im 2", 2, {0xED, 0x5E}}, + + {"in a, (c)", "in a, (c)", 2, {0xED, 0x78}}, + {"in a ,( c )", "in a, (c)", 2, {0xED, 0x78}}, + {"in a, (66)", "in a, (66)", 2, {0xDB, 0x42}}, + {"in a ,( 66 )", "in a, (66)", 2, {0xDB, 0x42}}, + {"in a, ($FF)", "in a, ($FF)", 2, {0xDB, 0xff}}, + {"in a ,( $FF )", "in a, ($FF)", 2, {0xDB, 0xff}}, + {"in a, (128)", "in a, (128)", 2, {0xDB, 0x80}}, + {"in a ,( 128 )", "in a, (128)", 2, {0xDB, 0x80}}, + {"in b, (c)", "in b, (c)", 2, {0xED, 0x40}}, + {"in b ,( c )", "in b, (c)", 2, {0xED, 0x40}}, + {"in c, (c)", "in c, (c)", 2, {0xED, 0x48}}, + {"in c ,( c )", "in c, (c)", 2, {0xED, 0x48}}, + {"in d, (c)", "in d, (c)", 2, {0xED, 0x50}}, + {"in d ,( c )", "in d, (c)", 2, {0xED, 0x50}}, + {"in e, (c)", "in e, (c)", 2, {0xED, 0x58}}, + {"in e ,( c )", "in e, (c)", 2, {0xED, 0x58}}, + {"in h, (c)", "in h, (c)", 2, {0xED, 0x60}}, + {"in h ,( c )", "in h, (c)", 2, {0xED, 0x60}}, + {"in l, (c)", "in l, (c)", 2, {0xED, 0x68}}, + {"in l ,( c )", "in l, (c)", 2, {0xED, 0x68}}, + + {"inc (hl)", "inc (hl)", 1, {0x34}}, + {"inc ( hl)", "inc (hl)", 1, {0x34}}, + {"inc (ix+3)", "inc (ix+3)", 3, {0xDD, 0x34, 0x3}}, + {"inc ( ix + 3 )", "inc (ix+3)", 3, {0xDD, 0x34, 0x3}}, + {"inc (iy+5)", "inc (iy+5)", 3, {0xFD, 0x34, 0x5}}, + {"inc ( iy + 5 )", "inc (iy+5)", 3, {0xFD, 0x34, 0x5}}, + {"inc (ix+$FE)", "inc (ix+$FE)", 3, {0xDD, 0x34, 0xFE}}, + {"inc ( ix + $FE )", "inc (ix+$FE)", 3, {0xDD, 0x34, 0xFE}}, + {"inc (ix+-1)", "inc (ix+-1)", 3, {0xDD, 0x34, 0xFF}}, + {"inc ( ix + -1 )", "inc (ix+-1)", 3, {0xDD, 0x34, 0xFF}}, + {"inc a", "inc a", 1, {0x3C}}, + {"inc a", "inc a", 1, {0x3C}}, + {"inc b", "inc b", 1, {0x04}}, + {"inc b", "inc b", 1, {0x04}}, + {"inc bc", "inc bc", 1, {0x03}}, + {"inc bc", "inc bc", 1, {0x03}}, + {"inc c", "inc c", 1, {0x0C}}, + {"inc c", "inc c", 1, {0x0C}}, + {"inc d", "inc d", 1, {0x14}}, + {"inc d", "inc d", 1, {0x14}}, + {"inc de", "inc de", 1, {0x13}}, + {"inc de", "inc de", 1, {0x13}}, + {"inc e", "inc e", 1, {0x1C}}, + {"inc e", "inc e", 1, {0x1C}}, + {"inc h", "inc h", 1, {0x24}}, + {"inc h", "inc h", 1, {0x24}}, + {"inc hl", "inc hl", 1, {0x23}}, + {"inc hl", "inc hl", 1, {0x23}}, + {"inc ix", "inc ix", 2, {0xDD, 0x23}}, + {"inc iy", "inc iy", 2, {0xFD, 0x23}}, + {"inc l", "inc l", 1, {0x2C}}, + {"inc sp", "inc sp", 1, {0x33}}, + + {"ind", "ind", 2, {0xED, 0xAA}}, + + {"indr", "indr", 2, {0xED, 0xBA}}, + + {"ini", "ini", 2, {0xED, 0xA2}}, + + {"inir", "inir", 2, {0xED, 0xB2}}, + + {"jp (hl)", "jp (hl)", 1, {0xE9}}, + {"jp ( hl )", "jp (hl)", 1, {0xE9}}, + {"jp (ix)", "jp (ix)", 2, {0xDD, 0xE9}}, + {"jp ( ix )", "jp (ix)", 2, {0xDD, 0xE9}}, + {"jp (iy)", "jp (iy)", 2, {0xFD, 0xE9}}, + {"jp ( iy )", "jp (iy)", 2, {0xFD, 0xE9}}, + {"jp c, label", "jp c, label", 3, {0xDA, 0x00, 0x00}}, + {"jp c,label", "jp c, label", 3, {0xDA, 0x00, 0x00}}, + {"jp m, label", "jp m, label", 3, {0xFA, 0x00, 0x00}}, + {"jp m,label", "jp m, label", 3, {0xFA, 0x00, 0x00}}, + {"jp nc, label", "jp nc, label", 3, {0xD2, 0x00, 0x00}}, + {"jp nc,label", "jp nc, label", 3, {0xD2, 0x00, 0x00}}, + {"jp label", "jp label", 3, {0xC3, 0x00, 0x00}}, + {"jp label", "jp label", 3, {0xC3, 0x00, 0x00}}, + {"jp nz, label", "jp nz, label", 3, {0xC2, 0x00, 0x00}}, + {"jp nz, label", "jp nz, label", 3, {0xC2, 0x00, 0x00}}, + {"jp p, label", "jp p, label", 3, {0xF2, 0x00, 0x00}}, + {"jp p, label", "jp p, label", 3, {0xF2, 0x00, 0x00}}, + {"jp pe, label", "jp pe, label", 3, {0xEA, 0x00, 0x00}}, + {"jp pe, label", "jp pe, label", 3, {0xEA, 0x00, 0x00}}, + {"jp po, label", "jp po, label", 3, {0xE2, 0x00, 0x00}}, + {"jp po, label", "jp po, label", 3, {0xE2, 0x00, 0x00}}, + {"jp z, label", "jp z, label", 3, {0xCA, 0x00, 0x00}}, + {"jp z, label", "jp z, label", 3, {0xCA, 0x00, 0x00}}, + {"jp pc", "jp pc", 3, {0xC3, 0x02, 0x00}}, + {"jp pc", "jp pc", 3, {0xC3, 0x02, 0x00}}, + {"jp no", "jp no", 3, {0xC3, 0x01, 0x00}}, + {"jp no", "jp no", 3, {0xC3, 0x01, 0x00}}, + + {"jr c, label", "jr c, label", 2, {0x38, 0x00}}, + {"jr c, label", "jr c, label", 2, {0x38, 0x00}}, + {"jr label", "jr label", 2, {0x18, 0x00}}, + {"jr label", "jr label", 2, {0x18, 0x00}}, + {"jr nc, label", "jr nc, label", 2, {0x30, 0x00}}, + {"jr nc,label", "jr nc, label", 2, {0x30, 0x00}}, + {"jr nz, label", "jr nz, label", 2, {0x20, 0x00}}, + {"jr nz,label", "jr nz, label", 2, {0x20, 0x00}}, + {"jr clabel", "jr clabel", 2, {0x18, 0x03}}, + {"jr nzo", "jr nzo", 2, {0x18, 0x04}}, + + {"ld (bc), a", "ld (bc), a", 1, {0x2}}, + {"ld ( bc ) , a", "ld (bc), a", 1, {0x2}}, + {"ld (de), a", "ld (de), a", 1, {0x12}}, + {"ld ( de ) , a", "ld (de), a", 1, {0x12}}, + {"ld (hl), a", "ld (hl), a", 1, {0x77}}, + {"ld ( hl ) , a", "ld (hl), a", 1, {0x77}}, + {"ld (hl), b", "ld (hl), b", 1, {0x70}}, + {"ld ( hl ) , b", "ld (hl), b", 1, {0x70}}, + {"ld (hl), c", "ld (hl), c", 1, {0x71}}, + {"ld ( hl ) , c", "ld (hl), c", 1, {0x71}}, + {"ld (hl), d", "ld (hl), d", 1, {0x72}}, + {"ld ( hl ) , d", "ld (hl), d", 1, {0x72}}, + {"ld (hl), e", "ld (hl), e", 1, {0x73}}, + {"ld ( hl ) , e", "ld (hl), e", 1, {0x73}}, + {"ld (hl), h", "ld (hl), h", 1, {0x74}}, + {"ld ( hl ) , h", "ld (hl), h", 1, {0x74}}, + {"ld (hl), l", "ld (hl), l", 1, {0x75}}, + {"ld ( hl ) , l", "ld (hl), l", 1, {0x75}}, + {"ld (hl), 10", "ld (hl), 10", 2, {0x36, 0xA}}, + {"ld ( hl ) , 10", "ld (hl), 10", 2, {0x36, 0xA}}, + {"ld (hl), 'A'", "ld (hl), 'A'", 2, {0x36, 0x41}}, + {"ld ( hl ) , 'A'", "ld (hl), 'A'", 2, {0x36, 0x41}}, + + {"ld (ix+1), a", "ld (ix+1), a", 3, {0xDD, 0x77, 0x1}}, + {"ld ( ix + 1 ) , a", "ld (ix+1), a", 3, {0xDD, 0x77, 0x1}}, + {"ld (ix+$7f), a", "ld (ix+$7F), a", 3, {0xDD, 0x77, 0x7F}}, + {"ld ( ix + $7F ) , a", "ld (ix+$7F), a", 3, {0xDD, 0x77, 0x7F}}, + {"ld (ix+-1), a", "ld (ix+-1), a", 3, {0xDD, 0x77, 0xFF}}, + {"ld ( ix + -1 ) , a", "ld (ix+-1), a", 3, {0xDD, 0x77, 0xFF}}, + {"ld (ix+1), b", "ld (ix+1), b", 3, {0xDD, 0x70, 0x1}}, + {"ld ( ix + 1 ) , b", "ld (ix+1), b", 3, {0xDD, 0x70, 0x1}}, + {"ld (ix+$7F), b", "ld (ix+$7F), b", 3, {0xDD, 0x70, 0x7F}}, + {"ld ( ix + $7F ) , b", "ld (ix+$7F), b", 3, {0xDD, 0x70, 0x7F}}, + {"ld (ix+-1), b", "ld (ix+-1), b", 3, {0xDD, 0x70, 0xFF}}, + {"ld ( ix + -1 ) , b", "ld (ix+-1), b", 3, {0xDD, 0x70, 0xFF}}, + {"ld (ix+1), c", "ld (ix+1), c", 3, {0xDD, 0x71, 0x1}}, + {"ld ( ix + 1 ) , c", "ld (ix+1), c", 3, {0xDD, 0x71, 0x1}}, + {"ld (ix+$7F), c", "ld (ix+$7F), c", 3, {0xDD, 0x71, 0x7F}}, + {"ld ( ix + $7F ) , c", "ld (ix+$7F), c", 3, {0xDD, 0x71, 0x7F}}, + {"ld (ix+-1), c", "ld (ix+-1), c", 3, {0xDD, 0x71, 0xFF}}, + {"ld ( ix + -1 ) , c", "ld (ix+-1), c", 3, {0xDD, 0x71, 0xFF}}, + {"ld (ix+1), d", "ld (ix+1), d", 3, {0xDD, 0x72, 0x1}}, + {"ld ( ix + 1 ) , d", "ld (ix+1), d", 3, {0xDD, 0x72, 0x1}}, + {"ld (ix+$7F), d", "ld (ix+$7F), d", 3, {0xDD, 0x72, 0x7F}}, + {"ld ( ix + $7F ) , d", "ld (ix+$7F), d", 3, {0xDD, 0x72, 0x7F}}, + {"ld (ix+-1), d", "ld (ix+-1), d", 3, {0xDD, 0x72, 0xFF}}, + {"ld ( ix + -1 ) , d", "ld (ix+-1), d", 3, {0xDD, 0x72, 0xFF}}, + {"ld (ix+1), e", "ld (ix+1), e", 3, {0xDD, 0x73, 0x1}}, + {"ld ( ix + 1 ) , e", "ld (ix+1), e", 3, {0xDD, 0x73, 0x1}}, + {"ld (ix+$8F), e", "ld (ix+$8F), e", 3, {0xDD, 0x73, 0x8F}}, + {"ld ( ix + $8F ) , e", "ld (ix+$8F), e", 3, {0xDD, 0x73, 0x8F}}, + {"ld (ix+-1), e", "ld (ix+-1), e", 3, {0xDD, 0x73, 0xFF}}, + {"ld ( ix + -1 ) , e", "ld (ix+-1), e", 3, {0xDD, 0x73, 0xFF}}, + {"ld (ix+1), h", "ld (ix+1), h", 3, {0xDD, 0x74, 0x1}}, + {"ld ( ix + 1 ) , h", "ld (ix+1), h", 3, {0xDD, 0x74, 0x1}}, + {"ld (ix+$CF), h", "ld (ix+$CF), h", 3, {0xDD, 0x74, 0xCF}}, + {"ld ( ix + $CF ) , h", "ld (ix+$CF), h", 3, {0xDD, 0x74, 0xCF}}, + {"ld (ix+-1), h", "ld (ix+-1), h", 3, {0xDD, 0x74, 0xFF}}, + {"ld ( ix + -1 ) , h", "ld (ix+-1), h", 3, {0xDD, 0x74, 0xFF}}, + {"ld (ix+1), l", "ld (ix+1), l", 3, {0xDD, 0x75, 0x1}}, + {"ld ( ix + 1 ) , l", "ld (ix+1), l", 3, {0xDD, 0x75, 0x1}}, + {"ld (ix+$CC), l", "ld (ix+$CC), l", 3, {0xDD, 0x75, 0xCC}}, + {"ld ( ix + $CC ) , l", "ld (ix+$CC), l", 3, {0xDD, 0x75, 0xCC}}, + {"ld (ix+-1), l", "ld (ix+-1), l", 3, {0xDD, 0x75, 0xFF}}, + {"ld ( ix + -1 ) , l", "ld (ix+-1), l", 3, {0xDD, 0x75, 0xFF}}, + + {"ld (ix+1), 'A'", "ld (ix+1), 'A'", 4, {0xDD, 0x36, 0x1, 0x41}}, + {"ld (ix+1), 11", "ld (ix+1), 11", 4, {0xDD, 0x36, 0x1, 0xB}}, + {"ld ( ix + 1 ) , 11", "ld (ix+1), 11", 4, {0xDD, 0x36, 0x1, 0xB}}, + {"ld (ix+$AA), 11", "ld (ix+$AA), 11", 4, {0xDD, 0x36, 0xAA, 0xB}}, + {"ld (ix+$AA), $B", "ld (ix+$AA), $B", 4, {0xDD, 0x36, 0xAA, 0xB}}, + {"ld (ix+32), $B", "ld (ix+32), $B", 4, {0xDD, 0x36, 0x20, 0xB}}, + {"ld (ix+-1), $B", "ld (ix+-1), $B", 4, {0xDD, 0x36, 0xFF, 0xB}}, + {"ld (ix+-1), -1", "ld (ix+-1), -1", 4, {0xDD, 0x36, 0xFF, 0xFF}}, + {"ld (ix+32), -1", "ld (ix+32), -1", 4, {0xDD, 0x36, 0x20, 0xFF}}, + + {"ld (iy+1), a", "ld (iy+1), a", 3, {0xFD, 0x77, 0x1}}, + {"ld ( iy + 1 ) , a", "ld (iy+1), a", 3, {0xFD, 0x77, 0x1}}, + {"ld (iy+-1), a", "ld (iy+-1), a", 3, {0xFD, 0x77, 0xFF}}, + {"ld ( iy + -1 ) , a", "ld (iy+-1), a", 3, {0xFD, 0x77, 0xFF}}, + {"ld (iy+$ff), a", "ld (iy+$FF), a", 3, {0xFD, 0x77, 0xFF}}, + {"ld ( iy + $ff ) , a", "ld (iy+$FF), a", 3, {0xFD, 0x77, 0xFF}}, + {"ld (iy+1), b", "ld (iy+1), b", 3, {0xFD, 0x70, 0x1}}, + {"ld ( iy + 1 ) , b", "ld (iy+1), b", 3, {0xFD, 0x70, 0x1}}, + {"ld (iy+-1), b", "ld (iy+-1), b", 3, {0xFD, 0x70, 0xFF}}, + {"ld ( iy + -1 ) , b", "ld (iy+-1), b", 3, {0xFD, 0x70, 0xFF}}, + {"ld (iy+$ff), b", "ld (iy+$FF), b", 3, {0xFD, 0x70, 0xFF}}, + {"ld ( iy + $ff ) , b", "ld (iy+$FF), b", 3, {0xFD, 0x70, 0xFF}}, + {"ld (iy+1), c", "ld (iy+1), c", 3, {0xFD, 0x71, 0x1}}, + {"ld ( iy + 1 ) , c", "ld (iy+1), c", 3, {0xFD, 0x71, 0x1}}, + {"ld (iy+-1), c", "ld (iy+-1), c", 3, {0xFD, 0x71, 0xFF}}, + {"ld ( iy + -1 ) , c", "ld (iy+-1), c", 3, {0xFD, 0x71, 0xFF}}, + {"ld (iy+$FF), c", "ld (iy+$FF), c", 3, {0xFD, 0x71, 0xFF}}, + {"ld ( iy + $FF ) , c", "ld (iy+$FF), c", 3, {0xFD, 0x71, 0xFF}}, + {"ld (iy+1), d", "ld (iy+1), d", 3, {0xFD, 0x72, 0x1}}, + {"ld ( iy + 1 ) , d", "ld (iy+1), d", 3, {0xFD, 0x72, 0x1}}, + {"ld (iy+-1), d", "ld (iy+-1), d", 3, {0xFD, 0x72, 0xFF}}, + {"ld ( iy + -1 ) , d", "ld (iy+-1), d", 3, {0xFD, 0x72, 0xFF}}, + {"ld (iy+$FF), d", "ld (iy+$FF), d", 3, {0xFD, 0x72, 0xFF}}, + {"ld ( iy + $FF ) , d", "ld (iy+$FF), d", 3, {0xFD, 0x72, 0xFF}}, + {"ld (iy+1), e", "ld (iy+1), e", 3, {0xFD, 0x73, 0x1}}, + {"ld ( iy + 1 ) , e", "ld (iy+1), e", 3, {0xFD, 0x73, 0x1}}, + {"ld (iy+-1), e", "ld (iy+-1), e", 3, {0xFD, 0x73, 0xFF}}, + {"ld ( iy + -1 ) , e", "ld (iy+-1), e", 3, {0xFD, 0x73, 0xFF}}, + {"ld (iy+$FF), e", "ld (iy+$FF), e", 3, {0xFD, 0x73, 0xFF}}, + {"ld ( iy + $FF ) , e", "ld (iy+$FF), e", 3, {0xFD, 0x73, 0xFF}}, + {"ld (iy+1), h", "ld (iy+1), h", 3, {0xFD, 0x74, 0x1}}, + {"ld ( iy + 1 ) , h", "ld (iy+1), h", 3, {0xFD, 0x74, 0x1}}, + {"ld (iy+-1), h", "ld (iy+-1), h", 3, {0xFD, 0x74, 0xFF}}, + {"ld ( iy + -1 ) , h", "ld (iy+-1), h", 3, {0xFD, 0x74, 0xFF}}, + {"ld (iy+$FF), h", "ld (iy+$FF), h", 3, {0xFD, 0x74, 0xFF}}, + {"ld ( iy + $FF ) , h", "ld (iy+$FF), h", 3, {0xFD, 0x74, 0xFF}}, + {"ld (iy+1), l", "ld (iy+1), l", 3, {0xFD, 0x75, 0x1}}, + {"ld ( iy + 1 ) , l", "ld (iy+1), l", 3, {0xFD, 0x75, 0x1}}, + {"ld (iy+-1), l", "ld (iy+-1), l", 3, {0xFD, 0x75, 0xFF}}, + {"ld ( iy + -1 ) , l", "ld (iy+-1), l", 3, {0xFD, 0x75, 0xFF}}, + {"ld (iy+$FF), l", "ld (iy+$FF), l", 3, {0xFD, 0x75, 0xFF}}, + {"ld ( iy + $FF ) , l", "ld (iy+$FF), l", 3, {0xFD, 0x75, 0xFF}}, + {"ld (iy+1), l", "ld (iy+1), l", 3, {0xFD, 0x75, 0x1}}, + {"ld ( iy + 1 ) , l", "ld (iy+1), l", 3, {0xFD, 0x75, 0x1}}, + {"ld (iy+-1), l", "ld (iy+-1), l", 3, {0xFD, 0x75, 0xFF}}, + {"ld ( iy + -1 ) , l", "ld (iy+-1), l", 3, {0xFD, 0x75, 0xFF}}, + {"ld (iy+$FF), l", "ld (iy+$FF), l", 3, {0xFD, 0x75, 0xFF}}, + {"ld ( iy + $FF ) , l", "ld (iy+$FF), l", 3, {0xFD, 0x75, 0xFF}}, + + {"ld (iy+1), 'A'", "ld (iy+1), 'A'", 4, {0xFD, 0x36, 0x1, 0x41}}, + {"ld (iy+1), 11", "ld (iy+1), 11", 4, {0xFD, 0x36, 0x1, 0xB}}, + {"ld ( iy + 1 ) , 11", "ld (iy+1), 11", 4, {0xFD, 0x36, 0x1, 0xB}}, + {"ld (iy+$AA), 11", "ld (iy+$AA), 11", 4, {0xFD, 0x36, 0xAA, 0xB}}, + {"ld (iy+$AA), $b", "ld (iy+$AA), $B", 4, {0xFD, 0x36, 0xAA, 0xB}}, + {"ld (iy+32), $b", "ld (iy+32), $B", 4, {0xFD, 0x36, 0x20, 0xB}}, + {"ld (iy+-1), $b", "ld (iy+-1), $B", 4, {0xFD, 0x36, 0xFF, 0xB}}, + {"ld (iy+-1), -1", "ld (iy+-1), -1", 4, {0xFD, 0x36, 0xFF, 0xFF}}, + {"ld (iy+32), -1", "ld (iy+32), -1", 4, {0xFD, 0x36, 0x20, 0xFF}}, + + {"ld (label), a", "ld (label), a", 3, {0x32, 0x00, 0x00}}, + {"ld ( label ) , a", "ld (label), a", 3, {0x32, 0x00, 0x00}}, + {"ld (16384), a", "ld (16384), a", 3, {0x32, 0x00, 0x40}}, + {"ld ( 16384 ) , a", "ld (16384), a", 3, {0x32, 0x00, 0x40}}, + {"ld ($4000), a", "ld ($4000), a", 3, {0x32, 0x00, 0x40}}, + {"ld ( $4000 ), a", "ld ($4000), a", 3, {0x32, 0x00, 0x40}}, + {"ld (16384), bc", "ld (16384), bc", 4, {0xED, 0x43, 0x00, 0x40}}, + {"ld ( 16384 ) , bc", "ld (16384), bc", 4, {0xED, 0x43, 0x00, 0x40}}, + {"ld ($4000), bc", "ld ($4000), bc", 4, {0xED, 0x43, 0x00, 0x40}}, + {"ld ( $4000 ) , bc", "ld ($4000), bc", 4, {0xED, 0x43, 0x00, 0x40}}, + {"ld (16385), de", "ld (16385), de", 4, {0xED, 0x53, 0x01, 0x40}}, + {"ld ( 16385 ) , de", "ld (16385), de", 4, {0xED, 0x53, 0x01, 0x40}}, + {"ld ($4001), de", "ld ($4001), de", 4, {0xED, 0x53, 0x01, 0x40}}, + {"ld ( $4001 ) , de", "ld ($4001), de", 4, {0xED, 0x53, 0x01, 0x40}}, + {"ld (16384), hl", "ld (16384), hl", 3, {0x22, 0x00, 0x40}}, + {"ld ( 16384 ) , hl", "ld (16384), hl", 3, {0x22, 0x00, 0x40}}, + {"ld ($4000), hl", "ld ($4000), hl", 3, {0x22, 0x00, 0x40}}, + {"ld ( $4000 ) , hl", "ld ($4000), hl", 3, {0x22, 0x00, 0x40}}, + {"ld (16385), ix", "ld (16385), ix", 4, {0xDD, 0x22, 0x01, 0x40}}, + {"ld ( 16385 ) , ix", "ld (16385), ix", 4, {0xDD, 0x22, 0x01, 0x40}}, + {"ld ($4001), ix", "ld ($4001), ix", 4, {0xDD, 0x22, 0x01, 0x40}}, + {"ld ( $4001 ) , ix", "ld ($4001), ix", 4, {0xDD, 0x22, 0x01, 0x40}}, + {"ld (16385), iy", "ld (16385), iy", 4, {0xFD, 0x22, 0x01, 0x40}}, + {"ld ( 16385 ) , iy", "ld (16385), iy", 4, {0xFD, 0x22, 0x01, 0x40}}, + {"ld ($4001), iy", "ld ($4001), iy", 4, {0xFD, 0x22, 0x01, 0x40}}, + {"ld ( $4001 ) , iy", "ld ($4001), iy", 4, {0xFD, 0x22, 0x01, 0x40}}, + {"ld (16385), sp", "ld (16385), sp", 4, {0xED, 0x73, 0x01, 0x40}}, + {"ld ( 16385 ) , sp", "ld (16385), sp", 4, {0xED, 0x73, 0x01, 0x40}}, + {"ld ($4001), sp", "ld ($4001), sp", 4, {0xED, 0x73, 0x01, 0x40}}, + {"ld ( $4001 ) , sp", "ld ($4001), sp", 4, {0xED, 0x73, 0x01, 0x40}}, + {"ld a, (bc)", "ld a, (bc)", 1, {0xA}}, + {"ld a , ( bc )", "ld a, (bc)", 1, {0xA}}, + {"ld a, (de)", "ld a, (de)", 1, {0x1A}}, + {"ld a , ( de )", "ld a, (de)", 1, {0x1A}}, + {"ld a, (hl)", "ld a, (hl)", 1, {0x7E}}, + {"ld a , ( hl )", "ld a, (hl)", 1, {0x7E}}, + {"ld a, (ix+55)", "ld a, (ix+55)", 3, {0xDD, 0x7E, 0x37}}, + {"ld a , ( ix + 55 )", "ld a, (ix+55)", 3, {0xDD, 0x7E, 0x37}}, + {"ld a, (ix+$37)", "ld a, (ix+$37)", 3, {0xDD, 0x7E, 0x37}}, + {"ld a , ( ix + $37 )", "ld a, (ix+$37)", 3, {0xDD, 0x7E, 0x37}}, + {"ld a, (iy+55)", "ld a, (iy+55)", 3, {0xFD, 0x7E, 0x37}}, + {"ld a , ( iy + 55 )", "ld a, (iy+55)", 3, {0xFD, 0x7E, 0x37}}, + {"ld a, (iy+$37)", "ld a, (iy+$37)", 3, {0xFD, 0x7E, 0x37}}, + {"ld a , ( iy + $37 )", "ld a, (iy+$37)", 3, {0xFD, 0x7E, 0x37}}, + {"ld a, (55)", "ld a, (55)", 3, {0x3A, 0x37, 0x00}}, + {"ld a , ( 55 )", "ld a, (55)", 3, {0x3A, 0x37, 0x00}}, + {"ld a, ($37)", "ld a, ($37)", 3, {0x3A, 0x37, 0x00}}, + {"ld a , ( $37 )", "ld a, ($37)", 3, {0x3A, 0x37, 0x00}}, + {"ld a, ($dead)", "ld a, ($DEAD)", 3, {0x3A, 0xAD, 0xDE}}, + {"ld a , ( $dead )", "ld a, ($DEAD)", 3, {0x3A, 0xAD, 0xDE}}, + {"ld a, (label)", "ld a, (label)", 3, {0x3A, 0x00, 0x00}}, + {"ld a , ( label )", "ld a, (label)", 3, {0x3A, 0x00, 0x00}}, + {"ld a, a", "ld a, a", 1, {0x7F}}, + {"ld a , a", "ld a, a", 1, {0x7F}}, + {"ld a, b", "ld a, b", 1, {0x78}}, + {"ld a , b", "ld a, b", 1, {0x78}}, + {"ld a, c", "ld a, c", 1, {0x79}}, + {"ld a , c", "ld a, c", 1, {0x79}}, + {"ld a, d", "ld a, d", 1, {0x7A}}, + {"ld a , d", "ld a, d", 1, {0x7A}}, + {"ld a, e", "ld a, e", 1, {0x7B}}, + {"ld a , e", "ld a, e", 1, {0x7B}}, + {"ld a, h", "ld a, h", 1, {0x7C}}, + {"ld a , h", "ld a, h", 1, {0x7C}}, + {"ld a, i", "ld a, i", 2, {0xED, 0x57}}, + {"ld a , i", "ld a, i", 2, {0xED, 0x57}}, + {"ld a, l", "ld a, l", 1, {0x7D}}, + {"ld a , l", "ld a, l", 1, {0x7D}}, + {"ld a, r", "ld a, r", 2, {0xED, 0x5F}}, + {"ld a , r", "ld a, r", 2, {0xED, 0x5F}}, + {"ld r, a", "ld r, a", 2, {0xED, 0x4F}}, + {"ld r , a", "ld r, a", 2, {0xED, 0x4F}}, + {"ld a, 32", "ld a, 32", 2, {0x3E, 0x20}}, + {"ld a , 32", "ld a, 32", 2 , {0x3E, 0x20}}, + {"ld a, $20", "ld a, $20", 2, {0x3E, 0x20}}, + {"ld a , $20", "ld a, $20", 2 , {0x3E, 0x20}}, + {"ld a, 128", "ld a, 128", 2, {0x3E, 0x80}}, + {"ld a , 128", "ld a, 128", 2 , {0x3E, 0x80}}, + {"ld a, -1", "ld a, -1", 2, {0x3E, 0xFF}}, + {"ld a , -1", "ld a, -1", 2 , {0x3E, 0xFF}}, + {"ld a, 'A'", "ld a, 'A'", 2, {0x3E, 0x41}}, + {"ld a , 'A'", "ld a, 'A'", 2 , {0x3E, 0x41}}, + {"ld a, label1-label", "ld a, label1-label", 2, {0x3E, 0x05, 0x00, + 0x04}}, + {"ld a , label1 - label", "ld a, label1-label", 2, {0x3E, 0x05, 0x00, + 0x04}}, + {"ld a, label1-verylonglabel", "ld a, label1-verylonglabel", 2, + {0x3E, 0x05, 0x00, 0x04}}, + {"ld a , label1 - verylonglabel", "ld a, label1-verylonglabel", 2, + {0x3E, 0x05, 0x00, 0x04}}, + {"ld a, verylonglabel-label1", "ld a, verylonglabel-label1", 2, + {0x3E, 0x0, 0x05, 0x08}}, + {"ld a , verylonglabel - label1", "ld a, verylonglabel-label1", 2, + {0x3E, 0x0, 0x05, 0x08}}, + + {"ld b, (hl)", "ld b, (hl)", 1, {0x46}}, + {"ld b , ( hl )", "ld b, (hl)", 1, {0x46}}, + {"ld b, (ix+55)", "ld b, (ix+55)", 3, {0xDD, 0x46, 0x37}}, + {"ld b , ( ix + 55 )", "ld b, (ix+55)", 3, {0xDD, 0x46, 0x37}}, + {"ld b, (ix+$37)", "ld b, (ix+$37)", 3, {0xDD, 0x46, 0x37}}, + {"ld b , ( ix + $37 )", "ld b, (ix+$37)", 3, {0xDD, 0x46, 0x37}}, + {"ld b, (ix+-1)", "ld b, (ix+-1)", 3, {0xDD, 0x46, 0xff}}, + {"ld b , ( ix + -1 )", "ld b, (ix+-1)", 3, {0xDD, 0x46, 0xff}}, + {"ld b, (iy+55)", "ld b, (iy+55)", 3, {0xFD, 0x46, 0x37}}, + {"ld b , ( iy + 55 )", "ld b, (iy+55)", 3, {0xFD, 0x46, 0x37}}, + {"ld b, (iy+$37)", "ld b, (iy+$37)", 3, {0xFD, 0x46, 0x37}}, + {"ld b , ( iy + $37 )", "ld b, (iy+$37)", 3, {0xFD, 0x46, 0x37}}, + {"ld b, (iy+-1)", "ld b, (iy+-1)", 3, {0xFD, 0x46, 0xFF}}, + {"ld b , ( iy + -1 )", "ld b, (iy+-1)", 3, {0xFD, 0x46, 0xFF}}, + {"ld b, a", "ld b, a", 1, {0x47}}, + {"ld b , a", "ld b, a", 1, {0x47}}, + {"ld b, b", "ld b, b", 1, {0x40}}, + {"ld b , b", "ld b, b", 1, {0x40}}, + {"ld b, c", "ld b, c", 1, {0x41}}, + {"ld b , c", "ld b, c", 1, {0x41}}, + {"ld b, d", "ld b, d", 1, {0x42}}, + {"ld b , d", "ld b, d", 1, {0x42}}, + {"ld b, e", "ld b, e", 1, {0x43}}, + {"ld b , e", "ld b, e", 1, {0x43}}, + {"ld b, h", "ld b, h", 1, {0x44}}, + {"ld b , h", "ld b, h", 1, {0x44}}, + {"ld b, l", "ld b, l", 1, {0x45}}, + {"ld b , l", "ld b, l", 1, {0x45}}, + {"ld b, 32", "ld b, 32", 2, {0x06, 0x20}}, + {"ld b , 32", "ld b, 32", 2 , {0x06, 0x20}}, + {"ld b, $20", "ld b, $20", 2, {0x06, 0x20}}, + {"ld b , $20", "ld b, $20", 2 , {0x06, 0x20}}, + {"ld b, -2", "ld b, -2", 2, {0x06, 0xFE}}, + {"ld b , -2", "ld b, -2", 2 , {0x06, 0xFE}}, + {"ld b, 128", "ld b, 128", 2, {0x06, 0x80}}, + {"ld b , 128", "ld b, 128", 2 , {0x06, 0x80}}, + {"ld b, 'A'", "ld b, 'A'", 2, {0x06, 0x41}}, + {"ld b , 'A'", "ld b, 'A'", 2 , {0x06, 0x41}}, + {"ld b, label1-label", "ld b, label1-label", 2, {0x06, 0x05, 0x00, + 0x04}}, + {"ld b , label1 - label", "ld b, label1-label", 2, {0x06, 0x05, 0x00, + 0x04}}, + {"ld b, label1-verylonglabel", "ld b, label1-verylonglabel", 2, + {0x06, 0x05, 0x00, 0x04}}, + {"ld b , label1 - verylonglabel", "ld b, label1-verylonglabel", 2, + {0x06, 0x05, 0x00, 0x04}}, + {"ld b, verylonglabel-label1", "ld b, verylonglabel-label1", 2, + {0x06, 0x0, 0x05, 0x08}}, + {"ld b , verylonglabel - label1", "ld b, verylonglabel-label1", 2, + {0x06, 0x0, 0x05, 0x08}}, + + {"ld bc, 257", "ld bc, 257", 3, {0x1, 0x01, 0x1}}, + {"ld bc , 257", "ld bc, 257", 3, {0x1, 0x01, 0x1}}, + {"ld bc, 65535", "ld bc, 65535", 3, {0x1, 0xFF, 0xFF}}, + {"ld bc , 65535", "ld bc, 65535", 3, {0x1, 0xFF, 0xFF}}, + {"ld bc, (257)", "ld bc, (257)", 4, {0xED, 0x4B, 0x01, 0x1}}, + {"ld bc , ( 257 )", "ld bc, (257)", 4, {0xED, 0x4B, 0x01, 0x1}}, + {"ld bc, ($101)", "ld bc, ($101)", 4, {0xED, 0x4B, 0x01, 0x1}}, + {"ld bc , ( $101 )", "ld bc, ($101)", 4, {0xED, 0x4B, 0x01, 0x1}}, + {"ld bc, (label)", "ld bc, (label)", 4, {0xED, 0x4B, 0x00, 0x0}}, + {"ld bc , ( label )", "ld bc, (label)", 4, {0xED, 0x4B, 0x00, 0x0}}, + {"ld bc, label", "ld bc, label", 3, {0x1, 0x00, 0x00}}, + {"ld bc, label", "ld bc, label", 3, {0x1, 0x00, 0x00}}, + {"ld bc, label1-label", "ld bc, label1-label", 3, {0x1, 0x05, 0x00, + 0x04}}, + {"ld bc , label1 - label", "ld bc, label1-label", 3, {0x1, 0x05, 0x00, + 0x04}}, + {"ld bc, label1-verylonglabel", "ld bc, label1-verylonglabel", 3, + {0x1, 0x05, 0x00, 0x04}}, + {"ld bc , label1 - verylonglabel", "ld bc, label1-verylonglabel", 3, + {0x1, 0x05, 0x00, 0x04}}, + {"ld bc, verylonglabel-label1", "ld bc, verylonglabel-label1", 3, + {0x1, 0x0, 0x05, 0x08}}, + {"ld bc , verylonglabel - label1", "ld bc, verylonglabel-label1", 3, + {0x1, 0x0, 0x05, 0x08}}, + + {"ld c, (hl)", "ld c, (hl)", 1, {0x4E}}, + {"ld c , ( hl )", "ld c, (hl)", 1, {0x4E}}, + {"ld c, (ix+55)", "ld c, (ix+55)", 3, {0xDD, 0x4E, 0x37}}, + {"ld c , ( ix + 55 )", "ld c, (ix+55)", 3, {0xDD, 0x4E, 0x37}}, + {"ld c, (ix+$37)", "ld c, (ix+$37)", 3, {0xDD, 0x4E, 0x37}}, + {"ld c , ( ix + $37 )", "ld c, (ix+$37)", 3, {0xDD, 0x4E, 0x37}}, + {"ld c, (ix+-2)", "ld c, (ix+-2)", 3, {0xDD, 0x4E, 0xFE}}, + {"ld c , ( ix + -2 )", "ld c, (ix+-2)", 3, {0xDD, 0x4E, 0xFE}}, + {"ld c, (iy+55)", "ld c, (iy+55)", 3, {0xFD, 0x4E, 0x37}}, + {"ld c , ( iy + 55 )", "ld c, (iy+55)", 3, {0xFD, 0x4E, 0x37}}, + {"ld c, (iy+$37)", "ld c, (iy+$37)", 3, {0xFD, 0x4E, 0x37}}, + {"ld c , ( iy + $37 )", "ld c, (iy+$37)", 3, {0xFD, 0x4E, 0x37}}, + {"ld c, (iy+-2)", "ld c, (iy+-2)", 3, {0xFD, 0x4E, 0xFE}}, + {"ld c , ( iy + -2 )", "ld c, (iy+-2)", 3, {0xFD, 0x4E, 0xFE}}, + {"ld c, a", "ld c, a", 1, {0x4F}}, + {"ld c , a", "ld c, a", 1, {0x4F}}, + {"ld c, b", "ld c, b", 1, {0x48}}, + {"ld c , b", "ld c, b", 1, {0x48}}, + {"ld c, c", "ld c, c", 1, {0x49}}, + {"ld c , c", "ld c, c", 1, {0x49}}, + {"ld c, d", "ld c, d", 1, {0x4A}}, + {"ld c , d", "ld c, d", 1, {0x4A}}, + {"ld c, e", "ld c, e", 1, {0x4B}}, + {"ld c , e", "ld c, e", 1, {0x4B}}, + {"ld c, h", "ld c, h", 1, {0x4C}}, + {"ld c , h", "ld c, h", 1, {0x4C}}, + {"ld c, l", "ld c, l", 1, {0x4D}}, + {"ld c , l", "ld c, l", 1, {0x4D}}, + {"ld c, 32", "ld c, 32", 2, {0x0E, 0x20}}, + {"ld c , 32", "ld c, 32", 2 , {0x0E, 0x20}}, + {"ld c, $20", "ld c, $20", 2, {0x0E, 0x20}}, + {"ld c , $20", "ld c, $20", 2 , {0x0E, 0x20}}, + {"ld c, -3", "ld c, -3", 2, {0x0E, 0xFD}}, + {"ld c , -3", "ld c, -3", 2 , {0x0E, 0xFD}}, + {"ld c, 128", "ld c, 128", 2, {0x0E, 0x80}}, + {"ld c , 128", "ld c, 128", 2 , {0x0E, 0x80}}, + {"ld c, 'A'", "ld c, 'A'", 2, {0x0E, 0x41}}, + {"ld c , 'A'", "ld c, 'A'", 2 , {0x0E, 0x41}}, + {"ld c, label1-label", "ld c, label1-label", 2, {0x0E, 0x05, 0x00, + 0x04}}, + {"ld c , label1 - label", "ld c, label1-label", 2, {0x0E, 0x05, 0x00, + 0x04}}, + {"ld c, label1-verylonglabel", "ld c, label1-verylonglabel", 2, + {0x0E, 0x05, 0x00, 0x04}}, + {"ld c , label1 - verylonglabel", "ld c, label1-verylonglabel", 2, + {0x0E, 0x05, 0x00, 0x04}}, + {"ld c, verylonglabel-label1", "ld c, verylonglabel-label1", 2, + {0x0E, 0x0, 0x05, 0x08}}, + {"ld c , verylonglabel - label1", "ld c, verylonglabel-label1", 2, + {0x0E, 0x0, 0x05, 0x08}}, + + {"ld d, (hl)", "ld d, (hl)", 1, {0x56}}, + {"ld d , ( hl )", "ld d, (hl)", 1, {0x56}}, + {"ld d, (ix+55)", "ld d, (ix+55)", 3, {0xDD, 0x56, 0x37}}, + {"ld d , ( ix + 55 )", "ld d, (ix+55)", 3, {0xDD, 0x56, 0x37}}, + {"ld d, (ix+$37)", "ld d, (ix+$37)", 3, {0xDD, 0x56, 0x37}}, + {"ld d , ( ix + $37 )", "ld d, (ix+$37)", 3, {0xDD, 0x56, 0x37}}, + {"ld d, (ix+-2)", "ld d, (ix+-2)", 3, {0xDD, 0x56, 0xFE}}, + {"ld d , ( ix + -2 )", "ld d, (ix+-2)", 3, {0xDD, 0x56, 0xFE}}, + {"ld d, (iy+55)", "ld d, (iy+55)", 3, {0xFD, 0x56, 0x37}}, + {"ld d , ( iy + 55 )", "ld d, (iy+55)", 3, {0xFD, 0x56, 0x37}}, + {"ld d, (iy+$37)", "ld d, (iy+$37)", 3, {0xFD, 0x56, 0x37}}, + {"ld d , ( iy + $37 )", "ld d, (iy+$37)", 3, {0xFD, 0x56, 0x37}}, + {"ld d, (iy+-2)", "ld d, (iy+-2)", 3, {0xFD, 0x56, 0xFE}}, + {"ld d , ( iy + -2 )", "ld d, (iy+-2)", 3, {0xFD, 0x56, 0xFE}}, + {"ld d, a", "ld d, a", 1, {0x57}}, + {"ld d , a", "ld d, a", 1, {0x57}}, + {"ld d, b", "ld d, b", 1, {0x50}}, + {"ld d , b", "ld d, b", 1, {0x50}}, + {"ld d, c", "ld d, c", 1, {0x51}}, + {"ld d , c", "ld d, c", 1, {0x51}}, + {"ld d, d", "ld d, d", 1, {0x52}}, + {"ld d , d", "ld d, d", 1, {0x52}}, + {"ld d, e", "ld d, e", 1, {0x53}}, + {"ld d , e", "ld d, e", 1, {0x53}}, + {"ld d, h", "ld d, h", 1, {0x54}}, + {"ld d , h", "ld d, h", 1, {0x54}}, + {"ld d, l", "ld d, l", 1, {0x55}}, + {"ld d , l", "ld d, l", 1, {0x55}}, + {"ld d, 32", "ld d, 32", 2, {0x16, 0x20}}, + {"ld d , 32", "ld d, 32", 2 , {0x16, 0x20}}, + {"ld d, $20", "ld d, $20", 2, {0x16, 0x20}}, + {"ld d , $20", "ld d, $20", 2 , {0x16, 0x20}}, + {"ld d, -4", "ld d, -4", 2, {0x16, 0xFC}}, + {"ld d , -4", "ld d, -4", 2 , {0x16, 0xFC}}, + {"ld d, 128", "ld d, 128", 2, {0x16, 0x80}}, + {"ld d , 128", "ld d, 128", 2 , {0x16, 0x80}}, + {"ld d, 'A'", "ld d, 'A'", 2, {0x16, 0x41}}, + {"ld d , 'A'", "ld d, 'A'", 2 , {0x16, 0x41}}, + {"ld d, label1-label", "ld d, label1-label", 2, {0x16, 0x05, 0x00, + 0x04}}, + {"ld d , label1 - label", "ld d, label1-label", 2, {0x16, 0x05, 0x00, + 0x04}}, + {"ld d, label1-verylonglabel", "ld d, label1-verylonglabel", 2, + {0x16, 0x05, 0x00, 0x04}}, + {"ld d , label1 - verylonglabel", "ld d, label1-verylonglabel", 2, + {0x16, 0x05, 0x00, 0x04}}, + {"ld d, verylonglabel-label1", "ld d, verylonglabel-label1", 2, + {0x16, 0x0, 0x05, 0x08}}, + {"ld d , verylonglabel - label1", "ld d, verylonglabel-label1", 2, + {0x16, 0x0, 0x05, 0x08}}, + + {"ld de, 'B'", "ld de, 'B'", 3, {0x11, 0x42, 0x0}}, + {"ld de , 'B'", "ld de, 'B'", 3, {0x11, 0x42, 0x0}}, + {"ld de, 257", "ld de, 257", 3, {0x11, 0x01, 0x1}}, + {"ld de , 257", "ld de, 257", 3, {0x11, 0x01, 0x1}}, + {"ld de, 65535", "ld de, 65535", 3, {0x11, 0xFF, 0xFF}}, + {"ld de , 65535", "ld de, 65535", 3, {0x11, 0xFF, 0xFF}}, + {"ld de, (257)", "ld de, (257)", 4, {0xED, 0x5B, 0x01, 0x1}}, + {"ld de , ( 257 )", "ld de, (257)", 4, {0xED, 0x5B, 0x01, 0x1}}, + {"ld de, ($DEAD)", "ld de, ($DEAD)", 4, {0xED, 0x5B, 0xAD, 0xDE}}, + {"ld de , ( $DEAD )", "ld de, ($DEAD)", 4, {0xED, 0x5B, 0xAD, 0xDE}}, + {"ld de, (label)", "ld de, (label)", 4, {0xED, 0x5B, 0x00, 0x0}}, + {"ld de , ( label )", "ld de, (label)", 4, {0xED, 0x5B, 0x00, 0x0}}, + {"ld de, label", "ld de, label", 3, {0x11, 0x00, 0x00}}, + {"ld de, label", "ld de, label", 3, {0x11, 0x00, 0x00}}, + {"ld de, label1-label", "ld de, label1-label", 3, {0x11, 0x05, 0x00, + 0x04}}, + {"ld de , label1 - label", "ld de, label1-label", 3, {0x11, 0x05, 0x00, + 0x04}}, + {"ld de, label1-verylonglabel", "ld de, label1-verylonglabel", 3, + {0x11, 0x05, 0x00, 0x04}}, + {"ld de , label1 - verylonglabel", "ld de, label1-verylonglabel", 3, + {0x11, 0x05, 0x00, 0x04}}, + {"ld de, verylonglabel-label1", "ld de, verylonglabel-label1", 3, + {0x11, 0x0, 0x05, 0x08}}, + {"ld de , verylonglabel - label1", "ld de, verylonglabel-label1", 3, + {0x11, 0x0, 0x05, 0x08}}, + + {"ld e, (hl)", "ld e, (hl)", 1, {0x5E}}, + {"ld e , ( hl )", "ld e, (hl)", 1, {0x5e}}, + {"ld e, (ix+55)", "ld e, (ix+55)", 3, {0xDD, 0x5E, 0x37}}, + {"ld e , ( ix + 55 )", "ld e, (ix+55)", 3, {0xDD, 0x5E, 0x37}}, + {"ld e, (ix+$37)", "ld e, (ix+$37)", 3, {0xDD, 0x5E, 0x37}}, + {"ld e , ( ix + $37 )", "ld e, (ix+$37)", 3, {0xDD, 0x5E, 0x37}}, + {"ld e, (ix+-2)", "ld e, (ix+-2)", 3, {0xDD, 0x5E, 0xFE}}, + {"ld e , ( ix + -2 )", "ld e, (ix+-2)", 3, {0xDD, 0x5E, 0xFE}}, + {"ld e, (iy+55)", "ld e, (iy+55)", 3, {0xFD, 0x5E, 0x37}}, + {"ld e , ( iy + 55 )", "ld e, (iy+55)", 3, {0xFD, 0x5E, 0x37}}, + {"ld e, (iy+$37)", "ld e, (iy+$37)", 3, {0xFD, 0x5E, 0x37}}, + {"ld e , ( iy + $37 )", "ld e, (iy+$37)", 3, {0xFD, 0x5E, 0x37}}, + {"ld e, (iy+-2)", "ld e, (iy+-2)", 3, {0xFD, 0x5E, 0xFE}}, + {"ld e , ( iy + -2 )", "ld e, (iy+-2)", 3, {0xFD, 0x5E, 0xFE}}, + {"ld e, a", "ld e, a", 1, {0x5F}}, + {"ld e , a", "ld e, a", 1, {0x5F}}, + {"ld e, b", "ld e, b", 1, {0x58}}, + {"ld e , b", "ld e, b", 1, {0x58}}, + {"ld e, c", "ld e, c", 1, {0x59}}, + {"ld e , c", "ld e, c", 1, {0x59}}, + {"ld e, d", "ld e, d", 1, {0x5A}}, + {"ld e , d", "ld e, d", 1, {0x5A}}, + {"ld e, e", "ld e, e", 1, {0x5B}}, + {"ld e , e", "ld e, e", 1, {0x5B}}, + {"ld e, h", "ld e, h", 1, {0x5C}}, + {"ld e , h", "ld e, h", 1, {0x5C}}, + {"ld e, l", "ld e, l", 1, {0x5D}}, + {"ld e , l", "ld e, l", 1, {0x5D}}, + {"ld e, 32", "ld e, 32", 2, {0x1E, 0x20}}, + {"ld e , 32", "ld e, 32", 2 , {0x1E, 0x20}}, + {"ld e, $20", "ld e, $20", 2, {0x1E, 0x20}}, + {"ld e , $20", "ld e, $20", 2 , {0x1E, 0x20}}, + {"ld e, -4", "ld e, -4", 2, {0x1E, 0xFC}}, + {"ld e , -4", "ld e, -4", 2 , {0x1E, 0xFC}}, + {"ld e, 128", "ld e, 128", 2, {0x1E, 0x80}}, + {"ld e , 128", "ld e, 128", 2 , {0x1E, 0x80}}, + {"ld e, 'B'", "ld e, 'B'", 2, {0x1E, 0x42}}, + {"ld e , 'B'", "ld e, 'B'", 2 , {0x1E, 0x42}}, + {"ld e, label1-label", "ld e, label1-label", 2, {0x1E, 0x05, 0x00, + 0x04}}, + {"ld e , label1 - label", "ld e, label1-label", 2, {0x1E, 0x05, 0x00, + 0x04}}, + {"ld e, label1-verylonglabel", "ld e, label1-verylonglabel", 2, + {0x1E, 0x05, 0x00, 0x04}}, + {"ld e , label1 - verylonglabel", "ld e, label1-verylonglabel", 2, + {0x1E, 0x05, 0x00, 0x04}}, + {"ld e, verylonglabel-label1", "ld e, verylonglabel-label1", 2, + {0x1E, 0x0, 0x05, 0x08}}, + {"ld e , verylonglabel - label1", "ld e, verylonglabel-label1", 2, + {0x1E, 0x0, 0x05, 0x08}}, + + {"ld h, (hl)", "ld h, (hl)", 1, {0x66}}, + {"ld h , ( hl )", "ld h, (hl)", 1, {0x66}}, + {"ld h, (ix+55)", "ld h, (ix+55)", 3, {0xDD, 0x66, 0x37}}, + {"ld h , ( ix + 55 )", "ld h, (ix+55)", 3, {0xDD, 0x66, 0x37}}, + {"ld h, (ix+$37)", "ld h, (ix+$37)", 3, {0xDD, 0x66, 0x37}}, + {"ld h , ( ix + $37 )", "ld h, (ix+$37)", 3, {0xDD, 0x66, 0x37}}, + {"ld h, (ix+-2)", "ld h, (ix+-2)", 3, {0xDD, 0x66, 0xFE}}, + {"ld h , ( ix + -2 )", "ld h, (ix+-2)", 3, {0xDD, 0x66, 0xFE}}, + {"ld h, (iy+55)", "ld h, (iy+55)", 3, {0xFD, 0x66, 0x37}}, + {"ld h , ( iy + 55 )", "ld h, (iy+55)", 3, {0xFD, 0x66, 0x37}}, + {"ld h, (iy+$37)", "ld h, (iy+$37)", 3, {0xFD, 0x66, 0x37}}, + {"ld h , ( iy + $37 )", "ld h, (iy+$37)", 3, {0xFD, 0x66, 0x37}}, + {"ld h, (iy+-2)", "ld h, (iy+-2)", 3, {0xFD, 0x66, 0xFE}}, + {"ld h , ( iy + -2 )", "ld h, (iy+-2)", 3, {0xFD, 0x66, 0xFE}}, + {"ld h, a", "ld h, a", 1, {0x67}}, + {"ld h , a", "ld h, a", 1, {0x67}}, + {"ld h, b", "ld h, b", 1, {0x60}}, + {"ld h , b", "ld h, b", 1, {0x60}}, + {"ld h, c", "ld h, c", 1, {0x61}}, + {"ld h , c", "ld h, c", 1, {0x61}}, + {"ld h, d", "ld h, d", 1, {0x62}}, + {"ld h , d", "ld h, d", 1, {0x62}}, + {"ld h, e", "ld h, e", 1, {0x63}}, + {"ld h , e", "ld h, e", 1, {0x63}}, + {"ld h, h", "ld h, h", 1, {0x64}}, + {"ld h , h", "ld h, h", 1, {0x64}}, + {"ld h, l", "ld h, l", 1, {0x65}}, + {"ld h , l", "ld h, l", 1, {0x65}}, + {"ld h, 32", "ld h, 32", 2, {0x26, 0x20}}, + {"ld h , 32", "ld h, 32", 2 , {0x26, 0x20}}, + {"ld h, $20", "ld h, $20", 2, {0x26, 0x20}}, + {"ld h , $20", "ld h, $20", 2 , {0x26, 0x20}}, + {"ld h, 128", "ld h, 128", 2, {0x26, 0x80}}, + {"ld h , 128", "ld h, 128", 2 , {0x26, 0x80}}, + {"ld h, -2", "ld h, -2", 2, {0x26, 0xFE}}, + {"ld h , -2", "ld h, -2", 2 , {0x26, 0xFE}}, + {"ld h, 'C'", "ld h, 'C'", 2, {0x26, 0x43}}, + {"ld h , 'C'", "ld h, 'C'", 2 , {0x26, 0x43}}, + {"ld h, label1-label", "ld h, label1-label", 2, {0x26, 0x05, 0x00, + 0x04}}, + {"ld h , label1 - label", "ld h, label1-label", 2, {0x26, 0x05, 0x00, + 0x04}}, + {"ld h, label1-verylonglabel", "ld h, label1-verylonglabel", 2, + {0x26, 0x05, 0x00, 0x04}}, + {"ld h , label1 - verylonglabel", "ld h, label1-verylonglabel", 2, + {0x26, 0x05, 0x00, 0x04}}, + {"ld h, verylonglabel-label1", "ld h, verylonglabel-label1", 2, + {0x26, 0x0, 0x05, 0x08}}, + {"ld h , verylonglabel - label1", "ld h, verylonglabel-label1", 2, + {0x26, 0x0, 0x05, 0x08}}, + + {"ld hl, 'C'", "ld hl, 'C'", 3, {0x21, 0x43, 0x00}}, + {"ld hl , 'C'", "ld hl, 'C'", 3 , {0x21, 0x43, 0x00}}, + {"ld hl, 257", "ld hl, 257", 3, {0x21, 0x01, 0x1}}, + {"ld hl , 257", "ld hl, 257", 3, {0x21, 0x01, 0x1}}, + {"ld hl, 65535", "ld hl, 65535", 3, {0x21, 0xFF, 0xFF}}, + {"ld hl , 65535", "ld hl, 65535", 3, {0x21, 0xFF, 0xFF}}, + {"ld hl, (257)", "ld hl, (257)", 3, {0x2A, 0x01, 0x1}}, + {"ld hl , ( 257 )", "ld hl, (257)", 3, {0x2A, 0x01, 0x1}}, + {"ld hl, ($BEEF)", "ld hl, ($BEEF)", 3, {0x2A, 0xEF, 0xBE}}, + {"ld hl , ( $BEEF )", "ld hl, ($BEEF)", 3, {0x2A, 0xEF, 0xBE}}, + {"ld hl, (label)", "ld hl, (label)", 3, {0x2A, 0x00, 0x0}}, + {"ld hl , ( label )", "ld hl, (label)", 3, {0x2A, 0x00, 0x0}}, + {"ld hl, label", "ld hl, label", 3, {0x21, 0x00, 0x00}}, + {"ld hl, label", "ld hl, label", 3, {0x21, 0x00, 0x00}}, + {"ld hl, label1-label", "ld hl, label1-label", 3, {0x21, 0x05, 0x00, + 0x04}}, + {"ld hl , label1 - label", "ld hl, label1-label", 3, {0x21, 0x05, 0x00, + 0x04}}, + {"ld hl, label1-verylonglabel", "ld hl, label1-verylonglabel", 3, + {0x21, 0x05, 0x00, 0x04}}, + {"ld hl , label1 - verylonglabel", "ld hl, label1-verylonglabel", 3, + {0x21, 0x05, 0x00, 0x04}}, + {"ld hl, verylonglabel-label1", "ld hl, verylonglabel-label1", 3, + {0x21, 0x0, 0x05, 0x08}}, + {"ld hl , verylonglabel - label1", "ld hl, verylonglabel-label1", 3, + {0x21, 0x0, 0x05, 0x08}}, + + {"ld i, a", "ld i, a", 2, {0xED, 0x47}}, + {"ld i , a", "ld i, a", 2, {0xED, 0x47}}, + + {"ld ix, (257)", "ld ix, (257)", 4, {0xDD, 0x2A, 0x1, 0x1}}, + {"ld ix , ( 257 )", "ld ix, (257)", 4, {0xDD, 0x2A, 0x1, 0x1}}, + {"ld ix, ($beef)", "ld ix, ($BEEF)", 4, {0xDD, 0x2A, 0xEF, 0xBE}}, + {"ld ix , ( $beef )", "ld ix, ($BEEF)", 4, {0xDD, 0x2A, 0xEF, 0xBE}}, + {"ld ix, (label)", "ld ix, (label)", 4, {0xDD, 0x2A, 0x0, 0x0}}, + {"ld ix , ( label )", "ld ix, (label)", 4, {0xDD, 0x2A, 0x0, 0x0}}, + {"ld ix, 257", "ld ix, 257", 4, {0xDD, 0x21, 0x1, 0x1}}, + {"ld ix , 257", "ld ix, 257", 4, {0xDD, 0x21, 0x1, 0x1}}, + {"ld ix, 65535", "ld ix, 65535", 4, {0xDD, 0x21, 0xFF, 0xFF}}, + {"ld ix , 65535", "ld ix, 65535", 4, {0xDD, 0x21, 0xFF, 0xFF}}, + {"ld ix, $BEEF", "ld ix, $BEEF", 4, {0xDD, 0x21, 0xEF, 0xBE}}, + {"ld ix , $BEEF", "ld ix, $BEEF", 4, {0xDD, 0x21, 0xEF, 0xBE}}, + {"ld ix, -32768", "ld ix, -32768", 4, {0xDD, 0x21, 0x0, 0x80}}, + {"ld ix , -32768", "ld ix, -32768", 4, {0xDD, 0x21, 0x0, 0x80}}, + {"ld ix, 'A'", "ld ix, 'A'", 4, {0xDD, 0x21, 0x41, 0x00}}, + {"ld ix , 'A'", "ld ix, 'A'", 4, {0xDD, 0x21, 0x41, 0x00}}, + {"ld ix, label", "ld ix, label", 4, {0xDD, 0x21, 0x0, 0x00}}, + {"ld ix , label", "ld ix, label", 4, {0xDD, 0x21, 0x0, 0x00}}, + + {"ld iy, (257)", "ld iy, (257)", 4, {0xFD, 0x2A, 0x1, 0x1}}, + {"ld iy , ( 257 )", "ld iy, (257)", 4, {0xFD, 0x2A, 0x1, 0x1}}, + {"ld iy, ($BEEF)", "ld iy, ($BEEF)", 4, {0xFD, 0x2A, 0xEF, 0xBE}}, + {"ld iy , ( $BEEF )", "ld iy, ($BEEF)", 4, {0xFD, 0x2A, 0xEF, 0xBE}}, + {"ld iy, (label)", "ld iy, (label)", 4, {0xFD, 0x2A, 0x0, 0x0}}, + {"ld iy , ( label )", "ld iy, (label)", 4, {0xFD, 0x2A, 0x0, 0x0}}, + {"ld iy, 257", "ld iy, 257", 4, {0xFD, 0x21, 0x1, 0x1}}, + {"ld iy , 257", "ld iy, 257", 4, {0xFD, 0x21, 0x1, 0x1}}, + {"ld iy, 65535", "ld iy, 65535", 4, {0xFD, 0x21, 0xFF, 0xFF}}, + {"ld iy , 65535", "ld iy, 65535", 4, {0xFD, 0x21, 0xFF, 0xFF}}, + {"ld iy, 'A'", "ld iy, 'A'", 4, {0xFD, 0x21, 0x41, 0x0}}, + {"ld iy , 'A'", "ld iy, 'A'", 4, {0xFD, 0x21, 0x41, 0x0}}, + {"ld iy, $BEEF", "ld iy, $BEEF", 4, {0xFD, 0x21, 0xEF, 0xBE}}, + {"ld iy , $BEEF", "ld iy, $BEEF", 4, {0xFD, 0x21, 0xEF, 0xBE}}, + {"ld iy, -2", "ld iy, -2", 4, {0xFD, 0x21, 0xFE, 0xFF}}, + {"ld iy , -2", "ld iy, -2", 4, {0xFD, 0x21, 0xFE, 0xFF}}, + {"ld iy, label", "ld iy, label", 4, {0xFD, 0x21, 0x0, 0x00}}, + {"ld iy , label", "ld iy, label", 4, {0xFD, 0x21, 0x0, 0x00}}, + + {"ld l, (hl)", "ld l, (hl)", 1, {0x6E}}, + {"ld l , ( hl )", "ld l, (hl)", 1, {0x6E}}, + {"ld l, (ix+55)", "ld l, (ix+55)", 3, {0xDD, 0x6E, 0x37}}, + {"ld l , ( ix + 55 )", "ld l, (ix+55)", 3, {0xDD, 0x6E, 0x37}}, + {"ld l, (ix+$37)", "ld l, (ix+$37)", 3, {0xDD, 0x6E, 0x37}}, + {"ld l , ( ix + $37 )", "ld l, (ix+$37)", 3, {0xDD, 0x6E, 0x37}}, + {"ld l, (ix+-2)", "ld l, (ix+-2)", 3, {0xDD, 0x6E, 0xFE}}, + {"ld l , ( ix + -2 )", "ld l, (ix+-2)", 3, {0xDD, 0x6E, 0xFE}}, + {"ld l, (iy+55)", "ld l, (iy+55)", 3, {0xFD, 0x6E, 0x37}}, + {"ld l , ( iy + 55 )", "ld l, (iy+55)", 3, {0xFD, 0x6E, 0x37}}, + {"ld l, (iy+$37)", "ld l, (iy+$37)", 3, {0xFD, 0x6E, 0x37}}, + {"ld l , ( iy + $37 )", "ld l, (iy+$37)", 3, {0xFD, 0x6E, 0x37}}, + {"ld l, (iy+-2)", "ld l, (iy+-2)", 3, {0xFD, 0x6E, 0xFE}}, + {"ld l , ( iy + -2 )", "ld l, (iy+-2)", 3, {0xFD, 0x6E, 0xFE}}, + {"ld l, a", "ld l, a", 1, {0x6F}}, + {"ld l , a", "ld l, a", 1, {0x6F}}, + {"ld l, b", "ld l, b", 1, {0x68}}, + {"ld l , b", "ld l, b", 1, {0x68}}, + {"ld l, c", "ld l, c", 1, {0x69}}, + {"ld l , c", "ld l, c", 1, {0x69}}, + {"ld l, d", "ld l, d", 1, {0x6A}}, + {"ld l , d", "ld l, d", 1, {0x6A}}, + {"ld l, e", "ld l, e", 1, {0x6B}}, + {"ld l , e", "ld l, e", 1, {0x6B}}, + {"ld l, h", "ld l, h", 1, {0x6C}}, + {"ld l , h", "ld l, h", 1, {0x6C}}, + {"ld l, l", "ld l, l", 1, {0x6D}}, + {"ld l , l", "ld l, l", 1, {0x6D}}, + {"ld l, 32", "ld l, 32", 2, {0x2E, 0x20}}, + {"ld l , 32", "ld l, 32", 2 , {0x2E, 0x20}}, + {"ld l, $20", "ld l, $20", 2, {0x2E, 0x20}}, + {"ld l , $20", "ld l, $20", 2 , {0x2E, 0x20}}, + {"ld l, 255", "ld l, 255", 2, {0x2E, 0xFF}}, + {"ld l , 255", "ld l, 255", 2 , {0x2E, 0xFF}}, + {"ld l, -2", "ld l, -2", 2, {0x2E, 0xFE}}, + {"ld l , -2", "ld l, -2", 2 , {0x2E, 0xFE}}, + {"ld l, 'A'", "ld l, 'A'", 2, {0x2E, 0x41}}, + {"ld l , 'A'", "ld l, 'A'", 2 , {0x2E, 0x41}}, + + {"ld sp, (257)", "ld sp, (257)", 4, {0xED, 0x7B, 0x1, 0x1}}, + {"ld sp , ( 257 )", "ld sp, (257)", 4, {0xED, 0x7B, 0x1, 0x1}}, + {"ld sp, ($DEAD)", "ld sp, ($DEAD)", 4, {0xED, 0x7B, 0xAD, 0xDE}}, + {"ld sp , ( $DEAD )", "ld sp, ($DEAD)", 4, {0xED, 0x7B, 0xAD, 0xDE}}, + {"ld sp, (label)", "ld sp, (label)", 4, {0xED, 0x7B, 0x0, 0x0}}, + {"ld sp , ( label )", "ld sp, (label)", 4, {0xED, 0x7B, 0x0, 0x0}}, + {"ld sp, hl", "ld sp, hl", 1, {0xF9}}, + {"ld sp , hl", "ld sp, hl", 1, {0xF9}}, + {"ld sp, ix", "ld sp, ix", 2, {0xDD, 0xF9}}, + {"ld sp , ix", "ld sp, ix", 2, {0xDD, 0xF9}}, + {"ld sp, iy", "ld sp, iy", 2, {0xFD, 0xF9}}, + {"ld sp , iy", "ld sp, iy", 2, {0xFD, 0xF9}}, + {"ld sp, 257", "ld sp, 257", 3, {0x31, 0x1, 0x1}}, + {"ld sp , 257", "ld sp, 257", 3, {0x31, 0x1, 0x1}}, + {"ld sp, 65535", "ld sp, 65535", 3, {0x31, 0xFF, 0xFF}}, + {"ld sp , 65535", "ld sp, 65535", 3, {0x31, 0xFF, 0xFF}}, + {"ld sp, $BEEF", "ld sp, $BEEF", 3, {0x31, 0xEF, 0xBE}}, + {"ld sp , $BEEF", "ld sp, $BEEF", 3, {0x31, 0xEF, 0xBE}}, + {"ld sp, -2", "ld sp, -2", 3, {0x31, 0xFE, 0xFF}}, + {"ld sp , -2", "ld sp, -2", 3, {0x31, 0xFE, 0xFF}}, + {"ld sp, 'A'", "ld sp, 'A'", 3, {0x31, 0x41, 0x0}}, + {"ld sp , 'A'", "ld sp, 'A'", 3, {0x31, 0x41, 0x0}}, + {"ld sp, label", "ld sp, label", 3, {0x31, 0x00, 0x00}}, + {"ld sp , label", "ld sp, label", 3, {0x31, 0x0, 0x00}}, + {"ld sp, label1-label", "ld sp, label1-label", 3, {0x31, 0x05, 0x00, + 0x04}}, + {"ld sp , label1 - label", "ld sp, label1-label", 3, {0x31, 0x05, 0x00, + 0x04}}, + {"ld sp, label1-verylonglabel", "ld sp, label1-verylonglabel", 3, + {0x31, 0x05, 0x00, 0x04}}, + {"ld sp , label1 - verylonglabel", "ld sp, label1-verylonglabel", 3, + {0x31, 0x05, 0x00, 0x04}}, + {"ld sp, verylonglabel-label1", "ld sp, verylonglabel-label1", 3, + {0x31, 0x0, 0x05, 0x08}}, + {"ld sp , verylonglabel - label1", "ld sp, verylonglabel-label1", 3, + {0x31, 0x0, 0x05, 0x08}}, + + {"ldd", "ldd", 2, {0xED, 0xA8}}, + {"lddr", "lddr", 2, {0xED, 0xB8}}, + {"ldi", "ldi", 2, {0xED, 0xA0}}, + {"map", "map", 1, {0x0}}, + {"neg", "neg", 2, {0xED, 0x44}}, + {"nop", "nop", 1, {0x0}}, + + {"or (hl)", "or (hl)", 1, { 0xB6 }}, + {"or ( hl )", "or (hl)", 1, { 0xB6 }}, + {"or (ix + $FF)", "or (ix+$FF)", 3, { 0xDD, 0xB6, 0xff }}, + {"or ( ix + $FF )", "or (ix+$FF)", 3, { 0xDD, 0xB6, 0xff }}, + {"or (iy+2)", "or (iy+2)", 3, { 0xFD, 0xB6, 0x02 }}, + {"or ( iy +2 )", "or (iy+2)", 3, { 0xFD, 0xB6, 0x02 }}, + {"or (iy+-128)", "or (iy+-128)", 3, { 0xFD, 0xB6, 0x80 }}, + {"or ( iy + -128 )", "or (iy+-128)", 3, { 0xFD, 0xB6, 0x80 }}, + {"or a", "or a", 1, { 0xB7 }}, + {"or a", "or a", 1, { 0xB7 }}, + {"or b", "or b", 1, { 0xB0 }}, + {"or b", "or b", 1, { 0xB0 }}, + {"or c", "or c", 1, { 0xB1 }}, + {"or c", "or c", 1, { 0xB1 }}, + {"or d", "or d", 1, { 0xB2 }}, + {"or d", "or d", 1, { 0xB2 }}, + {"or e", "or e", 1, { 0xB3 }}, + {"or e", "or e", 1, { 0xB3 }}, + {"or h", "or h", 1, { 0xB4 }}, + {"or h", "or h", 1, { 0xB4 }}, + {"or l", "or l", 1, { 0xB5 }}, + {"or l", "or l", 1, { 0xB5 }}, + {"or 127", "or 127", 2, { 0xF6, 0x7f }}, + {"or 127", "or 127", 2, { 0xF6, 0x7f }}, + {"or 255", "or 255", 2, { 0xF6, 0xff }}, + {"or 255", "or 255", 2, { 0xF6, 0xff }}, + {"or 'A'", "or 'A'", 2, { 0xF6, 0x41 }}, + {"or 'A'", "or 'A'", 2, { 0xF6, 0x41 }}, + + /* + * The size here is wrong, but org statements + * don't have a size. It's easier to test + * org here with the rest of the instructions. + * We could have a separate set of tests for + * sizeless directives, but it's not worth it. + */ + + {"org $1000", "org $1000", 1, { 0x00, 0x10 }}, + {"org $1000", "org $1000", 1, { 0x00, 0x10 }}, + {"org 256", "org 256", 1, { 0x00, 0x1 }}, + {"org 256", "org 256", 1, { 0x00, 0x1 }}, + + {"otdr", "otdr", 2, {0xED, 0xBB}}, + {"otir", "otir", 2, {0xED, 0xB3}}, + + {"out (c), a", "out (c), a", 2, {0xED, 0x79}}, + {"out ( c ), a", "out (c), a", 2, {0xED, 0x79}}, + {"out (c), b", "out (c), b", 2, {0xED, 0x41}}, + {"out ( c ) , b", "out (c), b", 2, {0xED, 0x41}}, + {"out (c), c", "out (c), c", 2, {0xED, 0x49}}, + {"out ( c ) ,c", "out (c), c", 2, {0xED, 0x49}}, + {"out (c), d", "out (c), d", 2, {0xED, 0x51}}, + {"out ( c ),d", "out (c), d", 2, {0xED, 0x51}}, + {"out (c), e", "out (c), e", 2, {0xED, 0x59}}, + {"out ( c ) ,e", "out (c), e", 2, {0xED, 0x59}}, + {"out (c), h", "out (c), h", 2, {0xED, 0x61}}, + {"out ( c ) , h", "out (c), h", 2, {0xED, 0x61}}, + {"out (c), l", "out (c), l", 2, {0xED, 0x69}}, + {"out ( c ) , l", "out (c), l", 2, {0xED, 0x69}}, + {"out (66), a", "out (66), a", 2, {0xD3, 0x42}}, + {"out ( 66 ), a", "out (66), a", 2, {0xD3, 0x42}}, + {"out (128), a", "out (128), a", 2, {0xD3, 0x80}}, + {"out ( 128 ), a", "out (128), a", 2, {0xD3, 0x80}}, + {"out ($FF), a", "out ($FF), a", 2, {0xD3, 0xFF}}, + {"out ( $FF ), a", "out ($FF), a", 2, {0xD3, 0xFF}}, + + {"outd", "outd", 2, {0xED, 0xAB}}, + {"outi", "outi", 2, {0xED, 0xA3}}, + + {"pop af", "pop af", 1, {0xF1}}, + {"pop af", "pop af", 1, {0xF1}}, + {"pop bc", "pop bc", 1, {0xC1}}, + {"pop bc", "pop bc", 1, {0xC1}}, + {"pop de", "pop de", 1, {0xD1}}, + {"pop de", "pop de", 1, {0xD1}}, + {"pop hl", "pop hl", 1, {0xE1}}, + {"pop hl", "pop hl", 1, {0xE1}}, + {"pop ix", "pop ix", 2, {0xDD, 0xE1}}, + {"pop ix", "pop ix", 2, {0xDD, 0xE1}}, + {"pop iy", "pop iy", 2, {0xFD, 0xE1}}, + {"pop iy", "pop iy", 2, {0xFD, 0xE1}}, + + {"push af", "push af", 1, {0xF5}}, + {"push af", "push af", 1, {0xF5}}, + {"push bc", "push bc", 1, {0xC5}}, + {"push bc", "push bc", 1, {0xC5}}, + {"push de", "push de", 1, {0xD5}}, + {"push de", "push de", 1, {0xD5}}, + {"push hl", "push hl", 1, {0xE5}}, + {"push hl", "push hl", 1, {0xE5}}, + {"push ix", "push ix", 2, {0xDD, 0xE5}}, + {"push ix", "push ix", 2, {0xDD, 0xE5}}, + {"push iy", "push iy", 2, {0xFD, 0xE5}}, + {"push iy", "push iy", 2, {0xFD, 0xE5}}, + + {"res 0, (hl)", "res 0, (hl)", 2, { 0xCB, 0x86 }}, + {"res 0, ( hl )", "res 0, (hl)", 2, { 0xCB, 0x86 }}, + {"res 0, (ix + 127)", "res 0, (ix+127)", 4, { 0xDD, 0xCB, 0x7f, 0x86 }}, + {"res 0, ( ix + 127 )", "res 0, (ix+127)", 4, { 0xDD, 0xCB, 0x7f, 0x86 }}, + {"res 0, (iy + 127)", "res 0, (iy+127)", 4, { 0xFD, 0xCB, 0x7f, 0x86 }}, + {"res 0, ( iy + 127 )", "res 0, (iy+127)", 4, { 0xFD, 0xCB, 0x7f, 0x86 }}, + {"res 0, (iy + -128)", "res 0, (iy+-128)", 4, { 0xFD, 0xCB, 0x80, 0x86 }}, + {"res 0, (ix+$FE )", "res 0, (ix+$FE)", 4, { 0xDD, 0xCB, 0xfe, 0x86 }}, + {"res 0, (iy+$FE )", "res 0, (iy+$FE)", 4, { 0xFD, 0xCB, 0xfe, 0x86 }}, + {"res 0, a", "res 0, a", 2, { 0xCB, 0X87 }}, + {"res 0, a", "res 0, a", 2, { 0xCB, 0X87 }}, + {"res 0, b", "res 0, b", 2, { 0xCB, 0X80 }}, + {"res 0, b", "res 0, b", 2, { 0xCB, 0X80 }}, + {"res 0, c", "res 0, c", 2, { 0xCB, 0X81 }}, + {"res 0, c", "res 0, c", 2, { 0xCB, 0X81 }}, + {"res 0, d", "res 0, d", 2, { 0xCB, 0X82 }}, + {"res 0, d", "res 0, d", 2, { 0xCB, 0X82 }}, + {"res 0, e", "res 0, e", 2, { 0xCB, 0X83 }}, + {"res 0, e", "res 0, e", 2, { 0xCB, 0X83 }}, + {"res 0, h", "res 0, h", 2, { 0xCB, 0X84 }}, + {"res 0, h", "res 0, h", 2, { 0xCB, 0X84 }}, + {"res 0, l", "res 0, l", 2, { 0xCB, 0X85 }}, + {"res 0, l", "res 0, l", 2, { 0xCB, 0X85 }}, + {"res $0, l", "res 0, l", 2, { 0xCB, 0X85 }}, + + {"res 1, (hl)", "res 1, (hl)", 2, { 0xCB, 0x8E }}, + {"res 1, ( hl )", "res 1, (hl)", 2, { 0xCB, 0x8E }}, + {"res 1, (ix + 127)", "res 1, (ix+127)", 4, { 0xDD, 0xCB, 0x7f, 0x8E }}, + {"res 1, ( ix + 127 )", "res 1, (ix+127)", 4, { 0xDD, 0xCB, 0x7f, 0x8E }}, + {"res 1, (iy + 127)", "res 1, (iy+127)", 4, { 0xFD, 0xCB, 0x7f, 0x8E }}, + {"res 1, ( iy + 127 )", "res 1, (iy+127)", 4, { 0xFD, 0xCB, 0x7f, 0x8E }}, + {"res 1, (iy + -128)", "res 1, (iy+-128)", 4, { 0xFD, 0xCB, 0x80, 0x8E }}, + {"res 1, (ix+$FE )", "res 1, (ix+$FE)", 4, { 0xDD, 0xCB, 0xfe, 0x8E }}, + {"res 1, (iy+$FE )", "res 1, (iy+$FE)", 4, { 0xFD, 0xCB, 0xfe, 0x8E }}, + {"res 1, a", "res 1, a", 2, { 0xCB, 0X8F }}, + {"res 1, a", "res 1, a", 2, { 0xCB, 0X8F }}, + {"res 1, b", "res 1, b", 2, { 0xCB, 0X88 }}, + {"res 1, b", "res 1, b", 2, { 0xCB, 0X88 }}, + {"res 1, c", "res 1, c", 2, { 0xCB, 0X89 }}, + {"res 1, c", "res 1, c", 2, { 0xCB, 0X89 }}, + {"res 1, d", "res 1, d", 2, { 0xCB, 0X8A }}, + {"res 1, d", "res 1, d", 2, { 0xCB, 0X8A }}, + {"res 1, e", "res 1, e", 2, { 0xCB, 0X8B }}, + {"res 1, e", "res 1, e", 2, { 0xCB, 0X8B }}, + {"res 1, h", "res 1, h", 2, { 0xCB, 0X8C }}, + {"res 1, h", "res 1, h", 2, { 0xCB, 0X8C }}, + {"res 1, l", "res 1, l", 2, { 0xCB, 0X8D }}, + {"res 1, l", "res 1, l", 2, { 0xCB, 0X8D }}, + {"res $1, l", "res 1, l", 2, { 0xCB, 0X8D }}, + + {"res 2, (hl)", "res 2, (hl)", 2, { 0xCB, 0x96 }}, + {"res 2, ( hl )", "res 2, (hl)", 2, { 0xCB, 0x96 }}, + {"res 2, (ix + 127)", "res 2, (ix+127)", 4, { 0xDD, 0xCB, 0x7f, 0x96 }}, + {"res 2, ( ix + 127 )", "res 2, (ix+127)", 4, { 0xDD, 0xCB, 0x7f, 0x96 }}, + {"res 2, (iy + 127)", "res 2, (iy+127)", 4, { 0xFD, 0xCB, 0x7f, 0x96 }}, + {"res 2, ( iy + 127 )", "res 2, (iy+127)", 4, { 0xFD, 0xCB, 0x7f, 0x96 }}, + {"res 2, (iy + -128)", "res 2, (iy+-128)", 4, { 0xFD, 0xCB, 0x80, 0x96 }}, + {"res 2, (ix+$FE )", "res 2, (ix+$FE)", 4, { 0xDD, 0xCB, 0xfe, 0x96 }}, + {"res 2, (iy+$FE )", "res 2, (iy+$FE)", 4, { 0xFD, 0xCB, 0xfe, 0x96 }}, + {"res 2, a", "res 2, a", 2, { 0xCB, 0X97 }}, + {"res 2, a", "res 2, a", 2, { 0xCB, 0X97 }}, + {"res 2, b", "res 2, b", 2, { 0xCB, 0X90 }}, + {"res 2, b", "res 2, b", 2, { 0xCB, 0X90 }}, + {"res 2, c", "res 2, c", 2, { 0xCB, 0X91 }}, + {"res 2, c", "res 2, c", 2, { 0xCB, 0X91 }}, + {"res 2, d", "res 2, d", 2, { 0xCB, 0X92 }}, + {"res 2, d", "res 2, d", 2, { 0xCB, 0X92 }}, + {"res 2, e", "res 2, e", 2, { 0xCB, 0X93 }}, + {"res 2, e", "res 2, e", 2, { 0xCB, 0X93 }}, + {"res 2, h", "res 2, h", 2, { 0xCB, 0X94 }}, + {"res 2, h", "res 2, h", 2, { 0xCB, 0X94 }}, + {"res 2, l", "res 2, l", 2, { 0xCB, 0X95 }}, + {"res 2, l", "res 2, l", 2, { 0xCB, 0X95 }}, + {"res $2, l", "res 2, l", 2, { 0xCB, 0X95 }}, + + {"res 3, (hl)", "res 3, (hl)", 2, { 0xCB, 0x9E }}, + {"res 3, ( hl )", "res 3, (hl)", 2, { 0xCB, 0x9E }}, + {"res 3, (ix + 127)", "res 3, (ix+127)", 4, { 0xDD, 0xCB, 0x7f, 0x9E }}, + {"res 3, ( ix + 127 )", "res 3, (ix+127)", 4, { 0xDD, 0xCB, 0x7f, 0x9E }}, + {"res 3, (iy + 127)", "res 3, (iy+127)", 4, { 0xFD, 0xCB, 0x7f, 0x9E }}, + {"res 3, ( iy + 127 )", "res 3, (iy+127)", 4, { 0xFD, 0xCB, 0x7f, 0x9E }}, + {"res 3, (iy + -128)", "res 3, (iy+-128)", 4, { 0xFD, 0xCB, 0x80, 0x9E }}, + {"res 3, (ix+$FE )", "res 3, (ix+$FE)", 4, { 0xDD, 0xCB, 0xfe, 0x9E }}, + {"res 3, (iy+$FE )", "res 3, (iy+$FE)", 4, { 0xFD, 0xCB, 0xfe, 0x9E }}, + {"res 3, a", "res 3, a", 2, { 0xCB, 0X9F }}, + {"res 3, a", "res 3, a", 2, { 0xCB, 0X9F }}, + {"res 3, b", "res 3, b", 2, { 0xCB, 0X98 }}, + {"res 3, b", "res 3, b", 2, { 0xCB, 0X98 }}, + {"res 3, c", "res 3, c", 2, { 0xCB, 0X99 }}, + {"res 3, c", "res 3, c", 2, { 0xCB, 0X99 }}, + {"res 3, d", "res 3, d", 2, { 0xCB, 0X9A }}, + {"res 3, d", "res 3, d", 2, { 0xCB, 0X9A }}, + {"res 3, e", "res 3, e", 2, { 0xCB, 0X9B }}, + {"res 3, e", "res 3, e", 2, { 0xCB, 0X9B }}, + {"res 3, h", "res 3, h", 2, { 0xCB, 0X9C }}, + {"res 3, h", "res 3, h", 2, { 0xCB, 0X9C }}, + {"res 3, l", "res 3, l", 2, { 0xCB, 0X9D }}, + {"res 3, l", "res 3, l", 2, { 0xCB, 0X9D }}, + {"res $3, l", "res 3, l", 2, { 0xCB, 0X9D }}, + + {"res 4, (hl)", "res 4, (hl)", 2, { 0xCB, 0xA6 }}, + {"res 4, ( hl )", "res 4, (hl)", 2, { 0xCB, 0xA6 }}, + {"res 4, (ix + 127)", "res 4, (ix+127)", 4, { 0xDD, 0xCB, 0x7f, 0xA6 }}, + {"res 4, ( ix + 127 )", "res 4, (ix+127)", 4, { 0xDD, 0xCB, 0x7f, 0xA6 }}, + {"res 4, (iy + 127)", "res 4, (iy+127)", 4, { 0xFD, 0xCB, 0x7f, 0xA6 }}, + {"res 4, ( iy + 127 )", "res 4, (iy+127)", 4, { 0xFD, 0xCB, 0x7f, 0xA6 }}, + {"res 4, (iy + -128)", "res 4, (iy+-128)", 4, { 0xFD, 0xCB, 0x80, 0xA6 }}, + {"res 4, (ix+$FE )", "res 4, (ix+$FE)", 4, { 0xDD, 0xCB, 0xfe, 0xA6 }}, + {"res 4, (iy+$FE )", "res 4, (iy+$FE)", 4, { 0xFD, 0xCB, 0xfe, 0xA6 }}, + {"res 4, a", "res 4, a", 2, { 0xCB, 0XA7 }}, + {"res 4, a", "res 4, a", 2, { 0xCB, 0XA7 }}, + {"res 4, b", "res 4, b", 2, { 0xCB, 0XA0 }}, + {"res 4, b", "res 4, b", 2, { 0xCB, 0XA0 }}, + {"res 4, c", "res 4, c", 2, { 0xCB, 0XA1 }}, + {"res 4, c", "res 4, c", 2, { 0xCB, 0XA1 }}, + {"res 4, d", "res 4, d", 2, { 0xCB, 0XA2 }}, + {"res 4, d", "res 4, d", 2, { 0xCB, 0XA2 }}, + {"res 4, e", "res 4, e", 2, { 0xCB, 0XA3 }}, + {"res 4, e", "res 4, e", 2, { 0xCB, 0XA3 }}, + {"res 4, h", "res 4, h", 2, { 0xCB, 0XA4 }}, + {"res 4, h", "res 4, h", 2, { 0xCB, 0XA4 }}, + {"res 4, l", "res 4, l", 2, { 0xCB, 0XA5 }}, + {"res 4, l", "res 4, l", 2, { 0xCB, 0XA5 }}, + {"res $4, l", "res 4, l", 2, { 0xCB, 0XA5 }}, + + {"res 5, (hl)", "res 5, (hl)", 2, { 0xCB, 0xAE }}, + {"res 5, ( hl )", "res 5, (hl)", 2, { 0xCB, 0xAE }}, + {"res 5, (ix + 127)", "res 5, (ix+127)", 4, { 0xDD, 0xCB, 0x7f, 0xAE }}, + {"res 5, ( ix + 127 )", "res 5, (ix+127)", 4, { 0xDD, 0xCB, 0x7f, 0xAE }}, + {"res 5, (iy + 127)", "res 5, (iy+127)", 4, { 0xFD, 0xCB, 0x7f, 0xAE }}, + {"res 5, ( iy + 127 )", "res 5, (iy+127)", 4, { 0xFD, 0xCB, 0x7f, 0xAE }}, + {"res 5, (iy + -128)", "res 5, (iy+-128)", 4, { 0xFD, 0xCB, 0x80, 0xAE }}, + {"res 5, (ix+$FE )", "res 5, (ix+$FE)", 4, { 0xDD, 0xCB, 0xfe, 0xAE }}, + {"res 5, (iy+$FE )", "res 5, (iy+$FE)", 4, { 0xFD, 0xCB, 0xfe, 0xAE }}, + {"res 5, a", "res 5, a", 2, { 0xCB, 0XAF }}, + {"res 5, a", "res 5, a", 2, { 0xCB, 0XAF }}, + {"res 5, b", "res 5, b", 2, { 0xCB, 0XA8 }}, + {"res 5, b", "res 5, b", 2, { 0xCB, 0XA8 }}, + {"res 5, c", "res 5, c", 2, { 0xCB, 0XA9 }}, + {"res 5, c", "res 5, c", 2, { 0xCB, 0XA9 }}, + {"res 5, d", "res 5, d", 2, { 0xCB, 0XAA }}, + {"res 5, d", "res 5, d", 2, { 0xCB, 0XAA }}, + {"res 5, e", "res 5, e", 2, { 0xCB, 0XAB }}, + {"res 5, e", "res 5, e", 2, { 0xCB, 0XAB }}, + {"res 5, h", "res 5, h", 2, { 0xCB, 0XAC }}, + {"res 5, h", "res 5, h", 2, { 0xCB, 0XAC }}, + {"res 5, l", "res 5, l", 2, { 0xCB, 0XAD }}, + {"res 5, l", "res 5, l", 2, { 0xCB, 0XAD }}, + {"res $5, l", "res 5, l", 2, { 0xCB, 0XAD }}, + + {"res 6, (hl)", "res 6, (hl)", 2, { 0xCB, 0xB6 }}, + {"res 6, ( hl )", "res 6, (hl)", 2, { 0xCB, 0xB6 }}, + {"res 6, (ix + 127)", "res 6, (ix+127)", 4, { 0xDD, 0xCB, 0x7f, 0xB6 }}, + {"res 6, ( ix + 127 )", "res 6, (ix+127)", 4, { 0xDD, 0xCB, 0x7f, 0xB6 }}, + {"res 6, (iy + 127)", "res 6, (iy+127)", 4, { 0xFD, 0xCB, 0x7f, 0xB6 }}, + {"res 6, ( iy + 127 )", "res 6, (iy+127)", 4, { 0xFD, 0xCB, 0x7f, 0xB6 }}, + {"res 6, (iy + -128)", "res 6, (iy+-128)", 4, { 0xFD, 0xCB, 0x80, 0xB6 }}, + {"res 6, (ix+$FE )", "res 6, (ix+$FE)", 4, { 0xDD, 0xCB, 0xfe, 0xB6 }}, + {"res 6, (iy+$FE )", "res 6, (iy+$FE)", 4, { 0xFD, 0xCB, 0xfe, 0xB6 }}, + {"res 6, a", "res 6, a", 2, { 0xCB, 0XB7 }}, + {"res 6, a", "res 6, a", 2, { 0xCB, 0XB7 }}, + {"res 6, b", "res 6, b", 2, { 0xCB, 0XB0 }}, + {"res 6, b", "res 6, b", 2, { 0xCB, 0XB0 }}, + {"res 6, c", "res 6, c", 2, { 0xCB, 0XB1 }}, + {"res 6, c", "res 6, c", 2, { 0xCB, 0XB1 }}, + {"res 6, d", "res 6, d", 2, { 0xCB, 0XB2 }}, + {"res 6, d", "res 6, d", 2, { 0xCB, 0XB2 }}, + {"res 6, e", "res 6, e", 2, { 0xCB, 0XB3 }}, + {"res 6, e", "res 6, e", 2, { 0xCB, 0XB3 }}, + {"res 6, h", "res 6, h", 2, { 0xCB, 0XB4 }}, + {"res 6, h", "res 6, h", 2, { 0xCB, 0XB4 }}, + {"res 6, l", "res 6, l", 2, { 0xCB, 0XB5 }}, + {"res 6, l", "res 6, l", 2, { 0xCB, 0XB5 }}, + {"res $6, l", "res 6, l", 2, { 0xCB, 0XB5 }}, + + {"res 7, (hl)", "res 7, (hl)", 2, { 0xCB, 0xBE }}, + {"res 7, ( hl )", "res 7, (hl)", 2, { 0xCB, 0xBE }}, + {"res 7, (ix + 127)", "res 7, (ix+127)", 4, { 0xDD, 0xCB, 0x7f, 0xBE }}, + {"res 7, ( ix + 127 )", "res 7, (ix+127)", 4, { 0xDD, 0xCB, 0x7f, 0xBE }}, + {"res 7, (iy + 127)", "res 7, (iy+127)", 4, { 0xFD, 0xCB, 0x7f, 0xBE }}, + {"res 7, ( iy + 127 )", "res 7, (iy+127)", 4, { 0xFD, 0xCB, 0x7f, 0xBE }}, + {"res 7, (iy + -128)", "res 7, (iy+-128)", 4, { 0xFD, 0xCB, 0x80, 0xBE }}, + {"res 7, (ix+$FE )", "res 7, (ix+$FE)", 4, { 0xDD, 0xCB, 0xfe, 0xBE }}, + {"res 7, (iy+$FE )", "res 7, (iy+$FE)", 4, { 0xFD, 0xCB, 0xfe, 0xBE }}, + {"res 7, a", "res 7, a", 2, { 0xCB, 0XBF }}, + {"res 7, a", "res 7, a", 2, { 0xCB, 0XBF }}, + {"res 7, b", "res 7, b", 2, { 0xCB, 0XB8 }}, + {"res 7, b", "res 7, b", 2, { 0xCB, 0XB8 }}, + {"res 7, c", "res 7, c", 2, { 0xCB, 0XB9 }}, + {"res 7, c", "res 7, c", 2, { 0xCB, 0XB9 }}, + {"res 7, d", "res 7, d", 2, { 0xCB, 0XBA }}, + {"res 7, d", "res 7, d", 2, { 0xCB, 0XBA }}, + {"res 7, e", "res 7, e", 2, { 0xCB, 0XBB }}, + {"res 7, e", "res 7, e", 2, { 0xCB, 0XBB }}, + {"res 7, h", "res 7, h", 2, { 0xCB, 0XBC }}, + {"res 7, h", "res 7, h", 2, { 0xCB, 0XBC }}, + {"res 7, l", "res 7, l", 2, { 0xCB, 0XBD }}, + {"res 7, l", "res 7, l", 2, { 0xCB, 0XBD }}, + {"res $7, l", "res 7, l", 2, { 0xCB, 0XBD }}, + + {"ret", "ret", 1, {0xc9}}, + {"ret c", "ret c", 1, {0xd8}}, + {"ret c", "ret c", 1, {0xd8}}, + {"ret m", "ret m", 1, {0xf8}}, + {"ret m", "ret m", 1, {0xf8}}, + {"ret nc", "ret nc", 1, {0xd0}}, + {"ret nc", "ret nc", 1, {0xd0}}, + {"ret nz", "ret nz", 1, {0xc0}}, + {"ret nz", "ret nz", 1, {0xc0}}, + {"ret p", "ret p", 1, {0xf0}}, + {"ret p", "ret p", 1, {0xf0}}, + {"ret pe", "ret pe", 1, {0xe8}}, + {"ret pe", "ret pe", 1, {0xe8}}, + {"ret po", "ret po", 1, {0xe0}}, + {"ret po", "ret po", 1, {0xe0}}, + + {"reti", "reti", 2, {0xED, 0x4D}}, + {"retn", "retn", 2, {0xED, 0x45}}, + + {"rl (hl)", "rl (hl)", 2, { 0xCB, 0x16 }}, + {"rl ( hl )", "rl (hl)", 2, { 0xCB, 0x16 }}, + {"rl (ix + $FF)", "rl (ix+$FF)", 4, { 0xDD, 0xCB, 0xff, 0x16 }}, + {"rl ( ix + $FF )", "rl (ix+$FF)", 4, { 0xDD, 0xCB, 0xff, 0x16 }}, + {"rl (iy+-128)", "rl (iy+-128)", 4, { 0xFD, 0xCB, 0x80, 0x16 }}, + {"rl ( iy + -128 )", "rl (iy+-128)", 4, { 0xFD, 0xCB, 0x80, 0x16 }}, + {"rl (iy+2)", "rl (iy+2)", 4, { 0xFD, 0xCB, 0x02, 0x16 }}, + {"rl ( iy + 2 )", "rl (iy+2)", 4, { 0xFD, 0xCB, 0x02, 0x16 }}, + {"rl a", "rl a", 2, { 0xCB, 0x17 }}, + {"rl a", "rl a", 2, { 0xCB, 0x17 }}, + {"rl b", "rl b", 2, { 0xCB, 0x10 }}, + {"rl b", "rl b", 2, { 0xCB, 0x10 }}, + {"rl c", "rl c", 2, { 0xCB, 0x11 }}, + {"rl c", "rl c", 2, { 0xCB, 0x11 }}, + {"rl d", "rl d", 2, { 0xCB, 0x12 }}, + {"rl d", "rl d", 2, { 0xCB, 0x12 }}, + {"rl e", "rl e", 2, { 0xCB, 0x13 }}, + {"rl e", "rl e", 2, { 0xCB, 0x13 }}, + {"rl h", "rl h", 2, { 0xCB, 0x14 }}, + {"rl h", "rl h", 2, { 0xCB, 0x14 }}, + {"rl l", "rl l", 2, { 0xCB, 0x15 }}, + {"rl l", "rl l", 2, { 0xCB, 0x15 }}, + + {"rla", "rla", 1, { 0x17 }}, + + {"rlc (hl)", "rlc (hl)", 2, { 0xCB, 0x06 }}, + {"rlc ( hl )", "rlc (hl)", 2, { 0xCB, 0x06 }}, + {"rlc (ix+$FF)", "rlc (ix+$FF)", 4, { 0xDD, 0xCB, 0xff, 0x06 }}, + {"rlc ( ix + $ ff )", "rlc (ix+$FF)", 4, { 0xDD, 0xCB, 0xff, 0x06 }}, + {"rlc (iy+-128)", "rlc (iy+-128)", 4, { 0xFD, 0xCB, 0x80, 0x06 }}, + {"rlc ( iy + -128 )", "rlc (iy+-128)", 4, { 0xFD, 0xCB, 0x80, 0x06 }}, + {"rlc (ix+2)", "rlc (ix+2)", 4, { 0xDD, 0xCB, 0x2, 0x06 }}, + {"rlc ( ix + 2 )", "rlc (ix+2)", 4, { 0xDD, 0xCB, 0x2, 0x06 }}, + {"rlc a", "rlc a", 2, { 0xCB, 0x07 }}, + {"rlc a", "rlc a", 2, { 0xCB, 0x07 }}, + {"rlc b", "rlc b", 2, { 0xCB, 0x00 }}, + {"rlc b", "rlc b", 2, { 0xCB, 0x00 }}, + {"rlc c", "rlc c", 2, { 0xCB, 0x01 }}, + {"rlc c", "rlc c", 2, { 0xCB, 0x01 }}, + {"rlc d", "rlc d", 2, { 0xCB, 0x02 }}, + {"rlc d", "rlc d", 2, { 0xCB, 0x02 }}, + {"rlc e", "rlc e", 2, { 0xCB, 0x03 }}, + {"rlc e", "rlc e", 2, { 0xCB, 0x03 }}, + {"rlc h", "rlc h", 2, { 0xCB, 0x04 }}, + {"rlc h", "rlc h", 2, { 0xCB, 0x04 }}, + {"rlc l", "rlc l", 2, { 0xCB, 0x05 }}, + {"rlc l", "rlc l", 2, { 0xCB, 0x05 }}, + + {"rlca", "rlca", 1, { 0x07 }}, + {"rld", "rld", 2, { 0xED, 0x6F }}, + + {"rr (hl)", "rr (hl)", 2, { 0xCB, 0x1E }}, + {"rr ( hl )", "rr (hl)", 2, { 0xCB, 0x1E }}, + {"rr (ix+$FF)", "rr (ix+$FF)", 4, { 0xDD, 0xCB, 0xff, 0x1E }}, + {"rr ( ix + $FF )", "rr (ix+$FF)", 4, { 0xDD, 0xCB, 0xff, 0x1E }}, + {"rr (iy+-128)", "rr (iy+-128)", 4, { 0xFD, 0xCB, 0x80, 0x1E }}, + {"rr ( iy + -128 )", "rr (iy+-128)", 4, { 0xFD, 0xCB, 0x80, 0x1E }}, + {"rr (iy+2)", "rr (iy+2)", 4, { 0xFD, 0xCB, 0x2, 0x1E }}, + {"rr ( iy + 2 )", "rr (iy+2)", 4, { 0xFD, 0xCB, 0x2, 0x1E }}, + {"rr a", "rr a", 2, { 0xCB, 0x1F }}, + {"rr a", "rr a", 2, { 0xCB, 0x1F }}, + {"rr b", "rr b", 2, { 0xCB, 0x18 }}, + {"rr b", "rr b", 2, { 0xCB, 0x18 }}, + {"rr c", "rr c", 2, { 0xCB, 0x19 }}, + {"rr c", "rr c", 2, { 0xCB, 0x19 }}, + {"rr d", "rr d", 2, { 0xCB, 0x1A }}, + {"rr d", "rr d", 2, { 0xCB, 0x1A }}, + {"rr e", "rr e", 2, { 0xCB, 0x1B }}, + {"rr e", "rr e", 2, { 0xCB, 0x1B }}, + {"rr h", "rr h", 2, { 0xCB, 0x1C }}, + {"rr h", "rr h", 2, { 0xCB, 0x1C }}, + {"rr l", "rr l", 2, { 0xCB, 0x1D }}, + {"rr l", "rr l", 2, { 0xCB, 0x1D }}, + + {"rra", "rra", 1, { 0x1F}}, + + {"rrc (hl)", "rrc (hl)", 2, { 0xCB, 0x0E }}, + {"rrc ( hl )", "rrc (hl)", 2, { 0xCB, 0x0E }}, + {"rrc (ix+$FF)", "rrc (ix+$FF)", 4, { 0xDD, 0xCB, 0xff, 0x0E }}, + {"rrc ( ix + $FF )", "rrc (ix+$FF)", 4, { 0xDD, 0xCB, 0xff, 0x0E }}, + {"rrc (iy+-128)", "rrc (iy+-128)", 4, { 0xFD, 0xCB, 0x80, 0x0E }}, + {"rrc ( iy + -128 )", "rrc (iy+-128)", 4, { 0xFD, 0xCB, 0x80, 0x0E }}, + {"rrc (iy+3)", "rrc (iy+3)", 4, { 0xFD, 0xCB, 0x3, 0x0E }}, + {"rrc ( iy + 3 )", "rrc (iy+3)", 4, { 0xFD, 0xCB, 0x3, 0x0E }}, + {"rrc a", "rrc a", 2, { 0xCB, 0x0F }}, + {"rrc a", "rrc a", 2, { 0xCB, 0x0F }}, + {"rrc b", "rrc b", 2, { 0xCB, 0x08 }}, + {"rrc b", "rrc b", 2, { 0xCB, 0x08 }}, + {"rrc c", "rrc c", 2, { 0xCB, 0x09 }}, + {"rrc c", "rrc c", 2, { 0xCB, 0x09 }}, + {"rrc d", "rrc d", 2, { 0xCB, 0x0A }}, + {"rrc d", "rrc d", 2, { 0xCB, 0x0A }}, + {"rrc e", "rrc e", 2, { 0xCB, 0x0B }}, + {"rrc e", "rrc e", 2, { 0xCB, 0x0B }}, + {"rrc h", "rrc h", 2, { 0xCB, 0x0C }}, + {"rrc h", "rrc h", 2, { 0xCB, 0x0C }}, + {"rrc l", "rrc l", 2, { 0xCB, 0x0D }}, + {"rrc l", "rrc l", 2, { 0xCB, 0x0D }}, + + {"rrd", "rrd", 2, { 0xED, 0x67 }}, + + {"rst 0", "rst 0", 1, { 0xC7 }}, + {"rst 0", "rst 0", 1, { 0xC7 }}, + {"rst $0", "rst $0", 1, { 0xC7 }}, + {"rst $0", "rst $0", 1, { 0xC7 }}, + {"rst 8", "rst 8", 1, { 0xCF }}, + {"rst 8", "rst 8", 1, { 0xCF }}, + {"rst $8", "rst $8", 1, { 0xCF }}, + {"rst $8", "rst $8", 1, { 0xCF }}, + {"rst 16", "rst 16", 1, { 0xD7 }}, + {"rst 16", "rst 16", 1, { 0xD7 }}, + {"rst $10", "rst $10", 1, { 0xD7 }}, + {"rst $10", "rst $10", 1, { 0xD7 }}, + {"rst 24", "rst 24", 1, { 0xDF }}, + {"rst 24", "rst 24", 1, { 0xDF }}, + {"rst $18", "rst $18", 1, { 0xDF }}, + {"rst $18", "rst $18", 1, { 0xDF }}, + {"rst 32", "rst 32", 1, { 0xE7 }}, + {"rst 32", "rst 32", 1, { 0xE7 }}, + {"rst $20", "rst $20", 1, { 0xE7 }}, + {"rst $20", "rst $20", 1, { 0xE7 }}, + {"rst ' '", "rst ' '", 1, { 0xE7 }}, + {"rst ' '", "rst ' '", 1, { 0xE7 }}, + {"rst 40", "rst 40", 1, { 0xEF }}, + {"rst 40", "rst 40", 1, { 0xEF }}, + {"rst $28", "rst $28", 1, { 0xEF }}, + {"rst $28", "rst $28", 1, { 0xEF }}, + {"rst 48", "rst 48", 1, { 0xF7 }}, + {"rst 48", "rst 48", 1, { 0xF7 }}, + {"rst $30", "rst $30", 1, { 0xF7 }}, + {"rst $30", "rst $30", 1, { 0xF7 }}, + {"rst 56", "rst 56", 1, { 0xFF }}, + {"rst 56", "rst 56", 1, { 0xFF }}, + {"rst $38", "rst $38", 1, { 0xFF }}, + {"rst $38", "rst $38", 1, { 0xFF }}, + + {"sbc a, (hl)", "sbc a, (hl)", 1, { 0x9e }}, + {"sbc a,( hl)", "sbc a, (hl)", 1, { 0x9e }}, + {"sbc a, (ix+15)", "sbc a, (ix+15)", 3, { 0xdd, 0x9e, 0xf}}, + {"sbc a,( ix + 15 )", "sbc a, (ix+15)", 3, { 0xdd, 0x9e, 0xf}}, + {"sbc a, (ix+$f)", "sbc a, (ix+$F)", 3, { 0xdd, 0x9e, 0xf}}, + {"sbc a,( ix + $f )", "sbc a, (ix+$F)", 3, { 0xdd, 0x9e, 0xf}}, + {"sbc a, (iy+15)", "sbc a, (iy+15)", 3, { 0xfd, 0x9e, 0xf}}, + {"sbc a,( iy + 15 )", "sbc a, (iy+15)", 3, { 0xfd, 0x9e, 0xf}}, + {"sbc a, (iy+-1)", "sbc a, (iy+-1)", 3, { 0xfd, 0x9e, 0xff}}, + {"sbc a,( iy + -1 )", "sbc a, (iy+-1)", 3, { 0xfd, 0x9e, 0xff}}, + {"sbc a,( iy + 0)", "sbc a, (iy+0)", 3, { 0xfd, 0x9e, 0x0}}, + {"sbc a,( iy + 0)", "sbc a, (iy+0)", 3, { 0xfd, 0x9e, 0x0}}, + {"sbc a, a", "sbc a, a", 1, { 0x9f }}, + {"sbc a,a", "sbc a, a", 1, { 0x9f }}, + {"sbc a, b", "sbc a, b", 1, { 0x98 }}, + {"sbc a,b", "sbc a, b", 1, { 0x98 }}, + {"sbc a, c", "sbc a, c", 1, { 0x99 }}, + {"sbc a , c", "sbc a, c", 1, { 0x99 }}, + {"sbc a, d", "sbc a, d", 1, { 0x9A }}, + {"sbc a , d", "sbc a, d", 1, { 0x9A }}, + {"sbc a, e", "sbc a, e", 1, { 0x9B }}, + {"sbc a , e", "sbc a, e", 1, { 0x9B }}, + {"sbc a, h", "sbc a, h", 1, { 0x9C }}, + {"sbc a , h", "sbc a, h", 1, { 0x9C }}, + {"sbc a, l", "sbc a, l", 1, { 0x9D }}, + {"sbc a , l", "sbc a, l", 1, { 0x9D }}, + {"sbc a, 40", "sbc a, 40", 2, { 0xDE, 0x28 }}, + {"sbc a , 40", "sbc a, 40", 2, { 0xDE, 0x28 }}, + {"sbc a, $28", "sbc a, $28", 2, { 0xDE, 0x28 }}, + {"sbc a , $28", "sbc a, $28", 2, { 0xDE, 0x28 }}, + {"sbc a, 255", "sbc a, 255", 2, { 0xDE, 0xFF }}, + {"sbc a , 255", "sbc a, 255", 2, { 0xDE, 0xFF }}, + {"sbc a, 'A'", "sbc a, 'A'", 2, { 0xDE, 0x41 }}, + {"sbc a , 'A'", "sbc a, 'A'", 2, { 0xDE, 0x41 }}, + {"sbc a, -1", "sbc a, -1", 2, { 0xDE, 0xFF }}, + {"sbc a , -1", "sbc a, -1", 2, { 0xDE, 0xFF }}, + {"sbc hl, bc", "sbc hl, bc", 2, { 0xed, 0x42 }}, + {"sbc hl, bc", "sbc hl, bc", 2, { 0xed, 0x42 }}, + {"sbc hl, de", "sbc hl, de", 2, { 0xed, 0x52 }}, + {"sbc hl, de", "sbc hl, de", 2, { 0xed, 0x52 }}, + {"sbc hl, hl", "sbc hl, hl", 2, { 0xed, 0x62 }}, + {"sbc hl, hl", "sbc hl, hl", 2, { 0xed, 0x62 }}, + {"sbc hl, sp", "sbc hl, sp", 2, { 0xed, 0x72 }}, + {"sbc hl, sp", "sbc hl, sp", 2, { 0xed, 0x72 }}, + + {"scf", "scf", 1, { 0x37 }}, + + {"set 0, (hl)", "set 0, (hl)", 2, { 0xCB, 0xC6 }}, + {"set 0, ( hl )", "set 0, (hl)", 2, { 0xCB, 0xC6 }}, + {"set 0, (ix + 127)", "set 0, (ix+127)", 4, { 0xDD, 0xCB, 0x7f, 0xC6 }}, + {"set 0, ( ix + 127 )", "set 0, (ix+127)", 4, { 0xDD, 0xCB, 0x7f, 0xC6 }}, + {"set 0, (iy + 127)", "set 0, (iy+127)", 4, { 0xFD, 0xCB, 0x7f, 0xC6 }}, + {"set 0, ( iy + 127 )", "set 0, (iy+127)", 4, { 0xFD, 0xCB, 0x7f, 0xC6 }}, + {"set 0, (iy + -128)", "set 0, (iy+-128)", 4, { 0xFD, 0xCB, 0x80, 0xC6 }}, + {"set 0, (ix+$FE )", "set 0, (ix+$FE)", 4, { 0xDD, 0xCB, 0xfe, 0xC6 }}, + {"set 0, (iy+$FE )", "set 0, (iy+$FE)", 4, { 0xFD, 0xCB, 0xfe, 0xC6 }}, + {"set 0, a", "set 0, a", 2, { 0xCB, 0XC7 }}, + {"set 0, a", "set 0, a", 2, { 0xCB, 0XC7 }}, + {"set 0, b", "set 0, b", 2, { 0xCB, 0XC0 }}, + {"set 0, b", "set 0, b", 2, { 0xCB, 0XC0 }}, + {"set 0, c", "set 0, c", 2, { 0xCB, 0XC1 }}, + {"set 0, c", "set 0, c", 2, { 0xCB, 0XC1 }}, + {"set 0, d", "set 0, d", 2, { 0xCB, 0XC2 }}, + {"set 0, d", "set 0, d", 2, { 0xCB, 0XC2 }}, + {"set 0, e", "set 0, e", 2, { 0xCB, 0XC3 }}, + {"set 0, e", "set 0, e", 2, { 0xCB, 0XC3 }}, + {"set 0, h", "set 0, h", 2, { 0xCB, 0XC4 }}, + {"set 0, h", "set 0, h", 2, { 0xCB, 0XC4 }}, + {"set 0, l", "set 0, l", 2, { 0xCB, 0XC5 }}, + {"set 0, l", "set 0, l", 2, { 0xCB, 0XC5 }}, + + {"set 1, (hl)", "set 1, (hl)", 2, { 0xCB, 0xCE }}, + {"set 1, ( hl )", "set 1, (hl)", 2, { 0xCB, 0xCE }}, + {"set 1, (ix + 127)", "set 1, (ix+127)", 4, { 0xDD, 0xCB, 0x7f, 0xCE }}, + {"set 1, ( ix + 127 )", "set 1, (ix+127)", 4, { 0xDD, 0xCB, 0x7f, 0xCE }}, + {"set 1, (iy + 127)", "set 1, (iy+127)", 4, { 0xFD, 0xCB, 0x7f, 0xCE }}, + {"set 1, ( iy + 127 )", "set 1, (iy+127)", 4, { 0xFD, 0xCB, 0x7f, 0xCE }}, + {"set 1, (iy + -128)", "set 1, (iy+-128)", 4, { 0xFD, 0xCB, 0x80, 0xCE }}, + {"set 1, (ix+$FE )", "set 1, (ix+$FE)", 4, { 0xDD, 0xCB, 0xfe, 0xCE }}, + {"set 1, (iy+$FE )", "set 1, (iy+$FE)", 4, { 0xFD, 0xCB, 0xfe, 0xCE }}, + {"set 1, a", "set 1, a", 2, { 0xCB, 0XCF }}, + {"set 1, a", "set 1, a", 2, { 0xCB, 0XCF }}, + {"set 1, b", "set 1, b", 2, { 0xCB, 0XC8 }}, + {"set 1, b", "set 1, b", 2, { 0xCB, 0XC8 }}, + {"set 1, c", "set 1, c", 2, { 0xCB, 0XC9 }}, + {"set 1, c", "set 1, c", 2, { 0xCB, 0XC9 }}, + {"set 1, d", "set 1, d", 2, { 0xCB, 0XCA }}, + {"set 1, d", "set 1, d", 2, { 0xCB, 0XCA }}, + {"set 1, e", "set 1, e", 2, { 0xCB, 0XCB }}, + {"set 1, e", "set 1, e", 2, { 0xCB, 0XCB }}, + {"set 1, h", "set 1, h", 2, { 0xCB, 0XCC }}, + {"set 1, h", "set 1, h", 2, { 0xCB, 0XCC }}, + {"set 1, l", "set 1, l", 2, { 0xCB, 0XCD }}, + {"set 1, l", "set 1, l", 2, { 0xCB, 0XCD }}, + + {"set 2, (hl)", "set 2, (hl)", 2, { 0xCB, 0xD6 }}, + {"set 2, ( hl )", "set 2, (hl)", 2, { 0xCB, 0xD6 }}, + {"set 2, (ix + 127)", "set 2, (ix+127)", 4, { 0xDD, 0xCB, 0x7f, 0xD6 }}, + {"set 2, ( ix + 127 )", "set 2, (ix+127)", 4, { 0xDD, 0xCB, 0x7f, 0xD6 }}, + {"set 2, (iy + 127)", "set 2, (iy+127)", 4, { 0xFD, 0xCB, 0x7f, 0xD6 }}, + {"set 2, ( iy + 127 )", "set 2, (iy+127)", 4, { 0xFD, 0xCB, 0x7f, 0xD6 }}, + {"set 2, (iy + -128)", "set 2, (iy+-128)", 4, { 0xFD, 0xCB, 0x80, 0xD6 }}, + {"set 2, (ix+$FE )", "set 2, (ix+$FE)", 4, { 0xDD, 0xCB, 0xfe, 0xD6 }}, + {"set 2, (iy+$FE )", "set 2, (iy+$FE)", 4, { 0xFD, 0xCB, 0xfe, 0xD6 }}, + {"set 2, a", "set 2, a", 2, { 0xCB, 0XD7 }}, + {"set 2, a", "set 2, a", 2, { 0xCB, 0XD7 }}, + {"set 2, b", "set 2, b", 2, { 0xCB, 0XD0 }}, + {"set 2, b", "set 2, b", 2, { 0xCB, 0XD0 }}, + {"set 2, c", "set 2, c", 2, { 0xCB, 0XD1 }}, + {"set 2, c", "set 2, c", 2, { 0xCB, 0XD1 }}, + {"set 2, d", "set 2, d", 2, { 0xCB, 0XD2 }}, + {"set 2, d", "set 2, d", 2, { 0xCB, 0XD2 }}, + {"set 2, e", "set 2, e", 2, { 0xCB, 0XD3 }}, + {"set 2, e", "set 2, e", 2, { 0xCB, 0XD3 }}, + {"set 2, h", "set 2, h", 2, { 0xCB, 0XD4 }}, + {"set 2, h", "set 2, h", 2, { 0xCB, 0XD4 }}, + {"set 2, l", "set 2, l", 2, { 0xCB, 0XD5 }}, + {"set 2, l", "set 2, l", 2, { 0xCB, 0XD5 }}, + + {"set 3, (hl)", "set 3, (hl)", 2, { 0xCB, 0xDE }}, + {"set 3, ( hl )", "set 3, (hl)", 2, { 0xCB, 0xDE }}, + {"set 3, (ix + 127)", "set 3, (ix+127)", 4, { 0xDD, 0xCB, 0x7f, 0xDE }}, + {"set 3, ( ix + 127 )", "set 3, (ix+127)", 4, { 0xDD, 0xCB, 0x7f, 0xDE }}, + {"set 3, (iy + 127)", "set 3, (iy+127)", 4, { 0xFD, 0xCB, 0x7f, 0xDE }}, + {"set 3, ( iy + 127 )", "set 3, (iy+127)", 4, { 0xFD, 0xCB, 0x7f, 0xDE }}, + {"set 3, (iy + -128)", "set 3, (iy+-128)", 4, { 0xFD, 0xCB, 0x80, 0xDE }}, + {"set 3, (ix+$FE )", "set 3, (ix+$FE)", 4, { 0xDD, 0xCB, 0xfe, 0xDE }}, + {"set 3, (iy+$FE )", "set 3, (iy+$FE)", 4, { 0xFD, 0xCB, 0xfe, 0xDE }}, + {"set 3, a", "set 3, a", 2, { 0xCB, 0XDF }}, + {"set 3, a", "set 3, a", 2, { 0xCB, 0XDF }}, + {"set 3, b", "set 3, b", 2, { 0xCB, 0XD8 }}, + {"set 3, b", "set 3, b", 2, { 0xCB, 0XD8 }}, + {"set 3, c", "set 3, c", 2, { 0xCB, 0XD9 }}, + {"set 3, c", "set 3, c", 2, { 0xCB, 0XD9 }}, + {"set 3, d", "set 3, d", 2, { 0xCB, 0XDA }}, + {"set 3, d", "set 3, d", 2, { 0xCB, 0XDA }}, + {"set 3, e", "set 3, e", 2, { 0xCB, 0XDB }}, + {"set 3, e", "set 3, e", 2, { 0xCB, 0XDB }}, + {"set 3, h", "set 3, h", 2, { 0xCB, 0XDC }}, + {"set 3, h", "set 3, h", 2, { 0xCB, 0XDC }}, + {"set 3, l", "set 3, l", 2, { 0xCB, 0XDD }}, + {"set 3, l", "set 3, l", 2, { 0xCB, 0XDD }}, + + {"set 4, (hl)", "set 4, (hl)", 2, { 0xCB, 0xE6 }}, + {"set 4, ( hl )", "set 4, (hl)", 2, { 0xCB, 0xE6 }}, + {"set 4, (ix + 127)", "set 4, (ix+127)", 4, { 0xDD, 0xCB, 0x7f, 0xE6 }}, + {"set 4, ( ix + 127 )", "set 4, (ix+127)", 4, { 0xDD, 0xCB, 0x7f, 0xE6 }}, + {"set 4, (iy + 127)", "set 4, (iy+127)", 4, { 0xFD, 0xCB, 0x7f, 0xE6 }}, + {"set 4, ( iy + 127 )", "set 4, (iy+127)", 4, { 0xFD, 0xCB, 0x7f, 0xE6 }}, + {"set 4, (iy + -128)", "set 4, (iy+-128)", 4, { 0xFD, 0xCB, 0x80, 0xE6 }}, + {"set 4, (ix+$FE )", "set 4, (ix+$FE)", 4, { 0xDD, 0xCB, 0xfe, 0xE6 }}, + {"set 4, (iy+$FE )", "set 4, (iy+$FE)", 4, { 0xFD, 0xCB, 0xfe, 0xE6 }}, + {"set 4, a", "set 4, a", 2, { 0xCB, 0XE7 }}, + {"set 4, a", "set 4, a", 2, { 0xCB, 0XE7 }}, + {"set 4, b", "set 4, b", 2, { 0xCB, 0XE0 }}, + {"set 4, b", "set 4, b", 2, { 0xCB, 0XE0 }}, + {"set 4, c", "set 4, c", 2, { 0xCB, 0XE1 }}, + {"set 4, c", "set 4, c", 2, { 0xCB, 0XE1 }}, + {"set 4, d", "set 4, d", 2, { 0xCB, 0XE2 }}, + {"set 4, d", "set 4, d", 2, { 0xCB, 0XE2 }}, + {"set 4, e", "set 4, e", 2, { 0xCB, 0XE3 }}, + {"set 4, e", "set 4, e", 2, { 0xCB, 0XE3 }}, + {"set 4, h", "set 4, h", 2, { 0xCB, 0XE4 }}, + {"set 4, h", "set 4, h", 2, { 0xCB, 0XE4 }}, + {"set 4, l", "set 4, l", 2, { 0xCB, 0XE5 }}, + {"set 4, l", "set 4, l", 2, { 0xCB, 0XE5 }}, + + {"set 5, (hl)", "set 5, (hl)", 2, { 0xCB, 0xEE }}, + {"set 5, ( hl )", "set 5, (hl)", 2, { 0xCB, 0xEE }}, + {"set 5, (ix + 127)", "set 5, (ix+127)", 4, { 0xDD, 0xCB, 0x7f, 0xEE }}, + {"set 5, ( ix + 127 )", "set 5, (ix+127)", 4, { 0xDD, 0xCB, 0x7f, 0xEE }}, + {"set 5, (iy + 127)", "set 5, (iy+127)", 4, { 0xFD, 0xCB, 0x7f, 0xEE }}, + {"set 5, ( iy + 127 )", "set 5, (iy+127)", 4, { 0xFD, 0xCB, 0x7f, 0xEE }}, + {"set 5, (iy + -128)", "set 5, (iy+-128)", 4, { 0xFD, 0xCB, 0x80, 0xEE }}, + {"set 5, (ix+$FE )", "set 5, (ix+$FE)", 4, { 0xDD, 0xCB, 0xfe, 0xEE }}, + {"set 5, (iy+$FE )", "set 5, (iy+$FE)", 4, { 0xFD, 0xCB, 0xfe, 0xEE }}, + {"set 5, a", "set 5, a", 2, { 0xCB, 0XEF }}, + {"set 5, a", "set 5, a", 2, { 0xCB, 0XEF }}, + {"set 5, b", "set 5, b", 2, { 0xCB, 0XE8 }}, + {"set 5, b", "set 5, b", 2, { 0xCB, 0XE8 }}, + {"set 5, c", "set 5, c", 2, { 0xCB, 0XE9 }}, + {"set 5, c", "set 5, c", 2, { 0xCB, 0XE9 }}, + {"set 5, d", "set 5, d", 2, { 0xCB, 0XEA }}, + {"set 5, d", "set 5, d", 2, { 0xCB, 0XEA }}, + {"set 5, e", "set 5, e", 2, { 0xCB, 0XEB }}, + {"set 5, e", "set 5, e", 2, { 0xCB, 0XEB }}, + {"set 5, h", "set 5, h", 2, { 0xCB, 0XEC }}, + {"set 5, h", "set 5, h", 2, { 0xCB, 0XEC }}, + {"set 5, l", "set 5, l", 2, { 0xCB, 0XED }}, + {"set 5, l", "set 5, l", 2, { 0xCB, 0XED }}, + + {"set 6, (hl)", "set 6, (hl)", 2, { 0xCB, 0xF6 }}, + {"set 6, ( hl )", "set 6, (hl)", 2, { 0xCB, 0xF6 }}, + {"set 6, (ix + 127)", "set 6, (ix+127)", 4, { 0xDD, 0xCB, 0x7f, 0xF6 }}, + {"set 6, ( ix + 127 )", "set 6, (ix+127)", 4, { 0xDD, 0xCB, 0x7f, 0xF6 }}, + {"set 6, (iy + 127)", "set 6, (iy+127)", 4, { 0xFD, 0xCB, 0x7f, 0xF6 }}, + {"set 6, ( iy + 127 )", "set 6, (iy+127)", 4, { 0xFD, 0xCB, 0x7f, 0xF6 }}, + {"set 6, (iy + -128)", "set 6, (iy+-128)", 4, { 0xFD, 0xCB, 0x80, 0xF6 }}, + {"set 6, (ix+$FE )", "set 6, (ix+$FE)", 4, { 0xDD, 0xCB, 0xfe, 0xF6 }}, + {"set 6, (iy+$FE )", "set 6, (iy+$FE)", 4, { 0xFD, 0xCB, 0xfe, 0xF6 }}, + {"set 6, a", "set 6, a", 2, { 0xCB, 0XF7 }}, + {"set 6, a", "set 6, a", 2, { 0xCB, 0XF7 }}, + {"set 6, b", "set 6, b", 2, { 0xCB, 0XF0 }}, + {"set 6, b", "set 6, b", 2, { 0xCB, 0XF0 }}, + {"set 6, c", "set 6, c", 2, { 0xCB, 0XF1 }}, + {"set 6, c", "set 6, c", 2, { 0xCB, 0XF1 }}, + {"set 6, d", "set 6, d", 2, { 0xCB, 0XF2 }}, + {"set 6, d", "set 6, d", 2, { 0xCB, 0XF2 }}, + {"set 6, e", "set 6, e", 2, { 0xCB, 0XF3 }}, + {"set 6, e", "set 6, e", 2, { 0xCB, 0XF3 }}, + {"set 6, h", "set 6, h", 2, { 0xCB, 0XF4 }}, + {"set 6, h", "set 6, h", 2, { 0xCB, 0XF4 }}, + {"set 6, l", "set 6, l", 2, { 0xCB, 0XF5 }}, + {"set 6, l", "set 6, l", 2, { 0xCB, 0XF5 }}, + + {"set 7, (hl)", "set 7, (hl)", 2, { 0xCB, 0xFE }}, + {"set 7, ( hl )", "set 7, (hl)", 2, { 0xCB, 0xFE }}, + {"set 7, (ix + 127)", "set 7, (ix+127)", 4, { 0xDD, 0xCB, 0x7f, 0xFE }}, + {"set 7, ( ix + 127 )", "set 7, (ix+127)", 4, { 0xDD, 0xCB, 0x7f, 0xFE }}, + {"set 7, (iy + 127)", "set 7, (iy+127)", 4, { 0xFD, 0xCB, 0x7f, 0xFE }}, + {"set 7, ( iy + 127 )", "set 7, (iy+127)", 4, { 0xFD, 0xCB, 0x7f, 0xFE }}, + {"set 7, (iy + -128)", "set 7, (iy+-128)", 4, { 0xFD, 0xCB, 0x80, 0xFE }}, + {"set 7, (ix+$FE )", "set 7, (ix+$FE)", 4, { 0xDD, 0xCB, 0xfe, 0xFE }}, + {"set 7, (iy+$FE )", "set 7, (iy+$FE)", 4, { 0xFD, 0xCB, 0xfe, 0xFE }}, + {"set 7, a", "set 7, a", 2, { 0xCB, 0XFF }}, + {"set 7, a", "set 7, a", 2, { 0xCB, 0XFF }}, + {"set 7, b", "set 7, b", 2, { 0xCB, 0XF8 }}, + {"set 7, b", "set 7, b", 2, { 0xCB, 0XF8 }}, + {"set 7, c", "set 7, c", 2, { 0xCB, 0XF9 }}, + {"set 7, c", "set 7, c", 2, { 0xCB, 0XF9 }}, + {"set 7, d", "set 7, d", 2, { 0xCB, 0XFA }}, + {"set 7, d", "set 7, d", 2, { 0xCB, 0XFA }}, + {"set 7, e", "set 7, e", 2, { 0xCB, 0XFB }}, + {"set 7, e", "set 7, e", 2, { 0xCB, 0XFB }}, + {"set 7, h", "set 7, h", 2, { 0xCB, 0XFC }}, + {"set 7, h", "set 7, h", 2, { 0xCB, 0XFC }}, + {"set 7, l", "set 7, l", 2, { 0xCB, 0XFD }}, + {"set 7, l", "set 7, l", 2, { 0xCB, 0XFD }}, + + {"sla (hl)", "sla (hl)", 2, { 0xCB, 0x26 }}, + {"sla ( hl )", "sla (hl)", 2, { 0xCB, 0x26 }}, + {"sla (ix+$FF)", "sla (ix+$FF)", 4, { 0xDD, 0xCB, 0xff, 0x26 }}, + {"sla ( ix + $FF )", "sla (ix+$FF)", 4, { 0xDD, 0xCB, 0xff, 0x26 }}, + {"sla (iy+-128)", "sla (iy+-128)", 4, { 0xFD, 0xCB, 0x80, 0x26 }}, + {"sla ( iy + -128 )", "sla (iy+-128)", 4, { 0xFD, 0xCB, 0x80, 0x26 }}, + {"sla (iy+17)", "sla (iy+17)", 4, { 0xFD, 0xCB, 0x11, 0x26 }}, + {"sla ( iy + 17 )", "sla (iy+17)", 4, { 0xFD, 0xCB, 0x11, 0x26 }}, + {"sla a", "sla a", 2, { 0xCB, 0x27 }}, + {"sla a", "sla a", 2, { 0xCB, 0x27 }}, + {"sla b", "sla b", 2, { 0xCB, 0x20 }}, + {"sla b", "sla b", 2, { 0xCB, 0x20 }}, + {"sla c", "sla c", 2, { 0xCB, 0x21 }}, + {"sla c", "sla c", 2, { 0xCB, 0x21 }}, + {"sla d", "sla d", 2, { 0xCB, 0x22 }}, + {"sla d", "sla d", 2, { 0xCB, 0x22 }}, + {"sla e", "sla e", 2, { 0xCB, 0x23 }}, + {"sla e", "sla e", 2, { 0xCB, 0x23 }}, + {"sla h", "sla h", 2, { 0xCB, 0x24 }}, + {"sla h", "sla h", 2, { 0xCB, 0x24 }}, + {"sla l", "sla l", 2, { 0xCB, 0x25 }}, + {"sla l", "sla l", 2, { 0xCB, 0x25 }}, + + {"sra (hl)", "sra (hl)", 2, { 0xCB, 0x2E }}, + {"sra ( hl )", "sra (hl)", 2, { 0xCB, 0x2E }}, + {"sra (ix+$FF)", "sra (ix+$FF)", 4, { 0xDD, 0xCB, 0xff, 0x2E }}, + {"sra ( ix + $FF )", "sra (ix+$FF)", 4, { 0xDD, 0xCB, 0xff, 0x2E }}, + {"sra (iy+-128)", "sra (iy+-128)", 4, { 0xFD, 0xCB, 0x80, 0x2E }}, + {"sra ( iy + -128 )", "sra (iy+-128)", 4, { 0xFD, 0xCB, 0x80, 0x2E }}, + {"sra (iy+33)", "sra (iy+33)", 4, { 0xFD, 0xCB, 0x21, 0x2E }}, + {"sra ( iy + 33 )", "sra (iy+33)", 4, { 0xFD, 0xCB, 0x21, 0x2E }}, + {"sra a", "sra a", 2, { 0xCB, 0x2F }}, + {"sra a", "sra a", 2, { 0xCB, 0x2F }}, + {"sra b", "sra b", 2, { 0xCB, 0x28 }}, + {"sra b", "sra b", 2, { 0xCB, 0x28 }}, + {"sra c", "sra c", 2, { 0xCB, 0x29 }}, + {"sra c", "sra c", 2, { 0xCB, 0x29 }}, + {"sra d", "sra d", 2, { 0xCB, 0x2A }}, + {"sra d", "sra d", 2, { 0xCB, 0x2A }}, + {"sra e", "sra e", 2, { 0xCB, 0x2B }}, + {"sra e", "sra e", 2, { 0xCB, 0x2B }}, + {"sra h", "sra h", 2, { 0xCB, 0x2C }}, + {"sra h", "sra h", 2, { 0xCB, 0x2C }}, + {"sra l", "sra l", 2, { 0xCB, 0x2D }}, + {"sra l", "sra l", 2, { 0xCB, 0x2D }}, + + {"srl (hl)", "srl (hl)", 2, { 0xCB, 0x3E }}, + {"srl ( hl )", "srl (hl)", 2, { 0xCB, 0x3E }}, + {"srl (ix+$ff)", "srl (ix+$FF)", 4, { 0xDD, 0xCB, 0xff, 0x3E }}, + {"srl ( ix + $ff )", "srl (ix+$FF)", 4, { 0xDD, 0xCB, 0xff, 0x3E }}, + {"srl (iy+-128)", "srl (iy+-128)", 4, { 0xFD, 0xCB, 0x80, 0x3E }}, + {"srl ( iy + -128 )", "srl (iy+-128)", 4, { 0xFD, 0xCB, 0x80, 0x3E }}, + {"srl (iy+48)", "srl (iy+48)", 4, { 0xFD, 0xCB, 0x30, 0x3E }}, + {"srl ( iy + 48 )", "srl (iy+48)", 4, { 0xFD, 0xCB, 0x30, 0x3E }}, + {"srl a", "srl a", 2, { 0xCB, 0x3F }}, + {"srl a", "srl a", 2, { 0xCB, 0x3F }}, + {"srl b", "srl b", 2, { 0xCB, 0x38 }}, + {"srl b", "srl b", 2, { 0xCB, 0x38 }}, + {"srl c", "srl c", 2, { 0xCB, 0x39 }}, + {"srl c", "srl c", 2, { 0xCB, 0x39 }}, + {"srl d", "srl d", 2, { 0xCB, 0x3A }}, + {"srl d", "srl d", 2, { 0xCB, 0x3A }}, + {"srl e", "srl e", 2, { 0xCB, 0x3B }}, + {"srl e", "srl e", 2, { 0xCB, 0x3B }}, + {"srl h", "srl h", 2, { 0xCB, 0x3C }}, + {"srl h", "srl h", 2, { 0xCB, 0x3C }}, + {"srl l", "srl l", 2, { 0xCB, 0x3D }}, + {"srl l", "srl l", 2, { 0xCB, 0x3D }}, + + {"sub (hl)", "sub (hl)", 1, { 0x96 }}, + {"sub ( hl)", "sub (hl)", 1, { 0x96 }}, + {"sub (ix+15)", "sub (ix+15)", 3, { 0xdd, 0x96, 0xf}}, + {"sub ( ix + 15 )", "sub (ix+15)", 3, { 0xdd, 0x96, 0xf}}, + {"sub (iy+15)", "sub (iy+15)", 3, { 0xfd, 0x96, 0xf}}, + {"sub ( iy + 15 )", "sub (iy+15)", 3, { 0xfd, 0x96, 0xf}}, + {"sub (iy+0)", "sub (iy+0)", 3, { 0xfd, 0x96, 0x0}}, + {"sub ( iy + 0)", "sub (iy+0)", 3, { 0xfd, 0x96, 0x0}}, + {"sub a", "sub a", 1, { 0x97 }}, + {"sub a", "sub a", 1, { 0x97 }}, + {"sub b", "sub b", 1, { 0x90 }}, + {"sub b", "sub b", 1, { 0x90 }}, + {"sub c", "sub c", 1, { 0x91 }}, + {"sub c", "sub c", 1, { 0x91 }}, + {"sub d", "sub d", 1, { 0x92 }}, + {"sub d", "sub d", 1, { 0x92 }}, + {"sub e", "sub e", 1, { 0x93 }}, + {"sub e", "sub e", 1, { 0x93 }}, + {"sub h", "sub h", 1, { 0x94 }}, + {"sub h", "sub h", 1, { 0x94 }}, + {"sub l", "sub l", 1, { 0x95 }}, + {"sub l", "sub l", 1, { 0x95 }}, + {"sub 40", "sub 40", 2, { 0xD6, 0x28 }}, + {"sub 40", "sub 40", 2, { 0xD6, 0x28 }}, + {"sub 255", "sub 255", 2, { 0xD6, 0xFF }}, + {"sub 255", "sub 255", 2, { 0xD6, 0xFF }}, + {"sub 'A'", "sub 'A'", 2, { 0xD6, 0x41 }}, + {"sub 'A'", "sub 'A'", 2, { 0xD6, 0x41 }}, + + {"xor (hl)", "xor (hl)", 1, { 0xAE }}, + {"xor ( hl )", "xor (hl)", 1, { 0xAE }}, + {"xor (ix+$FF)", "xor (ix+$FF)", 3, { 0xDD, 0xAE, 0xff }}, + {"xor ( ix + $FF )", "xor (ix+$FF)", 3, { 0xDD, 0xAE, 0xff }}, + {"xor (iy + -128)", "xor (iy+-128)", 3, { 0xFD, 0xAE, 0x80 }}, + {"xor ( iy + -128 )", "xor (iy+-128)", 3, { 0xFD, 0xAE, 0x80 }}, + {"xor (iy +100)", "xor (iy+100)", 3, { 0xFD, 0xAE, 0x64 }}, + {"xor ( iy + 100 )", "xor (iy+100)", 3, { 0xFD, 0xAE, 0x64 }}, + {"xor a", "xor a", 1, { 0xAF }}, + {"xor a", "xor a", 1, { 0xAF }}, + {"xor b", "xor b", 1, { 0xA8 }}, + {"xor b", "xor b", 1, { 0xA8 }}, + {"xor c", "xor c", 1, { 0xA9 }}, + {"xor c", "xor c", 1, { 0xA9 }}, + {"xor d", "xor d", 1, { 0xAA }}, + {"xor d", "xor d", 1, { 0xAA }}, + {"xor e", "xor e", 1, { 0xAB }}, + {"xor e", "xor e", 1, { 0xAB }}, + {"xor h", "xor h", 1, { 0xAC }}, + {"xor h", "xor h", 1, { 0xAC }}, + {"xor l", "xor l", 1, { 0xAD }}, + {"xor l", "xor l", 1, { 0xAD }}, + {"xor 127", "xor 127", 2, { 0xEE, 0x7f }}, + {"xor 127", "xor 127", 2, { 0xEE, 0x7f }}, + {"xor 255", "xor 255", 2, { 0xEE, 0xff }}, + {"xor 255", "xor 255", 2, { 0xEE, 0xff }}, + {"xor 'A'", "xor 'A'", 2, { 0xEE, 0x41 }}, + {"xor 'A'", "xor 'A'", 2, { 0xEE, 0x41 }}, + + {"ld a, $DD", "ld a, $DD", 2, {0x3E, 0xDD}}, + + {"db $DD", "db $DD", 1, {0xDD}}, + {"db $DD", "db $DD", 1, {0xDD}}, + {"db -1", "db -1", 1, {0xFF}}, + {"db -1", "db -1", 1, {0xFF}}, + {"db 127", "db 127", 1, {0x7F}}, + {"db 127", "db 127", 1, {0x7F}}, + {"db 255", "db 255", 1, {0xFF}}, + {"db 255", "db 255", 1, {0xFF}}, + {"db 'A'", "db 'A'", 1, {0x41}}, + {"db 'A'", "db 'A'", 1, {0x41}}, + {"db $de,$ad", "db $DE,$AD", 2, {0xDE, 0xAD}}, + {"db $de , $ad", "db $DE,$AD", 2, {0xDE, 0xAD}}, + {"db 1,2,3", "db 1,2,3", 3, {0x1, 0x2, 0x3}}, + {"db 1,2, 3", "db 1,2,3", 3, {0x1, 0x2, 0x3}}, + {"db -1,-2,-3", "db -1,-2,-3", 3, {0xFF, 0xFE, 0xFD}}, + {"db -1,-2, -3", "db -1,-2,-3", 3, {0xFF, 0xFE, 0xFD}}, + {"db 'A','B','C','D'", "db 'A','B','C','D'", 4, + {0x41, 0x42, 0x43, 0x44}}, + {"db 'A','B', 'C','D'", "db 'A','B','C','D'", 4, + {0x41, 0x42, 0x43, 0x44}}, + {"db -1, -2, -3, 4", "db -1,-2,-3,4", + 4, {0xFF, 0xFE, 0xFD, 0x4}}, + {"db -1,-2, -3,4", "db -1,-2,-3,4", + 4, {0xFF, 0xFE, 0xFD, 0x4}}, + {"db 127, -2, -3, 4", "db 127,-2,-3,4", + 4, {0x7F, 0xFE, 0xFD, 0x4}}, + {"db 127,-2, -3,4", "db 127,-2,-3,4", + 4, {0x7F, 0xFE, 0xFD, 0x4}}, + {"db label1-label", "db label1-label", 1, {0x05, 0x00, 0x04, 0x00}}, + {"db label1-verylonglabel", "db label1-verylonglabel", 1, + {0x05, 0x00, 0x04, 0x00}}, + {"db verylonglabel-label1", "db verylonglabel-label1", 1, + {0x00, 0x05, 0x08, 0x00}}, + + {"dw $DEAD", "dw $DEAD", 2, {0xAD, 0xDE}}, + {"dw $DEAD", "dw $DEAD", 2, {0xAD, 0xDE}}, + {"dw -32768", "dw -32768", 2, {0x00, 0x80}}, + {"dw -32768", "dw -32768", 2, {0x00, 0x80}}, + {"dw 32767", "dw 32767", 2, {0xFF, 0x7F}}, + {"dw 32767", "dw 32767", 2, {0xFF, 0x7F}}, + {"dw 65535", "dw 65535", 2, {0xFF, 0xFF}}, + {"dw 65535", "dw 65535", 2, {0xFF, 0xFF}}, + {"dw 65535, 65535", "dw 65535,65535", 4, {0xFF, 0xFF, 0xFF, 0xFF}}, + {"dw 65535 , 65535", "dw 65535,65535", 4, + {0xFF, 0xFF, 0xFF, 0xFF}}, + {"dw 'A'", "dw 'A'", 2, {0x41, 0x0}}, + {"dw 'A'", "dw 'A'", 2, {0x41, 0x0}}, + {"dw 'A','B'", "dw 'A','B'", 4, {0x41, 0x0, 0x42, 0x0}}, + {"dw 'A' ,'B'", "dw 'A','B'", 4, {0x41, 0x0, 0x42, 0x0}}, + {"dw -1,1", "dw -1,1", 4, {0xFF, 0xFF, 0x1, 0x0}}, + {"dw -1 , 1", "dw -1,1", 4, {0xFF, 0xFF, 0x1, 0x0}}, + {"dw $FFff, $FFfe", "dw $FFFF,$FFFE", 4, {0xFF, 0xFF, 0xFE, 0xFF}}, + {"dw $FFff ,$FFfe", "dw $FFFF,$FFFE", 4, + {0xFF, 0xFF, 0xFE, 0xFF}}, + {"dw -32768,-32768", "dw -32768,-32768", 4, + {0x00, 0x80, 0x00, 0x80}}, + {"dw -32768, -32768", "dw -32768,-32768", 4, + {0x00, 0x80, 0x00, 0x80}}, + {"dw label", "dw label", 2, {0x00, 0x00}}, + {"dw label1-label", "dw label1-label", 2, {0x05, 0x00, 0x04, 0x00}}, + {"dw label1-verylonglabel", "dw label1-verylonglabel", 2, + {0x05, 0x00, 0x04, 0x00}}, + {"dw verylonglabel-label1", "dw verylonglabel-label1", 2, + {0x00, 0x05, 0x08, 0x00}}, + + /* + * The sizes here are wrong. Size is calculated in a special way for + * these instructions. + */ + + {"ds 1000, $FF", "ds 1000, $FF", 1, {0xFF, 0xe8, 0x3}}, + {"ds 1000 ,$FF", "ds 1000, $FF", 1, {0xFF, 0xe8, 0x3}}, + {"ds $FF, 100", "ds $FF, 100", 1, {0x64, 0xFF}}, + {"ds $FF , 100", "ds $FF, 100", 1, {0x64, 0xFF}}, + {"ds $100, -1", "ds $100, -1", 1, {0xFF, 0x00, 0x1}}, + {"ds $100 ,-1", "ds $100, -1", 1, {0xFF, 0x00, 0x1}}, + {"ds $100, 'c'", "ds $100, 'c'", 1, {0x63, 0x00, 0x1}}, + {"ds $100 ,'c'", "ds $100, 'c'", 1, {0x63, 0x00, 0x1}}, +}; + +const size_t opcode_tests_count = sizeof(opcode_tests) / sizeof(test_t); + +const format_test_t format_tests[] = { + {"", "", SPECASM_LINE_TYPE_EMPTY}, + {"xor 127", " xor 127", SPECASM_LINE_TYPE_XOR}, + {".thisisshort", ".thisisshort", SPECASM_LINE_TYPE_SL}, + {".thisnotshort", ".thisnotshort", SPECASM_LINE_TYPE_LL}, + {"._123456789a123456789a123456789a", "._123456789a123456789a123456789a", + SPECASM_LINE_TYPE_LL}, + {";_123456789a123456789a123456789a", ";_123456789a123456789a123456789a", + SPECASM_LINE_TYPE_LC}, + {";thisisshort", ";thisisshort", SPECASM_LINE_TYPE_SC}, + {";thisnotshort", ";thisnotshort", SPECASM_LINE_TYPE_LC}, + {"sub 40 ;thisisshort", " sub 40 ;thisisshort", + SPECASM_LINE_TYPE_SUB}, + {"sub 40 ; thisisshor", " sub 40 ; thisisshor", + SPECASM_LINE_TYPE_SUB}, + {"set 1, l ;", " set 1, l ", + SPECASM_LINE_TYPE_SET}, + {"set 1, l ;", " set 1, l ", + SPECASM_LINE_TYPE_SET}, + {"sub 40 ; a ; b", " sub 40 ; a ; b ", + SPECASM_LINE_TYPE_SUB}, + { "db 127 ; a byte", "db 127 ; a byte", + SPECASM_LINE_TYPE_DB}, + { "dw 128 ; a word", "dw 128 ; a word", + SPECASM_LINE_TYPE_DW}, + { "ret ; return", " ret ; return", + SPECASM_LINE_TYPE_RET}, + { "ret c ; return", " ret c ; return", + SPECASM_LINE_TYPE_RET}, + { "'short\" str'", "'short\" str'", SPECASM_LINE_TYPE_STR_SIN_SHORT}, + { "'short\" str' ; hello", "'short\" str' ; hello", + SPECASM_LINE_TYPE_STR_SIN_SHORT}, + { " 'short str'", "'short str'", SPECASM_LINE_TYPE_STR_SIN_SHORT}, + { "'a fairly long string'", "'a fairly long string'", + SPECASM_LINE_TYPE_STR_SIN_LONG}, + { " 'a fairly long string'", "'a fairly long string'", + SPECASM_LINE_TYPE_STR_SIN_LONG}, + { "'unterminated string", "'unterminated string ", + SPECASM_LINE_TYPE_STR_SIN_LONG}, + { "'unterminated string ; hello", "'unterminated string ; hello ", + SPECASM_LINE_TYPE_STR_SIN_LONG}, + { "\"short' str\"", "\"short' str\"", SPECASM_LINE_TYPE_STR_DBL_SHORT}, + { " \"short str\"", "\"short str\"", SPECASM_LINE_TYPE_STR_DBL_SHORT}, + { "\"a fairly long string\"", "\"a fairly long string\"", + SPECASM_LINE_TYPE_STR_DBL_LONG}, + { " \"a fairly long string\"", "\"a fairly long string\"", + SPECASM_LINE_TYPE_STR_DBL_LONG}, + { "\"unterminated string", "\"unterminated string ", + SPECASM_LINE_TYPE_STR_DBL_LONG}, + { "#short@ str#", "#short@ str#", SPECASM_LINE_TYPE_STR_HSH_SHORT}, + { " #short str#", "#short str#", SPECASM_LINE_TYPE_STR_HSH_SHORT}, + { "#a fairly long string#", "#a fairly long string#", + SPECASM_LINE_TYPE_STR_HSH_LONG}, + { " #a fairly long string#", "#a fairly long string#", + SPECASM_LINE_TYPE_STR_HSH_LONG}, + { "#unterminated string", "#unterminated string ", + SPECASM_LINE_TYPE_STR_HSH_LONG}, + { "@short# str@", "@short# str@", SPECASM_LINE_TYPE_STR_AMP_SHORT}, + { " @short str@", "@short str@", SPECASM_LINE_TYPE_STR_AMP_SHORT}, + { "@a fairly long string@", "@a fairly long string@", + SPECASM_LINE_TYPE_STR_AMP_LONG}, + { " @a fairly long string@", "@a fairly long string@", + SPECASM_LINE_TYPE_STR_AMP_LONG}, + { "@unterminated string", "@unterminated string ", + SPECASM_LINE_TYPE_STR_AMP_LONG}, + {"dw label1-label", "dw label1-label", SPECASM_LINE_TYPE_DW_SUB}, + {"dw label1 - label", "dw label1-label", + SPECASM_LINE_TYPE_DW_SUB}, + {"db label1-label", "db label1-label", SPECASM_LINE_TYPE_DB_SUB}, + {"db label1 - label", "db label1-label", + SPECASM_LINE_TYPE_DB_SUB}, + {"ds $10, 10", "ds $10, 10", SPECASM_LINE_TYPE_DS}, + {"- sub.x", "-sub.x", SPECASM_LINE_TYPE_INC_SHORT}, + {"-/a/very/long/path", "-/a/very/long/path", + SPECASM_LINE_TYPE_INC_LONG}, + {"+ sub.x", "+sub.x", SPECASM_LINE_TYPE_INC_SYS_SHORT}, + {"+a/very/long/path", "+a/very/long/path", + SPECASM_LINE_TYPE_INC_SYS_LONG} +}; + +const size_t format_tests_count = sizeof(format_tests) / sizeof(format_test_t); + +const bad_test_t bad_tests[] = { + {"10", SPECASM_ERROR_BAD_MNENOMIC }, + {"markus", SPECASM_ERROR_BAD_MNENOMIC }, + {"addd", SPECASM_ERROR_BAD_MNENOMIC }, + {"-", SPECASM_ERROR_BAD_MNENOMIC }, + {"$", SPECASM_ERROR_BAD_MNENOMIC }, + {"ADD", SPECASM_ERROR_BAD_MNENOMIC }, + + { "adc", SPECASM_ERROR_BAD_REG }, + { "adc a", SPECASM_ERROR_COMMA_EXPECTED }, + { "adc a, ", SPECASM_ERROR_BAD_REG }, + { "adc x, 10", SPECASM_ERROR_BAD_REG }, + { "adc a, 258", SPECASM_ERROR_NUM_TOO_BIG }, + { "adc a, $100", SPECASM_ERROR_NUM_TOO_BIG }, + { "adc a, $gg", SPECASM_ERROR_BAD_REG }, + { "adc a, $$aa", SPECASM_ERROR_BAD_REG }, + { "adc a, hl)", SPECASM_ERROR_BAD_REG }, + { "adc a, (hl", SPECASM_ERROR_BAD_REG }, + { "adc a, (xx)", SPECASM_ERROR_BAD_REG }, + { "adc a, (bc)", SPECASM_ERROR_BAD_REG }, + { "adc a, (a)", SPECASM_ERROR_BAD_REG }, + { "adc bc, 10", SPECASM_ERROR_BAD_REG }, + { "adc a, (ix)", SPECASM_ERROR_BAD_REG }, + { "adc a, (ix+)", SPECASM_ERROR_BAD_NUM }, + { "adc a, (ix+bc)", SPECASM_ERROR_BAD_NUM }, + { "adc a, (ix+-129)", SPECASM_ERROR_NUM_TOO_BIG }, + { "adc a, (ix-129)", SPECASM_ERROR_BAD_REG }, + { "adc a, (iy+bc)", SPECASM_ERROR_BAD_NUM }, + { "adc a, (iy+-129)", SPECASM_ERROR_NUM_TOO_BIG }, + { "adc a, (iy-129)", SPECASM_ERROR_BAD_REG }, + { "adc a, (de+19)", SPECASM_ERROR_BAD_REG }, + { "adc a, (de+'A')", SPECASM_ERROR_BAD_REG }, + { "adc b, 10", SPECASM_ERROR_BAD_REG }, + { "adc c, 10", SPECASM_ERROR_BAD_REG }, + { "adc d, 10", SPECASM_ERROR_BAD_REG }, + { "adc e, 10", SPECASM_ERROR_BAD_REG }, + { "adc h, 10", SPECASM_ERROR_BAD_REG }, + { "adc l, 10", SPECASM_ERROR_BAD_REG }, + { "adc hl, 10", SPECASM_ERROR_BAD_REG }, + { "adc hl, ix", SPECASM_ERROR_BAD_REG }, + { "adc de, hl", SPECASM_ERROR_BAD_REG }, + + { "add a", SPECASM_ERROR_COMMA_EXPECTED }, + { "add a, (bc)", SPECASM_ERROR_BAD_REG }, + { "add a, (h)", SPECASM_ERROR_BAD_REG }, + { "add a, (hl", SPECASM_ERROR_BAD_REG }, + { "add a, hl)", SPECASM_ERROR_BAD_REG }, + { "add b, (hl)", SPECASM_ERROR_BAD_REG }, + { "add a, x", SPECASM_ERROR_BAD_REG }, + { "add a, 329", SPECASM_ERROR_NUM_TOO_BIG }, + { "add 10, b", SPECASM_ERROR_BAD_REG }, + { "add bc, hl", SPECASM_ERROR_BAD_REG }, + { "add hl, $101", SPECASM_ERROR_BAD_REG }, + { "add ix, hl", SPECASM_ERROR_BAD_REG }, + { "add iy, hl", SPECASM_ERROR_BAD_REG }, + { "add sp, hl", SPECASM_ERROR_BAD_REG }, + { "add", SPECASM_ERROR_BAD_REG }, + { "add a, ", SPECASM_ERROR_BAD_REG }, + { "add , 10", SPECASM_ERROR_BAD_REG }, + + {"align 512", SPECASM_ERROR_BAD_NUM }, + {"align 1", SPECASM_ERROR_BAD_NUM }, + {"align 3", SPECASM_ERROR_BAD_NUM }, + {"align -1", SPECASM_ERROR_BAD_NUM }, + {"align 'c'", SPECASM_ERROR_BAD_NUM }, + {"align ", SPECASM_ERROR_BAD_NUM }, + + {"and", SPECASM_ERROR_BAD_REG }, + {"and (bc)", SPECASM_ERROR_BAD_REG }, + {"and (ix)", SPECASM_ERROR_BAD_REG }, + {"and (iy)", SPECASM_ERROR_BAD_REG }, + {"and iy)", SPECASM_ERROR_BAD_REG }, + {"and (iy", SPECASM_ERROR_BAD_REG }, + {"and (ix+128)", SPECASM_ERROR_NUM_TOO_BIG }, + {"and (iy+1028)", SPECASM_ERROR_NUM_TOO_BIG }, + {"and 328", SPECASM_ERROR_NUM_TOO_BIG }, + {"and -129", SPECASM_ERROR_NUM_TOO_BIG }, + {"and $100", SPECASM_ERROR_NUM_TOO_BIG }, + {"and hl", SPECASM_ERROR_BAD_REG }, + {"and f", SPECASM_ERROR_BAD_REG }, + + {"bit 'A', (hl)", SPECASM_ERROR_BAD_NUM }, + {"bit 9, (hl)", SPECASM_ERROR_BAD_NUM }, + {"bit $ff, (hl)", SPECASM_ERROR_BAD_NUM }, + {"bit 0, ix + 127)", SPECASM_ERROR_BAD_REG }, + {"bit 0, (ix + 127", SPECASM_ERROR_BAD_REG }, + {"bit 0, (ix)", SPECASM_ERROR_BAD_REG }, + {"bit 0, (ix+)", SPECASM_ERROR_BAD_NUM }, + {"bit 0, (ix+$100)", SPECASM_ERROR_NUM_TOO_BIG }, + {"bit 0, (ix-100)", SPECASM_ERROR_BAD_REG }, + {"bit 0, bc", SPECASM_ERROR_BAD_REG }, + {"bit 0, gg", SPECASM_ERROR_BAD_REG }, + {"bit 0, $bc", SPECASM_ERROR_BAD_REG }, + {"bit a, a", SPECASM_ERROR_BAD_NUM }, + {"bit 0", SPECASM_ERROR_COMMA_EXPECTED }, + + {"call", SPECASM_ERROR_BAD_LABEL }, + {"call nzc, label", SPECASM_ERROR_CONDITION_CODE }, + {"call nzc , label", SPECASM_ERROR_CONDITION_CODE }, + {"call poe, label", SPECASM_ERROR_CONDITION_CODE }, + {"call poe , label", SPECASM_ERROR_CONDITION_CODE }, + {"call pc , label", SPECASM_ERROR_CONDITION_CODE }, + {"call nz", SPECASM_ERROR_CONDITION_CODE }, + {"call nz ", SPECASM_ERROR_COMMA_EXPECTED }, + {"call nz,", SPECASM_ERROR_BAD_LABEL }, + {"call nz ,", SPECASM_ERROR_BAD_LABEL }, + {"call no ,", SPECASM_ERROR_CONDITION_CODE }, + {"call c, bc", SPECASM_ERROR_BAD_LABEL }, + {"call bc", SPECASM_ERROR_BAD_LABEL }, + {"call -1", SPECASM_ERROR_BAD_LABEL }, + + {"cp hl)", SPECASM_ERROR_BAD_REG }, + {"cp (hl", SPECASM_ERROR_BAD_REG }, + {"cp (bc)", SPECASM_ERROR_BAD_REG }, + {"cp (ix)", SPECASM_ERROR_BAD_REG }, + {"cp (ix+)", SPECASM_ERROR_BAD_NUM }, + {"cp (ix+300)", SPECASM_ERROR_NUM_TOO_BIG }, + {"cp 300", SPECASM_ERROR_NUM_TOO_BIG }, + {"cp bc", SPECASM_ERROR_BAD_REG }, + + {"dec (bc)", SPECASM_ERROR_BAD_REG }, + {"dec hl)", SPECASM_ERROR_BAD_REG }, + {"dec (hl", SPECASM_ERROR_BAD_REG }, + {"dec (hl, 10)", SPECASM_ERROR_BAD_REG }, + {"dec (ix)", SPECASM_ERROR_BAD_REG }, + {"dec (ix+)", SPECASM_ERROR_BAD_NUM }, + {"dec (ix+1000)", SPECASM_ERROR_NUM_TOO_BIG }, + {"dec af", SPECASM_ERROR_BAD_REG }, + {"dec 10", SPECASM_ERROR_BAD_REG }, + + {"djnz", SPECASM_ERROR_BAD_LABEL }, + {"djnz bc", SPECASM_ERROR_BAD_LABEL }, + + {"ex af, af", SPECASM_ERROR_BAD_REG }, + {"ex (bc), ix", SPECASM_ERROR_BAD_REG }, + {"ex (sp)", SPECASM_ERROR_COMMA_EXPECTED }, + {"ex (sp),", SPECASM_ERROR_BAD_REG }, + {"ex (sp),10", SPECASM_ERROR_BAD_REG }, + {"ex (sp),label", SPECASM_ERROR_BAD_REG }, + {"ex (sp), bc", SPECASM_ERROR_BAD_REG }, + {"ex bc, hl", SPECASM_ERROR_BAD_REG }, + {"ex 10, hl", SPECASM_ERROR_BAD_REG }, + + {"im", SPECASM_ERROR_BAD_NUM }, + {"im , ", SPECASM_ERROR_BAD_NUM }, + {"im 3 ", SPECASM_ERROR_BAD_NUM }, + {"im 255 ", SPECASM_ERROR_BAD_NUM }, + {"im 'A'", SPECASM_ERROR_BAD_NUM }, + + {"in", SPECASM_ERROR_BAD_REG }, + {"in ,", SPECASM_ERROR_BAD_REG }, + {"in a", SPECASM_ERROR_COMMA_EXPECTED }, + {"in a,", SPECASM_ERROR_BAD_NUM }, + {"in a, (a)", SPECASM_ERROR_BAD_REG }, + {"in a, c)", SPECASM_ERROR_BAD_NUM }, + {"in a, (c", SPECASM_ERROR_BAD_NUM }, + {"in a, (1000)", SPECASM_ERROR_NUM_TOO_BIG }, + {"in ix, (100)", SPECASM_ERROR_BAD_REG }, + {"in a, (-100)", SPECASM_ERROR_NUM_NEG }, + {"in b, (100)", SPECASM_ERROR_BAD_REG }, + {"in b, ('A')", SPECASM_ERROR_BAD_REG }, + + {"inc (bc)", SPECASM_ERROR_BAD_REG }, + {"inc hl)", SPECASM_ERROR_BAD_REG }, + {"inc (hl", SPECASM_ERROR_BAD_REG }, + {"inc (hl, 10)", SPECASM_ERROR_BAD_REG }, + {"inc (ix)", SPECASM_ERROR_BAD_REG }, + {"inc (ix+)", SPECASM_ERROR_BAD_NUM }, + {"inc (ix+1000)", SPECASM_ERROR_NUM_TOO_BIG }, + {"inc af", SPECASM_ERROR_BAD_REG }, + {"inc 10", SPECASM_ERROR_BAD_REG }, + + {"jp", SPECASM_ERROR_BAD_LABEL }, + {"jp nzc, label", SPECASM_ERROR_CONDITION_CODE }, + {"jp nz", SPECASM_ERROR_CONDITION_CODE }, + {"jp nz ", SPECASM_ERROR_COMMA_EXPECTED }, + {"jp nz,", SPECASM_ERROR_BAD_LABEL }, + {"jp 100", SPECASM_ERROR_BAD_LABEL }, + {"jp c, 100", SPECASM_ERROR_BAD_LABEL }, + {"jp c, bc", SPECASM_ERROR_BAD_LABEL }, + {"jp bc", SPECASM_ERROR_BAD_REG }, + {"jp (bc)", SPECASM_ERROR_BAD_REG }, + + {"jr", SPECASM_ERROR_BAD_LABEL }, + {"jr c, ", SPECASM_ERROR_BAD_LABEL }, + {"jr 10", SPECASM_ERROR_BAD_LABEL }, + {"jr po, label", SPECASM_ERROR_CONDITION_CODE }, + {"jr pe, label", SPECASM_ERROR_CONDITION_CODE }, + {"jr p, label", SPECASM_ERROR_CONDITION_CODE }, + {"jr m, label", SPECASM_ERROR_CONDITION_CODE }, + + {"ld", SPECASM_ERROR_BAD_REG }, + {"ld (a), a", SPECASM_ERROR_BAD_REG }, + {"ld (bc, a", SPECASM_ERROR_BAD_REG }, + {"ld bc), a", SPECASM_ERROR_BAD_REG }, + {"ld (bc), hl", SPECASM_ERROR_BAD_REG }, + {"ld (bc), b", SPECASM_ERROR_BAD_REG }, + {"ld (bc), 10", SPECASM_ERROR_BAD_REG }, + {"ld (de), b", SPECASM_ERROR_BAD_REG }, + {"ld (de), 10", SPECASM_ERROR_BAD_REG }, + {"ld (hl), 256", SPECASM_ERROR_NUM_TOO_BIG }, + {"ld (hl), bc", SPECASM_ERROR_BAD_REG }, + {"ld (ix+1), bc", SPECASM_ERROR_BAD_REG }, + {"ld (ix), bc", SPECASM_ERROR_BAD_REG }, + {"ld (ix+), bc", SPECASM_ERROR_BAD_NUM }, + {"ld (ix+129), bc", SPECASM_ERROR_NUM_TOO_BIG }, + {"ld (iy+1), bc", SPECASM_ERROR_BAD_REG }, + {"ld (iy), bc", SPECASM_ERROR_BAD_REG }, + {"ld (iy+), bc", SPECASM_ERROR_BAD_NUM }, + {"ld (iy+129), bc", SPECASM_ERROR_NUM_TOO_BIG }, + {"ld (iy+$100), bc", SPECASM_ERROR_NUM_TOO_BIG }, + {"ld (iy+-129), bc", SPECASM_ERROR_NUM_TOO_BIG }, + {"ld ($100)", SPECASM_ERROR_COMMA_EXPECTED }, + {"ld ($100), 10", SPECASM_ERROR_BAD_REG }, + {"ld ($100), b", SPECASM_ERROR_BAD_REG }, + {"ld ($10000), bc", SPECASM_ERROR_NUM_TOO_BIG }, + {"ld (-1), bc", SPECASM_ERROR_NUM_NEG }, + {"ld a", SPECASM_ERROR_COMMA_EXPECTED }, + {"ld a,", SPECASM_ERROR_BAD_REG }, + {"ld a, (ix)", SPECASM_ERROR_BAD_REG }, + {"ld a, (ix+128)", SPECASM_ERROR_NUM_TOO_BIG }, + {"ld a, ($10000)", SPECASM_ERROR_NUM_TOO_BIG }, + {"ld a, bc", SPECASM_ERROR_BAD_REG }, + {"ld a, $100", SPECASM_ERROR_NUM_TOO_BIG }, + {"ld a, label", SPECASM_ERROR_BAD_LABEL }, + {"ld 1, 1", SPECASM_ERROR_BAD_REG }, + {"ld bc, (label", SPECASM_ERROR_BAD_REG }, + {"ld bc, ($10000)", SPECASM_ERROR_NUM_TOO_BIG }, + {"ld bc, ($100", SPECASM_ERROR_BAD_REG }, + {"ld bc, (-1)", SPECASM_ERROR_NUM_NEG }, + {"ld bc, de", SPECASM_ERROR_BAD_REG }, + {"ld de, ($10000)", SPECASM_ERROR_NUM_TOO_BIG }, + {"ld de, ($100", SPECASM_ERROR_BAD_REG }, + {"ld de, hl", SPECASM_ERROR_BAD_REG }, + {"ld de, (-1)", SPECASM_ERROR_NUM_NEG }, + {"ld hl, $10000", SPECASM_ERROR_NUM_TOO_BIG }, + {"ld hl, -32769", SPECASM_ERROR_NUM_TOO_BIG }, + {"ld hl, 65536", SPECASM_ERROR_NUM_TOO_BIG }, + {"ld hl, ($10000)", SPECASM_ERROR_NUM_TOO_BIG }, + {"ld hl, ($100", SPECASM_ERROR_BAD_REG }, + {"ld hl ($100)", SPECASM_ERROR_COMMA_EXPECTED }, + {"ld hl, (-1)", SPECASM_ERROR_NUM_NEG }, + {"ld hl, de", SPECASM_ERROR_BAD_REG }, + {"ld i, b", SPECASM_ERROR_BAD_REG }, + {"ld b, i", SPECASM_ERROR_BAD_REG }, + {"ld bc, a", SPECASM_ERROR_BAD_REG }, + {"ld i, 10", SPECASM_ERROR_BAD_REG }, + {"ld ix, ($10000)", SPECASM_ERROR_NUM_TOO_BIG }, + {"ld ix, ($100", SPECASM_ERROR_BAD_REG }, + {"ld ix ($100)", SPECASM_ERROR_COMMA_EXPECTED }, + {"ld ix, (-1)", SPECASM_ERROR_NUM_NEG }, + {"ld sp, ($10000)", SPECASM_ERROR_NUM_TOO_BIG }, + {"ld sp, ($100", SPECASM_ERROR_BAD_REG }, + {"ld sp ($100)", SPECASM_ERROR_COMMA_EXPECTED }, + {"ld sp, ('A')", SPECASM_ERROR_BAD_REG }, + {"ld sp, (-1)", SPECASM_ERROR_NUM_NEG }, + {"ld sp, a", SPECASM_ERROR_BAD_REG }, + {"ld ix, label1-label2", SPECASM_ERROR_BAD_LABEL }, + {"ld iy, label1-label2", SPECASM_ERROR_BAD_LABEL }, + + {"or", SPECASM_ERROR_BAD_REG }, + {"or (bc)", SPECASM_ERROR_BAD_REG }, + {"or (ix)", SPECASM_ERROR_BAD_REG }, + {"or (iy)", SPECASM_ERROR_BAD_REG }, + {"or iy)", SPECASM_ERROR_BAD_REG }, + {"or (iy", SPECASM_ERROR_BAD_REG }, + {"or (ix+128)", SPECASM_ERROR_NUM_TOO_BIG }, + {"or (iy+1028)", SPECASM_ERROR_NUM_TOO_BIG }, + {"or 256", SPECASM_ERROR_NUM_TOO_BIG }, + {"or -129", SPECASM_ERROR_NUM_TOO_BIG }, + {"or $100", SPECASM_ERROR_NUM_TOO_BIG }, + {"or hl", SPECASM_ERROR_BAD_REG }, + {"or f", SPECASM_ERROR_BAD_REG }, + + {"org", SPECASM_ERROR_BAD_NUM }, + {"org aa", SPECASM_ERROR_BAD_NUM }, + {"org $10000", SPECASM_ERROR_NUM_TOO_BIG }, + {"org 'a'", SPECASM_ERROR_BAD_NUM }, + {"org -1", SPECASM_ERROR_NUM_NEG }, + + {"out", SPECASM_ERROR_BAD_NUM }, + {"out ,", SPECASM_ERROR_BAD_NUM }, + {"out (c)", SPECASM_ERROR_COMMA_EXPECTED }, + {"out (77)", SPECASM_ERROR_COMMA_EXPECTED }, + {"out (77),", SPECASM_ERROR_BAD_REG }, + {"out (c),", SPECASM_ERROR_BAD_REG }, + {"out (c)", SPECASM_ERROR_COMMA_EXPECTED }, + {"out (c),", SPECASM_ERROR_BAD_REG }, + {"out (c), ix", SPECASM_ERROR_BAD_REG }, + {"out (c), xx", SPECASM_ERROR_BAD_REG }, + {"out (d), b", SPECASM_ERROR_BAD_REG }, + {"out 66), a", SPECASM_ERROR_BAD_NUM }, + {"out (66, c", SPECASM_ERROR_BAD_NUM }, + {"out (-7), c", SPECASM_ERROR_NUM_NEG }, + {"out (66), c", SPECASM_ERROR_BAD_REG }, + {"out ('A'), a", SPECASM_ERROR_BAD_NUM }, + {"out (660), c", SPECASM_ERROR_NUM_TOO_BIG }, + {"out (10), xx", SPECASM_ERROR_BAD_REG }, + {"out (ix+10), xx", SPECASM_ERROR_BAD_REG }, + + {"pop", SPECASM_ERROR_BAD_REG }, + {"pop a", SPECASM_ERROR_BAD_REG }, + {"pop b", SPECASM_ERROR_BAD_REG }, + {"pop bb", SPECASM_ERROR_BAD_REG }, + {"pop 10", SPECASM_ERROR_BAD_REG }, + {"pop (bc)", SPECASM_ERROR_BAD_REG }, + {"pop (ix+100)", SPECASM_ERROR_BAD_REG }, + + {"push", SPECASM_ERROR_BAD_REG }, + {"push a", SPECASM_ERROR_BAD_REG }, + {"push b", SPECASM_ERROR_BAD_REG }, + {"push bb", SPECASM_ERROR_BAD_REG }, + {"push 10", SPECASM_ERROR_BAD_REG }, + {"push (bc)", SPECASM_ERROR_BAD_REG }, + {"push (ix+100)", SPECASM_ERROR_BAD_REG }, + + {"res 'A', (hl)", SPECASM_ERROR_BAD_NUM }, + {"res 9, (hl)", SPECASM_ERROR_BAD_NUM }, + {"res $ff, (hl)", SPECASM_ERROR_BAD_NUM }, + {"res 0, ix + 127)", SPECASM_ERROR_BAD_REG }, + {"res 0, (ix + 127", SPECASM_ERROR_BAD_REG }, + {"res 0, (ix)", SPECASM_ERROR_BAD_REG }, + {"res 0, (ix+)", SPECASM_ERROR_BAD_NUM }, + {"res 0, (ix+$100)", SPECASM_ERROR_NUM_TOO_BIG }, + {"res 0, (ix-100)", SPECASM_ERROR_BAD_REG }, + {"res 0, bc", SPECASM_ERROR_BAD_REG }, + {"res 0, gg", SPECASM_ERROR_BAD_REG }, + {"res 0, $bc", SPECASM_ERROR_BAD_REG }, + + {"ret pp", SPECASM_ERROR_CONDITION_CODE }, + {"ret pop", SPECASM_ERROR_CONDITION_CODE }, + + {"rl", SPECASM_ERROR_BAD_REG }, + {"rl,", SPECASM_ERROR_BAD_MNENOMIC }, + {"rl (bc)", SPECASM_ERROR_BAD_REG }, + {"rl (", SPECASM_ERROR_BAD_REG }, + {"rl (hl", SPECASM_ERROR_BAD_REG }, + {"rl hl)", SPECASM_ERROR_BAD_REG }, + {"rl hl", SPECASM_ERROR_BAD_REG }, + {"rl i", SPECASM_ERROR_BAD_REG }, + {"rl (ix+255)", SPECASM_ERROR_NUM_TOO_BIG }, + {"rl (ix 11)", SPECASM_ERROR_BAD_REG }, + {"rl (ix +)", SPECASM_ERROR_BAD_NUM }, + {"rl 10", SPECASM_ERROR_BAD_REG }, + {"rl label", SPECASM_ERROR_BAD_REG }, + + {"rlc", SPECASM_ERROR_BAD_REG }, + {"rlc,", SPECASM_ERROR_BAD_MNENOMIC }, + {"rlc (bc)", SPECASM_ERROR_BAD_REG }, + {"rlc (", SPECASM_ERROR_BAD_REG }, + {"rlc (hl", SPECASM_ERROR_BAD_REG }, + {"rlc hl)", SPECASM_ERROR_BAD_REG }, + {"rlc hl", SPECASM_ERROR_BAD_REG }, + {"rlc i", SPECASM_ERROR_BAD_REG }, + {"rlc (ix+255)", SPECASM_ERROR_NUM_TOO_BIG }, + {"rlc (ix 11)", SPECASM_ERROR_BAD_REG }, + {"rlc (ix +)", SPECASM_ERROR_BAD_NUM }, + {"rlc 10", SPECASM_ERROR_BAD_REG }, + {"rlc label", SPECASM_ERROR_BAD_REG }, + + {"rr", SPECASM_ERROR_BAD_REG }, + {"rr,", SPECASM_ERROR_BAD_MNENOMIC }, + {"rr (bc)", SPECASM_ERROR_BAD_REG }, + {"rr (", SPECASM_ERROR_BAD_REG }, + {"rr (hl", SPECASM_ERROR_BAD_REG }, + {"rr hl)", SPECASM_ERROR_BAD_REG }, + {"rr hl", SPECASM_ERROR_BAD_REG }, + {"rr i", SPECASM_ERROR_BAD_REG }, + {"rr (ix+255)", SPECASM_ERROR_NUM_TOO_BIG }, + {"rr (ix 11)", SPECASM_ERROR_BAD_REG }, + {"rr (ix +)", SPECASM_ERROR_BAD_NUM }, + {"rr 10", SPECASM_ERROR_BAD_REG }, + {"rr label", SPECASM_ERROR_BAD_REG }, + + {"rrc", SPECASM_ERROR_BAD_REG }, + {"rrc,", SPECASM_ERROR_BAD_MNENOMIC }, + {"rrc (bc)", SPECASM_ERROR_BAD_REG }, + {"rrc (", SPECASM_ERROR_BAD_REG }, + {"rrc (hl", SPECASM_ERROR_BAD_REG }, + {"rrc hl)", SPECASM_ERROR_BAD_REG }, + {"rrc hl", SPECASM_ERROR_BAD_REG }, + {"rrc i", SPECASM_ERROR_BAD_REG }, + {"rrc (ix+255)", SPECASM_ERROR_NUM_TOO_BIG }, + {"rrc (ix 11)", SPECASM_ERROR_BAD_REG }, + {"rrc (ix +)", SPECASM_ERROR_BAD_NUM }, + {"rrc 10", SPECASM_ERROR_BAD_REG }, + {"rrc label", SPECASM_ERROR_BAD_REG }, + + {"rst", SPECASM_ERROR_BAD_NUM }, + {"rst 1", SPECASM_ERROR_BAD_NUM }, + {"rst 'A'", SPECASM_ERROR_BAD_NUM }, + {"rst label", SPECASM_ERROR_BAD_NUM }, + {"rst a", SPECASM_ERROR_BAD_NUM }, + + { "sbc", SPECASM_ERROR_BAD_REG }, + { "sbc a", SPECASM_ERROR_COMMA_EXPECTED }, + { "sbc a, ", SPECASM_ERROR_BAD_REG }, + { "sbc x, 10", SPECASM_ERROR_BAD_REG }, + { "sbc a, 256", SPECASM_ERROR_NUM_TOO_BIG }, + { "sbc a, $100", SPECASM_ERROR_NUM_TOO_BIG }, + { "sbc a, $gg", SPECASM_ERROR_BAD_REG }, + { "sbc a, $$aa", SPECASM_ERROR_BAD_REG }, + { "sbc a, hl)", SPECASM_ERROR_BAD_REG }, + { "sbc a, (hl", SPECASM_ERROR_BAD_REG }, + { "sbc a, (xx)", SPECASM_ERROR_BAD_REG }, + { "sbc a, (bc)", SPECASM_ERROR_BAD_REG }, + { "sbc a, (a)", SPECASM_ERROR_BAD_REG }, + { "sbc bc, 10", SPECASM_ERROR_BAD_REG }, + { "sbc a, (ix)", SPECASM_ERROR_BAD_REG }, + { "sbc a, (ix+)", SPECASM_ERROR_BAD_NUM }, + { "sbc a, (ix+bc)", SPECASM_ERROR_BAD_NUM }, + { "sbc a, (ix+-129)", SPECASM_ERROR_NUM_TOO_BIG }, + { "sbc a, (ix-129)", SPECASM_ERROR_BAD_REG }, + { "sbc a, (iy+bc)", SPECASM_ERROR_BAD_NUM }, + { "sbc a, (iy+-129)", SPECASM_ERROR_NUM_TOO_BIG }, + { "sbc a, (iy-129)", SPECASM_ERROR_BAD_REG }, + { "sbc a, (de+19)", SPECASM_ERROR_BAD_REG }, + { "sbc b, 10", SPECASM_ERROR_BAD_REG }, + { "sbc c, 10", SPECASM_ERROR_BAD_REG }, + { "sbc d, 10", SPECASM_ERROR_BAD_REG }, + { "sbc e, 10", SPECASM_ERROR_BAD_REG }, + { "sbc h, 10", SPECASM_ERROR_BAD_REG }, + { "sbc l, 10", SPECASM_ERROR_BAD_REG }, + { "sbc hl, 10", SPECASM_ERROR_BAD_REG }, + { "sbc hl, ix", SPECASM_ERROR_BAD_REG }, + { "sbc de, hl", SPECASM_ERROR_BAD_REG }, + + {"set 9, (hl)", SPECASM_ERROR_BAD_NUM }, + {"set $ff, (hl)", SPECASM_ERROR_BAD_NUM }, + {"set 0, ix + 127)", SPECASM_ERROR_BAD_REG }, + {"set 0, (ix + 127", SPECASM_ERROR_BAD_REG }, + {"set 0, (ix)", SPECASM_ERROR_BAD_REG }, + {"set 0, (ix+)", SPECASM_ERROR_BAD_NUM }, + {"set 0, (ix+$100)", SPECASM_ERROR_NUM_TOO_BIG }, + {"set 0, (ix-100)", SPECASM_ERROR_BAD_REG }, + {"set 0, bc", SPECASM_ERROR_BAD_REG }, + {"set 0, gg", SPECASM_ERROR_BAD_REG }, + {"set 0, $bc", SPECASM_ERROR_BAD_REG }, + + {"sla", SPECASM_ERROR_BAD_REG }, + {"sla,", SPECASM_ERROR_BAD_MNENOMIC }, + {"sla (bc)", SPECASM_ERROR_BAD_REG }, + {"sla (", SPECASM_ERROR_BAD_REG }, + {"sla (hl", SPECASM_ERROR_BAD_REG }, + {"sla hl)", SPECASM_ERROR_BAD_REG }, + {"sla hl", SPECASM_ERROR_BAD_REG }, + {"sla i", SPECASM_ERROR_BAD_REG }, + {"sla (ix+255)", SPECASM_ERROR_NUM_TOO_BIG }, + {"sla (ix 11)", SPECASM_ERROR_BAD_REG }, + {"sla (ix +)", SPECASM_ERROR_BAD_NUM }, + {"sla 10", SPECASM_ERROR_BAD_REG }, + {"sla label", SPECASM_ERROR_BAD_REG }, + + {"sra", SPECASM_ERROR_BAD_REG }, + {"sra,", SPECASM_ERROR_BAD_MNENOMIC }, + {"sra (bc)", SPECASM_ERROR_BAD_REG }, + {"sra (", SPECASM_ERROR_BAD_REG }, + {"sra (hl", SPECASM_ERROR_BAD_REG }, + {"sra hl)", SPECASM_ERROR_BAD_REG }, + {"sra hl", SPECASM_ERROR_BAD_REG }, + {"sra i", SPECASM_ERROR_BAD_REG }, + {"sra (ix+255)", SPECASM_ERROR_NUM_TOO_BIG }, + {"sra (ix 11)", SPECASM_ERROR_BAD_REG }, + {"sra (ix +)", SPECASM_ERROR_BAD_NUM }, + {"sra 10", SPECASM_ERROR_BAD_REG }, + {"sra label", SPECASM_ERROR_BAD_REG }, + + {"srl", SPECASM_ERROR_BAD_REG }, + {"srl,", SPECASM_ERROR_BAD_MNENOMIC }, + {"srl (bc)", SPECASM_ERROR_BAD_REG }, + {"srl (", SPECASM_ERROR_BAD_REG }, + {"srl (hl", SPECASM_ERROR_BAD_REG }, + {"srl hl)", SPECASM_ERROR_BAD_REG }, + {"srl hl", SPECASM_ERROR_BAD_REG }, + {"srl i", SPECASM_ERROR_BAD_REG }, + {"srl (ix+255)", SPECASM_ERROR_NUM_TOO_BIG }, + {"srl (ix 11)", SPECASM_ERROR_BAD_REG }, + {"srl (ix +)", SPECASM_ERROR_BAD_NUM }, + {"srl 10", SPECASM_ERROR_BAD_REG }, + {"srl label", SPECASM_ERROR_BAD_REG }, + + {"sub", SPECASM_ERROR_BAD_REG }, + {"sub (bc)", SPECASM_ERROR_BAD_REG }, + {"sub (ix)", SPECASM_ERROR_BAD_REG }, + {"sub (iy)", SPECASM_ERROR_BAD_REG }, + {"sub iy)", SPECASM_ERROR_BAD_REG }, + {"sub (iy", SPECASM_ERROR_BAD_REG }, + {"sub (ix+128)", SPECASM_ERROR_NUM_TOO_BIG }, + {"sub (iy+1028)", SPECASM_ERROR_NUM_TOO_BIG }, + {"sub 256", SPECASM_ERROR_NUM_TOO_BIG }, + {"sub -129", SPECASM_ERROR_NUM_TOO_BIG }, + {"sub $100", SPECASM_ERROR_NUM_TOO_BIG }, + {"sub hl", SPECASM_ERROR_BAD_REG }, + {"sub f", SPECASM_ERROR_BAD_REG }, + + {"xor", SPECASM_ERROR_BAD_REG }, + {"xor (bc)", SPECASM_ERROR_BAD_REG }, + {"xor (ix)", SPECASM_ERROR_BAD_REG }, + {"xor (iy)", SPECASM_ERROR_BAD_REG }, + {"xor iy)", SPECASM_ERROR_BAD_REG }, + {"xor (iy", SPECASM_ERROR_BAD_REG }, + {"xor (ix+128)", SPECASM_ERROR_NUM_TOO_BIG }, + {"xor (iy+1028)", SPECASM_ERROR_NUM_TOO_BIG }, + {"xor 256", SPECASM_ERROR_NUM_TOO_BIG }, + {"xor -129", SPECASM_ERROR_NUM_TOO_BIG }, + {"xor $100", SPECASM_ERROR_NUM_TOO_BIG }, + {"xor hl", SPECASM_ERROR_BAD_REG }, + {"xor f", SPECASM_ERROR_BAD_REG }, + + {"db label", SPECASM_ERROR_BAD_LABEL }, + {"db 256", SPECASM_ERROR_NUM_TOO_BIG }, + {"db 255, -1", SPECASM_ERROR_BAD_NUM }, + {"db -1, 255", SPECASM_ERROR_BAD_NUM }, + {"db -1, -2, -3, 128", SPECASM_ERROR_BAD_NUM }, + {"db -1, -2, -3, $20", SPECASM_ERROR_BAD_NUM }, + {"db 'A', 1, 2", SPECASM_ERROR_BAD_NUM }, + {"db 1, 'A', 2", SPECASM_ERROR_BAD_NUM }, + {"db", SPECASM_ERROR_BAD_LABEL }, + {"db $100", SPECASM_ERROR_NUM_TOO_BIG }, + {"dw", SPECASM_ERROR_BAD_LABEL }, + {"dw 65536", SPECASM_ERROR_NUM_TOO_BIG }, + {"dw $10000", SPECASM_ERROR_NUM_TOO_BIG }, + {"dw $1000, -1", SPECASM_ERROR_BAD_NUM }, + {"dw -1, 32768", SPECASM_ERROR_BAD_NUM }, + {"dw 'A', $fff", SPECASM_ERROR_BAD_NUM }, + + {"ds 0, $10", SPECASM_ERROR_BAD_NUM }, + {"ds 1000, $100", SPECASM_ERROR_NUM_TOO_BIG }, + {"ds -1000, 100", SPECASM_ERROR_NUM_NEG }, + {"ds", SPECASM_ERROR_BAD_NUM }, + {"ds 10", SPECASM_ERROR_COMMA_EXPECTED }, + {"ds 10,", SPECASM_ERROR_BAD_NUM }, +}; + +const size_t bad_tests_count = sizeof(bad_tests) / sizeof(bad_test_t); + +/* clang-format on */ diff --git a/src/test_content.h b/src/test_content.h new file mode 100644 index 0000000..2a39a97 --- /dev/null +++ b/src/test_content.h @@ -0,0 +1,55 @@ +/* + * Copyright contributors to Specasm + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. +*/ + +#ifndef TEST_CONTENT_H +#define TEST_CONTENT_H + +#include +#include + +#include "error.h" + +struct test_t_ { + const char *source; + const char *str; + unsigned int size; + uint8_t op_code[4]; +}; +typedef struct test_t_ test_t; + +struct format_test_t_ { + const char *source; + const char *str; + uint8_t type; +}; +typedef struct format_test_t_ format_test_t; + +struct bad_test_t_ { + const char *source; + specasm_error_t error; +}; +typedef struct bad_test_t_ bad_test_t; + +extern const test_t opcode_tests[]; +extern const size_t opcode_tests_count; + +extern const format_test_t format_tests[]; +extern const size_t format_tests_count; + +extern const bad_test_t bad_tests[]; +extern const size_t bad_tests_count; + +#endif diff --git a/src/test_content_zx.c b/src/test_content_zx.c new file mode 100644 index 0000000..ea8c6be --- /dev/null +++ b/src/test_content_zx.c @@ -0,0 +1,158 @@ +/* + * Copyright contributors to Specasm + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. +*/ + +#include +#include +#include + +#include "test_content.h" +#include "test_content_zx.h" + +static int prv_make_opcode_file(const char *path) +{ + size_t i; + char *fname; + int retval = 1; + FILE *f = NULL; + uint16_t count; + const char *name = "test_op"; + + fname = malloc(strlen(path) + strlen(name) + 2); + if (!fname) + return 1; + + sprintf(fname, "%s/%s", path, name); + + f = fopen(fname, "w"); + if (!f) { + fprintf(stderr, "Unable to open %s for writing\n", fname); + goto cleanup; + } + + count = (uint16_t) opcode_tests_count; + if (fwrite(&count, sizeof(count), 1, f) < 1) { + fprintf(stderr, "Failed to write to %s\n", fname); + goto cleanup; + } + + for (i = 0; i < opcode_tests_count; i++) { + const test_t *t = &opcode_tests[i]; + test_zx_t zx_test; + + if (strlen(t->source) > SPECASM_LINE_MAX_LEN) { + fprintf(stderr, "%s too long\n", t->source); + goto cleanup; + } + + if (strlen(t->str) > SPECASM_LINE_MAX_LEN) { + fprintf(stderr, "%s too long\n", t->str); + goto cleanup; + } + + strcpy(zx_test.source, t->source); + strcpy(zx_test.str, t->str); + zx_test.size = (uint8_t) t->size; + memcpy(zx_test.op_code, t->op_code, 4); + + if (fwrite(&zx_test, sizeof(zx_test), 1, f) < 1) { + fprintf(stderr, "Failed to write to %s\n", fname); + goto cleanup; + } + } + + retval = fclose(f); + f = NULL; + +cleanup: + + if (f) + (void) fclose(f); + + free(fname); + + return retval; +} + +static int prv_make_bad_test_file(const char *path) +{ + size_t i; + char *fname; + int retval = 1; + FILE *f = NULL; + uint16_t count; + const char *name = "test_bad"; + + fname = malloc(strlen(path) + strlen(name) + 2); + if (!fname) + return 1; + + sprintf(fname, "%s/%s", path, name); + + f = fopen(fname, "w"); + if (!f) { + fprintf(stderr, "Unable to open %s for writing\n", fname); + goto cleanup; + } + + count = (uint16_t) bad_tests_count; + if (fwrite(&count, sizeof(count), 1, f) < 1) { + fprintf(stderr, "Failed to write to %s\n", fname); + goto cleanup; + } + + for (i = 0; i < bad_tests_count; i++) { + const bad_test_t *t = &bad_tests[i]; + bad_test_zx_t zx_test; + + if (strlen(t->source) > SPECASM_LINE_MAX_LEN) { + fprintf(stderr, "%s too long\n", t->source); + goto cleanup; + } + + strcpy(zx_test.source, t->source); + zx_test.error = t->error; + + if (fwrite(&zx_test, sizeof(zx_test), 1, f) < 1) { + fprintf(stderr, "Failed to write to %s\n", fname); + goto cleanup; + } + } + + retval = fclose(f); + f = NULL; + +cleanup: + + if (f) + (void) fclose(f); + + free(fname); + + return retval; +} + +int main(int argc, char *argv[]) +{ + if (argc != 2) { + fprintf(stderr, "usage: test_content_zx path\n"); + return 1; + } + + int retval = prv_make_opcode_file(argv[1]) | + prv_make_bad_test_file(argv[1]); + + return retval; +} diff --git a/src/test_content_zx.h b/src/test_content_zx.h new file mode 100644 index 0000000..7fa473b --- /dev/null +++ b/src/test_content_zx.h @@ -0,0 +1,39 @@ +/* + * Copyright contributors to Specasm + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. +*/ + +#ifndef TEST_CONTENT_ZX_H +#define TEST_CONTENT_ZX_H + +#include + +#include "line.h" + +struct test_zx_t_ { + char source[SPECASM_LINE_MAX_LEN + 1]; + char str[SPECASM_LINE_MAX_LEN + 1]; + uint8_t size; + uint8_t op_code[4]; +}; +typedef struct test_zx_t_ test_zx_t; + +struct bad_test_zx_t_ { + char source[SPECASM_LINE_MAX_LEN + 1]; + specasm_error_t error; +}; +typedef struct bad_test_zx_t_ bad_test_zx_t; + + +#endif diff --git a/src/unittests.c b/src/unittests.c index 5bd1eaf..69a09f2 100644 --- a/src/unittests.c +++ b/src/unittests.c @@ -21,2803 +21,7 @@ #include "error.h" #include "line.h" #include "state.h" - -struct test_t_ { - const char *source; - const char *str; - unsigned int size; - uint8_t op_code[4]; -}; -typedef struct test_t_ test_t; - -struct format_test_t_ { - const char *source; - const char *str; - uint8_t type; -}; -typedef struct format_test_t_ format_test_t; - -struct bad_test_t_ { - const char *source; - specasm_error_t error; -}; -typedef struct bad_test_t_ bad_test_t; - -/* clang-format off */ - -static const test_t tests[] = { - {"adc a, (hl)", "adc a, (hl)", 1, { 0x8e }}, - {"adc a,( hl)", "adc a, (hl)", 1, { 0x8e }}, - {"adc a, (ix+15)", "adc a, (ix+15)", 3, { 0xdd, 0x8e, 0xf}}, - {"adc a,( ix + 15 )", "adc a, (ix+15)", 3, { 0xdd, 0x8e, 0xf}}, - {"adc a, (iy+15)", "adc a, (iy+15)", 3, { 0xfd, 0x8e, 0xf}}, - {"adc a,( iy + 15 )", "adc a, (iy+15)", 3, { 0xfd, 0x8e, 0xf}}, - {"adc a,( iy + 0)", "adc a, (iy+0)", 3, { 0xfd, 0x8e, 0x0}}, - {"adc a,( iy + 0)", "adc a, (iy+0)", 3, { 0xfd, 0x8e, 0x0}}, - {"adc a,(ix+$1c)", "adc a, (ix+$1c)", 3, { 0xdd, 0x8e, 0x1c}}, - {"adc a,(iy+$1c)", "adc a, (iy+$1c)", 3, { 0xfd, 0x8e, 0x1c}}, - {"adc a,(ix+-2)", "adc a, (ix+-2)", 3, { 0xdd, 0x8e, 0xfe}}, - {"adc a,(iy+-2)", "adc a, (iy+-2)", 3, { 0xfd, 0x8e, 0xfe}}, - {"adc a, a", "adc a, a", 1, { 0x8f }}, - {"adc a,a", "adc a, a", 1, { 0x8f }}, - {"adc a, b", "adc a, b", 1, { 0x88 }}, - {"adc a,b", "adc a, b", 1, { 0x88 }}, - {"adc a, c", "adc a, c", 1, { 0x89 }}, - {"adc a , c", "adc a, c", 1, { 0x89 }}, - {"adc a, d", "adc a, d", 1, { 0x8A }}, - {"adc a , d", "adc a, d", 1, { 0x8A }}, - {"adc a, e", "adc a, e", 1, { 0x8B }}, - {"adc a , e", "adc a, e", 1, { 0x8B }}, - {"adc a, h", "adc a, h", 1, { 0x8C }}, - {"adc a , h", "adc a, h", 1, { 0x8C }}, - {"adc a, l", "adc a, l", 1, { 0x8D }}, - {"adc a , l", "adc a, l", 1, { 0x8D }}, - {"adc a, 40", "adc a, 40", 2, { 0xCE, 0x28 }}, - {"adc a , 40", "adc a, 40", 2, { 0xCE, 0x28 }}, - {"adc a, 'A'", "adc a, 'A'", 2, { 0xCE, 0x41 }}, - {"adc a , 'A'", "adc a, 'A'", 2, { 0xCE, 0x41 }}, - {"adc a, 128", "adc a, 128", 2, { 0xCE, 0x80 }}, - {"adc a , 128", "adc a, 128", 2, { 0xCE, 0x80 }}, - {"adc a, $20", "adc a, $20", 2, { 0xCE, 0x20 }}, - {"adc a, $ff", "adc a, $ff", 2, { 0xCE, 0xff }}, - {"adc a, -1", "adc a, -1", 2, { 0xCE, 0xff }}, - {"adc hl, bc", "adc hl, bc", 2, { 0xed, 0x4a }}, - {"adc hl, bc", "adc hl, bc", 2, { 0xed, 0x4a }}, - {"adc hl, de", "adc hl, de", 2, { 0xed, 0x5a }}, - {"adc hl, de", "adc hl, de", 2, { 0xed, 0x5a }}, - {"adc hl, hl", "adc hl, hl", 2, { 0xed, 0x6a }}, - {"adc hl, hl", "adc hl, hl", 2, { 0xed, 0x6a }}, - {"adc hl, sp", "adc hl, sp", 2, { 0xed, 0x7a }}, - {"adc hl, sp", "adc hl, sp", 2, { 0xed, 0x7a }}, - - {"add a, (hl)", "add a, (hl)", 1, { 0x86 }}, - {"add a, ( hl )", "add a, (hl)", 1, { 0x86 }}, - {"add a, a", "add a, a", 1, { 0x87 }}, - {"add a , a", "add a, a", 1, { 0x87 }}, - {"add a, b", "add a, b", 1, { 0x80 }}, - {"add a , b", "add a, b", 1, { 0x80 }}, - {"add a, c", "add a, c", 1, { 0x81 }}, - {"add a , c", "add a, c", 1, { 0x81 }}, - {"add a, d", "add a, d", 1, { 0x82 }}, - {"add a , d", "add a, d", 1, { 0x82 }}, - {"add a, e", "add a, e", 1, { 0x83 }}, - {"add a , e", "add a, e", 1, { 0x83 }}, - {"add a, h", "add a, h", 1, { 0x84 }}, - {"add a , h", "add a, h", 1, { 0x84 }}, - {"add a, l", "add a, l", 1, { 0x85 }}, - {"add a , l", "add a, l", 1, { 0x85 }}, - {"add a, 32", "add a, 32", 2, { 0xC6, 0x20 }}, - {"add a , 32", "add a, 32", 2, { 0xC6, 0x20 }}, - {"add a, ' '", "add a, ' '", 2, { 0xC6, 0x20 }}, - {"add a , ' '", "add a, ' '", 2, { 0xC6, 0x20 }}, - {"add a, $20", "add a, $20", 2, { 0xC6, 0x20 }}, - {"add a, -128", "add a, -128", 2, { 0xC6, 0x80 }}, - {"add a, 255", "add a, 255", 2, { 0xC6, 0xFF }}, - {"add a , 255", "add a, 255", 2, { 0xC6, 0xFF }}, - {"add hl, bc", "add hl, bc", 1, { 0x09 }}, - {"add hl, bc", "add hl, bc", 1, { 0x09 }}, - {"add hl, de", "add hl, de", 1, { 0x19 }}, - {"add hl, de", "add hl, de", 1, { 0x19 }}, - {"add hl, hl", "add hl, hl", 1, { 0x29 }}, - {"add hl, hl", "add hl, hl", 1, { 0x29 }}, - {"add hl, sp", "add hl, sp", 1, { 0x39 }}, - {"add hl, sp", "add hl, sp", 1, { 0x39 }}, - {"add ix, bc", "add ix, bc", 2, { 0xDD, 0x09 }}, - {"add ix, bc", "add ix, bc", 2, { 0xDD, 0x09 }}, - {"add ix, de", "add ix, de", 2, { 0xDD, 0x19 }}, - {"add ix, de", "add ix, de", 2, { 0xDD, 0x19 }}, - {"add ix, ix", "add ix, ix", 2, { 0xDD, 0x29 }}, - {"add ix, ix", "add ix, ix", 2, { 0xDD, 0x29 }}, - {"add ix, sp", "add ix, sp", 2, { 0xDD, 0x39 }}, - {"add ix, sp", "add ix, sp", 2, { 0xDD, 0x39 }}, - {"add iy, bc", "add iy, bc", 2, { 0xFD, 0x09 }}, - {"add iy, bc", "add iy, bc", 2, { 0xFD, 0x09 }}, - {"add iy, de", "add iy, de", 2, { 0xFD, 0x19 }}, - {"add iy, de", "add iy, de", 2, { 0xFD, 0x19 }}, - {"add iy, iy", "add iy, iy", 2, { 0xFD, 0x29 }}, - {"add iy, iy", "add iy, iy", 2, { 0xFD, 0x29 }}, - {"add iy, sp", "add iy, sp", 2, { 0xFD, 0x39 }}, - {"add iy, sp", "add iy, sp", 2, { 0xFD, 0x39 }}, - - {"align 4", "align 4", 1, {0x2}}, - {"align 16", "align 16", 1, {0x4}}, - {"align $20", "align $20", 1, {0x5}}, - {"align 256", "align 256", 1, {0x8}}, - - {"and (hl)", "and (hl)", 1, { 0xA6 }}, - {"and ( hl )", "and (hl)", 1, { 0xA6 }}, - {"and (ix + 127)", "and (ix+127)", 3, { 0xDD, 0xA6, 0x7f }}, - {"and ( ix + 127 )", "and (ix+127)", 3, { 0xDD, 0xA6, 0x7f }}, - {"and (iy + 127)", "and (iy+127)", 3, { 0xFD, 0xA6, 0x7f }}, - {"and ( iy + 127 )", "and (iy+127)", 3, { 0xFD, 0xA6, 0x7f }}, - {"and (ix+$ff)", "and (ix+$ff)", 3, { 0xDD, 0xA6, 0xff }}, - {"and (iy+$7f)", "and (iy+$7f)", 3, { 0xFD, 0xA6, 0x7f }}, - {"and (ix+127)", "and (ix+127)", 3, { 0xDD, 0xA6, 0x7f }}, - {"and (iy+-128)", "and (iy+-128)", 3, { 0xFD, 0xA6, 0x80 }}, - {"and a", "and a", 1, { 0xA7 }}, - {"and a", "and a", 1, { 0xA7 }}, - {"and b", "and b", 1, { 0xA0 }}, - {"and b", "and b", 1, { 0xA0 }}, - {"and c", "and c", 1, { 0xA1 }}, - {"and c", "and c", 1, { 0xA1 }}, - {"and d", "and d", 1, { 0xA2 }}, - {"and d", "and d", 1, { 0xA2 }}, - {"and e", "and e", 1, { 0xA3 }}, - {"and e", "and e", 1, { 0xA3 }}, - {"and h", "and h", 1, { 0xA4 }}, - {"and h", "and h", 1, { 0xA4 }}, - {"and l", "and l", 1, { 0xA5 }}, - {"and l", "and l", 1, { 0xA5 }}, - {"and 127", "and 127", 2, { 0xE6, 0x7f }}, - {"and 127", "and 127", 2, { 0xE6, 0x7f }}, - {"and $ff", "and $ff", 2, { 0xE6, 0xff }}, - {"and $ff", "and $ff", 2, { 0xE6, 0xff }}, - {"and 255", "and 255", 2, { 0xE6, 0xff }}, - {"and 255", "and 255", 2, { 0xE6, 0xff }}, - {"and -2", "and -2", 2, { 0xE6, 0xfe }}, - {"and -2", "and -2", 2, { 0xE6, 0xfe }}, - {"and 'A'", "and 'A'", 2, { 0xE6, 0x41 }}, - {"and 'A'", "and 'A'", 2, { 0xE6, 0x41 }}, - - {"bit 0, (hl)", "bit 0, (hl)", 2, { 0xCB, 0x46 }}, - {"bit 0 , (hl)", "bit 0, (hl)", 2, { 0xCB, 0x46 }}, - {"bit 0, ( hl )", "bit 0, (hl)", 2, { 0xCB, 0x46 }}, - {"bit 0, (ix + 127)", "bit 0, (ix+127)", 4, { 0xDD, 0xCB, 0x7f, 0x46 }}, - {"bit 0, ( ix + 127 )", "bit 0, (ix+127)", 4, { 0xDD, 0xCB, 0x7f, 0x46 }}, - {"bit 0, (iy + 127)", "bit 0, (iy+127)", 4, { 0xFD, 0xCB, 0x7f, 0x46 }}, - {"bit 0, ( iy + 127 )", "bit 0, (iy+127)", 4, { 0xFD, 0xCB, 0x7f, 0x46 }}, - {"bit 0, (iy + -128)", "bit 0, (iy+-128)", 4, { 0xFD, 0xCB, 0x80, 0x46 }}, - {"bit 0, (ix+$fe )", "bit 0, (ix+$fe)", 4, { 0xDD, 0xCB, 0xfe, 0x46 }}, - {"bit 0, (iy+$fe )", "bit 0, (iy+$fe)", 4, { 0xFD, 0xCB, 0xfe, 0x46 }}, - {"bit 0, a", "bit 0, a", 2, { 0xCB, 0X47 }}, - {"bit 0, a", "bit 0, a", 2, { 0xCB, 0X47 }}, - {"bit 0, b", "bit 0, b", 2, { 0xCB, 0X40 }}, - {"bit 0, b", "bit 0, b", 2, { 0xCB, 0X40 }}, - {"bit 0, c", "bit 0, c", 2, { 0xCB, 0X41 }}, - {"bit 0, c", "bit 0, c", 2, { 0xCB, 0X41 }}, - {"bit 0, d", "bit 0, d", 2, { 0xCB, 0X42 }}, - {"bit 0, d", "bit 0, d", 2, { 0xCB, 0X42 }}, - {"bit 0, e", "bit 0, e", 2, { 0xCB, 0X43 }}, - {"bit 0, e", "bit 0, e", 2, { 0xCB, 0X43 }}, - {"bit 0, h", "bit 0, h", 2, { 0xCB, 0X44 }}, - {"bit 0, h", "bit 0, h", 2, { 0xCB, 0X44 }}, - {"bit 0, l", "bit 0, l", 2, { 0xCB, 0X45 }}, - {"bit 0, l", "bit 0, l", 2, { 0xCB, 0X45 }}, - {"bit $0, l", "bit 0, l", 2, { 0xCB, 0X45 }}, - - {"bit 1, (hl)", "bit 1, (hl)", 2, { 0xCB, 0x4E }}, - {"bit 1, ( hl )", "bit 1, (hl)", 2, { 0xCB, 0x4E }}, - {"bit 1, (ix + 127)", "bit 1, (ix+127)", 4, { 0xDD, 0xCB, 0x7f, 0x4E }}, - {"bit 1, ( ix + 127 )", "bit 1, (ix+127)", 4, { 0xDD, 0xCB, 0x7f, 0x4E }}, - {"bit 1, (iy + 127)", "bit 1, (iy+127)", 4, { 0xFD, 0xCB, 0x7f, 0x4E }}, - {"bit 1, ( iy + 127 )", "bit 1, (iy+127)", 4, { 0xFD, 0xCB, 0x7f, 0x4E }}, - {"bit 1, (iy + -128)", "bit 1, (iy+-128)", 4, { 0xFD, 0xCB, 0x80, 0x4E }}, - {"bit 1, (ix+$fe )", "bit 1, (ix+$fe)", 4, { 0xDD, 0xCB, 0xfe, 0x4E }}, - {"bit 1, (iy+$fe )", "bit 1, (iy+$fe)", 4, { 0xFD, 0xCB, 0xfe, 0x4E }}, - {"bit 1, a", "bit 1, a", 2, { 0xCB, 0X4F }}, - {"bit 1, a", "bit 1, a", 2, { 0xCB, 0X4F }}, - {"bit 1, b", "bit 1, b", 2, { 0xCB, 0X48 }}, - {"bit 1, b", "bit 1, b", 2, { 0xCB, 0X48 }}, - {"bit 1, c", "bit 1, c", 2, { 0xCB, 0X49 }}, - {"bit 1, c", "bit 1, c", 2, { 0xCB, 0X49 }}, - {"bit 1, d", "bit 1, d", 2, { 0xCB, 0X4A }}, - {"bit 1, d", "bit 1, d", 2, { 0xCB, 0X4A }}, - {"bit 1, e", "bit 1, e", 2, { 0xCB, 0X4B }}, - {"bit 1, e", "bit 1, e", 2, { 0xCB, 0X4B }}, - {"bit 1, h", "bit 1, h", 2, { 0xCB, 0X4C }}, - {"bit 1, h", "bit 1, h", 2, { 0xCB, 0X4C }}, - {"bit 1, l", "bit 1, l", 2, { 0xCB, 0X4D }}, - {"bit 1, l", "bit 1, l", 2, { 0xCB, 0X4D }}, - {"bit $1, l", "bit 1, l", 2, { 0xCB, 0X4D }}, - - {"bit 2, (hl)", "bit 2, (hl)", 2, { 0xCB, 0x56 }}, - {"bit 2, ( hl )", "bit 2, (hl)", 2, { 0xCB, 0x56 }}, - {"bit 2, (ix + 127)", "bit 2, (ix+127)", 4, { 0xDD, 0xCB, 0x7f, 0x56 }}, - {"bit 2, ( ix + 127 )", "bit 2, (ix+127)", 4, { 0xDD, 0xCB, 0x7f, 0x56 }}, - {"bit 2, (iy + 127)", "bit 2, (iy+127)", 4, { 0xFD, 0xCB, 0x7f, 0x56 }}, - {"bit 2, ( iy + 127 )", "bit 2, (iy+127)", 4, { 0xFD, 0xCB, 0x7f, 0x56 }}, - {"bit 2, (iy + -128)", "bit 2, (iy+-128)", 4, { 0xFD, 0xCB, 0x80, 0x56 }}, - {"bit 2, (ix+$fe )", "bit 2, (ix+$fe)", 4, { 0xDD, 0xCB, 0xfe, 0x56 }}, - {"bit 2, (iy+$fe )", "bit 2, (iy+$fe)", 4, { 0xFD, 0xCB, 0xfe, 0x56 }}, - {"bit 2, a", "bit 2, a", 2, { 0xCB, 0X57 }}, - {"bit 2, a", "bit 2, a", 2, { 0xCB, 0X57 }}, - {"bit 2, b", "bit 2, b", 2, { 0xCB, 0X50 }}, - {"bit 2, b", "bit 2, b", 2, { 0xCB, 0X50 }}, - {"bit 2, c", "bit 2, c", 2, { 0xCB, 0X51 }}, - {"bit 2, c", "bit 2, c", 2, { 0xCB, 0X51 }}, - {"bit 2, d", "bit 2, d", 2, { 0xCB, 0X52 }}, - {"bit 2, d", "bit 2, d", 2, { 0xCB, 0X52 }}, - {"bit 2, e", "bit 2, e", 2, { 0xCB, 0X53 }}, - {"bit 2, e", "bit 2, e", 2, { 0xCB, 0X53 }}, - {"bit 2, h", "bit 2, h", 2, { 0xCB, 0X54 }}, - {"bit 2, h", "bit 2, h", 2, { 0xCB, 0X54 }}, - {"bit 2, l", "bit 2, l", 2, { 0xCB, 0X55 }}, - {"bit 2, l", "bit 2, l", 2, { 0xCB, 0X55 }}, - - {"bit 3, (hl)", "bit 3, (hl)", 2, { 0xCB, 0x5E }}, - {"bit 3, ( hl )", "bit 3, (hl)", 2, { 0xCB, 0x5E }}, - {"bit 3, (ix + 127)", "bit 3, (ix+127)", 4, { 0xDD, 0xCB, 0x7f, 0x5E }}, - {"bit 3, ( ix + 127 )", "bit 3, (ix+127)", 4, { 0xDD, 0xCB, 0x7f, 0x5E }}, - {"bit 3, (iy + 127)", "bit 3, (iy+127)", 4, { 0xFD, 0xCB, 0x7f, 0x5E }}, - {"bit 3, ( iy + 127 )", "bit 3, (iy+127)", 4, { 0xFD, 0xCB, 0x7f, 0x5E }}, - {"bit 3, (iy + -128)", "bit 3, (iy+-128)", 4, { 0xFD, 0xCB, 0x80, 0x5E }}, - {"bit 3, (ix+$fe )", "bit 3, (ix+$fe)", 4, { 0xDD, 0xCB, 0xfe, 0x5E }}, - {"bit 3, (iy+$fe )", "bit 3, (iy+$fe)", 4, { 0xFD, 0xCB, 0xfe, 0x5E }}, - {"bit 3, a", "bit 3, a", 2, { 0xCB, 0X5F }}, - {"bit 3, a", "bit 3, a", 2, { 0xCB, 0X5F }}, - {"bit 3, b", "bit 3, b", 2, { 0xCB, 0X58 }}, - {"bit 3, b", "bit 3, b", 2, { 0xCB, 0X58 }}, - {"bit 3, c", "bit 3, c", 2, { 0xCB, 0X59 }}, - {"bit 3, c", "bit 3, c", 2, { 0xCB, 0X59 }}, - {"bit 3, d", "bit 3, d", 2, { 0xCB, 0X5A }}, - {"bit 3, d", "bit 3, d", 2, { 0xCB, 0X5A }}, - {"bit 3, e", "bit 3, e", 2, { 0xCB, 0X5B }}, - {"bit 3, e", "bit 3, e", 2, { 0xCB, 0X5B }}, - {"bit 3, h", "bit 3, h", 2, { 0xCB, 0X5C }}, - {"bit 3, h", "bit 3, h", 2, { 0xCB, 0X5C }}, - {"bit 3, l", "bit 3, l", 2, { 0xCB, 0X5D }}, - {"bit 3, l", "bit 3, l", 2, { 0xCB, 0X5D }}, - {"bit $3, l", "bit 3, l", 2, { 0xCB, 0X5D }}, - - {"bit 4, (hl)", "bit 4, (hl)", 2, { 0xCB, 0x66 }}, - {"bit 4, ( hl )", "bit 4, (hl)", 2, { 0xCB, 0x66 }}, - {"bit 4, (ix + 127)", "bit 4, (ix+127)", 4, { 0xDD, 0xCB, 0x7f, 0x66 }}, - {"bit 4, ( ix + 127 )", "bit 4, (ix+127)", 4, { 0xDD, 0xCB, 0x7f, 0x66 }}, - {"bit 4, (iy + 127)", "bit 4, (iy+127)", 4, { 0xFD, 0xCB, 0x7f, 0x66 }}, - {"bit 4, ( iy + 127 )", "bit 4, (iy+127)", 4, { 0xFD, 0xCB, 0x7f, 0x66 }}, - {"bit 4, (iy + -128)", "bit 4, (iy+-128)", 4, { 0xFD, 0xCB, 0x80, 0x66 }}, - {"bit 4, (ix+$fe )", "bit 4, (ix+$fe)", 4, { 0xDD, 0xCB, 0xfe, 0x66 }}, - {"bit 4, (iy+$fe )", "bit 4, (iy+$fe)", 4, { 0xFD, 0xCB, 0xfe, 0x66 }}, - {"bit 4, a", "bit 4, a", 2, { 0xCB, 0X67 }}, - {"bit 4, a", "bit 4, a", 2, { 0xCB, 0X67 }}, - {"bit 4, b", "bit 4, b", 2, { 0xCB, 0X60 }}, - {"bit 4, b", "bit 4, b", 2, { 0xCB, 0X60 }}, - {"bit 4, c", "bit 4, c", 2, { 0xCB, 0X61 }}, - {"bit 4, c", "bit 4, c", 2, { 0xCB, 0X61 }}, - {"bit 4, d", "bit 4, d", 2, { 0xCB, 0X62 }}, - {"bit 4, d", "bit 4, d", 2, { 0xCB, 0X62 }}, - {"bit 4, e", "bit 4, e", 2, { 0xCB, 0X63 }}, - {"bit 4, e", "bit 4, e", 2, { 0xCB, 0X63 }}, - {"bit 4, h", "bit 4, h", 2, { 0xCB, 0X64 }}, - {"bit 4, h", "bit 4, h", 2, { 0xCB, 0X64 }}, - {"bit 4, l", "bit 4, l", 2, { 0xCB, 0X65 }}, - {"bit 4, l", "bit 4, l", 2, { 0xCB, 0X65 }}, - {"bit $4, l", "bit 4, l", 2, { 0xCB, 0X65 }}, - - {"bit 5, (hl)", "bit 5, (hl)", 2, { 0xCB, 0x6E }}, - {"bit 5, ( hl )", "bit 5, (hl)", 2, { 0xCB, 0x6E }}, - {"bit 5, (ix + 127)", "bit 5, (ix+127)", 4, { 0xDD, 0xCB, 0x7f, 0x6E }}, - {"bit 5, ( ix + 127 )", "bit 5, (ix+127)", 4, { 0xDD, 0xCB, 0x7f, 0x6E }}, - {"bit 5, (iy + 127)", "bit 5, (iy+127)", 4, { 0xFD, 0xCB, 0x7f, 0x6E }}, - {"bit 5, ( iy + 127 )", "bit 5, (iy+127)", 4, { 0xFD, 0xCB, 0x7f, 0x6E }}, - {"bit 5, (iy + -128)", "bit 5, (iy+-128)", 4, { 0xFD, 0xCB, 0x80, 0x6E }}, - {"bit 5, (ix+$fe )", "bit 5, (ix+$fe)", 4, { 0xDD, 0xCB, 0xfe, 0x6E }}, - {"bit 5, (iy+$fe )", "bit 5, (iy+$fe)", 4, { 0xFD, 0xCB, 0xfe, 0x6E }}, - {"bit 5, a", "bit 5, a", 2, { 0xCB, 0X6F }}, - {"bit 5, a", "bit 5, a", 2, { 0xCB, 0X6F }}, - {"bit 5, b", "bit 5, b", 2, { 0xCB, 0X68 }}, - {"bit 5, b", "bit 5, b", 2, { 0xCB, 0X68 }}, - {"bit 5, c", "bit 5, c", 2, { 0xCB, 0X69 }}, - {"bit 5, c", "bit 5, c", 2, { 0xCB, 0X69 }}, - {"bit 5, d", "bit 5, d", 2, { 0xCB, 0X6A }}, - {"bit 5, d", "bit 5, d", 2, { 0xCB, 0X6A }}, - {"bit 5, e", "bit 5, e", 2, { 0xCB, 0X6B }}, - {"bit 5, e", "bit 5, e", 2, { 0xCB, 0X6B }}, - {"bit 5, h", "bit 5, h", 2, { 0xCB, 0X6C }}, - {"bit 5, h", "bit 5, h", 2, { 0xCB, 0X6C }}, - {"bit 5, l", "bit 5, l", 2, { 0xCB, 0X6D }}, - {"bit 5, l", "bit 5, l", 2, { 0xCB, 0X6D }}, - {"bit $5, l", "bit 5, l", 2, { 0xCB, 0X6D }}, - - {"bit 6, (hl)", "bit 6, (hl)", 2, { 0xCB, 0x76 }}, - {"bit 6, ( hl )", "bit 6, (hl)", 2, { 0xCB, 0x76 }}, - {"bit 6, (ix + 127)", "bit 6, (ix+127)", 4, { 0xDD, 0xCB, 0x7f, 0x76 }}, - {"bit 6, ( ix + 127 )", "bit 6, (ix+127)", 4, { 0xDD, 0xCB, 0x7f, 0x76 }}, - {"bit 6, (iy + 127)", "bit 6, (iy+127)", 4, { 0xFD, 0xCB, 0x7f, 0x76 }}, - {"bit 6, ( iy + 127 )", "bit 6, (iy+127)", 4, { 0xFD, 0xCB, 0x7f, 0x76 }}, - {"bit 6, (iy + -128)", "bit 6, (iy+-128)", 4, { 0xFD, 0xCB, 0x80, 0x76 }}, - {"bit 6, (ix+$fe )", "bit 6, (ix+$fe)", 4, { 0xDD, 0xCB, 0xfe, 0x76 }}, - {"bit 6, (iy+$fe )", "bit 6, (iy+$fe)", 4, { 0xFD, 0xCB, 0xfe, 0x76 }}, - {"bit 6, a", "bit 6, a", 2, { 0xCB, 0X77 }}, - {"bit 6, a", "bit 6, a", 2, { 0xCB, 0X77 }}, - {"bit 6, b", "bit 6, b", 2, { 0xCB, 0X70 }}, - {"bit 6, b", "bit 6, b", 2, { 0xCB, 0X70 }}, - {"bit 6, c", "bit 6, c", 2, { 0xCB, 0X71 }}, - {"bit 6, c", "bit 6, c", 2, { 0xCB, 0X71 }}, - {"bit 6, d", "bit 6, d", 2, { 0xCB, 0X72 }}, - {"bit 6, d", "bit 6, d", 2, { 0xCB, 0X72 }}, - {"bit 6, e", "bit 6, e", 2, { 0xCB, 0X73 }}, - {"bit 6, e", "bit 6, e", 2, { 0xCB, 0X73 }}, - {"bit 6, h", "bit 6, h", 2, { 0xCB, 0X74 }}, - {"bit 6, h", "bit 6, h", 2, { 0xCB, 0X74 }}, - {"bit 6, l", "bit 6, l", 2, { 0xCB, 0X75 }}, - {"bit 6, l", "bit 6, l", 2, { 0xCB, 0X75 }}, - - {"bit 7, (hl)", "bit 7, (hl)", 2, { 0xCB, 0x7E }}, - {"bit 7, ( hl )", "bit 7, (hl)", 2, { 0xCB, 0x7E }}, - {"bit 7, (ix + 127)", "bit 7, (ix+127)", 4, { 0xDD, 0xCB, 0x7f, 0x7E }}, - {"bit 7, ( ix + 127 )", "bit 7, (ix+127)", 4, { 0xDD, 0xCB, 0x7f, 0x7E }}, - {"bit 7, (iy + 127)", "bit 7, (iy+127)", 4, { 0xFD, 0xCB, 0x7f, 0x7E }}, - {"bit 7, ( iy + 127 )", "bit 7, (iy+127)", 4, { 0xFD, 0xCB, 0x7f, 0x7E }}, - {"bit 7, (iy + -128)", "bit 7, (iy+-128)", 4, { 0xFD, 0xCB, 0x80, 0x7E }}, - {"bit 7, (ix+$fe )", "bit 7, (ix+$fe)", 4, { 0xDD, 0xCB, 0xfe, 0x7E }}, - {"bit 7, (iy+$fe )", "bit 7, (iy+$fe)", 4, { 0xFD, 0xCB, 0xfe, 0x7E }}, - {"bit 7, a", "bit 7, a", 2, { 0xCB, 0X7F }}, - {"bit 7, a", "bit 7, a", 2, { 0xCB, 0X7F }}, - {"bit 7, b", "bit 7, b", 2, { 0xCB, 0X78 }}, - {"bit 7, b", "bit 7, b", 2, { 0xCB, 0X78 }}, - {"bit 7, c", "bit 7, c", 2, { 0xCB, 0X79 }}, - {"bit 7, c", "bit 7, c", 2, { 0xCB, 0X79 }}, - {"bit 7, d", "bit 7, d", 2, { 0xCB, 0X7A }}, - {"bit 7, d", "bit 7, d", 2, { 0xCB, 0X7A }}, - {"bit 7, e", "bit 7, e", 2, { 0xCB, 0X7B }}, - {"bit 7, e", "bit 7, e", 2, { 0xCB, 0X7B }}, - {"bit 7, h", "bit 7, h", 2, { 0xCB, 0X7C }}, - {"bit 7, h", "bit 7, h", 2, { 0xCB, 0X7C }}, - {"bit 7, l", "bit 7, l", 2, { 0xCB, 0X7D }}, - {"bit 7, l", "bit 7, l", 2, { 0xCB, 0X7D }}, - {"bit $7, l", "bit 7, l", 2, { 0xCB, 0X7D }}, - - {"call c, label", "call c, label", 3, {0xDC, 0x00, 0x00}}, - {"call c,label", "call c, label", 3, {0xDC, 0x00, 0x00}}, - {"call m, label", "call m, label", 3, {0xFC, 0x00, 0x00}}, - {"call m , label", "call m, label", 3, {0xFC, 0x00, 0x00}}, - {"call nc, label", "call nc, label", 3, {0xD4, 0x00, 0x00}}, - {"call nc , label", "call nc, label", 3, {0xD4, 0x00, 0x00}}, - {"call label", "call label", 3, {0xCD, 0x00, 0x00}}, - {"call label", "call label", 3, {0xCD, 0x00, 0x00}}, - {"call no", "call no", 3, {0xCD, 0x01, 0x0}}, - {"call no", "call no", 3, {0xCD, 0x01, 0x0}}, - {"call nz, label", "call nz, label", 3, {0xC4, 0x00, 0x00}}, - {"call nz , label", "call nz, label", 3, {0xC4, 0x00, 0x00}}, - {"call p, label", "call p, label", 3, {0xF4, 0x00, 0x00}}, - {"call p , label", "call p, label", 3, {0xF4, 0x00, 0x00}}, - {"call pe, label", "call pe, label", 3, {0xEC, 0x00, 0x00}}, - {"call pe , label", "call pe, label", 3, {0xEC, 0x00, 0x00}}, - {"call po, label", "call po, label", 3, {0xE4, 0x00, 0x00}}, - {"call po, label", "call po, label", 3, {0xE4, 0x00, 0x00}}, - {"call pc", "call pc", 3, {0xCD, 0x02, 0x00}}, - {"call pc", "call pc", 3, {0xCD, 0x02, 0x00}}, - {"call z, label", "call z, label", 3, {0xCC, 0x00, 0x00}}, - {"call z, label", "call z, label", 3, {0xCC, 0x00, 0x00}}, - {"call 100", "call 100", 3, {0xCD, 0x64, 0x00}}, - {"call 100", "call 100", 3, {0xCD, 0x64, 0x00}}, - {"call $dead", "call $dead", 3, {0xCD, 0xAD, 0xDE}}, - {"call $dead", "call $dead", 3, {0xCD, 0xAD, 0xDE}}, - {"call c, 4096", "call c, 4096", 3, {0xDC, 0x00, 0x10} }, - {"call c , 4096", "call c, 4096", 3, {0xDC, 0x00, 0x10} }, - {"call 60000", "call 60000", 3, {0xCD, 0x60, 0xEA} }, - - {"ccf", "ccf", 1, {0x3F}}, - - {"cp (hl)", "cp (hl)", 1, {0xBE}}, - {"cp ( hl )", "cp (hl)", 1, {0xBE}}, - {"cp (ix+77)", "cp (ix+77)", 3, {0xDD, 0xBE, 0x4D}}, - {"cp ( ix+ 77 )", "cp (ix+77)", 3, {0xDD, 0xBE, 0x4D}}, - {"cp (iy+77)", "cp (iy+77)", 3, {0xFD, 0xBE, 0x4D}}, - {"cp ( iy+ 77 )", "cp (iy+77)", 3, {0xFD, 0xBE, 0x4D}}, - {"cp (iy+$ff)", "cp (iy+$ff)", 3, {0xFD, 0xBE, 0xFF}}, - {"cp ( iy+ $ff )", "cp (iy+$ff)", 3, {0xFD, 0xBE, 0xFF}}, - {"cp (iy+-1)", "cp (iy+-1)", 3, {0xFD, 0xBE, 0xFF}}, - {"cp ( iy+ -1 )", "cp (iy+-1)", 3, {0xFD, 0xBE, 0xFF}}, - {"cp a", "cp a", 1, {0xBF}}, - {"cp a", "cp a", 1, {0xBF}}, - {"cp b", "cp b", 1, {0xB8}}, - {"cp b", "cp b", 1, {0xB8}}, - {"cp c", "cp c", 1, {0xB9}}, - {"cp c", "cp c", 1, {0xB9}}, - {"cp d", "cp d", 1, {0xBA}}, - {"cp d", "cp d", 1, {0xBA}}, - {"cp e", "cp e", 1, {0xBB}}, - {"cp e", "cp e", 1, {0xBB}}, - {"cp h", "cp h", 1, {0xBC}}, - {"cp h", "cp h", 1, {0xBC}}, - {"cp l", "cp l", 1, {0xBD}}, - {"cp l", "cp l", 1, {0xBD}}, - {"cp 101", "cp 101", 2, {0xFE, 0x65}}, - {"cp 101", "cp 101", 2, {0xFE, 0x65}}, - {"cp $65", "cp $65", 2, {0xFE, 0x65}}, - {"cp 'A'", "cp 'A'", 2, {0xFE, 0x41}}, - {"cp 'A'", "cp 'A'", 2, {0xFE, 0x41}}, - {"cp $65", "cp $65", 2, {0xFE, 0x65}}, - {"cp -128", "cp -128", 2, {0xFE, 0x80}}, - {"cp -128", "cp -128", 2, {0xFE, 0x80}}, - - {"cpd", "cpd", 2, {0xED, 0xA9}}, - - {"cpdr", "cpdr", 2, {0xED, 0xB9}}, - - {"cpi", "cpi", 2, {0xED, 0xA1}}, - - {"cpir", "cpir", 2, {0xED, 0xB1}}, - - {"cpl", "cpl", 1, {0x2f}}, - - {"daa", "daa", 1, {0x27}}, - - {"dec (hl)", "dec (hl)", 1, {0x35}}, - {"dec ( hl)", "dec (hl)", 1, {0x35}}, - {"dec (ix+3)", "dec (ix+3)", 3, {0xDD, 0x35, 0x3}}, - {"dec ( ix + 3 )", "dec (ix+3)", 3, {0xDD, 0x35, 0x3}}, - {"dec (iy+5)", "dec (iy+5)", 3, {0xFD, 0x35, 0x5}}, - {"dec ( iy + 5 )", "dec (iy+5)", 3, {0xFD, 0x35, 0x5}}, - {"dec a", "dec a", 1, {0x3D}}, - {"dec a", "dec a", 1, {0x3D}}, - {"dec b", "dec b", 1, {0x05}}, - {"dec b", "dec b", 1, {0x05}}, - {"dec bc", "dec bc", 1, {0x0B}}, - {"dec bc", "dec bc", 1, {0x0B}}, - {"dec c", "dec c", 1, {0x0D}}, - {"dec c", "dec c", 1, {0x0D}}, - {"dec d", "dec d", 1, {0x15}}, - {"dec d", "dec d", 1, {0x15}}, - {"dec de", "dec de", 1, {0x1B}}, - {"dec de", "dec de", 1, {0x1B}}, - {"dec e", "dec e", 1, {0x1D}}, - {"dec e", "dec e", 1, {0x1D}}, - {"dec h", "dec h", 1, {0x25}}, - {"dec h", "dec h", 1, {0x25}}, - {"dec hl", "dec hl", 1, {0x2B}}, - {"dec hl", "dec hl", 1, {0x2B}}, - {"dec ix", "dec ix", 2, {0xDD, 0x2B}}, - {"dec iy", "dec iy", 2, {0xFD, 0x2B}}, - {"dec l", "dec l", 1, {0x2D}}, - {"dec sp", "dec sp", 1, {0x3B}}, - - {"di", "di", 1, {0xF3}}, - - {"djnz label", "djnz label", 2, {0x10,0x0}}, - {"djnz label", "djnz label", 2, {0x10,0x0}}, - - {"ei", "ei", 1, {0xFB}}, - - {"ex (sp), hl", "ex (sp), hl", 1, {0xE3}}, - {"ex ( sp ) , hl", "ex (sp), hl", 1, {0xE3}}, - {"ex (sp), ix", "ex (sp), ix", 2, {0xDD, 0xE3}}, - {"ex ( sp ) , ix", "ex (sp), ix", 2, {0xDD, 0xE3}}, - {"ex (sp), iy", "ex (sp), iy", 2, {0xFD, 0xE3}}, - {"ex ( sp ) , iy", "ex (sp), iy", 2, {0xFD, 0xE3}}, - {"ex af, af'", "ex af, af'", 1, {0x08}}, - {"ex af,af'", "ex af, af'", 1, {0x08}}, - {"ex de, hl", "ex de, hl", 1, {0xEB}}, - {"ex de,hl", "ex de, hl", 1, {0xEB}}, - - {"exx", "exx", 1, {0xD9}}, - - {"halt", "halt", 1, {0x76}}, - - {"im 0", "im 0", 2, {0xED, 0x46}}, - {"im 0", "im 0", 2, {0xED, 0x46}}, - {"im 1", "im 1", 2, {0xED, 0x56}}, - {"im 1", "im 1", 2, {0xED, 0x56}}, - {"im 2", "im 2", 2, {0xED, 0x5E}}, - {"im 2", "im 2", 2, {0xED, 0x5E}}, - {"im $2", "im 2", 2, {0xED, 0x5E}}, - {"im $2", "im 2", 2, {0xED, 0x5E}}, - - {"in a, (c)", "in a, (c)", 2, {0xED, 0x78}}, - {"in a ,( c )", "in a, (c)", 2, {0xED, 0x78}}, - {"in a, (66)", "in a, (66)", 2, {0xDB, 0x42}}, - {"in a ,( 66 )", "in a, (66)", 2, {0xDB, 0x42}}, - {"in a, ($ff)", "in a, ($ff)", 2, {0xDB, 0xff}}, - {"in a ,( $ff )", "in a, ($ff)", 2, {0xDB, 0xff}}, - {"in a, (128)", "in a, (128)", 2, {0xDB, 0x80}}, - {"in a ,( 128 )", "in a, (128)", 2, {0xDB, 0x80}}, - {"in b, (c)", "in b, (c)", 2, {0xED, 0x40}}, - {"in b ,( c )", "in b, (c)", 2, {0xED, 0x40}}, - {"in c, (c)", "in c, (c)", 2, {0xED, 0x48}}, - {"in c ,( c )", "in c, (c)", 2, {0xED, 0x48}}, - {"in d, (c)", "in d, (c)", 2, {0xED, 0x50}}, - {"in d ,( c )", "in d, (c)", 2, {0xED, 0x50}}, - {"in e, (c)", "in e, (c)", 2, {0xED, 0x58}}, - {"in e ,( c )", "in e, (c)", 2, {0xED, 0x58}}, - {"in h, (c)", "in h, (c)", 2, {0xED, 0x60}}, - {"in h ,( c )", "in h, (c)", 2, {0xED, 0x60}}, - {"in l, (c)", "in l, (c)", 2, {0xED, 0x68}}, - {"in l ,( c )", "in l, (c)", 2, {0xED, 0x68}}, - - {"inc (hl)", "inc (hl)", 1, {0x34}}, - {"inc ( hl)", "inc (hl)", 1, {0x34}}, - {"inc (ix+3)", "inc (ix+3)", 3, {0xDD, 0x34, 0x3}}, - {"inc ( ix + 3 )", "inc (ix+3)", 3, {0xDD, 0x34, 0x3}}, - {"inc (iy+5)", "inc (iy+5)", 3, {0xFD, 0x34, 0x5}}, - {"inc ( iy + 5 )", "inc (iy+5)", 3, {0xFD, 0x34, 0x5}}, - {"inc (ix+$fe)", "inc (ix+$fe)", 3, {0xDD, 0x34, 0xFE}}, - {"inc ( ix + $fe )", "inc (ix+$fe)", 3, {0xDD, 0x34, 0xFE}}, - {"inc (ix+-1)", "inc (ix+-1)", 3, {0xDD, 0x34, 0xFF}}, - {"inc ( ix + -1 )", "inc (ix+-1)", 3, {0xDD, 0x34, 0xFF}}, - {"inc a", "inc a", 1, {0x3C}}, - {"inc a", "inc a", 1, {0x3C}}, - {"inc b", "inc b", 1, {0x04}}, - {"inc b", "inc b", 1, {0x04}}, - {"inc bc", "inc bc", 1, {0x03}}, - {"inc bc", "inc bc", 1, {0x03}}, - {"inc c", "inc c", 1, {0x0C}}, - {"inc c", "inc c", 1, {0x0C}}, - {"inc d", "inc d", 1, {0x14}}, - {"inc d", "inc d", 1, {0x14}}, - {"inc de", "inc de", 1, {0x13}}, - {"inc de", "inc de", 1, {0x13}}, - {"inc e", "inc e", 1, {0x1C}}, - {"inc e", "inc e", 1, {0x1C}}, - {"inc h", "inc h", 1, {0x24}}, - {"inc h", "inc h", 1, {0x24}}, - {"inc hl", "inc hl", 1, {0x23}}, - {"inc hl", "inc hl", 1, {0x23}}, - {"inc ix", "inc ix", 2, {0xDD, 0x23}}, - {"inc iy", "inc iy", 2, {0xFD, 0x23}}, - {"inc l", "inc l", 1, {0x2C}}, - {"inc sp", "inc sp", 1, {0x33}}, - - {"ind", "ind", 2, {0xED, 0xAA}}, - - {"indr", "indr", 2, {0xED, 0xBA}}, - - {"ini", "ini", 2, {0xED, 0xA2}}, - - {"inir", "inir", 2, {0xED, 0xB2}}, - - {"jp (hl)", "jp (hl)", 1, {0xE9}}, - {"jp ( hl )", "jp (hl)", 1, {0xE9}}, - {"jp (ix)", "jp (ix)", 2, {0xDD, 0xE9}}, - {"jp ( ix )", "jp (ix)", 2, {0xDD, 0xE9}}, - {"jp (iy)", "jp (iy)", 2, {0xFD, 0xE9}}, - {"jp ( iy )", "jp (iy)", 2, {0xFD, 0xE9}}, - {"jp c, label", "jp c, label", 3, {0xDA, 0x00, 0x00}}, - {"jp c,label", "jp c, label", 3, {0xDA, 0x00, 0x00}}, - {"jp m, label", "jp m, label", 3, {0xFA, 0x00, 0x00}}, - {"jp m,label", "jp m, label", 3, {0xFA, 0x00, 0x00}}, - {"jp nc, label", "jp nc, label", 3, {0xD2, 0x00, 0x00}}, - {"jp nc,label", "jp nc, label", 3, {0xD2, 0x00, 0x00}}, - {"jp label", "jp label", 3, {0xC3, 0x00, 0x00}}, - {"jp label", "jp label", 3, {0xC3, 0x00, 0x00}}, - {"jp nz, label", "jp nz, label", 3, {0xC2, 0x00, 0x00}}, - {"jp nz, label", "jp nz, label", 3, {0xC2, 0x00, 0x00}}, - {"jp p, label", "jp p, label", 3, {0xF2, 0x00, 0x00}}, - {"jp p, label", "jp p, label", 3, {0xF2, 0x00, 0x00}}, - {"jp pe, label", "jp pe, label", 3, {0xEA, 0x00, 0x00}}, - {"jp pe, label", "jp pe, label", 3, {0xEA, 0x00, 0x00}}, - {"jp po, label", "jp po, label", 3, {0xE2, 0x00, 0x00}}, - {"jp po, label", "jp po, label", 3, {0xE2, 0x00, 0x00}}, - {"jp z, label", "jp z, label", 3, {0xCA, 0x00, 0x00}}, - {"jp z, label", "jp z, label", 3, {0xCA, 0x00, 0x00}}, - {"jp pc", "jp pc", 3, {0xC3, 0x02, 0x00}}, - {"jp pc", "jp pc", 3, {0xC3, 0x02, 0x00}}, - {"jp no", "jp no", 3, {0xC3, 0x01, 0x00}}, - {"jp no", "jp no", 3, {0xC3, 0x01, 0x00}}, - - {"jr c, label", "jr c, label", 2, {0x38, 0x00}}, - {"jr c, label", "jr c, label", 2, {0x38, 0x00}}, - {"jr label", "jr label", 2, {0x18, 0x00}}, - {"jr label", "jr label", 2, {0x18, 0x00}}, - {"jr nc, label", "jr nc, label", 2, {0x30, 0x00}}, - {"jr nc,label", "jr nc, label", 2, {0x30, 0x00}}, - {"jr nz, label", "jr nz, label", 2, {0x20, 0x00}}, - {"jr nz,label", "jr nz, label", 2, {0x20, 0x00}}, - {"jr clabel", "jr clabel", 2, {0x18, 0x03}}, - {"jr nzo", "jr nzo", 2, {0x18, 0x04}}, - - {"ld (bc), a", "ld (bc), a", 1, {0x2}}, - {"ld ( bc ) , a", "ld (bc), a", 1, {0x2}}, - {"ld (de), a", "ld (de), a", 1, {0x12}}, - {"ld ( de ) , a", "ld (de), a", 1, {0x12}}, - {"ld (hl), a", "ld (hl), a", 1, {0x77}}, - {"ld ( hl ) , a", "ld (hl), a", 1, {0x77}}, - {"ld (hl), b", "ld (hl), b", 1, {0x70}}, - {"ld ( hl ) , b", "ld (hl), b", 1, {0x70}}, - {"ld (hl), c", "ld (hl), c", 1, {0x71}}, - {"ld ( hl ) , c", "ld (hl), c", 1, {0x71}}, - {"ld (hl), d", "ld (hl), d", 1, {0x72}}, - {"ld ( hl ) , d", "ld (hl), d", 1, {0x72}}, - {"ld (hl), e", "ld (hl), e", 1, {0x73}}, - {"ld ( hl ) , e", "ld (hl), e", 1, {0x73}}, - {"ld (hl), h", "ld (hl), h", 1, {0x74}}, - {"ld ( hl ) , h", "ld (hl), h", 1, {0x74}}, - {"ld (hl), l", "ld (hl), l", 1, {0x75}}, - {"ld ( hl ) , l", "ld (hl), l", 1, {0x75}}, - {"ld (hl), 10", "ld (hl), 10", 2, {0x36, 0xA}}, - {"ld ( hl ) , 10", "ld (hl), 10", 2, {0x36, 0xA}}, - {"ld (hl), 'A'", "ld (hl), 'A'", 2, {0x36, 0x41}}, - {"ld ( hl ) , 'A'", "ld (hl), 'A'", 2, {0x36, 0x41}}, - - {"ld (ix+1), a", "ld (ix+1), a", 3, {0xDD, 0x77, 0x1}}, - {"ld ( ix + 1 ) , a", "ld (ix+1), a", 3, {0xDD, 0x77, 0x1}}, - {"ld (ix+$7f), a", "ld (ix+$7f), a", 3, {0xDD, 0x77, 0x7F}}, - {"ld ( ix + $7f ) , a", "ld (ix+$7f), a", 3, {0xDD, 0x77, 0x7F}}, - {"ld (ix+-1), a", "ld (ix+-1), a", 3, {0xDD, 0x77, 0xFF}}, - {"ld ( ix + -1 ) , a", "ld (ix+-1), a", 3, {0xDD, 0x77, 0xFF}}, - {"ld (ix+1), b", "ld (ix+1), b", 3, {0xDD, 0x70, 0x1}}, - {"ld ( ix + 1 ) , b", "ld (ix+1), b", 3, {0xDD, 0x70, 0x1}}, - {"ld (ix+$7f), b", "ld (ix+$7f), b", 3, {0xDD, 0x70, 0x7F}}, - {"ld ( ix + $7f ) , b", "ld (ix+$7f), b", 3, {0xDD, 0x70, 0x7F}}, - {"ld (ix+-1), b", "ld (ix+-1), b", 3, {0xDD, 0x70, 0xFF}}, - {"ld ( ix + -1 ) , b", "ld (ix+-1), b", 3, {0xDD, 0x70, 0xFF}}, - {"ld (ix+1), c", "ld (ix+1), c", 3, {0xDD, 0x71, 0x1}}, - {"ld ( ix + 1 ) , c", "ld (ix+1), c", 3, {0xDD, 0x71, 0x1}}, - {"ld (ix+$7f), c", "ld (ix+$7f), c", 3, {0xDD, 0x71, 0x7F}}, - {"ld ( ix + $7f ) , c", "ld (ix+$7f), c", 3, {0xDD, 0x71, 0x7F}}, - {"ld (ix+-1), c", "ld (ix+-1), c", 3, {0xDD, 0x71, 0xFF}}, - {"ld ( ix + -1 ) , c", "ld (ix+-1), c", 3, {0xDD, 0x71, 0xFF}}, - {"ld (ix+1), d", "ld (ix+1), d", 3, {0xDD, 0x72, 0x1}}, - {"ld ( ix + 1 ) , d", "ld (ix+1), d", 3, {0xDD, 0x72, 0x1}}, - {"ld (ix+$7f), d", "ld (ix+$7f), d", 3, {0xDD, 0x72, 0x7F}}, - {"ld ( ix + $7f ) , d", "ld (ix+$7f), d", 3, {0xDD, 0x72, 0x7F}}, - {"ld (ix+-1), d", "ld (ix+-1), d", 3, {0xDD, 0x72, 0xFF}}, - {"ld ( ix + -1 ) , d", "ld (ix+-1), d", 3, {0xDD, 0x72, 0xFF}}, - {"ld (ix+1), e", "ld (ix+1), e", 3, {0xDD, 0x73, 0x1}}, - {"ld ( ix + 1 ) , e", "ld (ix+1), e", 3, {0xDD, 0x73, 0x1}}, - {"ld (ix+$8f), e", "ld (ix+$8f), e", 3, {0xDD, 0x73, 0x8F}}, - {"ld ( ix + $8f ) , e", "ld (ix+$8f), e", 3, {0xDD, 0x73, 0x8F}}, - {"ld (ix+-1), e", "ld (ix+-1), e", 3, {0xDD, 0x73, 0xFF}}, - {"ld ( ix + -1 ) , e", "ld (ix+-1), e", 3, {0xDD, 0x73, 0xFF}}, - {"ld (ix+1), h", "ld (ix+1), h", 3, {0xDD, 0x74, 0x1}}, - {"ld ( ix + 1 ) , h", "ld (ix+1), h", 3, {0xDD, 0x74, 0x1}}, - {"ld (ix+$cf), h", "ld (ix+$cf), h", 3, {0xDD, 0x74, 0xCF}}, - {"ld ( ix + $cf ) , h", "ld (ix+$cf), h", 3, {0xDD, 0x74, 0xCF}}, - {"ld (ix+-1), h", "ld (ix+-1), h", 3, {0xDD, 0x74, 0xFF}}, - {"ld ( ix + -1 ) , h", "ld (ix+-1), h", 3, {0xDD, 0x74, 0xFF}}, - {"ld (ix+1), l", "ld (ix+1), l", 3, {0xDD, 0x75, 0x1}}, - {"ld ( ix + 1 ) , l", "ld (ix+1), l", 3, {0xDD, 0x75, 0x1}}, - {"ld (ix+$cc), l", "ld (ix+$cc), l", 3, {0xDD, 0x75, 0xCC}}, - {"ld ( ix + $cc ) , l", "ld (ix+$cc), l", 3, {0xDD, 0x75, 0xCC}}, - {"ld (ix+-1), l", "ld (ix+-1), l", 3, {0xDD, 0x75, 0xFF}}, - {"ld ( ix + -1 ) , l", "ld (ix+-1), l", 3, {0xDD, 0x75, 0xFF}}, - - {"ld (ix+1), 'A'", "ld (ix+1), 'A'", 4, {0xDD, 0x36, 0x1, 0x41}}, - {"ld (ix+1), 11", "ld (ix+1), 11", 4, {0xDD, 0x36, 0x1, 0xB}}, - {"ld ( ix + 1 ) , 11", "ld (ix+1), 11", 4, {0xDD, 0x36, 0x1, 0xB}}, - {"ld (ix+$aa), 11", "ld (ix+$aa), 11", 4, {0xDD, 0x36, 0xAA, 0xB}}, - {"ld (ix+$aa), $b", "ld (ix+$aa), $b", 4, {0xDD, 0x36, 0xAA, 0xB}}, - {"ld (ix+32), $b", "ld (ix+32), $b", 4, {0xDD, 0x36, 0x20, 0xB}}, - {"ld (ix+-1), $b", "ld (ix+-1), $b", 4, {0xDD, 0x36, 0xFF, 0xB}}, - {"ld (ix+-1), -1", "ld (ix+-1), -1", 4, {0xDD, 0x36, 0xFF, 0xFF}}, - {"ld (ix+32), -1", "ld (ix+32), -1", 4, {0xDD, 0x36, 0x20, 0xFF}}, - - {"ld (iy+1), a", "ld (iy+1), a", 3, {0xFD, 0x77, 0x1}}, - {"ld ( iy + 1 ) , a", "ld (iy+1), a", 3, {0xFD, 0x77, 0x1}}, - {"ld (iy+-1), a", "ld (iy+-1), a", 3, {0xFD, 0x77, 0xFF}}, - {"ld ( iy + -1 ) , a", "ld (iy+-1), a", 3, {0xFD, 0x77, 0xFF}}, - {"ld (iy+$ff), a", "ld (iy+$ff), a", 3, {0xFD, 0x77, 0xFF}}, - {"ld ( iy + $ff ) , a", "ld (iy+$ff), a", 3, {0xFD, 0x77, 0xFF}}, - {"ld (iy+1), b", "ld (iy+1), b", 3, {0xFD, 0x70, 0x1}}, - {"ld ( iy + 1 ) , b", "ld (iy+1), b", 3, {0xFD, 0x70, 0x1}}, - {"ld (iy+-1), b", "ld (iy+-1), b", 3, {0xFD, 0x70, 0xFF}}, - {"ld ( iy + -1 ) , b", "ld (iy+-1), b", 3, {0xFD, 0x70, 0xFF}}, - {"ld (iy+$ff), b", "ld (iy+$ff), b", 3, {0xFD, 0x70, 0xFF}}, - {"ld ( iy + $ff ) , b", "ld (iy+$ff), b", 3, {0xFD, 0x70, 0xFF}}, - {"ld (iy+1), c", "ld (iy+1), c", 3, {0xFD, 0x71, 0x1}}, - {"ld ( iy + 1 ) , c", "ld (iy+1), c", 3, {0xFD, 0x71, 0x1}}, - {"ld (iy+-1), c", "ld (iy+-1), c", 3, {0xFD, 0x71, 0xFF}}, - {"ld ( iy + -1 ) , c", "ld (iy+-1), c", 3, {0xFD, 0x71, 0xFF}}, - {"ld (iy+$ff), c", "ld (iy+$ff), c", 3, {0xFD, 0x71, 0xFF}}, - {"ld ( iy + $ff ) , c", "ld (iy+$ff), c", 3, {0xFD, 0x71, 0xFF}}, - {"ld (iy+1), d", "ld (iy+1), d", 3, {0xFD, 0x72, 0x1}}, - {"ld ( iy + 1 ) , d", "ld (iy+1), d", 3, {0xFD, 0x72, 0x1}}, - {"ld (iy+-1), d", "ld (iy+-1), d", 3, {0xFD, 0x72, 0xFF}}, - {"ld ( iy + -1 ) , d", "ld (iy+-1), d", 3, {0xFD, 0x72, 0xFF}}, - {"ld (iy+$ff), d", "ld (iy+$ff), d", 3, {0xFD, 0x72, 0xFF}}, - {"ld ( iy + $ff ) , d", "ld (iy+$ff), d", 3, {0xFD, 0x72, 0xFF}}, - {"ld (iy+1), e", "ld (iy+1), e", 3, {0xFD, 0x73, 0x1}}, - {"ld ( iy + 1 ) , e", "ld (iy+1), e", 3, {0xFD, 0x73, 0x1}}, - {"ld (iy+-1), e", "ld (iy+-1), e", 3, {0xFD, 0x73, 0xFF}}, - {"ld ( iy + -1 ) , e", "ld (iy+-1), e", 3, {0xFD, 0x73, 0xFF}}, - {"ld (iy+$ff), e", "ld (iy+$ff), e", 3, {0xFD, 0x73, 0xFF}}, - {"ld ( iy + $ff ) , e", "ld (iy+$ff), e", 3, {0xFD, 0x73, 0xFF}}, - {"ld (iy+1), h", "ld (iy+1), h", 3, {0xFD, 0x74, 0x1}}, - {"ld ( iy + 1 ) , h", "ld (iy+1), h", 3, {0xFD, 0x74, 0x1}}, - {"ld (iy+-1), h", "ld (iy+-1), h", 3, {0xFD, 0x74, 0xFF}}, - {"ld ( iy + -1 ) , h", "ld (iy+-1), h", 3, {0xFD, 0x74, 0xFF}}, - {"ld (iy+$ff), h", "ld (iy+$ff), h", 3, {0xFD, 0x74, 0xFF}}, - {"ld ( iy + $ff ) , h", "ld (iy+$ff), h", 3, {0xFD, 0x74, 0xFF}}, - {"ld (iy+1), l", "ld (iy+1), l", 3, {0xFD, 0x75, 0x1}}, - {"ld ( iy + 1 ) , l", "ld (iy+1), l", 3, {0xFD, 0x75, 0x1}}, - {"ld (iy+-1), l", "ld (iy+-1), l", 3, {0xFD, 0x75, 0xFF}}, - {"ld ( iy + -1 ) , l", "ld (iy+-1), l", 3, {0xFD, 0x75, 0xFF}}, - {"ld (iy+$ff), l", "ld (iy+$ff), l", 3, {0xFD, 0x75, 0xFF}}, - {"ld ( iy + $ff ) , l", "ld (iy+$ff), l", 3, {0xFD, 0x75, 0xFF}}, - {"ld (iy+1), l", "ld (iy+1), l", 3, {0xFD, 0x75, 0x1}}, - {"ld ( iy + 1 ) , l", "ld (iy+1), l", 3, {0xFD, 0x75, 0x1}}, - {"ld (iy+-1), l", "ld (iy+-1), l", 3, {0xFD, 0x75, 0xFF}}, - {"ld ( iy + -1 ) , l", "ld (iy+-1), l", 3, {0xFD, 0x75, 0xFF}}, - {"ld (iy+$ff), l", "ld (iy+$ff), l", 3, {0xFD, 0x75, 0xFF}}, - {"ld ( iy + $ff ) , l", "ld (iy+$ff), l", 3, {0xFD, 0x75, 0xFF}}, - - {"ld (iy+1), 'A'", "ld (iy+1), 'A'", 4, {0xFD, 0x36, 0x1, 0x41}}, - {"ld (iy+1), 11", "ld (iy+1), 11", 4, {0xFD, 0x36, 0x1, 0xB}}, - {"ld ( iy + 1 ) , 11", "ld (iy+1), 11", 4, {0xFD, 0x36, 0x1, 0xB}}, - {"ld (iy+$aa), 11", "ld (iy+$aa), 11", 4, {0xFD, 0x36, 0xAA, 0xB}}, - {"ld (iy+$aa), $b", "ld (iy+$aa), $b", 4, {0xFD, 0x36, 0xAA, 0xB}}, - {"ld (iy+32), $b", "ld (iy+32), $b", 4, {0xFD, 0x36, 0x20, 0xB}}, - {"ld (iy+-1), $b", "ld (iy+-1), $b", 4, {0xFD, 0x36, 0xFF, 0xB}}, - {"ld (iy+-1), -1", "ld (iy+-1), -1", 4, {0xFD, 0x36, 0xFF, 0xFF}}, - {"ld (iy+32), -1", "ld (iy+32), -1", 4, {0xFD, 0x36, 0x20, 0xFF}}, - - {"ld (label), a", "ld (label), a", 3, {0x32, 0x00, 0x00}}, - {"ld ( label ) , a", "ld (label), a", 3, {0x32, 0x00, 0x00}}, - {"ld (16384), a", "ld (16384), a", 3, {0x32, 0x00, 0x40}}, - {"ld ( 16384 ) , a", "ld (16384), a", 3, {0x32, 0x00, 0x40}}, - {"ld ($4000), a", "ld ($4000), a", 3, {0x32, 0x00, 0x40}}, - {"ld ( $4000 ), a", "ld ($4000), a", 3, {0x32, 0x00, 0x40}}, - {"ld (16384), bc", "ld (16384), bc", 4, {0xED, 0x43, 0x00, 0x40}}, - {"ld ( 16384 ) , bc", "ld (16384), bc", 4, {0xED, 0x43, 0x00, 0x40}}, - {"ld ($4000), bc", "ld ($4000), bc", 4, {0xED, 0x43, 0x00, 0x40}}, - {"ld ( $4000 ) , bc", "ld ($4000), bc", 4, {0xED, 0x43, 0x00, 0x40}}, - {"ld (16385), de", "ld (16385), de", 4, {0xED, 0x53, 0x01, 0x40}}, - {"ld ( 16385 ) , de", "ld (16385), de", 4, {0xED, 0x53, 0x01, 0x40}}, - {"ld ($4001), de", "ld ($4001), de", 4, {0xED, 0x53, 0x01, 0x40}}, - {"ld ( $4001 ) , de", "ld ($4001), de", 4, {0xED, 0x53, 0x01, 0x40}}, - {"ld (16384), hl", "ld (16384), hl", 3, {0x22, 0x00, 0x40}}, - {"ld ( 16384 ) , hl", "ld (16384), hl", 3, {0x22, 0x00, 0x40}}, - {"ld ($4000), hl", "ld ($4000), hl", 3, {0x22, 0x00, 0x40}}, - {"ld ( $4000 ) , hl", "ld ($4000), hl", 3, {0x22, 0x00, 0x40}}, - {"ld (16385), ix", "ld (16385), ix", 4, {0xDD, 0x22, 0x01, 0x40}}, - {"ld ( 16385 ) , ix", "ld (16385), ix", 4, {0xDD, 0x22, 0x01, 0x40}}, - {"ld ($4001), ix", "ld ($4001), ix", 4, {0xDD, 0x22, 0x01, 0x40}}, - {"ld ( $4001 ) , ix", "ld ($4001), ix", 4, {0xDD, 0x22, 0x01, 0x40}}, - {"ld (16385), iy", "ld (16385), iy", 4, {0xFD, 0x22, 0x01, 0x40}}, - {"ld ( 16385 ) , iy", "ld (16385), iy", 4, {0xFD, 0x22, 0x01, 0x40}}, - {"ld ($4001), iy", "ld ($4001), iy", 4, {0xFD, 0x22, 0x01, 0x40}}, - {"ld ( $4001 ) , iy", "ld ($4001), iy", 4, {0xFD, 0x22, 0x01, 0x40}}, - {"ld (16385), sp", "ld (16385), sp", 4, {0xED, 0x73, 0x01, 0x40}}, - {"ld ( 16385 ) , sp", "ld (16385), sp", 4, {0xED, 0x73, 0x01, 0x40}}, - {"ld ($4001), sp", "ld ($4001), sp", 4, {0xED, 0x73, 0x01, 0x40}}, - {"ld ( $4001 ) , sp", "ld ($4001), sp", 4, {0xED, 0x73, 0x01, 0x40}}, - {"ld a, (bc)", "ld a, (bc)", 1, {0xA}}, - {"ld a , ( bc )", "ld a, (bc)", 1, {0xA}}, - {"ld a, (de)", "ld a, (de)", 1, {0x1A}}, - {"ld a , ( de )", "ld a, (de)", 1, {0x1A}}, - {"ld a, (hl)", "ld a, (hl)", 1, {0x7E}}, - {"ld a , ( hl )", "ld a, (hl)", 1, {0x7E}}, - {"ld a, (ix+55)", "ld a, (ix+55)", 3, {0xDD, 0x7E, 0x37}}, - {"ld a , ( ix + 55 )", "ld a, (ix+55)", 3, {0xDD, 0x7E, 0x37}}, - {"ld a, (ix+$37)", "ld a, (ix+$37)", 3, {0xDD, 0x7E, 0x37}}, - {"ld a , ( ix + $37 )", "ld a, (ix+$37)", 3, {0xDD, 0x7E, 0x37}}, - {"ld a, (iy+55)", "ld a, (iy+55)", 3, {0xFD, 0x7E, 0x37}}, - {"ld a , ( iy + 55 )", "ld a, (iy+55)", 3, {0xFD, 0x7E, 0x37}}, - {"ld a, (iy+$37)", "ld a, (iy+$37)", 3, {0xFD, 0x7E, 0x37}}, - {"ld a , ( iy + $37 )", "ld a, (iy+$37)", 3, {0xFD, 0x7E, 0x37}}, - {"ld a, (55)", "ld a, (55)", 3, {0x3A, 0x37, 0x00}}, - {"ld a , ( 55 )", "ld a, (55)", 3, {0x3A, 0x37, 0x00}}, - {"ld a, ($37)", "ld a, ($37)", 3, {0x3A, 0x37, 0x00}}, - {"ld a , ( $37 )", "ld a, ($37)", 3, {0x3A, 0x37, 0x00}}, - {"ld a, ($dead)", "ld a, ($dead)", 3, {0x3A, 0xAD, 0xDE}}, - {"ld a , ( $dead )", "ld a, ($dead)", 3, {0x3A, 0xAD, 0xDE}}, - {"ld a, (label)", "ld a, (label)", 3, {0x3A, 0x00, 0x00}}, - {"ld a , ( label )", "ld a, (label)", 3, {0x3A, 0x00, 0x00}}, - {"ld a, a", "ld a, a", 1, {0x7F}}, - {"ld a , a", "ld a, a", 1, {0x7F}}, - {"ld a, b", "ld a, b", 1, {0x78}}, - {"ld a , b", "ld a, b", 1, {0x78}}, - {"ld a, c", "ld a, c", 1, {0x79}}, - {"ld a , c", "ld a, c", 1, {0x79}}, - {"ld a, d", "ld a, d", 1, {0x7A}}, - {"ld a , d", "ld a, d", 1, {0x7A}}, - {"ld a, e", "ld a, e", 1, {0x7B}}, - {"ld a , e", "ld a, e", 1, {0x7B}}, - {"ld a, h", "ld a, h", 1, {0x7C}}, - {"ld a , h", "ld a, h", 1, {0x7C}}, - {"ld a, i", "ld a, i", 2, {0xED, 0x57}}, - {"ld a , i", "ld a, i", 2, {0xED, 0x57}}, - {"ld a, l", "ld a, l", 1, {0x7D}}, - {"ld a , l", "ld a, l", 1, {0x7D}}, - {"ld a, r", "ld a, r", 2, {0xED, 0x5F}}, - {"ld a , r", "ld a, r", 2, {0xED, 0x5F}}, - {"ld r, a", "ld r, a", 2, {0xED, 0x4F}}, - {"ld r , a", "ld r, a", 2, {0xED, 0x4F}}, - {"ld a, 32", "ld a, 32", 2, {0x3E, 0x20}}, - {"ld a , 32", "ld a, 32", 2 , {0x3E, 0x20}}, - {"ld a, $20", "ld a, $20", 2, {0x3E, 0x20}}, - {"ld a , $20", "ld a, $20", 2 , {0x3E, 0x20}}, - {"ld a, 128", "ld a, 128", 2, {0x3E, 0x80}}, - {"ld a , 128", "ld a, 128", 2 , {0x3E, 0x80}}, - {"ld a, -1", "ld a, -1", 2, {0x3E, 0xFF}}, - {"ld a , -1", "ld a, -1", 2 , {0x3E, 0xFF}}, - {"ld a, 'A'", "ld a, 'A'", 2, {0x3E, 0x41}}, - {"ld a , 'A'", "ld a, 'A'", 2 , {0x3E, 0x41}}, - {"ld a, label1-label", "ld a, label1-label", 2, {0x3E, 0x05, 0x00, - 0x04}}, - {"ld a , label1 - label", "ld a, label1-label", 2, {0x3E, 0x05, 0x00, - 0x04}}, - {"ld a, label1-verylonglabel", "ld a, label1-verylonglabel", 2, - {0x3E, 0x05, 0x00, 0x04}}, - {"ld a , label1 - verylonglabel", "ld a, label1-verylonglabel", 2, - {0x3E, 0x05, 0x00, 0x04}}, - {"ld a, verylonglabel-label1", "ld a, verylonglabel-label1", 2, - {0x3E, 0x0, 0x05, 0x08}}, - {"ld a , verylonglabel - label1", "ld a, verylonglabel-label1", 2, - {0x3E, 0x0, 0x05, 0x08}}, - - {"ld b, (hl)", "ld b, (hl)", 1, {0x46}}, - {"ld b , ( hl )", "ld b, (hl)", 1, {0x46}}, - {"ld b, (ix+55)", "ld b, (ix+55)", 3, {0xDD, 0x46, 0x37}}, - {"ld b , ( ix + 55 )", "ld b, (ix+55)", 3, {0xDD, 0x46, 0x37}}, - {"ld b, (ix+$37)", "ld b, (ix+$37)", 3, {0xDD, 0x46, 0x37}}, - {"ld b , ( ix + $37 )", "ld b, (ix+$37)", 3, {0xDD, 0x46, 0x37}}, - {"ld b, (ix+-1)", "ld b, (ix+-1)", 3, {0xDD, 0x46, 0xff}}, - {"ld b , ( ix + -1 )", "ld b, (ix+-1)", 3, {0xDD, 0x46, 0xff}}, - {"ld b, (iy+55)", "ld b, (iy+55)", 3, {0xFD, 0x46, 0x37}}, - {"ld b , ( iy + 55 )", "ld b, (iy+55)", 3, {0xFD, 0x46, 0x37}}, - {"ld b, (iy+$37)", "ld b, (iy+$37)", 3, {0xFD, 0x46, 0x37}}, - {"ld b , ( iy + $37 )", "ld b, (iy+$37)", 3, {0xFD, 0x46, 0x37}}, - {"ld b, (iy+-1)", "ld b, (iy+-1)", 3, {0xFD, 0x46, 0xFF}}, - {"ld b , ( iy + -1 )", "ld b, (iy+-1)", 3, {0xFD, 0x46, 0xFF}}, - {"ld b, a", "ld b, a", 1, {0x47}}, - {"ld b , a", "ld b, a", 1, {0x47}}, - {"ld b, b", "ld b, b", 1, {0x40}}, - {"ld b , b", "ld b, b", 1, {0x40}}, - {"ld b, c", "ld b, c", 1, {0x41}}, - {"ld b , c", "ld b, c", 1, {0x41}}, - {"ld b, d", "ld b, d", 1, {0x42}}, - {"ld b , d", "ld b, d", 1, {0x42}}, - {"ld b, e", "ld b, e", 1, {0x43}}, - {"ld b , e", "ld b, e", 1, {0x43}}, - {"ld b, h", "ld b, h", 1, {0x44}}, - {"ld b , h", "ld b, h", 1, {0x44}}, - {"ld b, l", "ld b, l", 1, {0x45}}, - {"ld b , l", "ld b, l", 1, {0x45}}, - {"ld b, 32", "ld b, 32", 2, {0x06, 0x20}}, - {"ld b , 32", "ld b, 32", 2 , {0x06, 0x20}}, - {"ld b, $20", "ld b, $20", 2, {0x06, 0x20}}, - {"ld b , $20", "ld b, $20", 2 , {0x06, 0x20}}, - {"ld b, -2", "ld b, -2", 2, {0x06, 0xFE}}, - {"ld b , -2", "ld b, -2", 2 , {0x06, 0xFE}}, - {"ld b, 128", "ld b, 128", 2, {0x06, 0x80}}, - {"ld b , 128", "ld b, 128", 2 , {0x06, 0x80}}, - {"ld b, 'A'", "ld b, 'A'", 2, {0x06, 0x41}}, - {"ld b , 'A'", "ld b, 'A'", 2 , {0x06, 0x41}}, - {"ld b, label1-label", "ld b, label1-label", 2, {0x06, 0x05, 0x00, - 0x04}}, - {"ld b , label1 - label", "ld b, label1-label", 2, {0x06, 0x05, 0x00, - 0x04}}, - {"ld b, label1-verylonglabel", "ld b, label1-verylonglabel", 2, - {0x06, 0x05, 0x00, 0x04}}, - {"ld b , label1 - verylonglabel", "ld b, label1-verylonglabel", 2, - {0x06, 0x05, 0x00, 0x04}}, - {"ld b, verylonglabel-label1", "ld b, verylonglabel-label1", 2, - {0x06, 0x0, 0x05, 0x08}}, - {"ld b , verylonglabel - label1", "ld b, verylonglabel-label1", 2, - {0x06, 0x0, 0x05, 0x08}}, - - {"ld bc, 257", "ld bc, 257", 3, {0x1, 0x01, 0x1}}, - {"ld bc , 257", "ld bc, 257", 3, {0x1, 0x01, 0x1}}, - {"ld bc, 65535", "ld bc, 65535", 3, {0x1, 0xFF, 0xFF}}, - {"ld bc , 65535", "ld bc, 65535", 3, {0x1, 0xFF, 0xFF}}, - {"ld bc, (257)", "ld bc, (257)", 4, {0xED, 0x4B, 0x01, 0x1}}, - {"ld bc , ( 257 )", "ld bc, (257)", 4, {0xED, 0x4B, 0x01, 0x1}}, - {"ld bc, ($101)", "ld bc, ($101)", 4, {0xED, 0x4B, 0x01, 0x1}}, - {"ld bc , ( $101 )", "ld bc, ($101)", 4, {0xED, 0x4B, 0x01, 0x1}}, - {"ld bc, (label)", "ld bc, (label)", 4, {0xED, 0x4B, 0x00, 0x0}}, - {"ld bc , ( label )", "ld bc, (label)", 4, {0xED, 0x4B, 0x00, 0x0}}, - {"ld bc, label", "ld bc, label", 3, {0x1, 0x00, 0x00}}, - {"ld bc, label", "ld bc, label", 3, {0x1, 0x00, 0x00}}, - {"ld bc, label1-label", "ld bc, label1-label", 3, {0x1, 0x05, 0x00, - 0x04}}, - {"ld bc , label1 - label", "ld bc, label1-label", 3, {0x1, 0x05, 0x00, - 0x04}}, - {"ld bc, label1-verylonglabel", "ld bc, label1-verylonglabel", 3, - {0x1, 0x05, 0x00, 0x04}}, - {"ld bc , label1 - verylonglabel", "ld bc, label1-verylonglabel", 3, - {0x1, 0x05, 0x00, 0x04}}, - {"ld bc, verylonglabel-label1", "ld bc, verylonglabel-label1", 3, - {0x1, 0x0, 0x05, 0x08}}, - {"ld bc , verylonglabel - label1", "ld bc, verylonglabel-label1", 3, - {0x1, 0x0, 0x05, 0x08}}, - - {"ld c, (hl)", "ld c, (hl)", 1, {0x4E}}, - {"ld c , ( hl )", "ld c, (hl)", 1, {0x4E}}, - {"ld c, (ix+55)", "ld c, (ix+55)", 3, {0xDD, 0x4E, 0x37}}, - {"ld c , ( ix + 55 )", "ld c, (ix+55)", 3, {0xDD, 0x4E, 0x37}}, - {"ld c, (ix+$37)", "ld c, (ix+$37)", 3, {0xDD, 0x4E, 0x37}}, - {"ld c , ( ix + $37 )", "ld c, (ix+$37)", 3, {0xDD, 0x4E, 0x37}}, - {"ld c, (ix+-2)", "ld c, (ix+-2)", 3, {0xDD, 0x4E, 0xFE}}, - {"ld c , ( ix + -2 )", "ld c, (ix+-2)", 3, {0xDD, 0x4E, 0xFE}}, - {"ld c, (iy+55)", "ld c, (iy+55)", 3, {0xFD, 0x4E, 0x37}}, - {"ld c , ( iy + 55 )", "ld c, (iy+55)", 3, {0xFD, 0x4E, 0x37}}, - {"ld c, (iy+$37)", "ld c, (iy+$37)", 3, {0xFD, 0x4E, 0x37}}, - {"ld c , ( iy + $37 )", "ld c, (iy+$37)", 3, {0xFD, 0x4E, 0x37}}, - {"ld c, (iy+-2)", "ld c, (iy+-2)", 3, {0xFD, 0x4E, 0xFE}}, - {"ld c , ( iy + -2 )", "ld c, (iy+-2)", 3, {0xFD, 0x4E, 0xFE}}, - {"ld c, a", "ld c, a", 1, {0x4F}}, - {"ld c , a", "ld c, a", 1, {0x4F}}, - {"ld c, b", "ld c, b", 1, {0x48}}, - {"ld c , b", "ld c, b", 1, {0x48}}, - {"ld c, c", "ld c, c", 1, {0x49}}, - {"ld c , c", "ld c, c", 1, {0x49}}, - {"ld c, d", "ld c, d", 1, {0x4A}}, - {"ld c , d", "ld c, d", 1, {0x4A}}, - {"ld c, e", "ld c, e", 1, {0x4B}}, - {"ld c , e", "ld c, e", 1, {0x4B}}, - {"ld c, h", "ld c, h", 1, {0x4C}}, - {"ld c , h", "ld c, h", 1, {0x4C}}, - {"ld c, l", "ld c, l", 1, {0x4D}}, - {"ld c , l", "ld c, l", 1, {0x4D}}, - {"ld c, 32", "ld c, 32", 2, {0x0E, 0x20}}, - {"ld c , 32", "ld c, 32", 2 , {0x0E, 0x20}}, - {"ld c, $20", "ld c, $20", 2, {0x0E, 0x20}}, - {"ld c , $20", "ld c, $20", 2 , {0x0E, 0x20}}, - {"ld c, -3", "ld c, -3", 2, {0x0E, 0xFD}}, - {"ld c , -3", "ld c, -3", 2 , {0x0E, 0xFD}}, - {"ld c, 128", "ld c, 128", 2, {0x0E, 0x80}}, - {"ld c , 128", "ld c, 128", 2 , {0x0E, 0x80}}, - {"ld c, 'A'", "ld c, 'A'", 2, {0x0E, 0x41}}, - {"ld c , 'A'", "ld c, 'A'", 2 , {0x0E, 0x41}}, - {"ld c, label1-label", "ld c, label1-label", 2, {0x0E, 0x05, 0x00, - 0x04}}, - {"ld c , label1 - label", "ld c, label1-label", 2, {0x0E, 0x05, 0x00, - 0x04}}, - {"ld c, label1-verylonglabel", "ld c, label1-verylonglabel", 2, - {0x0E, 0x05, 0x00, 0x04}}, - {"ld c , label1 - verylonglabel", "ld c, label1-verylonglabel", 2, - {0x0E, 0x05, 0x00, 0x04}}, - {"ld c, verylonglabel-label1", "ld c, verylonglabel-label1", 2, - {0x0E, 0x0, 0x05, 0x08}}, - {"ld c , verylonglabel - label1", "ld c, verylonglabel-label1", 2, - {0x0E, 0x0, 0x05, 0x08}}, - - {"ld d, (hl)", "ld d, (hl)", 1, {0x56}}, - {"ld d , ( hl )", "ld d, (hl)", 1, {0x56}}, - {"ld d, (ix+55)", "ld d, (ix+55)", 3, {0xDD, 0x56, 0x37}}, - {"ld d , ( ix + 55 )", "ld d, (ix+55)", 3, {0xDD, 0x56, 0x37}}, - {"ld d, (ix+$37)", "ld d, (ix+$37)", 3, {0xDD, 0x56, 0x37}}, - {"ld d , ( ix + $37 )", "ld d, (ix+$37)", 3, {0xDD, 0x56, 0x37}}, - {"ld d, (ix+-2)", "ld d, (ix+-2)", 3, {0xDD, 0x56, 0xFE}}, - {"ld d , ( ix + -2 )", "ld d, (ix+-2)", 3, {0xDD, 0x56, 0xFE}}, - {"ld d, (iy+55)", "ld d, (iy+55)", 3, {0xFD, 0x56, 0x37}}, - {"ld d , ( iy + 55 )", "ld d, (iy+55)", 3, {0xFD, 0x56, 0x37}}, - {"ld d, (iy+$37)", "ld d, (iy+$37)", 3, {0xFD, 0x56, 0x37}}, - {"ld d , ( iy + $37 )", "ld d, (iy+$37)", 3, {0xFD, 0x56, 0x37}}, - {"ld d, (iy+-2)", "ld d, (iy+-2)", 3, {0xFD, 0x56, 0xFE}}, - {"ld d , ( iy + -2 )", "ld d, (iy+-2)", 3, {0xFD, 0x56, 0xFE}}, - {"ld d, a", "ld d, a", 1, {0x57}}, - {"ld d , a", "ld d, a", 1, {0x57}}, - {"ld d, b", "ld d, b", 1, {0x50}}, - {"ld d , b", "ld d, b", 1, {0x50}}, - {"ld d, c", "ld d, c", 1, {0x51}}, - {"ld d , c", "ld d, c", 1, {0x51}}, - {"ld d, d", "ld d, d", 1, {0x52}}, - {"ld d , d", "ld d, d", 1, {0x52}}, - {"ld d, e", "ld d, e", 1, {0x53}}, - {"ld d , e", "ld d, e", 1, {0x53}}, - {"ld d, h", "ld d, h", 1, {0x54}}, - {"ld d , h", "ld d, h", 1, {0x54}}, - {"ld d, l", "ld d, l", 1, {0x55}}, - {"ld d , l", "ld d, l", 1, {0x55}}, - {"ld d, 32", "ld d, 32", 2, {0x16, 0x20}}, - {"ld d , 32", "ld d, 32", 2 , {0x16, 0x20}}, - {"ld d, $20", "ld d, $20", 2, {0x16, 0x20}}, - {"ld d , $20", "ld d, $20", 2 , {0x16, 0x20}}, - {"ld d, -4", "ld d, -4", 2, {0x16, 0xFC}}, - {"ld d , -4", "ld d, -4", 2 , {0x16, 0xFC}}, - {"ld d, 128", "ld d, 128", 2, {0x16, 0x80}}, - {"ld d , 128", "ld d, 128", 2 , {0x16, 0x80}}, - {"ld d, 'A'", "ld d, 'A'", 2, {0x16, 0x41}}, - {"ld d , 'A'", "ld d, 'A'", 2 , {0x16, 0x41}}, - {"ld d, label1-label", "ld d, label1-label", 2, {0x16, 0x05, 0x00, - 0x04}}, - {"ld d , label1 - label", "ld d, label1-label", 2, {0x16, 0x05, 0x00, - 0x04}}, - {"ld d, label1-verylonglabel", "ld d, label1-verylonglabel", 2, - {0x16, 0x05, 0x00, 0x04}}, - {"ld d , label1 - verylonglabel", "ld d, label1-verylonglabel", 2, - {0x16, 0x05, 0x00, 0x04}}, - {"ld d, verylonglabel-label1", "ld d, verylonglabel-label1", 2, - {0x16, 0x0, 0x05, 0x08}}, - {"ld d , verylonglabel - label1", "ld d, verylonglabel-label1", 2, - {0x16, 0x0, 0x05, 0x08}}, - - {"ld de, 'B'", "ld de, 'B'", 3, {0x11, 0x42, 0x0}}, - {"ld de , 'B'", "ld de, 'B'", 3, {0x11, 0x42, 0x0}}, - {"ld de, 257", "ld de, 257", 3, {0x11, 0x01, 0x1}}, - {"ld de , 257", "ld de, 257", 3, {0x11, 0x01, 0x1}}, - {"ld de, 65535", "ld de, 65535", 3, {0x11, 0xFF, 0xFF}}, - {"ld de , 65535", "ld de, 65535", 3, {0x11, 0xFF, 0xFF}}, - {"ld de, (257)", "ld de, (257)", 4, {0xED, 0x5B, 0x01, 0x1}}, - {"ld de , ( 257 )", "ld de, (257)", 4, {0xED, 0x5B, 0x01, 0x1}}, - {"ld de, ($dead)", "ld de, ($dead)", 4, {0xED, 0x5B, 0xAD, 0xDE}}, - {"ld de , ( $dead )", "ld de, ($dead)", 4, {0xED, 0x5B, 0xAD, 0xDE}}, - {"ld de, (label)", "ld de, (label)", 4, {0xED, 0x5B, 0x00, 0x0}}, - {"ld de , ( label )", "ld de, (label)", 4, {0xED, 0x5B, 0x00, 0x0}}, - {"ld de, label", "ld de, label", 3, {0x11, 0x00, 0x00}}, - {"ld de, label", "ld de, label", 3, {0x11, 0x00, 0x00}}, - {"ld de, label1-label", "ld de, label1-label", 3, {0x11, 0x05, 0x00, - 0x04}}, - {"ld de , label1 - label", "ld de, label1-label", 3, {0x11, 0x05, 0x00, - 0x04}}, - {"ld de, label1-verylonglabel", "ld de, label1-verylonglabel", 3, - {0x11, 0x05, 0x00, 0x04}}, - {"ld de , label1 - verylonglabel", "ld de, label1-verylonglabel", 3, - {0x11, 0x05, 0x00, 0x04}}, - {"ld de, verylonglabel-label1", "ld de, verylonglabel-label1", 3, - {0x11, 0x0, 0x05, 0x08}}, - {"ld de , verylonglabel - label1", "ld de, verylonglabel-label1", 3, - {0x11, 0x0, 0x05, 0x08}}, - - {"ld e, (hl)", "ld e, (hl)", 1, {0x5E}}, - {"ld e , ( hl )", "ld e, (hl)", 1, {0x5e}}, - {"ld e, (ix+55)", "ld e, (ix+55)", 3, {0xDD, 0x5E, 0x37}}, - {"ld e , ( ix + 55 )", "ld e, (ix+55)", 3, {0xDD, 0x5E, 0x37}}, - {"ld e, (ix+$37)", "ld e, (ix+$37)", 3, {0xDD, 0x5E, 0x37}}, - {"ld e , ( ix + $37 )", "ld e, (ix+$37)", 3, {0xDD, 0x5E, 0x37}}, - {"ld e, (ix+-2)", "ld e, (ix+-2)", 3, {0xDD, 0x5E, 0xFE}}, - {"ld e , ( ix + -2 )", "ld e, (ix+-2)", 3, {0xDD, 0x5E, 0xFE}}, - {"ld e, (iy+55)", "ld e, (iy+55)", 3, {0xFD, 0x5E, 0x37}}, - {"ld e , ( iy + 55 )", "ld e, (iy+55)", 3, {0xFD, 0x5E, 0x37}}, - {"ld e, (iy+$37)", "ld e, (iy+$37)", 3, {0xFD, 0x5E, 0x37}}, - {"ld e , ( iy + $37 )", "ld e, (iy+$37)", 3, {0xFD, 0x5E, 0x37}}, - {"ld e, (iy+-2)", "ld e, (iy+-2)", 3, {0xFD, 0x5E, 0xFE}}, - {"ld e , ( iy + -2 )", "ld e, (iy+-2)", 3, {0xFD, 0x5E, 0xFE}}, - {"ld e, a", "ld e, a", 1, {0x5F}}, - {"ld e , a", "ld e, a", 1, {0x5F}}, - {"ld e, b", "ld e, b", 1, {0x58}}, - {"ld e , b", "ld e, b", 1, {0x58}}, - {"ld e, c", "ld e, c", 1, {0x59}}, - {"ld e , c", "ld e, c", 1, {0x59}}, - {"ld e, d", "ld e, d", 1, {0x5A}}, - {"ld e , d", "ld e, d", 1, {0x5A}}, - {"ld e, e", "ld e, e", 1, {0x5B}}, - {"ld e , e", "ld e, e", 1, {0x5B}}, - {"ld e, h", "ld e, h", 1, {0x5C}}, - {"ld e , h", "ld e, h", 1, {0x5C}}, - {"ld e, l", "ld e, l", 1, {0x5D}}, - {"ld e , l", "ld e, l", 1, {0x5D}}, - {"ld e, 32", "ld e, 32", 2, {0x1E, 0x20}}, - {"ld e , 32", "ld e, 32", 2 , {0x1E, 0x20}}, - {"ld e, $20", "ld e, $20", 2, {0x1E, 0x20}}, - {"ld e , $20", "ld e, $20", 2 , {0x1E, 0x20}}, - {"ld e, -4", "ld e, -4", 2, {0x1E, 0xFC}}, - {"ld e , -4", "ld e, -4", 2 , {0x1E, 0xFC}}, - {"ld e, 128", "ld e, 128", 2, {0x1E, 0x80}}, - {"ld e , 128", "ld e, 128", 2 , {0x1E, 0x80}}, - {"ld e, 'B'", "ld e, 'B'", 2, {0x1E, 0x42}}, - {"ld e , 'B'", "ld e, 'B'", 2 , {0x1E, 0x42}}, - {"ld e, label1-label", "ld e, label1-label", 2, {0x1E, 0x05, 0x00, - 0x04}}, - {"ld e , label1 - label", "ld e, label1-label", 2, {0x1E, 0x05, 0x00, - 0x04}}, - {"ld e, label1-verylonglabel", "ld e, label1-verylonglabel", 2, - {0x1E, 0x05, 0x00, 0x04}}, - {"ld e , label1 - verylonglabel", "ld e, label1-verylonglabel", 2, - {0x1E, 0x05, 0x00, 0x04}}, - {"ld e, verylonglabel-label1", "ld e, verylonglabel-label1", 2, - {0x1E, 0x0, 0x05, 0x08}}, - {"ld e , verylonglabel - label1", "ld e, verylonglabel-label1", 2, - {0x1E, 0x0, 0x05, 0x08}}, - - {"ld h, (hl)", "ld h, (hl)", 1, {0x66}}, - {"ld h , ( hl )", "ld h, (hl)", 1, {0x66}}, - {"ld h, (ix+55)", "ld h, (ix+55)", 3, {0xDD, 0x66, 0x37}}, - {"ld h , ( ix + 55 )", "ld h, (ix+55)", 3, {0xDD, 0x66, 0x37}}, - {"ld h, (ix+$37)", "ld h, (ix+$37)", 3, {0xDD, 0x66, 0x37}}, - {"ld h , ( ix + $37 )", "ld h, (ix+$37)", 3, {0xDD, 0x66, 0x37}}, - {"ld h, (ix+-2)", "ld h, (ix+-2)", 3, {0xDD, 0x66, 0xFE}}, - {"ld h , ( ix + -2 )", "ld h, (ix+-2)", 3, {0xDD, 0x66, 0xFE}}, - {"ld h, (iy+55)", "ld h, (iy+55)", 3, {0xFD, 0x66, 0x37}}, - {"ld h , ( iy + 55 )", "ld h, (iy+55)", 3, {0xFD, 0x66, 0x37}}, - {"ld h, (iy+$37)", "ld h, (iy+$37)", 3, {0xFD, 0x66, 0x37}}, - {"ld h , ( iy + $37 )", "ld h, (iy+$37)", 3, {0xFD, 0x66, 0x37}}, - {"ld h, (iy+-2)", "ld h, (iy+-2)", 3, {0xFD, 0x66, 0xFE}}, - {"ld h , ( iy + -2 )", "ld h, (iy+-2)", 3, {0xFD, 0x66, 0xFE}}, - {"ld h, a", "ld h, a", 1, {0x67}}, - {"ld h , a", "ld h, a", 1, {0x67}}, - {"ld h, b", "ld h, b", 1, {0x60}}, - {"ld h , b", "ld h, b", 1, {0x60}}, - {"ld h, c", "ld h, c", 1, {0x61}}, - {"ld h , c", "ld h, c", 1, {0x61}}, - {"ld h, d", "ld h, d", 1, {0x62}}, - {"ld h , d", "ld h, d", 1, {0x62}}, - {"ld h, e", "ld h, e", 1, {0x63}}, - {"ld h , e", "ld h, e", 1, {0x63}}, - {"ld h, h", "ld h, h", 1, {0x64}}, - {"ld h , h", "ld h, h", 1, {0x64}}, - {"ld h, l", "ld h, l", 1, {0x65}}, - {"ld h , l", "ld h, l", 1, {0x65}}, - {"ld h, 32", "ld h, 32", 2, {0x26, 0x20}}, - {"ld h , 32", "ld h, 32", 2 , {0x26, 0x20}}, - {"ld h, $20", "ld h, $20", 2, {0x26, 0x20}}, - {"ld h , $20", "ld h, $20", 2 , {0x26, 0x20}}, - {"ld h, 128", "ld h, 128", 2, {0x26, 0x80}}, - {"ld h , 128", "ld h, 128", 2 , {0x26, 0x80}}, - {"ld h, -2", "ld h, -2", 2, {0x26, 0xFE}}, - {"ld h , -2", "ld h, -2", 2 , {0x26, 0xFE}}, - {"ld h, 'C'", "ld h, 'C'", 2, {0x26, 0x43}}, - {"ld h , 'C'", "ld h, 'C'", 2 , {0x26, 0x43}}, - {"ld h, label1-label", "ld h, label1-label", 2, {0x26, 0x05, 0x00, - 0x04}}, - {"ld h , label1 - label", "ld h, label1-label", 2, {0x26, 0x05, 0x00, - 0x04}}, - {"ld h, label1-verylonglabel", "ld h, label1-verylonglabel", 2, - {0x26, 0x05, 0x00, 0x04}}, - {"ld h , label1 - verylonglabel", "ld h, label1-verylonglabel", 2, - {0x26, 0x05, 0x00, 0x04}}, - {"ld h, verylonglabel-label1", "ld h, verylonglabel-label1", 2, - {0x26, 0x0, 0x05, 0x08}}, - {"ld h , verylonglabel - label1", "ld h, verylonglabel-label1", 2, - {0x26, 0x0, 0x05, 0x08}}, - - {"ld hl, 'C'", "ld hl, 'C'", 3, {0x21, 0x43, 0x00}}, - {"ld hl , 'C'", "ld hl, 'C'", 3 , {0x21, 0x43, 0x00}}, - {"ld hl, 257", "ld hl, 257", 3, {0x21, 0x01, 0x1}}, - {"ld hl , 257", "ld hl, 257", 3, {0x21, 0x01, 0x1}}, - {"ld hl, 65535", "ld hl, 65535", 3, {0x21, 0xFF, 0xFF}}, - {"ld hl , 65535", "ld hl, 65535", 3, {0x21, 0xFF, 0xFF}}, - {"ld hl, (257)", "ld hl, (257)", 3, {0x2A, 0x01, 0x1}}, - {"ld hl , ( 257 )", "ld hl, (257)", 3, {0x2A, 0x01, 0x1}}, - {"ld hl, ($beef)", "ld hl, ($beef)", 3, {0x2A, 0xEF, 0xBE}}, - {"ld hl , ( $beef )", "ld hl, ($beef)", 3, {0x2A, 0xEF, 0xBE}}, - {"ld hl, (label)", "ld hl, (label)", 3, {0x2A, 0x00, 0x0}}, - {"ld hl , ( label )", "ld hl, (label)", 3, {0x2A, 0x00, 0x0}}, - {"ld hl, label", "ld hl, label", 3, {0x21, 0x00, 0x00}}, - {"ld hl, label", "ld hl, label", 3, {0x21, 0x00, 0x00}}, - {"ld hl, label1-label", "ld hl, label1-label", 3, {0x21, 0x05, 0x00, - 0x04}}, - {"ld hl , label1 - label", "ld hl, label1-label", 3, {0x21, 0x05, 0x00, - 0x04}}, - {"ld hl, label1-verylonglabel", "ld hl, label1-verylonglabel", 3, - {0x21, 0x05, 0x00, 0x04}}, - {"ld hl , label1 - verylonglabel", "ld hl, label1-verylonglabel", 3, - {0x21, 0x05, 0x00, 0x04}}, - {"ld hl, verylonglabel-label1", "ld hl, verylonglabel-label1", 3, - {0x21, 0x0, 0x05, 0x08}}, - {"ld hl , verylonglabel - label1", "ld hl, verylonglabel-label1", 3, - {0x21, 0x0, 0x05, 0x08}}, - - {"ld i, a", "ld i, a", 2, {0xED, 0x47}}, - {"ld i , a", "ld i, a", 2, {0xED, 0x47}}, - - {"ld ix, (257)", "ld ix, (257)", 4, {0xDD, 0x2A, 0x1, 0x1}}, - {"ld ix , ( 257 )", "ld ix, (257)", 4, {0xDD, 0x2A, 0x1, 0x1}}, - {"ld ix, ($beef)", "ld ix, ($beef)", 4, {0xDD, 0x2A, 0xEF, 0xBE}}, - {"ld ix , ( $beef )", "ld ix, ($beef)", 4, {0xDD, 0x2A, 0xEF, 0xBE}}, - {"ld ix, (label)", "ld ix, (label)", 4, {0xDD, 0x2A, 0x0, 0x0}}, - {"ld ix , ( label )", "ld ix, (label)", 4, {0xDD, 0x2A, 0x0, 0x0}}, - {"ld ix, 257", "ld ix, 257", 4, {0xDD, 0x21, 0x1, 0x1}}, - {"ld ix , 257", "ld ix, 257", 4, {0xDD, 0x21, 0x1, 0x1}}, - {"ld ix, 65535", "ld ix, 65535", 4, {0xDD, 0x21, 0xFF, 0xFF}}, - {"ld ix , 65535", "ld ix, 65535", 4, {0xDD, 0x21, 0xFF, 0xFF}}, - {"ld ix, $beef", "ld ix, $beef", 4, {0xDD, 0x21, 0xEF, 0xBE}}, - {"ld ix , $beef", "ld ix, $beef", 4, {0xDD, 0x21, 0xEF, 0xBE}}, - {"ld ix, -32768", "ld ix, -32768", 4, {0xDD, 0x21, 0x0, 0x80}}, - {"ld ix , -32768", "ld ix, -32768", 4, {0xDD, 0x21, 0x0, 0x80}}, - {"ld ix, 'A'", "ld ix, 'A'", 4, {0xDD, 0x21, 0x41, 0x00}}, - {"ld ix , 'A'", "ld ix, 'A'", 4, {0xDD, 0x21, 0x41, 0x00}}, - {"ld ix, label", "ld ix, label", 4, {0xDD, 0x21, 0x0, 0x00}}, - {"ld ix , label", "ld ix, label", 4, {0xDD, 0x21, 0x0, 0x00}}, - - {"ld iy, (257)", "ld iy, (257)", 4, {0xFD, 0x2A, 0x1, 0x1}}, - {"ld iy , ( 257 )", "ld iy, (257)", 4, {0xFD, 0x2A, 0x1, 0x1}}, - {"ld iy, ($beef)", "ld iy, ($beef)", 4, {0xFD, 0x2A, 0xEF, 0xBE}}, - {"ld iy , ( $beef )", "ld iy, ($beef)", 4, {0xFD, 0x2A, 0xEF, 0xBE}}, - {"ld iy, (label)", "ld iy, (label)", 4, {0xFD, 0x2A, 0x0, 0x0}}, - {"ld iy , ( label )", "ld iy, (label)", 4, {0xFD, 0x2A, 0x0, 0x0}}, - {"ld iy, 257", "ld iy, 257", 4, {0xFD, 0x21, 0x1, 0x1}}, - {"ld iy , 257", "ld iy, 257", 4, {0xFD, 0x21, 0x1, 0x1}}, - {"ld iy, 65535", "ld iy, 65535", 4, {0xFD, 0x21, 0xFF, 0xFF}}, - {"ld iy , 65535", "ld iy, 65535", 4, {0xFD, 0x21, 0xFF, 0xFF}}, - {"ld iy, 'A'", "ld iy, 'A'", 4, {0xFD, 0x21, 0x41, 0x0}}, - {"ld iy , 'A'", "ld iy, 'A'", 4, {0xFD, 0x21, 0x41, 0x0}}, - {"ld iy, $beef", "ld iy, $beef", 4, {0xFD, 0x21, 0xEF, 0xBE}}, - {"ld iy , $beef", "ld iy, $beef", 4, {0xFD, 0x21, 0xEF, 0xBE}}, - {"ld iy, -2", "ld iy, -2", 4, {0xFD, 0x21, 0xFE, 0xFF}}, - {"ld iy , -2", "ld iy, -2", 4, {0xFD, 0x21, 0xFE, 0xFF}}, - {"ld iy, label", "ld iy, label", 4, {0xFD, 0x21, 0x0, 0x00}}, - {"ld iy , label", "ld iy, label", 4, {0xFD, 0x21, 0x0, 0x00}}, - - {"ld l, (hl)", "ld l, (hl)", 1, {0x6E}}, - {"ld l , ( hl )", "ld l, (hl)", 1, {0x6E}}, - {"ld l, (ix+55)", "ld l, (ix+55)", 3, {0xDD, 0x6E, 0x37}}, - {"ld l , ( ix + 55 )", "ld l, (ix+55)", 3, {0xDD, 0x6E, 0x37}}, - {"ld l, (ix+$37)", "ld l, (ix+$37)", 3, {0xDD, 0x6E, 0x37}}, - {"ld l , ( ix + $37 )", "ld l, (ix+$37)", 3, {0xDD, 0x6E, 0x37}}, - {"ld l, (ix+-2)", "ld l, (ix+-2)", 3, {0xDD, 0x6E, 0xFE}}, - {"ld l , ( ix + -2 )", "ld l, (ix+-2)", 3, {0xDD, 0x6E, 0xFE}}, - {"ld l, (iy+55)", "ld l, (iy+55)", 3, {0xFD, 0x6E, 0x37}}, - {"ld l , ( iy + 55 )", "ld l, (iy+55)", 3, {0xFD, 0x6E, 0x37}}, - {"ld l, (iy+$37)", "ld l, (iy+$37)", 3, {0xFD, 0x6E, 0x37}}, - {"ld l , ( iy + $37 )", "ld l, (iy+$37)", 3, {0xFD, 0x6E, 0x37}}, - {"ld l, (iy+-2)", "ld l, (iy+-2)", 3, {0xFD, 0x6E, 0xFE}}, - {"ld l , ( iy + -2 )", "ld l, (iy+-2)", 3, {0xFD, 0x6E, 0xFE}}, - {"ld l, a", "ld l, a", 1, {0x6F}}, - {"ld l , a", "ld l, a", 1, {0x6F}}, - {"ld l, b", "ld l, b", 1, {0x68}}, - {"ld l , b", "ld l, b", 1, {0x68}}, - {"ld l, c", "ld l, c", 1, {0x69}}, - {"ld l , c", "ld l, c", 1, {0x69}}, - {"ld l, d", "ld l, d", 1, {0x6A}}, - {"ld l , d", "ld l, d", 1, {0x6A}}, - {"ld l, e", "ld l, e", 1, {0x6B}}, - {"ld l , e", "ld l, e", 1, {0x6B}}, - {"ld l, h", "ld l, h", 1, {0x6C}}, - {"ld l , h", "ld l, h", 1, {0x6C}}, - {"ld l, l", "ld l, l", 1, {0x6D}}, - {"ld l , l", "ld l, l", 1, {0x6D}}, - {"ld l, 32", "ld l, 32", 2, {0x2E, 0x20}}, - {"ld l , 32", "ld l, 32", 2 , {0x2E, 0x20}}, - {"ld l, $20", "ld l, $20", 2, {0x2E, 0x20}}, - {"ld l , $20", "ld l, $20", 2 , {0x2E, 0x20}}, - {"ld l, 255", "ld l, 255", 2, {0x2E, 0xFF}}, - {"ld l , 255", "ld l, 255", 2 , {0x2E, 0xFF}}, - {"ld l, -2", "ld l, -2", 2, {0x2E, 0xFE}}, - {"ld l , -2", "ld l, -2", 2 , {0x2E, 0xFE}}, - {"ld l, 'A'", "ld l, 'A'", 2, {0x2E, 0x41}}, - {"ld l , 'A'", "ld l, 'A'", 2 , {0x2E, 0x41}}, - - {"ld sp, (257)", "ld sp, (257)", 4, {0xED, 0x7B, 0x1, 0x1}}, - {"ld sp , ( 257 )", "ld sp, (257)", 4, {0xED, 0x7B, 0x1, 0x1}}, - {"ld sp, ($dead)", "ld sp, ($dead)", 4, {0xED, 0x7B, 0xAD, 0xDE}}, - {"ld sp , ( $dead )", "ld sp, ($dead)", 4, {0xED, 0x7B, 0xAD, 0xDE}}, - {"ld sp, (label)", "ld sp, (label)", 4, {0xED, 0x7B, 0x0, 0x0}}, - {"ld sp , ( label )", "ld sp, (label)", 4, {0xED, 0x7B, 0x0, 0x0}}, - {"ld sp, hl", "ld sp, hl", 1, {0xF9}}, - {"ld sp , hl", "ld sp, hl", 1, {0xF9}}, - {"ld sp, ix", "ld sp, ix", 2, {0xDD, 0xF9}}, - {"ld sp , ix", "ld sp, ix", 2, {0xDD, 0xF9}}, - {"ld sp, iy", "ld sp, iy", 2, {0xFD, 0xF9}}, - {"ld sp , iy", "ld sp, iy", 2, {0xFD, 0xF9}}, - {"ld sp, 257", "ld sp, 257", 3, {0x31, 0x1, 0x1}}, - {"ld sp , 257", "ld sp, 257", 3, {0x31, 0x1, 0x1}}, - {"ld sp, 65535", "ld sp, 65535", 3, {0x31, 0xFF, 0xFF}}, - {"ld sp , 65535", "ld sp, 65535", 3, {0x31, 0xFF, 0xFF}}, - {"ld sp, $beef", "ld sp, $beef", 3, {0x31, 0xEF, 0xBE}}, - {"ld sp , $beef", "ld sp, $beef", 3, {0x31, 0xEF, 0xBE}}, - {"ld sp, -2", "ld sp, -2", 3, {0x31, 0xFE, 0xFF}}, - {"ld sp , -2", "ld sp, -2", 3, {0x31, 0xFE, 0xFF}}, - {"ld sp, 'A'", "ld sp, 'A'", 3, {0x31, 0x41, 0x0}}, - {"ld sp , 'A'", "ld sp, 'A'", 3, {0x31, 0x41, 0x0}}, - {"ld sp, label", "ld sp, label", 3, {0x31, 0x00, 0x00}}, - {"ld sp , label", "ld sp, label", 3, {0x31, 0x0, 0x00}}, - {"ld sp, label1-label", "ld sp, label1-label", 3, {0x31, 0x05, 0x00, - 0x04}}, - {"ld sp , label1 - label", "ld sp, label1-label", 3, {0x31, 0x05, 0x00, - 0x04}}, - {"ld sp, label1-verylonglabel", "ld sp, label1-verylonglabel", 3, - {0x31, 0x05, 0x00, 0x04}}, - {"ld sp , label1 - verylonglabel", "ld sp, label1-verylonglabel", 3, - {0x31, 0x05, 0x00, 0x04}}, - {"ld sp, verylonglabel-label1", "ld sp, verylonglabel-label1", 3, - {0x31, 0x0, 0x05, 0x08}}, - {"ld sp , verylonglabel - label1", "ld sp, verylonglabel-label1", 3, - {0x31, 0x0, 0x05, 0x08}}, - - {"ldd", "ldd", 2, {0xED, 0xA8}}, - {"lddr", "lddr", 2, {0xED, 0xB8}}, - {"ldi", "ldi", 2, {0xED, 0xA0}}, - {"map", "map", 1, {}}, - {"neg", "neg", 2, {0xED, 0x44}}, - {"nop", "nop", 1, {0x0}}, - - {"or (hl)", "or (hl)", 1, { 0xB6 }}, - {"or ( hl )", "or (hl)", 1, { 0xB6 }}, - {"or (ix + $ff)", "or (ix+$ff)", 3, { 0xDD, 0xB6, 0xff }}, - {"or ( ix + $ff )", "or (ix+$ff)", 3, { 0xDD, 0xB6, 0xff }}, - {"or (iy+2)", "or (iy+2)", 3, { 0xFD, 0xB6, 0x02 }}, - {"or ( iy +2 )", "or (iy+2)", 3, { 0xFD, 0xB6, 0x02 }}, - {"or (iy+-128)", "or (iy+-128)", 3, { 0xFD, 0xB6, 0x80 }}, - {"or ( iy + -128 )", "or (iy+-128)", 3, { 0xFD, 0xB6, 0x80 }}, - {"or a", "or a", 1, { 0xB7 }}, - {"or a", "or a", 1, { 0xB7 }}, - {"or b", "or b", 1, { 0xB0 }}, - {"or b", "or b", 1, { 0xB0 }}, - {"or c", "or c", 1, { 0xB1 }}, - {"or c", "or c", 1, { 0xB1 }}, - {"or d", "or d", 1, { 0xB2 }}, - {"or d", "or d", 1, { 0xB2 }}, - {"or e", "or e", 1, { 0xB3 }}, - {"or e", "or e", 1, { 0xB3 }}, - {"or h", "or h", 1, { 0xB4 }}, - {"or h", "or h", 1, { 0xB4 }}, - {"or l", "or l", 1, { 0xB5 }}, - {"or l", "or l", 1, { 0xB5 }}, - {"or 127", "or 127", 2, { 0xF6, 0x7f }}, - {"or 127", "or 127", 2, { 0xF6, 0x7f }}, - {"or 255", "or 255", 2, { 0xF6, 0xff }}, - {"or 255", "or 255", 2, { 0xF6, 0xff }}, - {"or 'A'", "or 'A'", 2, { 0xF6, 0x41 }}, - {"or 'A'", "or 'A'", 2, { 0xF6, 0x41 }}, - - /* - * The size here is wrong, but org statements - * don't have a size. It's easier to test - * org here with the rest of the instructions. - * We could have a separate set of tests for - * sizeless directives, but it's not worth it. - */ - - {"org $1000", "org $1000", 1, { 0x00, 0x10 }}, - {"org $1000", "org $1000", 1, { 0x00, 0x10 }}, - {"org 256", "org 256", 1, { 0x00, 0x1 }}, - {"org 256", "org 256", 1, { 0x00, 0x1 }}, - - {"otdr", "otdr", 2, {0xED, 0xBB}}, - {"otir", "otir", 2, {0xED, 0xB3}}, - - {"out (c), a", "out (c), a", 2, {0xED, 0x79}}, - {"out ( c ), a", "out (c), a", 2, {0xED, 0x79}}, - {"out (c), b", "out (c), b", 2, {0xED, 0x41}}, - {"out ( c ) , b", "out (c), b", 2, {0xED, 0x41}}, - {"out (c), c", "out (c), c", 2, {0xED, 0x49}}, - {"out ( c ) ,c", "out (c), c", 2, {0xED, 0x49}}, - {"out (c), d", "out (c), d", 2, {0xED, 0x51}}, - {"out ( c ),d", "out (c), d", 2, {0xED, 0x51}}, - {"out (c), e", "out (c), e", 2, {0xED, 0x59}}, - {"out ( c ) ,e", "out (c), e", 2, {0xED, 0x59}}, - {"out (c), h", "out (c), h", 2, {0xED, 0x61}}, - {"out ( c ) , h", "out (c), h", 2, {0xED, 0x61}}, - {"out (c), l", "out (c), l", 2, {0xED, 0x69}}, - {"out ( c ) , l", "out (c), l", 2, {0xED, 0x69}}, - {"out (66), a", "out (66), a", 2, {0xD3, 0x42}}, - {"out ( 66 ), a", "out (66), a", 2, {0xD3, 0x42}}, - {"out (128), a", "out (128), a", 2, {0xD3, 0x80}}, - {"out ( 128 ), a", "out (128), a", 2, {0xD3, 0x80}}, - {"out ($ff), a", "out ($ff), a", 2, {0xD3, 0xFF}}, - {"out ( $ff ), a", "out ($ff), a", 2, {0xD3, 0xFF}}, - - {"outd", "outd", 2, {0xED, 0xAB}}, - {"outi", "outi", 2, {0xED, 0xA3}}, - - {"pop af", "pop af", 1, {0xF1}}, - {"pop af", "pop af", 1, {0xF1}}, - {"pop bc", "pop bc", 1, {0xC1}}, - {"pop bc", "pop bc", 1, {0xC1}}, - {"pop de", "pop de", 1, {0xD1}}, - {"pop de", "pop de", 1, {0xD1}}, - {"pop hl", "pop hl", 1, {0xE1}}, - {"pop hl", "pop hl", 1, {0xE1}}, - {"pop ix", "pop ix", 2, {0xDD, 0xE1}}, - {"pop ix", "pop ix", 2, {0xDD, 0xE1}}, - {"pop iy", "pop iy", 2, {0xFD, 0xE1}}, - {"pop iy", "pop iy", 2, {0xFD, 0xE1}}, - - {"push af", "push af", 1, {0xF5}}, - {"push af", "push af", 1, {0xF5}}, - {"push bc", "push bc", 1, {0xC5}}, - {"push bc", "push bc", 1, {0xC5}}, - {"push de", "push de", 1, {0xD5}}, - {"push de", "push de", 1, {0xD5}}, - {"push hl", "push hl", 1, {0xE5}}, - {"push hl", "push hl", 1, {0xE5}}, - {"push ix", "push ix", 2, {0xDD, 0xE5}}, - {"push ix", "push ix", 2, {0xDD, 0xE5}}, - {"push iy", "push iy", 2, {0xFD, 0xE5}}, - {"push iy", "push iy", 2, {0xFD, 0xE5}}, - - {"res 0, (hl)", "res 0, (hl)", 2, { 0xCB, 0x86 }}, - {"res 0, ( hl )", "res 0, (hl)", 2, { 0xCB, 0x86 }}, - {"res 0, (ix + 127)", "res 0, (ix+127)", 4, { 0xDD, 0xCB, 0x7f, 0x86 }}, - {"res 0, ( ix + 127 )", "res 0, (ix+127)", 4, { 0xDD, 0xCB, 0x7f, 0x86 }}, - {"res 0, (iy + 127)", "res 0, (iy+127)", 4, { 0xFD, 0xCB, 0x7f, 0x86 }}, - {"res 0, ( iy + 127 )", "res 0, (iy+127)", 4, { 0xFD, 0xCB, 0x7f, 0x86 }}, - {"res 0, (iy + -128)", "res 0, (iy+-128)", 4, { 0xFD, 0xCB, 0x80, 0x86 }}, - {"res 0, (ix+$fe )", "res 0, (ix+$fe)", 4, { 0xDD, 0xCB, 0xfe, 0x86 }}, - {"res 0, (iy+$fe )", "res 0, (iy+$fe)", 4, { 0xFD, 0xCB, 0xfe, 0x86 }}, - {"res 0, a", "res 0, a", 2, { 0xCB, 0X87 }}, - {"res 0, a", "res 0, a", 2, { 0xCB, 0X87 }}, - {"res 0, b", "res 0, b", 2, { 0xCB, 0X80 }}, - {"res 0, b", "res 0, b", 2, { 0xCB, 0X80 }}, - {"res 0, c", "res 0, c", 2, { 0xCB, 0X81 }}, - {"res 0, c", "res 0, c", 2, { 0xCB, 0X81 }}, - {"res 0, d", "res 0, d", 2, { 0xCB, 0X82 }}, - {"res 0, d", "res 0, d", 2, { 0xCB, 0X82 }}, - {"res 0, e", "res 0, e", 2, { 0xCB, 0X83 }}, - {"res 0, e", "res 0, e", 2, { 0xCB, 0X83 }}, - {"res 0, h", "res 0, h", 2, { 0xCB, 0X84 }}, - {"res 0, h", "res 0, h", 2, { 0xCB, 0X84 }}, - {"res 0, l", "res 0, l", 2, { 0xCB, 0X85 }}, - {"res 0, l", "res 0, l", 2, { 0xCB, 0X85 }}, - {"res $0, l", "res 0, l", 2, { 0xCB, 0X85 }}, - - {"res 1, (hl)", "res 1, (hl)", 2, { 0xCB, 0x8E }}, - {"res 1, ( hl )", "res 1, (hl)", 2, { 0xCB, 0x8E }}, - {"res 1, (ix + 127)", "res 1, (ix+127)", 4, { 0xDD, 0xCB, 0x7f, 0x8E }}, - {"res 1, ( ix + 127 )", "res 1, (ix+127)", 4, { 0xDD, 0xCB, 0x7f, 0x8E }}, - {"res 1, (iy + 127)", "res 1, (iy+127)", 4, { 0xFD, 0xCB, 0x7f, 0x8E }}, - {"res 1, ( iy + 127 )", "res 1, (iy+127)", 4, { 0xFD, 0xCB, 0x7f, 0x8E }}, - {"res 1, (iy + -128)", "res 1, (iy+-128)", 4, { 0xFD, 0xCB, 0x80, 0x8E }}, - {"res 1, (ix+$fe )", "res 1, (ix+$fe)", 4, { 0xDD, 0xCB, 0xfe, 0x8E }}, - {"res 1, (iy+$fe )", "res 1, (iy+$fe)", 4, { 0xFD, 0xCB, 0xfe, 0x8E }}, - {"res 1, a", "res 1, a", 2, { 0xCB, 0X8F }}, - {"res 1, a", "res 1, a", 2, { 0xCB, 0X8F }}, - {"res 1, b", "res 1, b", 2, { 0xCB, 0X88 }}, - {"res 1, b", "res 1, b", 2, { 0xCB, 0X88 }}, - {"res 1, c", "res 1, c", 2, { 0xCB, 0X89 }}, - {"res 1, c", "res 1, c", 2, { 0xCB, 0X89 }}, - {"res 1, d", "res 1, d", 2, { 0xCB, 0X8A }}, - {"res 1, d", "res 1, d", 2, { 0xCB, 0X8A }}, - {"res 1, e", "res 1, e", 2, { 0xCB, 0X8B }}, - {"res 1, e", "res 1, e", 2, { 0xCB, 0X8B }}, - {"res 1, h", "res 1, h", 2, { 0xCB, 0X8C }}, - {"res 1, h", "res 1, h", 2, { 0xCB, 0X8C }}, - {"res 1, l", "res 1, l", 2, { 0xCB, 0X8D }}, - {"res 1, l", "res 1, l", 2, { 0xCB, 0X8D }}, - {"res $1, l", "res 1, l", 2, { 0xCB, 0X8D }}, - - {"res 2, (hl)", "res 2, (hl)", 2, { 0xCB, 0x96 }}, - {"res 2, ( hl )", "res 2, (hl)", 2, { 0xCB, 0x96 }}, - {"res 2, (ix + 127)", "res 2, (ix+127)", 4, { 0xDD, 0xCB, 0x7f, 0x96 }}, - {"res 2, ( ix + 127 )", "res 2, (ix+127)", 4, { 0xDD, 0xCB, 0x7f, 0x96 }}, - {"res 2, (iy + 127)", "res 2, (iy+127)", 4, { 0xFD, 0xCB, 0x7f, 0x96 }}, - {"res 2, ( iy + 127 )", "res 2, (iy+127)", 4, { 0xFD, 0xCB, 0x7f, 0x96 }}, - {"res 2, (iy + -128)", "res 2, (iy+-128)", 4, { 0xFD, 0xCB, 0x80, 0x96 }}, - {"res 2, (ix+$fe )", "res 2, (ix+$fe)", 4, { 0xDD, 0xCB, 0xfe, 0x96 }}, - {"res 2, (iy+$fe )", "res 2, (iy+$fe)", 4, { 0xFD, 0xCB, 0xfe, 0x96 }}, - {"res 2, a", "res 2, a", 2, { 0xCB, 0X97 }}, - {"res 2, a", "res 2, a", 2, { 0xCB, 0X97 }}, - {"res 2, b", "res 2, b", 2, { 0xCB, 0X90 }}, - {"res 2, b", "res 2, b", 2, { 0xCB, 0X90 }}, - {"res 2, c", "res 2, c", 2, { 0xCB, 0X91 }}, - {"res 2, c", "res 2, c", 2, { 0xCB, 0X91 }}, - {"res 2, d", "res 2, d", 2, { 0xCB, 0X92 }}, - {"res 2, d", "res 2, d", 2, { 0xCB, 0X92 }}, - {"res 2, e", "res 2, e", 2, { 0xCB, 0X93 }}, - {"res 2, e", "res 2, e", 2, { 0xCB, 0X93 }}, - {"res 2, h", "res 2, h", 2, { 0xCB, 0X94 }}, - {"res 2, h", "res 2, h", 2, { 0xCB, 0X94 }}, - {"res 2, l", "res 2, l", 2, { 0xCB, 0X95 }}, - {"res 2, l", "res 2, l", 2, { 0xCB, 0X95 }}, - {"res $2, l", "res 2, l", 2, { 0xCB, 0X95 }}, - - {"res 3, (hl)", "res 3, (hl)", 2, { 0xCB, 0x9E }}, - {"res 3, ( hl )", "res 3, (hl)", 2, { 0xCB, 0x9E }}, - {"res 3, (ix + 127)", "res 3, (ix+127)", 4, { 0xDD, 0xCB, 0x7f, 0x9E }}, - {"res 3, ( ix + 127 )", "res 3, (ix+127)", 4, { 0xDD, 0xCB, 0x7f, 0x9E }}, - {"res 3, (iy + 127)", "res 3, (iy+127)", 4, { 0xFD, 0xCB, 0x7f, 0x9E }}, - {"res 3, ( iy + 127 )", "res 3, (iy+127)", 4, { 0xFD, 0xCB, 0x7f, 0x9E }}, - {"res 3, (iy + -128)", "res 3, (iy+-128)", 4, { 0xFD, 0xCB, 0x80, 0x9E }}, - {"res 3, (ix+$fe )", "res 3, (ix+$fe)", 4, { 0xDD, 0xCB, 0xfe, 0x9E }}, - {"res 3, (iy+$fe )", "res 3, (iy+$fe)", 4, { 0xFD, 0xCB, 0xfe, 0x9E }}, - {"res 3, a", "res 3, a", 2, { 0xCB, 0X9F }}, - {"res 3, a", "res 3, a", 2, { 0xCB, 0X9F }}, - {"res 3, b", "res 3, b", 2, { 0xCB, 0X98 }}, - {"res 3, b", "res 3, b", 2, { 0xCB, 0X98 }}, - {"res 3, c", "res 3, c", 2, { 0xCB, 0X99 }}, - {"res 3, c", "res 3, c", 2, { 0xCB, 0X99 }}, - {"res 3, d", "res 3, d", 2, { 0xCB, 0X9A }}, - {"res 3, d", "res 3, d", 2, { 0xCB, 0X9A }}, - {"res 3, e", "res 3, e", 2, { 0xCB, 0X9B }}, - {"res 3, e", "res 3, e", 2, { 0xCB, 0X9B }}, - {"res 3, h", "res 3, h", 2, { 0xCB, 0X9C }}, - {"res 3, h", "res 3, h", 2, { 0xCB, 0X9C }}, - {"res 3, l", "res 3, l", 2, { 0xCB, 0X9D }}, - {"res 3, l", "res 3, l", 2, { 0xCB, 0X9D }}, - {"res $3, l", "res 3, l", 2, { 0xCB, 0X9D }}, - - {"res 4, (hl)", "res 4, (hl)", 2, { 0xCB, 0xA6 }}, - {"res 4, ( hl )", "res 4, (hl)", 2, { 0xCB, 0xA6 }}, - {"res 4, (ix + 127)", "res 4, (ix+127)", 4, { 0xDD, 0xCB, 0x7f, 0xA6 }}, - {"res 4, ( ix + 127 )", "res 4, (ix+127)", 4, { 0xDD, 0xCB, 0x7f, 0xA6 }}, - {"res 4, (iy + 127)", "res 4, (iy+127)", 4, { 0xFD, 0xCB, 0x7f, 0xA6 }}, - {"res 4, ( iy + 127 )", "res 4, (iy+127)", 4, { 0xFD, 0xCB, 0x7f, 0xA6 }}, - {"res 4, (iy + -128)", "res 4, (iy+-128)", 4, { 0xFD, 0xCB, 0x80, 0xA6 }}, - {"res 4, (ix+$fe )", "res 4, (ix+$fe)", 4, { 0xDD, 0xCB, 0xfe, 0xA6 }}, - {"res 4, (iy+$fe )", "res 4, (iy+$fe)", 4, { 0xFD, 0xCB, 0xfe, 0xA6 }}, - {"res 4, a", "res 4, a", 2, { 0xCB, 0XA7 }}, - {"res 4, a", "res 4, a", 2, { 0xCB, 0XA7 }}, - {"res 4, b", "res 4, b", 2, { 0xCB, 0XA0 }}, - {"res 4, b", "res 4, b", 2, { 0xCB, 0XA0 }}, - {"res 4, c", "res 4, c", 2, { 0xCB, 0XA1 }}, - {"res 4, c", "res 4, c", 2, { 0xCB, 0XA1 }}, - {"res 4, d", "res 4, d", 2, { 0xCB, 0XA2 }}, - {"res 4, d", "res 4, d", 2, { 0xCB, 0XA2 }}, - {"res 4, e", "res 4, e", 2, { 0xCB, 0XA3 }}, - {"res 4, e", "res 4, e", 2, { 0xCB, 0XA3 }}, - {"res 4, h", "res 4, h", 2, { 0xCB, 0XA4 }}, - {"res 4, h", "res 4, h", 2, { 0xCB, 0XA4 }}, - {"res 4, l", "res 4, l", 2, { 0xCB, 0XA5 }}, - {"res 4, l", "res 4, l", 2, { 0xCB, 0XA5 }}, - {"res $4, l", "res 4, l", 2, { 0xCB, 0XA5 }}, - - {"res 5, (hl)", "res 5, (hl)", 2, { 0xCB, 0xAE }}, - {"res 5, ( hl )", "res 5, (hl)", 2, { 0xCB, 0xAE }}, - {"res 5, (ix + 127)", "res 5, (ix+127)", 4, { 0xDD, 0xCB, 0x7f, 0xAE }}, - {"res 5, ( ix + 127 )", "res 5, (ix+127)", 4, { 0xDD, 0xCB, 0x7f, 0xAE }}, - {"res 5, (iy + 127)", "res 5, (iy+127)", 4, { 0xFD, 0xCB, 0x7f, 0xAE }}, - {"res 5, ( iy + 127 )", "res 5, (iy+127)", 4, { 0xFD, 0xCB, 0x7f, 0xAE }}, - {"res 5, (iy + -128)", "res 5, (iy+-128)", 4, { 0xFD, 0xCB, 0x80, 0xAE }}, - {"res 5, (ix+$fe )", "res 5, (ix+$fe)", 4, { 0xDD, 0xCB, 0xfe, 0xAE }}, - {"res 5, (iy+$fe )", "res 5, (iy+$fe)", 4, { 0xFD, 0xCB, 0xfe, 0xAE }}, - {"res 5, a", "res 5, a", 2, { 0xCB, 0XAF }}, - {"res 5, a", "res 5, a", 2, { 0xCB, 0XAF }}, - {"res 5, b", "res 5, b", 2, { 0xCB, 0XA8 }}, - {"res 5, b", "res 5, b", 2, { 0xCB, 0XA8 }}, - {"res 5, c", "res 5, c", 2, { 0xCB, 0XA9 }}, - {"res 5, c", "res 5, c", 2, { 0xCB, 0XA9 }}, - {"res 5, d", "res 5, d", 2, { 0xCB, 0XAA }}, - {"res 5, d", "res 5, d", 2, { 0xCB, 0XAA }}, - {"res 5, e", "res 5, e", 2, { 0xCB, 0XAB }}, - {"res 5, e", "res 5, e", 2, { 0xCB, 0XAB }}, - {"res 5, h", "res 5, h", 2, { 0xCB, 0XAC }}, - {"res 5, h", "res 5, h", 2, { 0xCB, 0XAC }}, - {"res 5, l", "res 5, l", 2, { 0xCB, 0XAD }}, - {"res 5, l", "res 5, l", 2, { 0xCB, 0XAD }}, - {"res $5, l", "res 5, l", 2, { 0xCB, 0XAD }}, - - {"res 6, (hl)", "res 6, (hl)", 2, { 0xCB, 0xB6 }}, - {"res 6, ( hl )", "res 6, (hl)", 2, { 0xCB, 0xB6 }}, - {"res 6, (ix + 127)", "res 6, (ix+127)", 4, { 0xDD, 0xCB, 0x7f, 0xB6 }}, - {"res 6, ( ix + 127 )", "res 6, (ix+127)", 4, { 0xDD, 0xCB, 0x7f, 0xB6 }}, - {"res 6, (iy + 127)", "res 6, (iy+127)", 4, { 0xFD, 0xCB, 0x7f, 0xB6 }}, - {"res 6, ( iy + 127 )", "res 6, (iy+127)", 4, { 0xFD, 0xCB, 0x7f, 0xB6 }}, - {"res 6, (iy + -128)", "res 6, (iy+-128)", 4, { 0xFD, 0xCB, 0x80, 0xB6 }}, - {"res 6, (ix+$fe )", "res 6, (ix+$fe)", 4, { 0xDD, 0xCB, 0xfe, 0xB6 }}, - {"res 6, (iy+$fe )", "res 6, (iy+$fe)", 4, { 0xFD, 0xCB, 0xfe, 0xB6 }}, - {"res 6, a", "res 6, a", 2, { 0xCB, 0XB7 }}, - {"res 6, a", "res 6, a", 2, { 0xCB, 0XB7 }}, - {"res 6, b", "res 6, b", 2, { 0xCB, 0XB0 }}, - {"res 6, b", "res 6, b", 2, { 0xCB, 0XB0 }}, - {"res 6, c", "res 6, c", 2, { 0xCB, 0XB1 }}, - {"res 6, c", "res 6, c", 2, { 0xCB, 0XB1 }}, - {"res 6, d", "res 6, d", 2, { 0xCB, 0XB2 }}, - {"res 6, d", "res 6, d", 2, { 0xCB, 0XB2 }}, - {"res 6, e", "res 6, e", 2, { 0xCB, 0XB3 }}, - {"res 6, e", "res 6, e", 2, { 0xCB, 0XB3 }}, - {"res 6, h", "res 6, h", 2, { 0xCB, 0XB4 }}, - {"res 6, h", "res 6, h", 2, { 0xCB, 0XB4 }}, - {"res 6, l", "res 6, l", 2, { 0xCB, 0XB5 }}, - {"res 6, l", "res 6, l", 2, { 0xCB, 0XB5 }}, - {"res $6, l", "res 6, l", 2, { 0xCB, 0XB5 }}, - - {"res 7, (hl)", "res 7, (hl)", 2, { 0xCB, 0xBE }}, - {"res 7, ( hl )", "res 7, (hl)", 2, { 0xCB, 0xBE }}, - {"res 7, (ix + 127)", "res 7, (ix+127)", 4, { 0xDD, 0xCB, 0x7f, 0xBE }}, - {"res 7, ( ix + 127 )", "res 7, (ix+127)", 4, { 0xDD, 0xCB, 0x7f, 0xBE }}, - {"res 7, (iy + 127)", "res 7, (iy+127)", 4, { 0xFD, 0xCB, 0x7f, 0xBE }}, - {"res 7, ( iy + 127 )", "res 7, (iy+127)", 4, { 0xFD, 0xCB, 0x7f, 0xBE }}, - {"res 7, (iy + -128)", "res 7, (iy+-128)", 4, { 0xFD, 0xCB, 0x80, 0xBE }}, - {"res 7, (ix+$fe )", "res 7, (ix+$fe)", 4, { 0xDD, 0xCB, 0xfe, 0xBE }}, - {"res 7, (iy+$fe )", "res 7, (iy+$fe)", 4, { 0xFD, 0xCB, 0xfe, 0xBE }}, - {"res 7, a", "res 7, a", 2, { 0xCB, 0XBF }}, - {"res 7, a", "res 7, a", 2, { 0xCB, 0XBF }}, - {"res 7, b", "res 7, b", 2, { 0xCB, 0XB8 }}, - {"res 7, b", "res 7, b", 2, { 0xCB, 0XB8 }}, - {"res 7, c", "res 7, c", 2, { 0xCB, 0XB9 }}, - {"res 7, c", "res 7, c", 2, { 0xCB, 0XB9 }}, - {"res 7, d", "res 7, d", 2, { 0xCB, 0XBA }}, - {"res 7, d", "res 7, d", 2, { 0xCB, 0XBA }}, - {"res 7, e", "res 7, e", 2, { 0xCB, 0XBB }}, - {"res 7, e", "res 7, e", 2, { 0xCB, 0XBB }}, - {"res 7, h", "res 7, h", 2, { 0xCB, 0XBC }}, - {"res 7, h", "res 7, h", 2, { 0xCB, 0XBC }}, - {"res 7, l", "res 7, l", 2, { 0xCB, 0XBD }}, - {"res 7, l", "res 7, l", 2, { 0xCB, 0XBD }}, - {"res $7, l", "res 7, l", 2, { 0xCB, 0XBD }}, - - {"ret", "ret", 1, {0xc9}}, - {"ret c", "ret c", 1, {0xd8}}, - {"ret c", "ret c", 1, {0xd8}}, - {"ret m", "ret m", 1, {0xf8}}, - {"ret m", "ret m", 1, {0xf8}}, - {"ret nc", "ret nc", 1, {0xd0}}, - {"ret nc", "ret nc", 1, {0xd0}}, - {"ret nz", "ret nz", 1, {0xc0}}, - {"ret nz", "ret nz", 1, {0xc0}}, - {"ret p", "ret p", 1, {0xf0}}, - {"ret p", "ret p", 1, {0xf0}}, - {"ret pe", "ret pe", 1, {0xe8}}, - {"ret pe", "ret pe", 1, {0xe8}}, - {"ret po", "ret po", 1, {0xe0}}, - {"ret po", "ret po", 1, {0xe0}}, - - {"reti", "reti", 2, {0xED, 0x4D}}, - {"retn", "retn", 2, {0xED, 0x45}}, - - {"rl (hl)", "rl (hl)", 2, { 0xCB, 0x16 }}, - {"rl ( hl )", "rl (hl)", 2, { 0xCB, 0x16 }}, - {"rl (ix + $ff)", "rl (ix+$ff)", 4, { 0xDD, 0xCB, 0xff, 0x16 }}, - {"rl ( ix + $ff )", "rl (ix+$ff)", 4, { 0xDD, 0xCB, 0xff, 0x16 }}, - {"rl (iy+-128)", "rl (iy+-128)", 4, { 0xFD, 0xCB, 0x80, 0x16 }}, - {"rl ( iy + -128 )", "rl (iy+-128)", 4, { 0xFD, 0xCB, 0x80, 0x16 }}, - {"rl (iy+2)", "rl (iy+2)", 4, { 0xFD, 0xCB, 0x02, 0x16 }}, - {"rl ( iy + 2 )", "rl (iy+2)", 4, { 0xFD, 0xCB, 0x02, 0x16 }}, - {"rl a", "rl a", 2, { 0xCB, 0x17 }}, - {"rl a", "rl a", 2, { 0xCB, 0x17 }}, - {"rl b", "rl b", 2, { 0xCB, 0x10 }}, - {"rl b", "rl b", 2, { 0xCB, 0x10 }}, - {"rl c", "rl c", 2, { 0xCB, 0x11 }}, - {"rl c", "rl c", 2, { 0xCB, 0x11 }}, - {"rl d", "rl d", 2, { 0xCB, 0x12 }}, - {"rl d", "rl d", 2, { 0xCB, 0x12 }}, - {"rl e", "rl e", 2, { 0xCB, 0x13 }}, - {"rl e", "rl e", 2, { 0xCB, 0x13 }}, - {"rl h", "rl h", 2, { 0xCB, 0x14 }}, - {"rl h", "rl h", 2, { 0xCB, 0x14 }}, - {"rl l", "rl l", 2, { 0xCB, 0x15 }}, - {"rl l", "rl l", 2, { 0xCB, 0x15 }}, - - {"rla", "rla", 1, { 0x17 }}, - - {"rlc (hl)", "rlc (hl)", 2, { 0xCB, 0x06 }}, - {"rlc ( hl )", "rlc (hl)", 2, { 0xCB, 0x06 }}, - {"rlc (ix+$ff)", "rlc (ix+$ff)", 4, { 0xDD, 0xCB, 0xff, 0x06 }}, - {"rlc ( ix + $ ff )", "rlc (ix+$ff)", 4, { 0xDD, 0xCB, 0xff, 0x06 }}, - {"rlc (iy+-128)", "rlc (iy+-128)", 4, { 0xFD, 0xCB, 0x80, 0x06 }}, - {"rlc ( iy + -128 )", "rlc (iy+-128)", 4, { 0xFD, 0xCB, 0x80, 0x06 }}, - {"rlc (ix+2)", "rlc (ix+2)", 4, { 0xDD, 0xCB, 0x2, 0x06 }}, - {"rlc ( ix + 2 )", "rlc (ix+2)", 4, { 0xDD, 0xCB, 0x2, 0x06 }}, - {"rlc a", "rlc a", 2, { 0xCB, 0x07 }}, - {"rlc a", "rlc a", 2, { 0xCB, 0x07 }}, - {"rlc b", "rlc b", 2, { 0xCB, 0x00 }}, - {"rlc b", "rlc b", 2, { 0xCB, 0x00 }}, - {"rlc c", "rlc c", 2, { 0xCB, 0x01 }}, - {"rlc c", "rlc c", 2, { 0xCB, 0x01 }}, - {"rlc d", "rlc d", 2, { 0xCB, 0x02 }}, - {"rlc d", "rlc d", 2, { 0xCB, 0x02 }}, - {"rlc e", "rlc e", 2, { 0xCB, 0x03 }}, - {"rlc e", "rlc e", 2, { 0xCB, 0x03 }}, - {"rlc h", "rlc h", 2, { 0xCB, 0x04 }}, - {"rlc h", "rlc h", 2, { 0xCB, 0x04 }}, - {"rlc l", "rlc l", 2, { 0xCB, 0x05 }}, - {"rlc l", "rlc l", 2, { 0xCB, 0x05 }}, - - {"rlca", "rlca", 1, { 0x07 }}, - {"rld", "rld", 2, { 0xED, 0x6F }}, - - {"rr (hl)", "rr (hl)", 2, { 0xCB, 0x1E }}, - {"rr ( hl )", "rr (hl)", 2, { 0xCB, 0x1E }}, - {"rr (ix+$ff)", "rr (ix+$ff)", 4, { 0xDD, 0xCB, 0xff, 0x1E }}, - {"rr ( ix + $ff )", "rr (ix+$ff)", 4, { 0xDD, 0xCB, 0xff, 0x1E }}, - {"rr (iy+-128)", "rr (iy+-128)", 4, { 0xFD, 0xCB, 0x80, 0x1E }}, - {"rr ( iy + -128 )", "rr (iy+-128)", 4, { 0xFD, 0xCB, 0x80, 0x1E }}, - {"rr (iy+2)", "rr (iy+2)", 4, { 0xFD, 0xCB, 0x2, 0x1E }}, - {"rr ( iy + 2 )", "rr (iy+2)", 4, { 0xFD, 0xCB, 0x2, 0x1E }}, - {"rr a", "rr a", 2, { 0xCB, 0x1F }}, - {"rr a", "rr a", 2, { 0xCB, 0x1F }}, - {"rr b", "rr b", 2, { 0xCB, 0x18 }}, - {"rr b", "rr b", 2, { 0xCB, 0x18 }}, - {"rr c", "rr c", 2, { 0xCB, 0x19 }}, - {"rr c", "rr c", 2, { 0xCB, 0x19 }}, - {"rr d", "rr d", 2, { 0xCB, 0x1A }}, - {"rr d", "rr d", 2, { 0xCB, 0x1A }}, - {"rr e", "rr e", 2, { 0xCB, 0x1B }}, - {"rr e", "rr e", 2, { 0xCB, 0x1B }}, - {"rr h", "rr h", 2, { 0xCB, 0x1C }}, - {"rr h", "rr h", 2, { 0xCB, 0x1C }}, - {"rr l", "rr l", 2, { 0xCB, 0x1D }}, - {"rr l", "rr l", 2, { 0xCB, 0x1D }}, - - {"rra", "rra", 1, { 0x1F}}, - - {"rrc (hl)", "rrc (hl)", 2, { 0xCB, 0x0E }}, - {"rrc ( hl )", "rrc (hl)", 2, { 0xCB, 0x0E }}, - {"rrc (ix+$ff)", "rrc (ix+$ff)", 4, { 0xDD, 0xCB, 0xff, 0x0E }}, - {"rrc ( ix + $ff )", "rrc (ix+$ff)", 4, { 0xDD, 0xCB, 0xff, 0x0E }}, - {"rrc (iy+-128)", "rrc (iy+-128)", 4, { 0xFD, 0xCB, 0x80, 0x0E }}, - {"rrc ( iy + -128 )", "rrc (iy+-128)", 4, { 0xFD, 0xCB, 0x80, 0x0E }}, - {"rrc (iy+3)", "rrc (iy+3)", 4, { 0xFD, 0xCB, 0x3, 0x0E }}, - {"rrc ( iy + 3 )", "rrc (iy+3)", 4, { 0xFD, 0xCB, 0x3, 0x0E }}, - {"rrc a", "rrc a", 2, { 0xCB, 0x0F }}, - {"rrc a", "rrc a", 2, { 0xCB, 0x0F }}, - {"rrc b", "rrc b", 2, { 0xCB, 0x08 }}, - {"rrc b", "rrc b", 2, { 0xCB, 0x08 }}, - {"rrc c", "rrc c", 2, { 0xCB, 0x09 }}, - {"rrc c", "rrc c", 2, { 0xCB, 0x09 }}, - {"rrc d", "rrc d", 2, { 0xCB, 0x0A }}, - {"rrc d", "rrc d", 2, { 0xCB, 0x0A }}, - {"rrc e", "rrc e", 2, { 0xCB, 0x0B }}, - {"rrc e", "rrc e", 2, { 0xCB, 0x0B }}, - {"rrc h", "rrc h", 2, { 0xCB, 0x0C }}, - {"rrc h", "rrc h", 2, { 0xCB, 0x0C }}, - {"rrc l", "rrc l", 2, { 0xCB, 0x0D }}, - {"rrc l", "rrc l", 2, { 0xCB, 0x0D }}, - - {"rrd", "rrd", 2, { 0xED, 0x67 }}, - - {"rst 0", "rst 0", 1, { 0xC7 }}, - {"rst 0", "rst 0", 1, { 0xC7 }}, - {"rst $0", "rst $0", 1, { 0xC7 }}, - {"rst $0", "rst $0", 1, { 0xC7 }}, - {"rst 8", "rst 8", 1, { 0xCF }}, - {"rst 8", "rst 8", 1, { 0xCF }}, - {"rst $8", "rst $8", 1, { 0xCF }}, - {"rst $8", "rst $8", 1, { 0xCF }}, - {"rst 16", "rst 16", 1, { 0xD7 }}, - {"rst 16", "rst 16", 1, { 0xD7 }}, - {"rst $10", "rst $10", 1, { 0xD7 }}, - {"rst $10", "rst $10", 1, { 0xD7 }}, - {"rst 24", "rst 24", 1, { 0xDF }}, - {"rst 24", "rst 24", 1, { 0xDF }}, - {"rst $18", "rst $18", 1, { 0xDF }}, - {"rst $18", "rst $18", 1, { 0xDF }}, - {"rst 32", "rst 32", 1, { 0xE7 }}, - {"rst 32", "rst 32", 1, { 0xE7 }}, - {"rst $20", "rst $20", 1, { 0xE7 }}, - {"rst $20", "rst $20", 1, { 0xE7 }}, - {"rst ' '", "rst ' '", 1, { 0xE7 }}, - {"rst ' '", "rst ' '", 1, { 0xE7 }}, - {"rst 40", "rst 40", 1, { 0xEF }}, - {"rst 40", "rst 40", 1, { 0xEF }}, - {"rst $28", "rst $28", 1, { 0xEF }}, - {"rst $28", "rst $28", 1, { 0xEF }}, - {"rst 48", "rst 48", 1, { 0xF7 }}, - {"rst 48", "rst 48", 1, { 0xF7 }}, - {"rst $30", "rst $30", 1, { 0xF7 }}, - {"rst $30", "rst $30", 1, { 0xF7 }}, - {"rst 56", "rst 56", 1, { 0xFF }}, - {"rst 56", "rst 56", 1, { 0xFF }}, - {"rst $38", "rst $38", 1, { 0xFF }}, - {"rst $38", "rst $38", 1, { 0xFF }}, - - {"sbc a, (hl)", "sbc a, (hl)", 1, { 0x9e }}, - {"sbc a,( hl)", "sbc a, (hl)", 1, { 0x9e }}, - {"sbc a, (ix+15)", "sbc a, (ix+15)", 3, { 0xdd, 0x9e, 0xf}}, - {"sbc a,( ix + 15 )", "sbc a, (ix+15)", 3, { 0xdd, 0x9e, 0xf}}, - {"sbc a, (ix+$f)", "sbc a, (ix+$f)", 3, { 0xdd, 0x9e, 0xf}}, - {"sbc a,( ix + $f )", "sbc a, (ix+$f)", 3, { 0xdd, 0x9e, 0xf}}, - {"sbc a, (iy+15)", "sbc a, (iy+15)", 3, { 0xfd, 0x9e, 0xf}}, - {"sbc a,( iy + 15 )", "sbc a, (iy+15)", 3, { 0xfd, 0x9e, 0xf}}, - {"sbc a, (iy+-1)", "sbc a, (iy+-1)", 3, { 0xfd, 0x9e, 0xff}}, - {"sbc a,( iy + -1 )", "sbc a, (iy+-1)", 3, { 0xfd, 0x9e, 0xff}}, - {"sbc a,( iy + 0)", "sbc a, (iy+0)", 3, { 0xfd, 0x9e, 0x0}}, - {"sbc a,( iy + 0)", "sbc a, (iy+0)", 3, { 0xfd, 0x9e, 0x0}}, - {"sbc a, a", "sbc a, a", 1, { 0x9f }}, - {"sbc a,a", "sbc a, a", 1, { 0x9f }}, - {"sbc a, b", "sbc a, b", 1, { 0x98 }}, - {"sbc a,b", "sbc a, b", 1, { 0x98 }}, - {"sbc a, c", "sbc a, c", 1, { 0x99 }}, - {"sbc a , c", "sbc a, c", 1, { 0x99 }}, - {"sbc a, d", "sbc a, d", 1, { 0x9A }}, - {"sbc a , d", "sbc a, d", 1, { 0x9A }}, - {"sbc a, e", "sbc a, e", 1, { 0x9B }}, - {"sbc a , e", "sbc a, e", 1, { 0x9B }}, - {"sbc a, h", "sbc a, h", 1, { 0x9C }}, - {"sbc a , h", "sbc a, h", 1, { 0x9C }}, - {"sbc a, l", "sbc a, l", 1, { 0x9D }}, - {"sbc a , l", "sbc a, l", 1, { 0x9D }}, - {"sbc a, 40", "sbc a, 40", 2, { 0xDE, 0x28 }}, - {"sbc a , 40", "sbc a, 40", 2, { 0xDE, 0x28 }}, - {"sbc a, $28", "sbc a, $28", 2, { 0xDE, 0x28 }}, - {"sbc a , $28", "sbc a, $28", 2, { 0xDE, 0x28 }}, - {"sbc a, 255", "sbc a, 255", 2, { 0xDE, 0xFF }}, - {"sbc a , 255", "sbc a, 255", 2, { 0xDE, 0xFF }}, - {"sbc a, 'A'", "sbc a, 'A'", 2, { 0xDE, 0x41 }}, - {"sbc a , 'A'", "sbc a, 'A'", 2, { 0xDE, 0x41 }}, - {"sbc a, -1", "sbc a, -1", 2, { 0xDE, 0xFF }}, - {"sbc a , -1", "sbc a, -1", 2, { 0xDE, 0xFF }}, - {"sbc hl, bc", "sbc hl, bc", 2, { 0xed, 0x42 }}, - {"sbc hl, bc", "sbc hl, bc", 2, { 0xed, 0x42 }}, - {"sbc hl, de", "sbc hl, de", 2, { 0xed, 0x52 }}, - {"sbc hl, de", "sbc hl, de", 2, { 0xed, 0x52 }}, - {"sbc hl, hl", "sbc hl, hl", 2, { 0xed, 0x62 }}, - {"sbc hl, hl", "sbc hl, hl", 2, { 0xed, 0x62 }}, - {"sbc hl, sp", "sbc hl, sp", 2, { 0xed, 0x72 }}, - {"sbc hl, sp", "sbc hl, sp", 2, { 0xed, 0x72 }}, - - {"scf", "scf", 1, { 0x37 }}, - - {"set 0, (hl)", "set 0, (hl)", 2, { 0xCB, 0xC6 }}, - {"set 0, ( hl )", "set 0, (hl)", 2, { 0xCB, 0xC6 }}, - {"set 0, (ix + 127)", "set 0, (ix+127)", 4, { 0xDD, 0xCB, 0x7f, 0xC6 }}, - {"set 0, ( ix + 127 )", "set 0, (ix+127)", 4, { 0xDD, 0xCB, 0x7f, 0xC6 }}, - {"set 0, (iy + 127)", "set 0, (iy+127)", 4, { 0xFD, 0xCB, 0x7f, 0xC6 }}, - {"set 0, ( iy + 127 )", "set 0, (iy+127)", 4, { 0xFD, 0xCB, 0x7f, 0xC6 }}, - {"set 0, (iy + -128)", "set 0, (iy+-128)", 4, { 0xFD, 0xCB, 0x80, 0xC6 }}, - {"set 0, (ix+$fe )", "set 0, (ix+$fe)", 4, { 0xDD, 0xCB, 0xfe, 0xC6 }}, - {"set 0, (iy+$fe )", "set 0, (iy+$fe)", 4, { 0xFD, 0xCB, 0xfe, 0xC6 }}, - {"set 0, a", "set 0, a", 2, { 0xCB, 0XC7 }}, - {"set 0, a", "set 0, a", 2, { 0xCB, 0XC7 }}, - {"set 0, b", "set 0, b", 2, { 0xCB, 0XC0 }}, - {"set 0, b", "set 0, b", 2, { 0xCB, 0XC0 }}, - {"set 0, c", "set 0, c", 2, { 0xCB, 0XC1 }}, - {"set 0, c", "set 0, c", 2, { 0xCB, 0XC1 }}, - {"set 0, d", "set 0, d", 2, { 0xCB, 0XC2 }}, - {"set 0, d", "set 0, d", 2, { 0xCB, 0XC2 }}, - {"set 0, e", "set 0, e", 2, { 0xCB, 0XC3 }}, - {"set 0, e", "set 0, e", 2, { 0xCB, 0XC3 }}, - {"set 0, h", "set 0, h", 2, { 0xCB, 0XC4 }}, - {"set 0, h", "set 0, h", 2, { 0xCB, 0XC4 }}, - {"set 0, l", "set 0, l", 2, { 0xCB, 0XC5 }}, - {"set 0, l", "set 0, l", 2, { 0xCB, 0XC5 }}, - - {"set 1, (hl)", "set 1, (hl)", 2, { 0xCB, 0xCE }}, - {"set 1, ( hl )", "set 1, (hl)", 2, { 0xCB, 0xCE }}, - {"set 1, (ix + 127)", "set 1, (ix+127)", 4, { 0xDD, 0xCB, 0x7f, 0xCE }}, - {"set 1, ( ix + 127 )", "set 1, (ix+127)", 4, { 0xDD, 0xCB, 0x7f, 0xCE }}, - {"set 1, (iy + 127)", "set 1, (iy+127)", 4, { 0xFD, 0xCB, 0x7f, 0xCE }}, - {"set 1, ( iy + 127 )", "set 1, (iy+127)", 4, { 0xFD, 0xCB, 0x7f, 0xCE }}, - {"set 1, (iy + -128)", "set 1, (iy+-128)", 4, { 0xFD, 0xCB, 0x80, 0xCE }}, - {"set 1, (ix+$fe )", "set 1, (ix+$fe)", 4, { 0xDD, 0xCB, 0xfe, 0xCE }}, - {"set 1, (iy+$fe )", "set 1, (iy+$fe)", 4, { 0xFD, 0xCB, 0xfe, 0xCE }}, - {"set 1, a", "set 1, a", 2, { 0xCB, 0XCF }}, - {"set 1, a", "set 1, a", 2, { 0xCB, 0XCF }}, - {"set 1, b", "set 1, b", 2, { 0xCB, 0XC8 }}, - {"set 1, b", "set 1, b", 2, { 0xCB, 0XC8 }}, - {"set 1, c", "set 1, c", 2, { 0xCB, 0XC9 }}, - {"set 1, c", "set 1, c", 2, { 0xCB, 0XC9 }}, - {"set 1, d", "set 1, d", 2, { 0xCB, 0XCA }}, - {"set 1, d", "set 1, d", 2, { 0xCB, 0XCA }}, - {"set 1, e", "set 1, e", 2, { 0xCB, 0XCB }}, - {"set 1, e", "set 1, e", 2, { 0xCB, 0XCB }}, - {"set 1, h", "set 1, h", 2, { 0xCB, 0XCC }}, - {"set 1, h", "set 1, h", 2, { 0xCB, 0XCC }}, - {"set 1, l", "set 1, l", 2, { 0xCB, 0XCD }}, - {"set 1, l", "set 1, l", 2, { 0xCB, 0XCD }}, - - {"set 2, (hl)", "set 2, (hl)", 2, { 0xCB, 0xD6 }}, - {"set 2, ( hl )", "set 2, (hl)", 2, { 0xCB, 0xD6 }}, - {"set 2, (ix + 127)", "set 2, (ix+127)", 4, { 0xDD, 0xCB, 0x7f, 0xD6 }}, - {"set 2, ( ix + 127 )", "set 2, (ix+127)", 4, { 0xDD, 0xCB, 0x7f, 0xD6 }}, - {"set 2, (iy + 127)", "set 2, (iy+127)", 4, { 0xFD, 0xCB, 0x7f, 0xD6 }}, - {"set 2, ( iy + 127 )", "set 2, (iy+127)", 4, { 0xFD, 0xCB, 0x7f, 0xD6 }}, - {"set 2, (iy + -128)", "set 2, (iy+-128)", 4, { 0xFD, 0xCB, 0x80, 0xD6 }}, - {"set 2, (ix+$fe )", "set 2, (ix+$fe)", 4, { 0xDD, 0xCB, 0xfe, 0xD6 }}, - {"set 2, (iy+$fe )", "set 2, (iy+$fe)", 4, { 0xFD, 0xCB, 0xfe, 0xD6 }}, - {"set 2, a", "set 2, a", 2, { 0xCB, 0XD7 }}, - {"set 2, a", "set 2, a", 2, { 0xCB, 0XD7 }}, - {"set 2, b", "set 2, b", 2, { 0xCB, 0XD0 }}, - {"set 2, b", "set 2, b", 2, { 0xCB, 0XD0 }}, - {"set 2, c", "set 2, c", 2, { 0xCB, 0XD1 }}, - {"set 2, c", "set 2, c", 2, { 0xCB, 0XD1 }}, - {"set 2, d", "set 2, d", 2, { 0xCB, 0XD2 }}, - {"set 2, d", "set 2, d", 2, { 0xCB, 0XD2 }}, - {"set 2, e", "set 2, e", 2, { 0xCB, 0XD3 }}, - {"set 2, e", "set 2, e", 2, { 0xCB, 0XD3 }}, - {"set 2, h", "set 2, h", 2, { 0xCB, 0XD4 }}, - {"set 2, h", "set 2, h", 2, { 0xCB, 0XD4 }}, - {"set 2, l", "set 2, l", 2, { 0xCB, 0XD5 }}, - {"set 2, l", "set 2, l", 2, { 0xCB, 0XD5 }}, - - {"set 3, (hl)", "set 3, (hl)", 2, { 0xCB, 0xDE }}, - {"set 3, ( hl )", "set 3, (hl)", 2, { 0xCB, 0xDE }}, - {"set 3, (ix + 127)", "set 3, (ix+127)", 4, { 0xDD, 0xCB, 0x7f, 0xDE }}, - {"set 3, ( ix + 127 )", "set 3, (ix+127)", 4, { 0xDD, 0xCB, 0x7f, 0xDE }}, - {"set 3, (iy + 127)", "set 3, (iy+127)", 4, { 0xFD, 0xCB, 0x7f, 0xDE }}, - {"set 3, ( iy + 127 )", "set 3, (iy+127)", 4, { 0xFD, 0xCB, 0x7f, 0xDE }}, - {"set 3, (iy + -128)", "set 3, (iy+-128)", 4, { 0xFD, 0xCB, 0x80, 0xDE }}, - {"set 3, (ix+$fe )", "set 3, (ix+$fe)", 4, { 0xDD, 0xCB, 0xfe, 0xDE }}, - {"set 3, (iy+$fe )", "set 3, (iy+$fe)", 4, { 0xFD, 0xCB, 0xfe, 0xDE }}, - {"set 3, a", "set 3, a", 2, { 0xCB, 0XDF }}, - {"set 3, a", "set 3, a", 2, { 0xCB, 0XDF }}, - {"set 3, b", "set 3, b", 2, { 0xCB, 0XD8 }}, - {"set 3, b", "set 3, b", 2, { 0xCB, 0XD8 }}, - {"set 3, c", "set 3, c", 2, { 0xCB, 0XD9 }}, - {"set 3, c", "set 3, c", 2, { 0xCB, 0XD9 }}, - {"set 3, d", "set 3, d", 2, { 0xCB, 0XDA }}, - {"set 3, d", "set 3, d", 2, { 0xCB, 0XDA }}, - {"set 3, e", "set 3, e", 2, { 0xCB, 0XDB }}, - {"set 3, e", "set 3, e", 2, { 0xCB, 0XDB }}, - {"set 3, h", "set 3, h", 2, { 0xCB, 0XDC }}, - {"set 3, h", "set 3, h", 2, { 0xCB, 0XDC }}, - {"set 3, l", "set 3, l", 2, { 0xCB, 0XDD }}, - {"set 3, l", "set 3, l", 2, { 0xCB, 0XDD }}, - - {"set 4, (hl)", "set 4, (hl)", 2, { 0xCB, 0xE6 }}, - {"set 4, ( hl )", "set 4, (hl)", 2, { 0xCB, 0xE6 }}, - {"set 4, (ix + 127)", "set 4, (ix+127)", 4, { 0xDD, 0xCB, 0x7f, 0xE6 }}, - {"set 4, ( ix + 127 )", "set 4, (ix+127)", 4, { 0xDD, 0xCB, 0x7f, 0xE6 }}, - {"set 4, (iy + 127)", "set 4, (iy+127)", 4, { 0xFD, 0xCB, 0x7f, 0xE6 }}, - {"set 4, ( iy + 127 )", "set 4, (iy+127)", 4, { 0xFD, 0xCB, 0x7f, 0xE6 }}, - {"set 4, (iy + -128)", "set 4, (iy+-128)", 4, { 0xFD, 0xCB, 0x80, 0xE6 }}, - {"set 4, (ix+$fe )", "set 4, (ix+$fe)", 4, { 0xDD, 0xCB, 0xfe, 0xE6 }}, - {"set 4, (iy+$fe )", "set 4, (iy+$fe)", 4, { 0xFD, 0xCB, 0xfe, 0xE6 }}, - {"set 4, a", "set 4, a", 2, { 0xCB, 0XE7 }}, - {"set 4, a", "set 4, a", 2, { 0xCB, 0XE7 }}, - {"set 4, b", "set 4, b", 2, { 0xCB, 0XE0 }}, - {"set 4, b", "set 4, b", 2, { 0xCB, 0XE0 }}, - {"set 4, c", "set 4, c", 2, { 0xCB, 0XE1 }}, - {"set 4, c", "set 4, c", 2, { 0xCB, 0XE1 }}, - {"set 4, d", "set 4, d", 2, { 0xCB, 0XE2 }}, - {"set 4, d", "set 4, d", 2, { 0xCB, 0XE2 }}, - {"set 4, e", "set 4, e", 2, { 0xCB, 0XE3 }}, - {"set 4, e", "set 4, e", 2, { 0xCB, 0XE3 }}, - {"set 4, h", "set 4, h", 2, { 0xCB, 0XE4 }}, - {"set 4, h", "set 4, h", 2, { 0xCB, 0XE4 }}, - {"set 4, l", "set 4, l", 2, { 0xCB, 0XE5 }}, - {"set 4, l", "set 4, l", 2, { 0xCB, 0XE5 }}, - - {"set 5, (hl)", "set 5, (hl)", 2, { 0xCB, 0xEE }}, - {"set 5, ( hl )", "set 5, (hl)", 2, { 0xCB, 0xEE }}, - {"set 5, (ix + 127)", "set 5, (ix+127)", 4, { 0xDD, 0xCB, 0x7f, 0xEE }}, - {"set 5, ( ix + 127 )", "set 5, (ix+127)", 4, { 0xDD, 0xCB, 0x7f, 0xEE }}, - {"set 5, (iy + 127)", "set 5, (iy+127)", 4, { 0xFD, 0xCB, 0x7f, 0xEE }}, - {"set 5, ( iy + 127 )", "set 5, (iy+127)", 4, { 0xFD, 0xCB, 0x7f, 0xEE }}, - {"set 5, (iy + -128)", "set 5, (iy+-128)", 4, { 0xFD, 0xCB, 0x80, 0xEE }}, - {"set 5, (ix+$fe )", "set 5, (ix+$fe)", 4, { 0xDD, 0xCB, 0xfe, 0xEE }}, - {"set 5, (iy+$fe )", "set 5, (iy+$fe)", 4, { 0xFD, 0xCB, 0xfe, 0xEE }}, - {"set 5, a", "set 5, a", 2, { 0xCB, 0XEF }}, - {"set 5, a", "set 5, a", 2, { 0xCB, 0XEF }}, - {"set 5, b", "set 5, b", 2, { 0xCB, 0XE8 }}, - {"set 5, b", "set 5, b", 2, { 0xCB, 0XE8 }}, - {"set 5, c", "set 5, c", 2, { 0xCB, 0XE9 }}, - {"set 5, c", "set 5, c", 2, { 0xCB, 0XE9 }}, - {"set 5, d", "set 5, d", 2, { 0xCB, 0XEA }}, - {"set 5, d", "set 5, d", 2, { 0xCB, 0XEA }}, - {"set 5, e", "set 5, e", 2, { 0xCB, 0XEB }}, - {"set 5, e", "set 5, e", 2, { 0xCB, 0XEB }}, - {"set 5, h", "set 5, h", 2, { 0xCB, 0XEC }}, - {"set 5, h", "set 5, h", 2, { 0xCB, 0XEC }}, - {"set 5, l", "set 5, l", 2, { 0xCB, 0XED }}, - {"set 5, l", "set 5, l", 2, { 0xCB, 0XED }}, - - {"set 6, (hl)", "set 6, (hl)", 2, { 0xCB, 0xF6 }}, - {"set 6, ( hl )", "set 6, (hl)", 2, { 0xCB, 0xF6 }}, - {"set 6, (ix + 127)", "set 6, (ix+127)", 4, { 0xDD, 0xCB, 0x7f, 0xF6 }}, - {"set 6, ( ix + 127 )", "set 6, (ix+127)", 4, { 0xDD, 0xCB, 0x7f, 0xF6 }}, - {"set 6, (iy + 127)", "set 6, (iy+127)", 4, { 0xFD, 0xCB, 0x7f, 0xF6 }}, - {"set 6, ( iy + 127 )", "set 6, (iy+127)", 4, { 0xFD, 0xCB, 0x7f, 0xF6 }}, - {"set 6, (iy + -128)", "set 6, (iy+-128)", 4, { 0xFD, 0xCB, 0x80, 0xF6 }}, - {"set 6, (ix+$fe )", "set 6, (ix+$fe)", 4, { 0xDD, 0xCB, 0xfe, 0xF6 }}, - {"set 6, (iy+$fe )", "set 6, (iy+$fe)", 4, { 0xFD, 0xCB, 0xfe, 0xF6 }}, - {"set 6, a", "set 6, a", 2, { 0xCB, 0XF7 }}, - {"set 6, a", "set 6, a", 2, { 0xCB, 0XF7 }}, - {"set 6, b", "set 6, b", 2, { 0xCB, 0XF0 }}, - {"set 6, b", "set 6, b", 2, { 0xCB, 0XF0 }}, - {"set 6, c", "set 6, c", 2, { 0xCB, 0XF1 }}, - {"set 6, c", "set 6, c", 2, { 0xCB, 0XF1 }}, - {"set 6, d", "set 6, d", 2, { 0xCB, 0XF2 }}, - {"set 6, d", "set 6, d", 2, { 0xCB, 0XF2 }}, - {"set 6, e", "set 6, e", 2, { 0xCB, 0XF3 }}, - {"set 6, e", "set 6, e", 2, { 0xCB, 0XF3 }}, - {"set 6, h", "set 6, h", 2, { 0xCB, 0XF4 }}, - {"set 6, h", "set 6, h", 2, { 0xCB, 0XF4 }}, - {"set 6, l", "set 6, l", 2, { 0xCB, 0XF5 }}, - {"set 6, l", "set 6, l", 2, { 0xCB, 0XF5 }}, - - {"set 7, (hl)", "set 7, (hl)", 2, { 0xCB, 0xFE }}, - {"set 7, ( hl )", "set 7, (hl)", 2, { 0xCB, 0xFE }}, - {"set 7, (ix + 127)", "set 7, (ix+127)", 4, { 0xDD, 0xCB, 0x7f, 0xFE }}, - {"set 7, ( ix + 127 )", "set 7, (ix+127)", 4, { 0xDD, 0xCB, 0x7f, 0xFE }}, - {"set 7, (iy + 127)", "set 7, (iy+127)", 4, { 0xFD, 0xCB, 0x7f, 0xFE }}, - {"set 7, ( iy + 127 )", "set 7, (iy+127)", 4, { 0xFD, 0xCB, 0x7f, 0xFE }}, - {"set 7, (iy + -128)", "set 7, (iy+-128)", 4, { 0xFD, 0xCB, 0x80, 0xFE }}, - {"set 7, (ix+$fe )", "set 7, (ix+$fe)", 4, { 0xDD, 0xCB, 0xfe, 0xFE }}, - {"set 7, (iy+$fe )", "set 7, (iy+$fe)", 4, { 0xFD, 0xCB, 0xfe, 0xFE }}, - {"set 7, a", "set 7, a", 2, { 0xCB, 0XFF }}, - {"set 7, a", "set 7, a", 2, { 0xCB, 0XFF }}, - {"set 7, b", "set 7, b", 2, { 0xCB, 0XF8 }}, - {"set 7, b", "set 7, b", 2, { 0xCB, 0XF8 }}, - {"set 7, c", "set 7, c", 2, { 0xCB, 0XF9 }}, - {"set 7, c", "set 7, c", 2, { 0xCB, 0XF9 }}, - {"set 7, d", "set 7, d", 2, { 0xCB, 0XFA }}, - {"set 7, d", "set 7, d", 2, { 0xCB, 0XFA }}, - {"set 7, e", "set 7, e", 2, { 0xCB, 0XFB }}, - {"set 7, e", "set 7, e", 2, { 0xCB, 0XFB }}, - {"set 7, h", "set 7, h", 2, { 0xCB, 0XFC }}, - {"set 7, h", "set 7, h", 2, { 0xCB, 0XFC }}, - {"set 7, l", "set 7, l", 2, { 0xCB, 0XFD }}, - {"set 7, l", "set 7, l", 2, { 0xCB, 0XFD }}, - - {"sla (hl)", "sla (hl)", 2, { 0xCB, 0x26 }}, - {"sla ( hl )", "sla (hl)", 2, { 0xCB, 0x26 }}, - {"sla (ix+$ff)", "sla (ix+$ff)", 4, { 0xDD, 0xCB, 0xff, 0x26 }}, - {"sla ( ix + $ff )", "sla (ix+$ff)", 4, { 0xDD, 0xCB, 0xff, 0x26 }}, - {"sla (iy+-128)", "sla (iy+-128)", 4, { 0xFD, 0xCB, 0x80, 0x26 }}, - {"sla ( iy + -128 )", "sla (iy+-128)", 4, { 0xFD, 0xCB, 0x80, 0x26 }}, - {"sla (iy+17)", "sla (iy+17)", 4, { 0xFD, 0xCB, 0x11, 0x26 }}, - {"sla ( iy + 17 )", "sla (iy+17)", 4, { 0xFD, 0xCB, 0x11, 0x26 }}, - {"sla a", "sla a", 2, { 0xCB, 0x27 }}, - {"sla a", "sla a", 2, { 0xCB, 0x27 }}, - {"sla b", "sla b", 2, { 0xCB, 0x20 }}, - {"sla b", "sla b", 2, { 0xCB, 0x20 }}, - {"sla c", "sla c", 2, { 0xCB, 0x21 }}, - {"sla c", "sla c", 2, { 0xCB, 0x21 }}, - {"sla d", "sla d", 2, { 0xCB, 0x22 }}, - {"sla d", "sla d", 2, { 0xCB, 0x22 }}, - {"sla e", "sla e", 2, { 0xCB, 0x23 }}, - {"sla e", "sla e", 2, { 0xCB, 0x23 }}, - {"sla h", "sla h", 2, { 0xCB, 0x24 }}, - {"sla h", "sla h", 2, { 0xCB, 0x24 }}, - {"sla l", "sla l", 2, { 0xCB, 0x25 }}, - {"sla l", "sla l", 2, { 0xCB, 0x25 }}, - - {"sra (hl)", "sra (hl)", 2, { 0xCB, 0x2E }}, - {"sra ( hl )", "sra (hl)", 2, { 0xCB, 0x2E }}, - {"sra (ix+$ff)", "sra (ix+$ff)", 4, { 0xDD, 0xCB, 0xff, 0x2E }}, - {"sra ( ix + $ff )", "sra (ix+$ff)", 4, { 0xDD, 0xCB, 0xff, 0x2E }}, - {"sra (iy+-128)", "sra (iy+-128)", 4, { 0xFD, 0xCB, 0x80, 0x2E }}, - {"sra ( iy + -128 )", "sra (iy+-128)", 4, { 0xFD, 0xCB, 0x80, 0x2E }}, - {"sra (iy+33)", "sra (iy+33)", 4, { 0xFD, 0xCB, 0x21, 0x2E }}, - {"sra ( iy + 33 )", "sra (iy+33)", 4, { 0xFD, 0xCB, 0x21, 0x2E }}, - {"sra a", "sra a", 2, { 0xCB, 0x2F }}, - {"sra a", "sra a", 2, { 0xCB, 0x2F }}, - {"sra b", "sra b", 2, { 0xCB, 0x28 }}, - {"sra b", "sra b", 2, { 0xCB, 0x28 }}, - {"sra c", "sra c", 2, { 0xCB, 0x29 }}, - {"sra c", "sra c", 2, { 0xCB, 0x29 }}, - {"sra d", "sra d", 2, { 0xCB, 0x2A }}, - {"sra d", "sra d", 2, { 0xCB, 0x2A }}, - {"sra e", "sra e", 2, { 0xCB, 0x2B }}, - {"sra e", "sra e", 2, { 0xCB, 0x2B }}, - {"sra h", "sra h", 2, { 0xCB, 0x2C }}, - {"sra h", "sra h", 2, { 0xCB, 0x2C }}, - {"sra l", "sra l", 2, { 0xCB, 0x2D }}, - {"sra l", "sra l", 2, { 0xCB, 0x2D }}, - - {"srl (hl)", "srl (hl)", 2, { 0xCB, 0x3E }}, - {"srl ( hl )", "srl (hl)", 2, { 0xCB, 0x3E }}, - {"srl (ix+$ff)", "srl (ix+$ff)", 4, { 0xDD, 0xCB, 0xff, 0x3E }}, - {"srl ( ix + $ff )", "srl (ix+$ff)", 4, { 0xDD, 0xCB, 0xff, 0x3E }}, - {"srl (iy+-128)", "srl (iy+-128)", 4, { 0xFD, 0xCB, 0x80, 0x3E }}, - {"srl ( iy + -128 )", "srl (iy+-128)", 4, { 0xFD, 0xCB, 0x80, 0x3E }}, - {"srl (iy+48)", "srl (iy+48)", 4, { 0xFD, 0xCB, 0x30, 0x3E }}, - {"srl ( iy + 48 )", "srl (iy+48)", 4, { 0xFD, 0xCB, 0x30, 0x3E }}, - {"srl a", "srl a", 2, { 0xCB, 0x3F }}, - {"srl a", "srl a", 2, { 0xCB, 0x3F }}, - {"srl b", "srl b", 2, { 0xCB, 0x38 }}, - {"srl b", "srl b", 2, { 0xCB, 0x38 }}, - {"srl c", "srl c", 2, { 0xCB, 0x39 }}, - {"srl c", "srl c", 2, { 0xCB, 0x39 }}, - {"srl d", "srl d", 2, { 0xCB, 0x3A }}, - {"srl d", "srl d", 2, { 0xCB, 0x3A }}, - {"srl e", "srl e", 2, { 0xCB, 0x3B }}, - {"srl e", "srl e", 2, { 0xCB, 0x3B }}, - {"srl h", "srl h", 2, { 0xCB, 0x3C }}, - {"srl h", "srl h", 2, { 0xCB, 0x3C }}, - {"srl l", "srl l", 2, { 0xCB, 0x3D }}, - {"srl l", "srl l", 2, { 0xCB, 0x3D }}, - - {"sub (hl)", "sub (hl)", 1, { 0x96 }}, - {"sub ( hl)", "sub (hl)", 1, { 0x96 }}, - {"sub (ix+15)", "sub (ix+15)", 3, { 0xdd, 0x96, 0xf}}, - {"sub ( ix + 15 )", "sub (ix+15)", 3, { 0xdd, 0x96, 0xf}}, - {"sub (iy+15)", "sub (iy+15)", 3, { 0xfd, 0x96, 0xf}}, - {"sub ( iy + 15 )", "sub (iy+15)", 3, { 0xfd, 0x96, 0xf}}, - {"sub (iy+0)", "sub (iy+0)", 3, { 0xfd, 0x96, 0x0}}, - {"sub ( iy + 0)", "sub (iy+0)", 3, { 0xfd, 0x96, 0x0}}, - {"sub a", "sub a", 1, { 0x97 }}, - {"sub a", "sub a", 1, { 0x97 }}, - {"sub b", "sub b", 1, { 0x90 }}, - {"sub b", "sub b", 1, { 0x90 }}, - {"sub c", "sub c", 1, { 0x91 }}, - {"sub c", "sub c", 1, { 0x91 }}, - {"sub d", "sub d", 1, { 0x92 }}, - {"sub d", "sub d", 1, { 0x92 }}, - {"sub e", "sub e", 1, { 0x93 }}, - {"sub e", "sub e", 1, { 0x93 }}, - {"sub h", "sub h", 1, { 0x94 }}, - {"sub h", "sub h", 1, { 0x94 }}, - {"sub l", "sub l", 1, { 0x95 }}, - {"sub l", "sub l", 1, { 0x95 }}, - {"sub 40", "sub 40", 2, { 0xD6, 0x28 }}, - {"sub 40", "sub 40", 2, { 0xD6, 0x28 }}, - {"sub 255", "sub 255", 2, { 0xD6, 0xFF }}, - {"sub 255", "sub 255", 2, { 0xD6, 0xFF }}, - {"sub 'A'", "sub 'A'", 2, { 0xD6, 0x41 }}, - {"sub 'A'", "sub 'A'", 2, { 0xD6, 0x41 }}, - - {"xor (hl)", "xor (hl)", 1, { 0xAE }}, - {"xor ( hl )", "xor (hl)", 1, { 0xAE }}, - {"xor (ix+$ff)", "xor (ix+$ff)", 3, { 0xDD, 0xAE, 0xff }}, - {"xor ( ix + $ff )", "xor (ix+$ff)", 3, { 0xDD, 0xAE, 0xff }}, - {"xor (iy + -128)", "xor (iy+-128)", 3, { 0xFD, 0xAE, 0x80 }}, - {"xor ( iy + -128 )", "xor (iy+-128)", 3, { 0xFD, 0xAE, 0x80 }}, - {"xor (iy +100)", "xor (iy+100)", 3, { 0xFD, 0xAE, 0x64 }}, - {"xor ( iy + 100 )", "xor (iy+100)", 3, { 0xFD, 0xAE, 0x64 }}, - {"xor a", "xor a", 1, { 0xAF }}, - {"xor a", "xor a", 1, { 0xAF }}, - {"xor b", "xor b", 1, { 0xA8 }}, - {"xor b", "xor b", 1, { 0xA8 }}, - {"xor c", "xor c", 1, { 0xA9 }}, - {"xor c", "xor c", 1, { 0xA9 }}, - {"xor d", "xor d", 1, { 0xAA }}, - {"xor d", "xor d", 1, { 0xAA }}, - {"xor e", "xor e", 1, { 0xAB }}, - {"xor e", "xor e", 1, { 0xAB }}, - {"xor h", "xor h", 1, { 0xAC }}, - {"xor h", "xor h", 1, { 0xAC }}, - {"xor l", "xor l", 1, { 0xAD }}, - {"xor l", "xor l", 1, { 0xAD }}, - {"xor 127", "xor 127", 2, { 0xEE, 0x7f }}, - {"xor 127", "xor 127", 2, { 0xEE, 0x7f }}, - {"xor 255", "xor 255", 2, { 0xEE, 0xff }}, - {"xor 255", "xor 255", 2, { 0xEE, 0xff }}, - {"xor 'A'", "xor 'A'", 2, { 0xEE, 0x41 }}, - {"xor 'A'", "xor 'A'", 2, { 0xEE, 0x41 }}, - - {"ld a, $DD", "ld a, $dd", 2, {0x3E, 0xDD}}, - - {"db $dd", "db $dd", 1, {0xDD}}, - {"db $dd", "db $dd", 1, {0xDD}}, - {"db -1", "db -1", 1, {0xFF}}, - {"db -1", "db -1", 1, {0xFF}}, - {"db 127", "db 127", 1, {0x7F}}, - {"db 127", "db 127", 1, {0x7F}}, - {"db 255", "db 255", 1, {0xFF}}, - {"db 255", "db 255", 1, {0xFF}}, - {"db 'A'", "db 'A'", 1, {0x41}}, - {"db 'A'", "db 'A'", 1, {0x41}}, - {"db $de,$ad", "db $de,$ad", 2, {0xDE, 0xAD}}, - {"db $de , $ad", "db $de,$ad", 2, {0xDE, 0xAD}}, - {"db 1,2,3", "db 1,2,3", 3, {0x1, 0x2, 0x3}}, - {"db 1,2, 3", "db 1,2,3", 3, {0x1, 0x2, 0x3}}, - {"db -1,-2,-3", "db -1,-2,-3", 3, {0xFF, 0xFE, 0xFD}}, - {"db -1,-2, -3", "db -1,-2,-3", 3, {0xFF, 0xFE, 0xFD}}, - {"db 'A','B','C','D'", "db 'A','B','C','D'", 4, - {0x41, 0x42, 0x43, 0x44}}, - {"db 'A','B', 'C','D'", "db 'A','B','C','D'", 4, - {0x41, 0x42, 0x43, 0x44}}, - {"db -1, -2, -3, 4", "db -1,-2,-3,4", - 4, {0xFF, 0xFE, 0xFD, 0x4}}, - {"db -1,-2, -3,4", "db -1,-2,-3,4", - 4, {0xFF, 0xFE, 0xFD, 0x4}}, - {"db 127, -2, -3, 4", "db 127,-2,-3,4", - 4, {0x7F, 0xFE, 0xFD, 0x4}}, - {"db 127,-2, -3,4", "db 127,-2,-3,4", - 4, {0x7F, 0xFE, 0xFD, 0x4}}, - {"db label1-label", "db label1-label", 1, {0x05, 0x00, 0x04, 0x00}}, - {"db label1-verylonglabel", "db label1-verylonglabel", 1, - {0x05, 0x00, 0x04, 0x00}}, - {"db verylonglabel-label1", "db verylonglabel-label1", 1, - {0x00, 0x05, 0x08, 0x00}}, - - {"dw $dead", "dw $dead", 2, {0xAD, 0xDE}}, - {"dw $dead", "dw $dead", 2, {0xAD, 0xDE}}, - {"dw -32768", "dw -32768", 2, {0x00, 0x80}}, - {"dw -32768", "dw -32768", 2, {0x00, 0x80}}, - {"dw 32767", "dw 32767", 2, {0xFF, 0x7F}}, - {"dw 32767", "dw 32767", 2, {0xFF, 0x7F}}, - {"dw 65535", "dw 65535", 2, {0xFF, 0xFF}}, - {"dw 65535", "dw 65535", 2, {0xFF, 0xFF}}, - {"dw 65535, 65535", "dw 65535,65535", 4, {0xFF, 0xFF, 0xFF, 0xFF}}, - {"dw 65535 , 65535", "dw 65535,65535", 4, - {0xFF, 0xFF, 0xFF, 0xFF}}, - {"dw 'A'", "dw 'A'", 2, {0x41, 0x0}}, - {"dw 'A'", "dw 'A'", 2, {0x41, 0x0}}, - {"dw 'A','B'", "dw 'A','B'", 4, {0x41, 0x0, 0x42, 0x0}}, - {"dw 'A' ,'B'", "dw 'A','B'", 4, {0x41, 0x0, 0x42, 0x0}}, - {"dw -1,1", "dw -1,1", 4, {0xFF, 0xFF, 0x1, 0x0}}, - {"dw -1 , 1", "dw -1,1", 4, {0xFF, 0xFF, 0x1, 0x0}}, - {"dw $ffff, $fffe", "dw $ffff,$fffe", 4, {0xFF, 0xFF, 0xFE, 0xFF}}, - {"dw $ffff ,$fffe", "dw $ffff,$fffe", 4, - {0xFF, 0xFF, 0xFE, 0xFF}}, - {"dw -32768,-32768", "dw -32768,-32768", 4, - {0x00, 0x80, 0x00, 0x80}}, - {"dw -32768, -32768", "dw -32768,-32768", 4, - {0x00, 0x80, 0x00, 0x80}}, - {"dw label", "dw label", 2, {0x00, 0x00}}, - {"dw label1-label", "dw label1-label", 2, {0x05, 0x00, 0x04, 0x00}}, - {"dw label1-verylonglabel", "dw label1-verylonglabel", 2, - {0x05, 0x00, 0x04, 0x00}}, - {"dw verylonglabel-label1", "dw verylonglabel-label1", 2, - {0x00, 0x05, 0x08, 0x00}}, - - /* - * The sizes here are wrong. Size is calculated in a special way for - * these instructions. - */ - - {"ds 1000, $ff", "ds 1000, $ff", 1, {0xFF, 0xe8, 0x3}}, - {"ds 1000 ,$ff", "ds 1000, $ff", 1, {0xFF, 0xe8, 0x3}}, - {"ds $ff, 100", "ds $ff, 100", 1, {0x64, 0xFF}}, - {"ds $ff , 100", "ds $ff, 100", 1, {0x64, 0xFF}}, - {"ds $100, -1", "ds $100, -1", 1, {0xFF, 0x00, 0x1}}, - {"ds $100 ,-1", "ds $100, -1", 1, {0xFF, 0x00, 0x1}}, - {"ds $100, 'c'", "ds $100, 'c'", 1, {0x63, 0x00, 0x1}}, - {"ds $100 ,'c'", "ds $100, 'c'", 1, {0x63, 0x00, 0x1}}, -}; - -static const format_test_t format_tests[] = { - {"", "", SPECASM_LINE_TYPE_EMPTY}, - {"xor 127", " xor 127", SPECASM_LINE_TYPE_XOR}, - {".thisisshort", ".thisisshort", SPECASM_LINE_TYPE_SL}, - {".thisnotshort", ".thisnotshort", SPECASM_LINE_TYPE_LL}, - {"._123456789a123456789a123456789a", "._123456789a123456789a123456789a", - SPECASM_LINE_TYPE_LL}, - {";_123456789a123456789a123456789a", ";_123456789a123456789a123456789a", - SPECASM_LINE_TYPE_LC}, - {";thisisshort", ";thisisshort", SPECASM_LINE_TYPE_SC}, - {";thisnotshort", ";thisnotshort", SPECASM_LINE_TYPE_LC}, - {"sub 40 ;thisisshort", " sub 40 ;thisisshort", - SPECASM_LINE_TYPE_SUB}, - {"sub 40 ; thisisshor", " sub 40 ; thisisshor", - SPECASM_LINE_TYPE_SUB}, - {"set 1, l ;", " set 1, l ", - SPECASM_LINE_TYPE_SET}, - {"set 1, l ;", " set 1, l ", - SPECASM_LINE_TYPE_SET}, - {"sub 40 ; a ; b", " sub 40 ; a ; b ", - SPECASM_LINE_TYPE_SUB}, - { "db 127 ; a byte", "db 127 ; a byte", - SPECASM_LINE_TYPE_DB}, - { "dw 128 ; a word", "dw 128 ; a word", - SPECASM_LINE_TYPE_DW}, - { "ret ; return", " ret ; return", - SPECASM_LINE_TYPE_RET}, - { "ret c ; return", " ret c ; return", - SPECASM_LINE_TYPE_RET}, - { "'short\" str'", "'short\" str'", SPECASM_LINE_TYPE_STR_SIN_SHORT}, - { "'short\" str' ; hello", "'short\" str' ; hello", - SPECASM_LINE_TYPE_STR_SIN_SHORT}, - { " 'short str'", "'short str'", SPECASM_LINE_TYPE_STR_SIN_SHORT}, - { "'a fairly long string'", "'a fairly long string'", - SPECASM_LINE_TYPE_STR_SIN_LONG}, - { " 'a fairly long string'", "'a fairly long string'", - SPECASM_LINE_TYPE_STR_SIN_LONG}, - { "'unterminated string", "'unterminated string ", - SPECASM_LINE_TYPE_STR_SIN_LONG}, - { "'unterminated string ; hello", "'unterminated string ; hello ", - SPECASM_LINE_TYPE_STR_SIN_LONG}, - { "\"short' str\"", "\"short' str\"", SPECASM_LINE_TYPE_STR_DBL_SHORT}, - { " \"short str\"", "\"short str\"", SPECASM_LINE_TYPE_STR_DBL_SHORT}, - { "\"a fairly long string\"", "\"a fairly long string\"", - SPECASM_LINE_TYPE_STR_DBL_LONG}, - { " \"a fairly long string\"", "\"a fairly long string\"", - SPECASM_LINE_TYPE_STR_DBL_LONG}, - { "\"unterminated string", "\"unterminated string ", - SPECASM_LINE_TYPE_STR_DBL_LONG}, - { "#short@ str#", "#short@ str#", SPECASM_LINE_TYPE_STR_HSH_SHORT}, - { " #short str#", "#short str#", SPECASM_LINE_TYPE_STR_HSH_SHORT}, - { "#a fairly long string#", "#a fairly long string#", - SPECASM_LINE_TYPE_STR_HSH_LONG}, - { " #a fairly long string#", "#a fairly long string#", - SPECASM_LINE_TYPE_STR_HSH_LONG}, - { "#unterminated string", "#unterminated string ", - SPECASM_LINE_TYPE_STR_HSH_LONG}, - { "@short# str@", "@short# str@", SPECASM_LINE_TYPE_STR_AMP_SHORT}, - { " @short str@", "@short str@", SPECASM_LINE_TYPE_STR_AMP_SHORT}, - { "@a fairly long string@", "@a fairly long string@", - SPECASM_LINE_TYPE_STR_AMP_LONG}, - { " @a fairly long string@", "@a fairly long string@", - SPECASM_LINE_TYPE_STR_AMP_LONG}, - { "@unterminated string", "@unterminated string ", - SPECASM_LINE_TYPE_STR_AMP_LONG}, - {"dw label1-label", "dw label1-label", SPECASM_LINE_TYPE_DW_SUB}, - {"dw label1 - label", "dw label1-label", - SPECASM_LINE_TYPE_DW_SUB}, - {"db label1-label", "db label1-label", SPECASM_LINE_TYPE_DB_SUB}, - {"db label1 - label", "db label1-label", - SPECASM_LINE_TYPE_DB_SUB}, - {"ds $10, 10", "ds $10, 10", SPECASM_LINE_TYPE_DS}, - {"- sub.x", "-sub.x", SPECASM_LINE_TYPE_INC_SHORT}, - {"-/a/very/long/path", "-/a/very/long/path", - SPECASM_LINE_TYPE_INC_LONG}, - {"+ sub.x", "+sub.x", SPECASM_LINE_TYPE_INC_SYS_SHORT}, - {"+a/very/long/path", "+a/very/long/path", - SPECASM_LINE_TYPE_INC_SYS_LONG} -}; - -static const bad_test_t bad_tests[] = { - {"10", SPECASM_ERROR_BAD_MNENOMIC }, - {"markus", SPECASM_ERROR_BAD_MNENOMIC }, - {"addd", SPECASM_ERROR_BAD_MNENOMIC }, - {"-", SPECASM_ERROR_BAD_MNENOMIC }, - {"$", SPECASM_ERROR_BAD_MNENOMIC }, - {"ADD", SPECASM_ERROR_BAD_MNENOMIC }, - - { "adc", SPECASM_ERROR_BAD_REG }, - { "adc a", SPECASM_ERROR_COMMA_EXPECTED }, - { "adc a, ", SPECASM_ERROR_BAD_REG }, - { "adc x, 10", SPECASM_ERROR_BAD_REG }, - { "adc a, 258", SPECASM_ERROR_NUM_TOO_BIG }, - { "adc a, $100", SPECASM_ERROR_NUM_TOO_BIG }, - { "adc a, $gg", SPECASM_ERROR_BAD_REG }, - { "adc a, $$aa", SPECASM_ERROR_BAD_REG }, - { "adc a, hl)", SPECASM_ERROR_BAD_REG }, - { "adc a, (hl", SPECASM_ERROR_BAD_REG }, - { "adc a, (xx)", SPECASM_ERROR_BAD_REG }, - { "adc a, (bc)", SPECASM_ERROR_BAD_REG }, - { "adc a, (a)", SPECASM_ERROR_BAD_REG }, - { "adc bc, 10", SPECASM_ERROR_BAD_REG }, - { "adc a, (ix)", SPECASM_ERROR_BAD_REG }, - { "adc a, (ix+)", SPECASM_ERROR_BAD_NUM }, - { "adc a, (ix+bc)", SPECASM_ERROR_BAD_NUM }, - { "adc a, (ix+-129)", SPECASM_ERROR_NUM_TOO_BIG }, - { "adc a, (ix-129)", SPECASM_ERROR_BAD_REG }, - { "adc a, (iy+bc)", SPECASM_ERROR_BAD_NUM }, - { "adc a, (iy+-129)", SPECASM_ERROR_NUM_TOO_BIG }, - { "adc a, (iy-129)", SPECASM_ERROR_BAD_REG }, - { "adc a, (de+19)", SPECASM_ERROR_BAD_REG }, - { "adc a, (de+'A')", SPECASM_ERROR_BAD_REG }, - { "adc b, 10", SPECASM_ERROR_BAD_REG }, - { "adc c, 10", SPECASM_ERROR_BAD_REG }, - { "adc d, 10", SPECASM_ERROR_BAD_REG }, - { "adc e, 10", SPECASM_ERROR_BAD_REG }, - { "adc h, 10", SPECASM_ERROR_BAD_REG }, - { "adc l, 10", SPECASM_ERROR_BAD_REG }, - { "adc hl, 10", SPECASM_ERROR_BAD_REG }, - { "adc hl, ix", SPECASM_ERROR_BAD_REG }, - { "adc de, hl", SPECASM_ERROR_BAD_REG }, - - { "add a", SPECASM_ERROR_COMMA_EXPECTED }, - { "add a, (bc)", SPECASM_ERROR_BAD_REG }, - { "add a, (h)", SPECASM_ERROR_BAD_REG }, - { "add a, (hl", SPECASM_ERROR_BAD_REG }, - { "add a, hl)", SPECASM_ERROR_BAD_REG }, - { "add b, (hl)", SPECASM_ERROR_BAD_REG }, - { "add a, x", SPECASM_ERROR_BAD_REG }, - { "add a, 329", SPECASM_ERROR_NUM_TOO_BIG }, - { "add 10, b", SPECASM_ERROR_BAD_REG }, - { "add bc, hl", SPECASM_ERROR_BAD_REG }, - { "add hl, $101", SPECASM_ERROR_BAD_REG }, - { "add ix, hl", SPECASM_ERROR_BAD_REG }, - { "add iy, hl", SPECASM_ERROR_BAD_REG }, - { "add sp, hl", SPECASM_ERROR_BAD_REG }, - { "add", SPECASM_ERROR_BAD_REG }, - { "add a, ", SPECASM_ERROR_BAD_REG }, - { "add , 10", SPECASM_ERROR_BAD_REG }, - - {"align 512", SPECASM_ERROR_BAD_NUM }, - {"align 1", SPECASM_ERROR_BAD_NUM }, - {"align 3", SPECASM_ERROR_BAD_NUM }, - {"align -1", SPECASM_ERROR_BAD_NUM }, - {"align 'c'", SPECASM_ERROR_BAD_NUM }, - {"align ", SPECASM_ERROR_BAD_NUM }, - - {"and", SPECASM_ERROR_BAD_REG }, - {"and (bc)", SPECASM_ERROR_BAD_REG }, - {"and (ix)", SPECASM_ERROR_BAD_REG }, - {"and (iy)", SPECASM_ERROR_BAD_REG }, - {"and iy)", SPECASM_ERROR_BAD_REG }, - {"and (iy", SPECASM_ERROR_BAD_REG }, - {"and (ix+128)", SPECASM_ERROR_NUM_TOO_BIG }, - {"and (iy+1028)", SPECASM_ERROR_NUM_TOO_BIG }, - {"and 328", SPECASM_ERROR_NUM_TOO_BIG }, - {"and -129", SPECASM_ERROR_NUM_TOO_BIG }, - {"and $100", SPECASM_ERROR_NUM_TOO_BIG }, - {"and hl", SPECASM_ERROR_BAD_REG }, - {"and f", SPECASM_ERROR_BAD_REG }, - - {"bit 'A', (hl)", SPECASM_ERROR_BAD_NUM }, - {"bit 9, (hl)", SPECASM_ERROR_BAD_NUM }, - {"bit $ff, (hl)", SPECASM_ERROR_BAD_NUM }, - {"bit 0, ix + 127)", SPECASM_ERROR_BAD_REG }, - {"bit 0, (ix + 127", SPECASM_ERROR_BAD_REG }, - {"bit 0, (ix)", SPECASM_ERROR_BAD_REG }, - {"bit 0, (ix+)", SPECASM_ERROR_BAD_NUM }, - {"bit 0, (ix+$100)", SPECASM_ERROR_NUM_TOO_BIG }, - {"bit 0, (ix-100)", SPECASM_ERROR_BAD_REG }, - {"bit 0, bc", SPECASM_ERROR_BAD_REG }, - {"bit 0, gg", SPECASM_ERROR_BAD_REG }, - {"bit 0, $bc", SPECASM_ERROR_BAD_REG }, - {"bit a, a", SPECASM_ERROR_BAD_NUM }, - {"bit 0", SPECASM_ERROR_COMMA_EXPECTED }, - - {"call", SPECASM_ERROR_BAD_LABEL }, - {"call nzc, label", SPECASM_ERROR_CONDITION_CODE }, - {"call nzc , label", SPECASM_ERROR_CONDITION_CODE }, - {"call poe, label", SPECASM_ERROR_CONDITION_CODE }, - {"call poe , label", SPECASM_ERROR_CONDITION_CODE }, - {"call pc , label", SPECASM_ERROR_CONDITION_CODE }, - {"call nz", SPECASM_ERROR_CONDITION_CODE }, - {"call nz ", SPECASM_ERROR_COMMA_EXPECTED }, - {"call nz,", SPECASM_ERROR_BAD_LABEL }, - {"call nz ,", SPECASM_ERROR_BAD_LABEL }, - {"call no ,", SPECASM_ERROR_CONDITION_CODE }, - {"call c, bc", SPECASM_ERROR_BAD_LABEL }, - {"call bc", SPECASM_ERROR_BAD_LABEL }, - {"call -1", SPECASM_ERROR_BAD_LABEL }, - - {"cp hl)", SPECASM_ERROR_BAD_REG }, - {"cp (hl", SPECASM_ERROR_BAD_REG }, - {"cp (bc)", SPECASM_ERROR_BAD_REG }, - {"cp (ix)", SPECASM_ERROR_BAD_REG }, - {"cp (ix+)", SPECASM_ERROR_BAD_NUM }, - {"cp (ix+300)", SPECASM_ERROR_NUM_TOO_BIG }, - {"cp 300", SPECASM_ERROR_NUM_TOO_BIG }, - {"cp bc", SPECASM_ERROR_BAD_REG }, - - {"dec (bc)", SPECASM_ERROR_BAD_REG }, - {"dec hl)", SPECASM_ERROR_BAD_REG }, - {"dec (hl", SPECASM_ERROR_BAD_REG }, - {"dec (hl, 10)", SPECASM_ERROR_BAD_REG }, - {"dec (ix)", SPECASM_ERROR_BAD_REG }, - {"dec (ix+)", SPECASM_ERROR_BAD_NUM }, - {"dec (ix+1000)", SPECASM_ERROR_NUM_TOO_BIG }, - {"dec af", SPECASM_ERROR_BAD_REG }, - {"dec 10", SPECASM_ERROR_BAD_REG }, - - {"djnz", SPECASM_ERROR_BAD_LABEL }, - {"djnz bc", SPECASM_ERROR_BAD_LABEL }, - - {"ex af, af", SPECASM_ERROR_BAD_REG }, - {"ex (bc), ix", SPECASM_ERROR_BAD_REG }, - {"ex (sp)", SPECASM_ERROR_COMMA_EXPECTED }, - {"ex (sp),", SPECASM_ERROR_BAD_REG }, - {"ex (sp),10", SPECASM_ERROR_BAD_REG }, - {"ex (sp),label", SPECASM_ERROR_BAD_REG }, - {"ex (sp), bc", SPECASM_ERROR_BAD_REG }, - {"ex bc, hl", SPECASM_ERROR_BAD_REG }, - {"ex 10, hl", SPECASM_ERROR_BAD_REG }, - - {"im", SPECASM_ERROR_BAD_NUM }, - {"im , ", SPECASM_ERROR_BAD_NUM }, - {"im 3 ", SPECASM_ERROR_BAD_NUM }, - {"im 255 ", SPECASM_ERROR_BAD_NUM }, - {"im 'A'", SPECASM_ERROR_BAD_NUM }, - - {"in", SPECASM_ERROR_BAD_REG }, - {"in ,", SPECASM_ERROR_BAD_REG }, - {"in a", SPECASM_ERROR_COMMA_EXPECTED }, - {"in a,", SPECASM_ERROR_BAD_NUM }, - {"in a, (a)", SPECASM_ERROR_BAD_REG }, - {"in a, c)", SPECASM_ERROR_BAD_NUM }, - {"in a, (c", SPECASM_ERROR_BAD_NUM }, - {"in a, (1000)", SPECASM_ERROR_NUM_TOO_BIG }, - {"in ix, (100)", SPECASM_ERROR_BAD_REG }, - {"in a, (-100)", SPECASM_ERROR_NUM_NEG }, - {"in b, (100)", SPECASM_ERROR_BAD_REG }, - {"in b, ('A')", SPECASM_ERROR_BAD_REG }, - - {"inc (bc)", SPECASM_ERROR_BAD_REG }, - {"inc hl)", SPECASM_ERROR_BAD_REG }, - {"inc (hl", SPECASM_ERROR_BAD_REG }, - {"inc (hl, 10)", SPECASM_ERROR_BAD_REG }, - {"inc (ix)", SPECASM_ERROR_BAD_REG }, - {"inc (ix+)", SPECASM_ERROR_BAD_NUM }, - {"inc (ix+1000)", SPECASM_ERROR_NUM_TOO_BIG }, - {"inc af", SPECASM_ERROR_BAD_REG }, - {"inc 10", SPECASM_ERROR_BAD_REG }, - - {"jp", SPECASM_ERROR_BAD_LABEL }, - {"jp nzc, label", SPECASM_ERROR_CONDITION_CODE }, - {"jp nz", SPECASM_ERROR_CONDITION_CODE }, - {"jp nz ", SPECASM_ERROR_COMMA_EXPECTED }, - {"jp nz,", SPECASM_ERROR_BAD_LABEL }, - {"jp 100", SPECASM_ERROR_BAD_LABEL }, - {"jp c, 100", SPECASM_ERROR_BAD_LABEL }, - {"jp c, bc", SPECASM_ERROR_BAD_LABEL }, - {"jp bc", SPECASM_ERROR_BAD_REG }, - {"jp (bc)", SPECASM_ERROR_BAD_REG }, - - {"jr", SPECASM_ERROR_BAD_LABEL }, - {"jr c, ", SPECASM_ERROR_BAD_LABEL }, - {"jr 10", SPECASM_ERROR_BAD_LABEL }, - {"jr po, label", SPECASM_ERROR_CONDITION_CODE }, - {"jr pe, label", SPECASM_ERROR_CONDITION_CODE }, - {"jr p, label", SPECASM_ERROR_CONDITION_CODE }, - {"jr m, label", SPECASM_ERROR_CONDITION_CODE }, - - {"ld", SPECASM_ERROR_BAD_REG }, - {"ld (a), a", SPECASM_ERROR_BAD_REG }, - {"ld (bc, a", SPECASM_ERROR_BAD_REG }, - {"ld bc), a", SPECASM_ERROR_BAD_REG }, - {"ld (bc), hl", SPECASM_ERROR_BAD_REG }, - {"ld (bc), b", SPECASM_ERROR_BAD_REG }, - {"ld (bc), 10", SPECASM_ERROR_BAD_REG }, - {"ld (de), b", SPECASM_ERROR_BAD_REG }, - {"ld (de), 10", SPECASM_ERROR_BAD_REG }, - {"ld (hl), 256", SPECASM_ERROR_NUM_TOO_BIG }, - {"ld (hl), bc", SPECASM_ERROR_BAD_REG }, - {"ld (ix+1), bc", SPECASM_ERROR_BAD_REG }, - {"ld (ix), bc", SPECASM_ERROR_BAD_REG }, - {"ld (ix+), bc", SPECASM_ERROR_BAD_NUM }, - {"ld (ix+129), bc", SPECASM_ERROR_NUM_TOO_BIG }, - {"ld (iy+1), bc", SPECASM_ERROR_BAD_REG }, - {"ld (iy), bc", SPECASM_ERROR_BAD_REG }, - {"ld (iy+), bc", SPECASM_ERROR_BAD_NUM }, - {"ld (iy+129), bc", SPECASM_ERROR_NUM_TOO_BIG }, - {"ld (iy+$100), bc", SPECASM_ERROR_NUM_TOO_BIG }, - {"ld (iy+-129), bc", SPECASM_ERROR_NUM_TOO_BIG }, - {"ld ($100)", SPECASM_ERROR_COMMA_EXPECTED }, - {"ld ($100), 10", SPECASM_ERROR_BAD_REG }, - {"ld ($100), b", SPECASM_ERROR_BAD_REG }, - {"ld ($10000), bc", SPECASM_ERROR_NUM_TOO_BIG }, - {"ld (-1), bc", SPECASM_ERROR_NUM_NEG }, - {"ld a", SPECASM_ERROR_COMMA_EXPECTED }, - {"ld a,", SPECASM_ERROR_BAD_REG }, - {"ld a, (ix)", SPECASM_ERROR_BAD_REG }, - {"ld a, (ix+128)", SPECASM_ERROR_NUM_TOO_BIG }, - {"ld a, ($10000)", SPECASM_ERROR_NUM_TOO_BIG }, - {"ld a, bc", SPECASM_ERROR_BAD_REG }, - {"ld a, $100", SPECASM_ERROR_NUM_TOO_BIG }, - {"ld a, label", SPECASM_ERROR_BAD_LABEL }, - {"ld 1, 1", SPECASM_ERROR_BAD_REG }, - {"ld bc, (label", SPECASM_ERROR_BAD_REG }, - {"ld bc, ($10000)", SPECASM_ERROR_NUM_TOO_BIG }, - {"ld bc, ($100", SPECASM_ERROR_BAD_REG }, - {"ld bc, (-1)", SPECASM_ERROR_NUM_NEG }, - {"ld bc, de", SPECASM_ERROR_BAD_REG }, - {"ld de, ($10000)", SPECASM_ERROR_NUM_TOO_BIG }, - {"ld de, ($100", SPECASM_ERROR_BAD_REG }, - {"ld de, hl", SPECASM_ERROR_BAD_REG }, - {"ld de, (-1)", SPECASM_ERROR_NUM_NEG }, - {"ld hl, $10000", SPECASM_ERROR_NUM_TOO_BIG }, - {"ld hl, -32769", SPECASM_ERROR_NUM_TOO_BIG }, - {"ld hl, 65536", SPECASM_ERROR_NUM_TOO_BIG }, - {"ld hl, ($10000)", SPECASM_ERROR_NUM_TOO_BIG }, - {"ld hl, ($100", SPECASM_ERROR_BAD_REG }, - {"ld hl ($100)", SPECASM_ERROR_COMMA_EXPECTED }, - {"ld hl, (-1)", SPECASM_ERROR_NUM_NEG }, - {"ld hl, de", SPECASM_ERROR_BAD_REG }, - {"ld i, b", SPECASM_ERROR_BAD_REG }, - {"ld b, i", SPECASM_ERROR_BAD_REG }, - {"ld bc, a", SPECASM_ERROR_BAD_REG }, - {"ld i, 10", SPECASM_ERROR_BAD_REG }, - {"ld ix, ($10000)", SPECASM_ERROR_NUM_TOO_BIG }, - {"ld ix, ($100", SPECASM_ERROR_BAD_REG }, - {"ld ix ($100)", SPECASM_ERROR_COMMA_EXPECTED }, - {"ld ix, (-1)", SPECASM_ERROR_NUM_NEG }, - {"ld sp, ($10000)", SPECASM_ERROR_NUM_TOO_BIG }, - {"ld sp, ($100", SPECASM_ERROR_BAD_REG }, - {"ld sp ($100)", SPECASM_ERROR_COMMA_EXPECTED }, - {"ld sp, ('A')", SPECASM_ERROR_BAD_REG }, - {"ld sp, (-1)", SPECASM_ERROR_NUM_NEG }, - {"ld sp, a", SPECASM_ERROR_BAD_REG }, - {"ld ix, label1-label2", SPECASM_ERROR_BAD_LABEL }, - {"ld iy, label1-label2", SPECASM_ERROR_BAD_LABEL }, - - {"or", SPECASM_ERROR_BAD_REG }, - {"or (bc)", SPECASM_ERROR_BAD_REG }, - {"or (ix)", SPECASM_ERROR_BAD_REG }, - {"or (iy)", SPECASM_ERROR_BAD_REG }, - {"or iy)", SPECASM_ERROR_BAD_REG }, - {"or (iy", SPECASM_ERROR_BAD_REG }, - {"or (ix+128)", SPECASM_ERROR_NUM_TOO_BIG }, - {"or (iy+1028)", SPECASM_ERROR_NUM_TOO_BIG }, - {"or 256", SPECASM_ERROR_NUM_TOO_BIG }, - {"or -129", SPECASM_ERROR_NUM_TOO_BIG }, - {"or $100", SPECASM_ERROR_NUM_TOO_BIG }, - {"or hl", SPECASM_ERROR_BAD_REG }, - {"or f", SPECASM_ERROR_BAD_REG }, - - {"org", SPECASM_ERROR_BAD_NUM }, - {"org aa", SPECASM_ERROR_BAD_NUM }, - {"org $10000", SPECASM_ERROR_NUM_TOO_BIG }, - {"org 'a'", SPECASM_ERROR_BAD_NUM }, - {"org -1", SPECASM_ERROR_NUM_NEG }, - - {"out", SPECASM_ERROR_BAD_NUM }, - {"out ,", SPECASM_ERROR_BAD_NUM }, - {"out (c)", SPECASM_ERROR_COMMA_EXPECTED }, - {"out (77)", SPECASM_ERROR_COMMA_EXPECTED }, - {"out (77),", SPECASM_ERROR_BAD_REG }, - {"out (c),", SPECASM_ERROR_BAD_REG }, - {"out (c)", SPECASM_ERROR_COMMA_EXPECTED }, - {"out (c),", SPECASM_ERROR_BAD_REG }, - {"out (c), ix", SPECASM_ERROR_BAD_REG }, - {"out (c), xx", SPECASM_ERROR_BAD_REG }, - {"out (d), b", SPECASM_ERROR_BAD_REG }, - {"out 66), a", SPECASM_ERROR_BAD_NUM }, - {"out (66, c", SPECASM_ERROR_BAD_NUM }, - {"out (-7), c", SPECASM_ERROR_NUM_NEG }, - {"out (66), c", SPECASM_ERROR_BAD_REG }, - {"out ('A'), a", SPECASM_ERROR_BAD_NUM }, - {"out (660), c", SPECASM_ERROR_NUM_TOO_BIG }, - {"out (10), xx", SPECASM_ERROR_BAD_REG }, - {"out (ix+10), xx", SPECASM_ERROR_BAD_REG }, - - {"pop", SPECASM_ERROR_BAD_REG }, - {"pop a", SPECASM_ERROR_BAD_REG }, - {"pop b", SPECASM_ERROR_BAD_REG }, - {"pop bb", SPECASM_ERROR_BAD_REG }, - {"pop 10", SPECASM_ERROR_BAD_REG }, - {"pop (bc)", SPECASM_ERROR_BAD_REG }, - {"pop (ix+100)", SPECASM_ERROR_BAD_REG }, - - {"push", SPECASM_ERROR_BAD_REG }, - {"push a", SPECASM_ERROR_BAD_REG }, - {"push b", SPECASM_ERROR_BAD_REG }, - {"push bb", SPECASM_ERROR_BAD_REG }, - {"push 10", SPECASM_ERROR_BAD_REG }, - {"push (bc)", SPECASM_ERROR_BAD_REG }, - {"push (ix+100)", SPECASM_ERROR_BAD_REG }, - - {"res 'A', (hl)", SPECASM_ERROR_BAD_NUM }, - {"res 9, (hl)", SPECASM_ERROR_BAD_NUM }, - {"res $ff, (hl)", SPECASM_ERROR_BAD_NUM }, - {"res 0, ix + 127)", SPECASM_ERROR_BAD_REG }, - {"res 0, (ix + 127", SPECASM_ERROR_BAD_REG }, - {"res 0, (ix)", SPECASM_ERROR_BAD_REG }, - {"res 0, (ix+)", SPECASM_ERROR_BAD_NUM }, - {"res 0, (ix+$100)", SPECASM_ERROR_NUM_TOO_BIG }, - {"res 0, (ix-100)", SPECASM_ERROR_BAD_REG }, - {"res 0, bc", SPECASM_ERROR_BAD_REG }, - {"res 0, gg", SPECASM_ERROR_BAD_REG }, - {"res 0, $bc", SPECASM_ERROR_BAD_REG }, - - {"ret pp", SPECASM_ERROR_CONDITION_CODE }, - {"ret pop", SPECASM_ERROR_CONDITION_CODE }, - - {"rl", SPECASM_ERROR_BAD_REG }, - {"rl,", SPECASM_ERROR_BAD_MNENOMIC }, - {"rl (bc)", SPECASM_ERROR_BAD_REG }, - {"rl (", SPECASM_ERROR_BAD_REG }, - {"rl (hl", SPECASM_ERROR_BAD_REG }, - {"rl hl)", SPECASM_ERROR_BAD_REG }, - {"rl hl", SPECASM_ERROR_BAD_REG }, - {"rl i", SPECASM_ERROR_BAD_REG }, - {"rl (ix+255)", SPECASM_ERROR_NUM_TOO_BIG }, - {"rl (ix 11)", SPECASM_ERROR_BAD_REG }, - {"rl (ix +)", SPECASM_ERROR_BAD_NUM }, - {"rl 10", SPECASM_ERROR_BAD_REG }, - {"rl label", SPECASM_ERROR_BAD_REG }, - - {"rlc", SPECASM_ERROR_BAD_REG }, - {"rlc,", SPECASM_ERROR_BAD_MNENOMIC }, - {"rlc (bc)", SPECASM_ERROR_BAD_REG }, - {"rlc (", SPECASM_ERROR_BAD_REG }, - {"rlc (hl", SPECASM_ERROR_BAD_REG }, - {"rlc hl)", SPECASM_ERROR_BAD_REG }, - {"rlc hl", SPECASM_ERROR_BAD_REG }, - {"rlc i", SPECASM_ERROR_BAD_REG }, - {"rlc (ix+255)", SPECASM_ERROR_NUM_TOO_BIG }, - {"rlc (ix 11)", SPECASM_ERROR_BAD_REG }, - {"rlc (ix +)", SPECASM_ERROR_BAD_NUM }, - {"rlc 10", SPECASM_ERROR_BAD_REG }, - {"rlc label", SPECASM_ERROR_BAD_REG }, - - {"rr", SPECASM_ERROR_BAD_REG }, - {"rr,", SPECASM_ERROR_BAD_MNENOMIC }, - {"rr (bc)", SPECASM_ERROR_BAD_REG }, - {"rr (", SPECASM_ERROR_BAD_REG }, - {"rr (hl", SPECASM_ERROR_BAD_REG }, - {"rr hl)", SPECASM_ERROR_BAD_REG }, - {"rr hl", SPECASM_ERROR_BAD_REG }, - {"rr i", SPECASM_ERROR_BAD_REG }, - {"rr (ix+255)", SPECASM_ERROR_NUM_TOO_BIG }, - {"rr (ix 11)", SPECASM_ERROR_BAD_REG }, - {"rr (ix +)", SPECASM_ERROR_BAD_NUM }, - {"rr 10", SPECASM_ERROR_BAD_REG }, - {"rr label", SPECASM_ERROR_BAD_REG }, - - {"rrc", SPECASM_ERROR_BAD_REG }, - {"rrc,", SPECASM_ERROR_BAD_MNENOMIC }, - {"rrc (bc)", SPECASM_ERROR_BAD_REG }, - {"rrc (", SPECASM_ERROR_BAD_REG }, - {"rrc (hl", SPECASM_ERROR_BAD_REG }, - {"rrc hl)", SPECASM_ERROR_BAD_REG }, - {"rrc hl", SPECASM_ERROR_BAD_REG }, - {"rrc i", SPECASM_ERROR_BAD_REG }, - {"rrc (ix+255)", SPECASM_ERROR_NUM_TOO_BIG }, - {"rrc (ix 11)", SPECASM_ERROR_BAD_REG }, - {"rrc (ix +)", SPECASM_ERROR_BAD_NUM }, - {"rrc 10", SPECASM_ERROR_BAD_REG }, - {"rrc label", SPECASM_ERROR_BAD_REG }, - - {"rst", SPECASM_ERROR_BAD_NUM }, - {"rst 1", SPECASM_ERROR_BAD_NUM }, - {"rst 'A'", SPECASM_ERROR_BAD_NUM }, - {"rst label", SPECASM_ERROR_BAD_NUM }, - {"rst a", SPECASM_ERROR_BAD_NUM }, - - { "sbc", SPECASM_ERROR_BAD_REG }, - { "sbc a", SPECASM_ERROR_COMMA_EXPECTED }, - { "sbc a, ", SPECASM_ERROR_BAD_REG }, - { "sbc x, 10", SPECASM_ERROR_BAD_REG }, - { "sbc a, 256", SPECASM_ERROR_NUM_TOO_BIG }, - { "sbc a, $100", SPECASM_ERROR_NUM_TOO_BIG }, - { "sbc a, $gg", SPECASM_ERROR_BAD_REG }, - { "sbc a, $$aa", SPECASM_ERROR_BAD_REG }, - { "sbc a, hl)", SPECASM_ERROR_BAD_REG }, - { "sbc a, (hl", SPECASM_ERROR_BAD_REG }, - { "sbc a, (xx)", SPECASM_ERROR_BAD_REG }, - { "sbc a, (bc)", SPECASM_ERROR_BAD_REG }, - { "sbc a, (a)", SPECASM_ERROR_BAD_REG }, - { "sbc bc, 10", SPECASM_ERROR_BAD_REG }, - { "sbc a, (ix)", SPECASM_ERROR_BAD_REG }, - { "sbc a, (ix+)", SPECASM_ERROR_BAD_NUM }, - { "sbc a, (ix+bc)", SPECASM_ERROR_BAD_NUM }, - { "sbc a, (ix+-129)", SPECASM_ERROR_NUM_TOO_BIG }, - { "sbc a, (ix-129)", SPECASM_ERROR_BAD_REG }, - { "sbc a, (iy+bc)", SPECASM_ERROR_BAD_NUM }, - { "sbc a, (iy+-129)", SPECASM_ERROR_NUM_TOO_BIG }, - { "sbc a, (iy-129)", SPECASM_ERROR_BAD_REG }, - { "sbc a, (de+19)", SPECASM_ERROR_BAD_REG }, - { "sbc b, 10", SPECASM_ERROR_BAD_REG }, - { "sbc c, 10", SPECASM_ERROR_BAD_REG }, - { "sbc d, 10", SPECASM_ERROR_BAD_REG }, - { "sbc e, 10", SPECASM_ERROR_BAD_REG }, - { "sbc h, 10", SPECASM_ERROR_BAD_REG }, - { "sbc l, 10", SPECASM_ERROR_BAD_REG }, - { "sbc hl, 10", SPECASM_ERROR_BAD_REG }, - { "sbc hl, ix", SPECASM_ERROR_BAD_REG }, - { "sbc de, hl", SPECASM_ERROR_BAD_REG }, - - {"set 9, (hl)", SPECASM_ERROR_BAD_NUM }, - {"set $ff, (hl)", SPECASM_ERROR_BAD_NUM }, - {"set 0, ix + 127)", SPECASM_ERROR_BAD_REG }, - {"set 0, (ix + 127", SPECASM_ERROR_BAD_REG }, - {"set 0, (ix)", SPECASM_ERROR_BAD_REG }, - {"set 0, (ix+)", SPECASM_ERROR_BAD_NUM }, - {"set 0, (ix+$100)", SPECASM_ERROR_NUM_TOO_BIG }, - {"set 0, (ix-100)", SPECASM_ERROR_BAD_REG }, - {"set 0, bc", SPECASM_ERROR_BAD_REG }, - {"set 0, gg", SPECASM_ERROR_BAD_REG }, - {"set 0, $bc", SPECASM_ERROR_BAD_REG }, - - {"sla", SPECASM_ERROR_BAD_REG }, - {"sla,", SPECASM_ERROR_BAD_MNENOMIC }, - {"sla (bc)", SPECASM_ERROR_BAD_REG }, - {"sla (", SPECASM_ERROR_BAD_REG }, - {"sla (hl", SPECASM_ERROR_BAD_REG }, - {"sla hl)", SPECASM_ERROR_BAD_REG }, - {"sla hl", SPECASM_ERROR_BAD_REG }, - {"sla i", SPECASM_ERROR_BAD_REG }, - {"sla (ix+255)", SPECASM_ERROR_NUM_TOO_BIG }, - {"sla (ix 11)", SPECASM_ERROR_BAD_REG }, - {"sla (ix +)", SPECASM_ERROR_BAD_NUM }, - {"sla 10", SPECASM_ERROR_BAD_REG }, - {"sla label", SPECASM_ERROR_BAD_REG }, - - {"sra", SPECASM_ERROR_BAD_REG }, - {"sra,", SPECASM_ERROR_BAD_MNENOMIC }, - {"sra (bc)", SPECASM_ERROR_BAD_REG }, - {"sra (", SPECASM_ERROR_BAD_REG }, - {"sra (hl", SPECASM_ERROR_BAD_REG }, - {"sra hl)", SPECASM_ERROR_BAD_REG }, - {"sra hl", SPECASM_ERROR_BAD_REG }, - {"sra i", SPECASM_ERROR_BAD_REG }, - {"sra (ix+255)", SPECASM_ERROR_NUM_TOO_BIG }, - {"sra (ix 11)", SPECASM_ERROR_BAD_REG }, - {"sra (ix +)", SPECASM_ERROR_BAD_NUM }, - {"sra 10", SPECASM_ERROR_BAD_REG }, - {"sra label", SPECASM_ERROR_BAD_REG }, - - {"srl", SPECASM_ERROR_BAD_REG }, - {"srl,", SPECASM_ERROR_BAD_MNENOMIC }, - {"srl (bc)", SPECASM_ERROR_BAD_REG }, - {"srl (", SPECASM_ERROR_BAD_REG }, - {"srl (hl", SPECASM_ERROR_BAD_REG }, - {"srl hl)", SPECASM_ERROR_BAD_REG }, - {"srl hl", SPECASM_ERROR_BAD_REG }, - {"srl i", SPECASM_ERROR_BAD_REG }, - {"srl (ix+255)", SPECASM_ERROR_NUM_TOO_BIG }, - {"srl (ix 11)", SPECASM_ERROR_BAD_REG }, - {"srl (ix +)", SPECASM_ERROR_BAD_NUM }, - {"srl 10", SPECASM_ERROR_BAD_REG }, - {"srl label", SPECASM_ERROR_BAD_REG }, - - {"sub", SPECASM_ERROR_BAD_REG }, - {"sub (bc)", SPECASM_ERROR_BAD_REG }, - {"sub (ix)", SPECASM_ERROR_BAD_REG }, - {"sub (iy)", SPECASM_ERROR_BAD_REG }, - {"sub iy)", SPECASM_ERROR_BAD_REG }, - {"sub (iy", SPECASM_ERROR_BAD_REG }, - {"sub (ix+128)", SPECASM_ERROR_NUM_TOO_BIG }, - {"sub (iy+1028)", SPECASM_ERROR_NUM_TOO_BIG }, - {"sub 256", SPECASM_ERROR_NUM_TOO_BIG }, - {"sub -129", SPECASM_ERROR_NUM_TOO_BIG }, - {"sub $100", SPECASM_ERROR_NUM_TOO_BIG }, - {"sub hl", SPECASM_ERROR_BAD_REG }, - {"sub f", SPECASM_ERROR_BAD_REG }, - - {"xor", SPECASM_ERROR_BAD_REG }, - {"xor (bc)", SPECASM_ERROR_BAD_REG }, - {"xor (ix)", SPECASM_ERROR_BAD_REG }, - {"xor (iy)", SPECASM_ERROR_BAD_REG }, - {"xor iy)", SPECASM_ERROR_BAD_REG }, - {"xor (iy", SPECASM_ERROR_BAD_REG }, - {"xor (ix+128)", SPECASM_ERROR_NUM_TOO_BIG }, - {"xor (iy+1028)", SPECASM_ERROR_NUM_TOO_BIG }, - {"xor 256", SPECASM_ERROR_NUM_TOO_BIG }, - {"xor -129", SPECASM_ERROR_NUM_TOO_BIG }, - {"xor $100", SPECASM_ERROR_NUM_TOO_BIG }, - {"xor hl", SPECASM_ERROR_BAD_REG }, - {"xor f", SPECASM_ERROR_BAD_REG }, - - {"db label", SPECASM_ERROR_BAD_LABEL }, - {"db 256", SPECASM_ERROR_NUM_TOO_BIG }, - {"db 255, -1", SPECASM_ERROR_BAD_NUM }, - {"db -1, 255", SPECASM_ERROR_BAD_NUM }, - {"db -1, -2, -3, 128", SPECASM_ERROR_BAD_NUM }, - {"db -1, -2, -3, $20", SPECASM_ERROR_BAD_NUM }, - {"db 'A', 1, 2", SPECASM_ERROR_BAD_NUM }, - {"db 1, 'A', 2", SPECASM_ERROR_BAD_NUM }, - {"db", SPECASM_ERROR_BAD_LABEL }, - {"db $100", SPECASM_ERROR_NUM_TOO_BIG }, - {"dw", SPECASM_ERROR_BAD_LABEL }, - {"dw 65536", SPECASM_ERROR_NUM_TOO_BIG }, - {"dw $10000", SPECASM_ERROR_NUM_TOO_BIG }, - {"dw $1000, -1", SPECASM_ERROR_BAD_NUM }, - {"dw -1, 32768", SPECASM_ERROR_BAD_NUM }, - {"dw 'A', $fff", SPECASM_ERROR_BAD_NUM }, - - {"ds 0, $10", SPECASM_ERROR_BAD_NUM }, - {"ds 1000, $100", SPECASM_ERROR_NUM_TOO_BIG }, - {"ds -1000, 100", SPECASM_ERROR_NUM_NEG }, - {"ds", SPECASM_ERROR_BAD_NUM }, - {"ds 10", SPECASM_ERROR_COMMA_EXPECTED }, - {"ds 10,", SPECASM_ERROR_BAD_NUM }, -}; - -/* clang-format on */ +#include "test_content.h" static int prv_test_opcodes() { @@ -2826,10 +30,10 @@ static int prv_test_opcodes() err_type = SPECASM_ERROR_OK; - for (i = 0; i < sizeof(tests) / sizeof(test_t); i++) { + for (i = 0; i < opcode_tests_count; i++) { char buf[33] = {0}; specasm_line_t line = {0}; - const test_t *t = &tests[i]; + const test_t *t = &opcode_tests[i]; printf("opcode: %s : ", t->source); parsed = specasm_parse_mnemomic_e(t->source, 0, &line); @@ -2887,10 +91,10 @@ static int prv_test_parse_format_bare() err_type = SPECASM_ERROR_OK; - for (i = 0; i < sizeof(tests) / sizeof(test_t); i++) { + for (i = 0; i < opcode_tests_count; i++) { char buf[SPECASM_LINE_MAX_LEN + 1]; char buf2[SPECASM_LINE_MAX_LEN + 1]; - const test_t *t = &tests[i]; + const test_t *t = &opcode_tests[i]; const specasm_line_t *line = &state.lines.lines[0]; memset(buf, ' ', sizeof(buf) - 1); @@ -2959,7 +163,7 @@ static int prv_test_format() err_type = SPECASM_ERROR_OK; - for (i = 0; i < sizeof(format_tests) / sizeof(format_test_t); i++) { + for (i = 0; i < format_tests_count; i++) { char buf[SPECASM_LINE_MAX_LEN + 1]; char buf2[SPECASM_LINE_MAX_LEN + 1]; const format_test_t *t = &format_tests[i]; @@ -3013,7 +217,7 @@ static int prv_test_bad_opcodes() { size_t i; - for (i = 0; i < sizeof(bad_tests) / sizeof(bad_test_t); i++) { + for (i = 0; i < bad_tests_count; i++) { specasm_line_t line = {0}; const bad_test_t *t = &bad_tests[i]; err_type = SPECASM_ERROR_OK; diff --git a/src/unittests_zx.c b/src/unittests_zx.c new file mode 100644 index 0000000..a6288ef --- /dev/null +++ b/src/unittests_zx.c @@ -0,0 +1,384 @@ +/* + * Copyright contributors to Specasm + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. +*/ + +#include +#include + +#include + +#include "error.h" +#include "peer.h" +#include "peer_file.h" +#include "state.h" +#include "test_content.h" +#include "test_content_zx.h" +#include "util_print_zx.h" + +#define UNITTEST_ZX_TEST_LINE 0 +#define UNITTEST_ZX_FORMAT_LINE 1 +#define UNITTEST_ZX_FORMAT_LINE2 2 +#define UNITTEST_ZX_ERROR_LINE 3 +#define UNITTEST_ZX_OPCODE_OK_LINE 6 +#define UNITTEST_ZX_FORMAT_OK_LINE 7 +#define UNITTEST_ZX_BAD_OK_LINE 8 +#define UNITTEST_ZX_VERSION_OK_LINE 9 + +static int prv_test_opcode(const test_zx_t *t) +{ + char buf[33] = {0}; + specasm_line_t line = {0}; + uint8_t parsed; + + specasm_util_clear(0, UNITTEST_ZX_TEST_LINE, + SPECASM_LINE_MAX_LEN, PAPER_WHITE|INK_BLACK); + (void) specasm_util_print(t->source, 0, + UNITTEST_ZX_TEST_LINE, + PAPER_WHITE|INK_BLACK); + + parsed = specasm_parse_mnemomic_e(t->source, 0, &line); + if (err_type != SPECASM_ERROR_OK) { + (void) specasm_util_print(error_msgs[err_type], 0, + UNITTEST_ZX_ERROR_LINE, + PAPER_RED|INK_BLACK); + return 1; + } + + if (parsed != strlen(t->source)) { + (void) specasm_util_print("mismatched length", 0, + UNITTEST_ZX_ERROR_LINE, + PAPER_RED|INK_BLACK); + return 1; + } + + if (t->size != specasm_line_get_size(&line) + 1) { + (void) specasm_util_print("mismatched opcode length", 0, + UNITTEST_ZX_ERROR_LINE, + PAPER_RED|INK_BLACK); + return 1; + } + + if (memcmp(line.data.op_code, t->op_code, 4)) { + (void) specasm_util_print("mismatched opcode", 0, + UNITTEST_ZX_ERROR_LINE, + PAPER_RED|INK_BLACK); + return 1; + } + + parsed = specasm_dump_opcode_e(&line, buf); + if (err_type != SPECASM_ERROR_OK) { + (void) specasm_util_print(error_msgs[err_type], 0, + UNITTEST_ZX_ERROR_LINE, + PAPER_RED|INK_BLACK); + return 1; + } + buf[parsed] = 0; + if (strcmp(t->str, buf)) { + (void) specasm_util_print(buf, 0, UNITTEST_ZX_FORMAT_LINE, + PAPER_RED|INK_BLACK); + (void) specasm_util_print("bad format", 0, + UNITTEST_ZX_ERROR_LINE, + PAPER_RED|INK_BLACK); + return 1; + } + + return 0; +} + +static int prv_test_format(const test_zx_t *t) +{ + size_t i; + + char buf[SPECASM_LINE_MAX_LEN + 1]; + char buf2[SPECASM_LINE_MAX_LEN + 1]; + const specasm_line_t *line = &state.lines.lines[0]; + + memset(buf, ' ', sizeof(buf) - 1); + buf[sizeof(buf) - 1] = 0; + memcpy(buf, t->source, strlen(t->source)); + + specasm_util_clear(0, UNITTEST_ZX_TEST_LINE, + SPECASM_LINE_MAX_LEN, PAPER_WHITE|INK_BLACK); + (void) specasm_util_print(t->source, 0, + UNITTEST_ZX_TEST_LINE, + PAPER_WHITE|INK_BLACK); + + specasm_parse_line_e(0, buf); + if (err_type != SPECASM_ERROR_OK) { + (void) specasm_util_print(error_msgs[err_type], 0, + UNITTEST_ZX_ERROR_LINE, + PAPER_RED|INK_BLACK); + return 1; + } + + if (t->size != specasm_line_get_size(line) + 1) { + (void) specasm_util_print("mismatched opcode length", 0, + UNITTEST_ZX_ERROR_LINE, + PAPER_RED|INK_BLACK); + return 1; + } + + if (memcmp(line->data.op_code, t->op_code, 4)) { + (void) specasm_util_print("mismatched opcode", 0, + UNITTEST_ZX_ERROR_LINE, + PAPER_RED|INK_BLACK); + return 1; + } + + memset(buf, 0, sizeof(buf)); + memset(buf2, ' ', sizeof(buf2) - 1); + buf2[sizeof(buf2) - 1] = 0; + if (line->type != SPECASM_LINE_TYPE_DB && + line->type != SPECASM_LINE_TYPE_DW && + line->type != SPECASM_LINE_TYPE_DB_SUB && + line->type != SPECASM_LINE_TYPE_DW_SUB && + line->type != SPECASM_LINE_TYPE_DS) + memcpy(buf2 + SPECASM_MAX_INDENT, t->str, + strlen(t->str)); + else + memcpy(buf2, t->str, strlen(t->str)); + specasm_format_line_e(buf, 0); + if (err_type != SPECASM_ERROR_OK) { + (void) specasm_util_print("dump: ", 0, + UNITTEST_ZX_ERROR_LINE, + PAPER_RED|INK_BLACK); + (void) specasm_util_print(error_msgs[err_type], 6, + UNITTEST_ZX_ERROR_LINE, + PAPER_RED|INK_BLACK); + return 1; + } + + if (strcmp(buf, buf2)) { + (void) specasm_util_print(buf, 0, UNITTEST_ZX_FORMAT_LINE, + PAPER_RED|INK_BLACK); + (void) specasm_util_print(buf2, 0, UNITTEST_ZX_FORMAT_LINE2, + PAPER_RED|INK_BLACK); + (void) specasm_util_print("bad format", 0, + UNITTEST_ZX_ERROR_LINE, + PAPER_RED|INK_BLACK); + return 1; + } + + return 0; +} + +static int prv_test_bad(const bad_test_zx_t *t) +{ + size_t i; + specasm_line_t line = {0}; + + err_type = SPECASM_ERROR_OK; + specasm_util_clear(0, UNITTEST_ZX_TEST_LINE, + SPECASM_LINE_MAX_LEN, PAPER_WHITE|INK_BLACK); + (void) specasm_util_print(t->source, 0, + UNITTEST_ZX_TEST_LINE, + PAPER_WHITE|INK_BLACK); + + (void)specasm_parse_mnemomic_e(t->source, 0, &line); + if (err_type != t->error) { + (void) specasm_util_print(error_msgs[err_type], 0, + UNITTEST_ZX_FORMAT_LINE, + PAPER_RED|INK_BLACK); + (void) specasm_util_print(error_msgs[t->error], 0, + UNITTEST_ZX_FORMAT_LINE2, + PAPER_RED|INK_BLACK); + (void) specasm_util_print("bad error", 0, + UNITTEST_ZX_ERROR_LINE, + PAPER_RED|INK_BLACK); + return 1; + } + err_type = SPECASM_ERROR_OK; + + return 0; +} + +static int prv_opcode_tests(void) +{ + specasm_handle_t h; + uint16_t count; + test_zx_t test; + + h = specasm_file_ropen_e("test_op"); + if (err_type != SPECASM_ERROR_OK) + goto on_error; + + (void) specasm_file_read_e(h, &count, 2); + if (err_type != SPECASM_ERROR_OK) + goto close_file; + + for (uint16_t i = 0; i < count; i++) { + (void) specasm_file_read_e(h, &test, sizeof(test)); + if (err_type != SPECASM_ERROR_OK) + goto close_file; + + if (prv_test_opcode(&test)) { + specasm_file_close_e(h); + return 1; + } + } + + (void) specasm_util_print("opcode tests [ok]", 0, + UNITTEST_ZX_OPCODE_OK_LINE, + PAPER_WHITE|INK_BLACK); + + specasm_file_close_e(h); + + return 0; + +close_file: + specasm_file_close_e(h); + +on_error: + (void) specasm_util_print(error_msgs[err_type], 0, + UNITTEST_ZX_ERROR_LINE, + PAPER_RED|INK_BLACK); + return 1; +} + +static int prv_format_tests(void) +{ + specasm_handle_t h; + uint16_t count; + test_zx_t test; + + h = specasm_file_ropen_e("test_op"); + if (err_type != SPECASM_ERROR_OK) + goto on_error; + + (void) specasm_file_read_e(h, &count, 2); + if (err_type != SPECASM_ERROR_OK) + goto close_file; + + for (uint16_t i = 0; i < count; i++) { + (void) specasm_file_read_e(h, &test, sizeof(test)); + if (err_type != SPECASM_ERROR_OK) + goto close_file; + + if (prv_test_format(&test)) { + specasm_file_close_e(h); + return 1; + } + } + + (void) specasm_util_print("format tests [ok]", 0, + UNITTEST_ZX_FORMAT_OK_LINE, + PAPER_WHITE|INK_BLACK); + + specasm_file_close_e(h); + + return 0; + +close_file: + specasm_file_close_e(h); + +on_error: + (void) specasm_util_print(error_msgs[err_type], 0, + UNITTEST_ZX_ERROR_LINE, + PAPER_RED|INK_BLACK); + return 1; +} + +static int prv_bad_tests(void) +{ + specasm_handle_t h; + uint16_t count; + bad_test_zx_t test; + + h = specasm_file_ropen_e("test_bad"); + if (err_type != SPECASM_ERROR_OK) + goto on_error; + + (void) specasm_file_read_e(h, &count, 2); + if (err_type != SPECASM_ERROR_OK) + goto close_file; + + for (uint16_t i = 0; i < count; i++) { + (void) specasm_file_read_e(h, &test, sizeof(test)); + if (err_type != SPECASM_ERROR_OK) + goto close_file; + + if (prv_test_bad(&test)) { + specasm_file_close_e(h); + return 1; + } + } + + (void) specasm_util_print("bad tests [ok]", 0, + UNITTEST_ZX_BAD_OK_LINE, + PAPER_WHITE|INK_BLACK); + + specasm_file_close_e(h); + + return 0; + +close_file: + specasm_file_close_e(h); + +on_error: + (void) specasm_util_print(error_msgs[err_type], 0, + UNITTEST_ZX_ERROR_LINE, + PAPER_RED|INK_BLACK); + return 1; +} + +static int prv_test_old_version(void) +{ + err_type = SPECASM_ERROR_OK; + + specasm_util_clear(0, UNITTEST_ZX_TEST_LINE, + SPECASM_LINE_MAX_LEN, PAPER_WHITE|INK_BLACK); + (void) specasm_util_print("version check", 0, + UNITTEST_ZX_TEST_LINE, + PAPER_WHITE|INK_BLACK); + + specasm_state_reset(); + state.version = SPECASM_VERSION + 1; + specasm_save_e("hello"); + specasm_load_e("hello"); + if (err_type != SPECASM_ERROR_SPECASM_TOO_OLD) { + (void) specasm_util_print( + error_msgs[SPECASM_ERROR_SPECASM_TOO_OLD], 0, + UNITTEST_ZX_FORMAT_LINE, PAPER_RED|INK_BLACK); + (void) specasm_util_print(error_msgs[err_type], 0, + UNITTEST_ZX_FORMAT_LINE2, + PAPER_RED|INK_BLACK); + (void) specasm_util_print("bad error", 0, + UNITTEST_ZX_ERROR_LINE, + PAPER_RED|INK_BLACK); + return 1; + } + + (void) specasm_util_print("version test [ok]", 0, + UNITTEST_ZX_VERSION_OK_LINE, + PAPER_WHITE|INK_BLACK); + + return 0; +} + +int main(int argc, char *argv[]) +{ + specasm_init_dump_table(); + + specasm_error_init(err_type); + zx_border(INK_WHITE); + zx_cls(PAPER_WHITE | INK_BLACK); + + if (prv_opcode_tests() || prv_format_tests() || prv_bad_tests() || + prv_test_old_version()) + return 1; + + return 0; +} + diff --git a/src/util_print_zx.c b/src/util_print_zx.c new file mode 100644 index 0000000..40c8fca --- /dev/null +++ b/src/util_print_zx.c @@ -0,0 +1,70 @@ +/* + * Copyright contributors to Specasm + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. +*/ + +#include + +#include "util_print_zx.h" + +uint8_t specasm_util_print(const char *str, uint8_t x, uint8_t y, uint8_t attr) +{ + uint8_t *cptr; + uint8_t *aptr = zx_cxy2aaddr(x, y); + uint8_t *bsptr; + uint8_t *sptr; + uint8_t i; + uint8_t old_x = x; + + bsptr = zx_cxy2saddr(x, y); + while (*str) { + *aptr++ = attr; + cptr = (uint8_t *)15360 + (*((uint8_t *)str) * 8); + sptr = bsptr; + i = 8; + do { + *sptr = *cptr++; + sptr += 256; + i--; + } while (i != 0); + str++; + x++; + bsptr++; + } + + return x - old_x; +} + +void specasm_util_clear(uint8_t x, uint8_t y, uint8_t l, uint8_t attr) +{ + uint8_t *aptr = zx_cxy2aaddr(x, y); + uint8_t *sptr; + uint8_t *bsptr; + uint8_t i; + + bsptr = zx_cxy2saddr(x, y); + while (l > 0) { + *aptr++ = attr; + sptr = bsptr; + i = 8; + do { + *sptr = 0; + sptr += 256; + i--; + } while (i != 0); + x++; + l--; + bsptr++; + } +} diff --git a/src/util_print_zx.h b/src/util_print_zx.h new file mode 100644 index 0000000..bc9c2dc --- /dev/null +++ b/src/util_print_zx.h @@ -0,0 +1,25 @@ +/* + * Copyright contributors to Specasm + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. +*/ + +#ifndef UTIL_PRINT_ZX_H +#define UTIL_PRINT_ZX_H + +#include + +uint8_t specasm_util_print(const char *str, uint8_t x, uint8_t y, uint8_t attr); +void specasm_util_clear(uint8_t x, uint8_t y, uint8_t l, uint8_t attr); + +#endif diff --git a/unitzx/Make.include b/unitzx/Make.include new file mode 100644 index 0000000..14b16c1 --- /dev/null +++ b/unitzx/Make.include @@ -0,0 +1,14 @@ +error.o: ../src/error.c ../src/error.h +state_base.o: ../src/state_base.c ../src/peer.h ../src/error.h ../src/peer_unit.h \ + ../src/line.h ../src/state_base.h ../src/strings.h +line.o: ../src/line.c ../src/peer.h ../src/error.h ../src/peer_unit.h ../src/line.h \ + ../src/state.h ../src/state_base.h ../src/strings.h +state.o: ../src/state.c ../src/state.h ../src/state_base.h ../src/line.h ../src/error.h \ + ../src/strings.h +peer_file_zx.o: ../src/peer_file.h ../src/error.h +util_print_zx.o: ../src/util_print_zx.h +peer_unit.o: ../src/peer_unit.c ../src/peer.h ../src/error.h ../src/peer_unit.h \ + ../src/line.h ../src/state.h ../src/state_base.h ../src/strings.h +unittests_zx.o: ../src/unittests_zx.c ../src/error.h ../src/line.h \ + ../src/state.h ../src/state_base.h ../src/strings.h ../src/test_content.h ../src/test_content_zx.h \ + ../src/peer.h ../src/peer_file.h ../src/peer_unit.h diff --git a/unitzx/Makefile b/unitzx/Makefile new file mode 100644 index 0000000..4f953cc --- /dev/null +++ b/unitzx/Makefile @@ -0,0 +1,34 @@ +VPATH=../src + +.PHONY: all +all: unitzx.tap + +CC=zcc +CFLAGS=+zx -SO3 --opt-code-size --max-allocs-per-node200000 -Cs "--disable-warning 85" -clib=sdcc_iy -DUNITTESTS + +include Make.include + +UNITZX = \ + error.o \ + state_base.o \ + line.o \ + state.o \ + peer_file_zx.o \ + util_print_zx.o \ + peer_unit.o \ + unittests_zx.o + +unitzx.tap: $(UNITZX) + $(CC) $(CFLAGS) -zorg=24000 -startup=31 -o unitzx $^ -create-app + +clean: + - rm -rf unitzx + - rm *.X *.o *.bin *.tap + +.PHONY: tests +tests: + - rm -rf unitzx + mkdir unitzx + cd .. && make -f Makefile test_content_zx + ../test_content_zx unitzx + cp unitzx.tap unitzx