diff --git a/README.md b/README.md index 224bdb98..9525499a 100644 --- a/README.md +++ b/README.md @@ -120,7 +120,7 @@ Using the File System [doc/constraints.txt](doc/constraints.txt) to understand what works and what does not. -* Copy the folder `qbin from the QNICE-FPGA root folder to your SD Card. It +* Copy the folder `qbin` from the QNICE-FPGA root folder to your SD Card. It contains some nice demo programs in the directly loadable `.out` file format. diff --git a/TODO.txt b/TODO.txt index 5cc0605f..24694aa8 100644 --- a/TODO.txt +++ b/TODO.txt @@ -69,6 +69,9 @@ HARDWARE: MONITOR: +* variables.asm: replace hardcoded blocksize for _SD$DEVICEHANDLE by using + FAT32$DEV_STRUCT_SIZE + * Get rid of the hardcoded keyboard locale * BS/DEL when entering hex digits (and at other reasonable places) @@ -99,14 +102,12 @@ ASSEMBLER STANDARD LIBs (WITHIN MONITOR): EMULATOR: -* Emulate the SD Card by being able to mount a reasonable container file - format (iso, dmg, ...) and/or by being able to mount a RAW binary dump - of an SD Card (maybe shortened/truncated, if it is sparsely filled with a - lot of zeros at the end) - -* Emulate the VGA output - -* Emulate the USB keyboard +* Emulate the VGA output and the USB keyboard (maybe using something like + LIBSDL? SFML? GLFW?). Optimally, the whole thing would by totally + dynamically loaded so that the emulator continues to run on text only + systems and on systems that don't have a multimedia library installed. + If this does not work, then we should just work with #defines within + the Emulator's code and compile two versions, like "qnice" and "qnice_vga". NATIVE TOOLCHAIN: ASSEMBLER: @@ -156,3 +157,8 @@ DEMOS: * Forth Interpreter * VGA Textmode games: Snake, Pac Man, 2048 + + +DOCUMENTATION: + +* Add the PDF or HTML documentation version of the VBCC toolchain. diff --git a/VERSIONS.txt b/VERSIONS.txt index c38c3ef8..9e2e5595 100644 --- a/VERSIONS.txt +++ b/VERSIONS.txt @@ -1,3 +1,16 @@ +Version 1.41 December, 30 2016 +================================= + +* CPU: Fixed a bug which prevented things like ADD @--R4, R4 from working + correctly, i.e. when a register was pre-decremented, then used for + indirect reading and then the same register was the target register. + See test_programs/predec.asm for a thorough description of this bug. +* EMULATOR: Can emulate the SD Cards introduced in Version 1.4 by being able + to mount raw binary images of FAT32 devices. Have a look at doc/emumount.txt + to see how it works. +* EMULATOR: 'dump' now shows ASCII values additionally to the hex values. +* Fixed a bunch of typos in various places and improved the documentation. + Version 1.4 December, 26 2016 ================================ diff --git a/dist_kit/qnice-v14.bit b/dist_kit/qnice-v141.bit similarity index 55% rename from dist_kit/qnice-v14.bit rename to dist_kit/qnice-v141.bit index af526de4..a132ba77 100644 Binary files a/dist_kit/qnice-v14.bit and b/dist_kit/qnice-v141.bit differ diff --git a/dist_kit/sysdef.asm b/dist_kit/sysdef.asm index 87bde2cf..1e2836d2 100644 --- a/dist_kit/sysdef.asm +++ b/dist_kit/sysdef.asm @@ -377,7 +377,11 @@ IO$SD_CSR .EQU 0xFF29 ; Command and Status Register (write to execute comm ; SD-Opcodes (CSR): 0x0000 Reset SD card ; 0x0001 Read 512 bytes from the linear block address ; 0x0002 Write 512 bytes to the linear block address -; Bits 0..2 are write-only (reading always returns 0) +; Bits 0 .. 2 are write-only (reading always returns 0) +; Bits 13 .. 12 return the card type: 00 = no card / unknown card +; 01 = SD V1 +; 10 = SD V2 +; 11 = SDHC ; Bit 14 of the CSR is the error bit: 1, if the last operation failed. In such ; a case, the error code is in IO$SD_ERROR and ; you need to reset the controller to go on diff --git a/dist_kit/sysdef.h b/dist_kit/sysdef.h index bbfc5e2a..447659be 100644 --- a/dist_kit/sysdef.h +++ b/dist_kit/sysdef.h @@ -369,7 +369,11 @@ // SD-Opcodes (CSR): 0x0000 Reset SD card // 0x0001 Read 512 bytes from the linear block address // 0x0002 Write 512 bytes to the linear block address -// Bits 0..2 are write-only (reading always returns 0) +// Bits 0 .. 2 are write-only (reading always returns 0) +// Bits 13 .. 12 return the card type: 00 = no card / unknown card +// 01 = SD V1 +// 10 = SD V2 +// 11 = SDHC // Bit 14 of the CSR is the error bit: 1, if the last operation failed. In such // a case, the error code is in IO_SD_ERROR and // you need to reset the controller to go on diff --git a/dist_kit/sysdef.vasm b/dist_kit/sysdef.vasm index f4742306..98b6975c 100644 --- a/dist_kit/sysdef.vasm +++ b/dist_kit/sysdef.vasm @@ -369,7 +369,11 @@ ; SD-Opcodes (CSR): 0x0000 Reset SD card ; 0x0001 Read 512 bytes from the linear block address ; 0x0002 Write 512 bytes to the linear block address -; Bits 0..2 are write-only (reading always returns 0) +; Bits 0 .. 2 are write-only (reading always returns 0) +; Bits 13 .. 12 return the card type: 00 = no card / unknown card +; 01 = SD V1 +; 10 = SD V2 +; 11 = SDHC ; Bit 14 of the CSR is the error bit: 1, if the last operation failed. In such ; a case, the error code is in IO$SD_ERROR and ; you need to reset the controller to go on diff --git a/doc/constraints.txt b/doc/constraints.txt index 82d07d50..73622174 100644 --- a/doc/constraints.txt +++ b/doc/constraints.txt @@ -15,7 +15,7 @@ Written by sy2002 / Last modified in December 2016 * When it comes to SDHC cards, i.e. cards larger than 2 GB, the following are tested as working: SanDisk 32 GB microSDHC Class 4, Transcend 32 GB microSDHC Class 10, Elegant 32 GB -* NOT WORKING are cards like SanDisk "Ultra" Class 10 cards (80 MB/Sek). Use +* NOT WORKING are cards like SanDisk "Ultra" Class 10 cards (80 MB/sec). Use slower cards instead, like SanDisk's 32 GB Class 4 card. So for summing it up: If you want to be on the safe side, then use cards SD cards (no SDHC, no SDXC) with a capacity of a maximum of 2 GB. diff --git a/doc/demos/q-tris-highscore.txt b/doc/demos/q-tris-highscore.txt index 286d7192..68997ec5 100644 --- a/doc/demos/q-tris-highscore.txt +++ b/doc/demos/q-tris-highscore.txt @@ -1,3 +1,4 @@ 5639 @ 499 Lines Volker Barthelmann 10/06/16 L8 / S241 / D93 / T20 / Q03 +2380 @ 234 Lines sy2002 12/26/16 L7 / S109 / D37 / T09 / Q06 2215 @ 190 Lines sy2002 04/24/16 L7 / S66 / D29 / T10 / Q09 1122 @ 124 Lines sy2002 06/04/16 L6 / S66 / D11 / T04 / Q06 diff --git a/doc/emumount.txt b/doc/emumount.txt new file mode 100644 index 00000000..353970c9 --- /dev/null +++ b/doc/emumount.txt @@ -0,0 +1,101 @@ +How to mount FAT32 devices and files in the Emulator +==================================================== + +QNICE-FPGA is able to work with (micro)SD Cards that are formatted using the +FAT32 file system and the MBR partition table. Please have a look at +doc/constraints.txt to learn more about that. + +IMPORTANT: FAT32 (not FAT16) and MBR is mandatory. + +The Emulator is able to mount raw image files that are made from appropriate +media and expose it to QNICE-FPGA via the SD Card interface, so that the +Monitor "thinks" this is a FAT32/MBR formatted SD card. As devices behave like +files on Unix-like systems, on these systems you can also directly mount a +device. + +Creating a raw image file from existing folders +----------------------------------------------- + +Use the tool, that your operating system provides, to generate a raw image +from existing folders of your hard drive. + +For macOS: + +Here is an example, how you can add the folders "test_programs" and "qbin" +from the QNICE-FPGA root folder to a newly created raw image file. + + +1. hdiutil create -megabytes 33 -fs MS-DOS -fsargs "-F 32" -volname myimage -srcfolder qbin -srcfolder test_programs -o myimage.dmg + +2. hdiutil convert myimage.dmg -format UDTO -o myimage + +3. mv myimage.cdr myimage.img + +IMPORTANT: hdiutil is only able to create FAT32 images, when the size of the +image (the "-megabytes" parameter) is larger than 32, so we use 33 in the +above-mentioned example. + +Creating a raw image file from an existing device +------------------------------------------------- + +If you have a FAT32 formatted SD Card or USB stick, then on Unix-like systems, +the easiest way is to use the "dd" command on the raw device. Example of how +to do it on a Mac: + +1. Find out which disk device is mounted to: diskutil list + Example: /dev/disk4 + +2. Use the raw device, by inserting a 'r' in front of the disk name: + Example: /dev/rdisk4 + +3. Create a raw dump (you need sudo): + Example: sudo dd if=/dev/rdisk4 of=mydump.img + (Takes quite a long time. Can be interrupted by CTRL+C, you then have + a partial dump, which is often OK and enough to play with.) + +4. This image file can be mounted by the Emulator. (Also by your OS. In macOS + for example, you can just double click such a file to mount it.) + +Mounting a raw image file +------------------------- + +Use the new command like parameter -a to mount a far image file: + +./qnice -a + +Or use the new interactive command attach to mount it: + +Q> attach + +Directly mount a device +----------------------- + +If you have a USB stick or a SD Card that is formatted FAT32/MBR and if you +are working under macOS or Linux and the likes, then you can directly use the +raw device to mount it in the emulator. + +Example of how to do it on a Mac: + +1. Use "diskutil list" to find out the device, to which your USB stick or your + SD Card has been mounted. + Example: /dev/disk4 + +2. Add the character 'r' to the beginning of the name of the device: + Example: /dev/rdisk4 + +3. Compile the Monitor: Go to the folder 'monitor' in the QNICE-FPGA + directory tree and run + ./compile_and_distribute.sh + (You need to be within the 'monitor' folder for the script to work.) + +4. Go to the 'emulator' folder. + +5. Mount the device and load the Monitor. Depending on your OS and OS version, + you might need to call the Emulator in the root context using sudo: + Example: sudo ./qnice -a /dev/rdisk4 ../monitor/monitor.out + +6. You are in the emulated QNICE monitor now. Browse the root folder by + entering "F" then "D" + + +written by sy2002 in December 2016 diff --git a/doc/monitor/doc.pdf b/doc/monitor/doc.pdf index a0e4773b..33051fc5 100644 Binary files a/doc/monitor/doc.pdf and b/doc/monitor/doc.pdf differ diff --git a/doc/vbcc.txt b/doc/vbcc.txt new file mode 100644 index 00000000..21bab1d5 --- /dev/null +++ b/doc/vbcc.txt @@ -0,0 +1,21 @@ +VBCC is able to use QNICE's register bank feature: + +If -opt-speed is set, then VBCC evaluates -rw-threshold, which is 2 by +default. It means: As soon as more than 2 registers need to be saved, then +bank switching is performed. + +If you need to prevent this, e.g. because you have a recursive function, then +use the __norbank directive: + +__norbank void highly_recursive(int x, int y, int z) +{ + ... +} + +If you want to force it, even when the to-be-saved registers are smaller than +treshold, then use the __rbank directive: + +__rbank void always_use_bankswitching(int x) +{ + ... +} diff --git a/emulator/ide_simulation.h b/emulator/ide_simulation.h old mode 100755 new mode 100644 index 776f9f05..fae78700 --- a/emulator/ide_simulation.h +++ b/emulator/ide_simulation.h @@ -3,6 +3,7 @@ # define FALSE !TRUE #endif +#define IDE_BASE_ADDRESS 0xffe0 void writeIDEDeviceRegister(unsigned int address, unsigned int value); unsigned int readIDEDeviceRegister(unsigned int address); @@ -10,4 +11,3 @@ void initializeIDEDevice(); //For testing purposes only - will be removed at end of development void testMe(); - diff --git a/emulator/make.bash b/emulator/make.bash index 1c7bc6ec..60859900 100755 --- a/emulator/make.bash +++ b/emulator/make.bash @@ -1,2 +1,2 @@ #!/bin/bash -cc qnice.c ide_simulation.c uart.c -o qnice +cc qnice.c ide_simulation.c uart.c sd.c -o qnice diff --git a/emulator/qnice.c b/emulator/qnice.c index f4dc1638..0679ce5b 100644 --- a/emulator/qnice.c +++ b/emulator/qnice.c @@ -1,28 +1,35 @@ /* ** QNICE emulator -- this emulator was written as a proof of concept for the -** QNICE processor. In most cases Thomas' Perl based emulator will be used. :-) +** QNICE processor. ** ** B. Ulmann, 16-AUG-2006...03-SEP-2006...04-NOV-2006...29-JUN-2007... ** 16-DEC-2007...03-JUN-2008...28-DEC-2014... ** xx-AUG-2015...xx-MAY-2016... +** 28-DEC-2016, 29-DEC-2016 ** */ #define USE_UART +#define USE_SD +#undef USE_IDE #include #include #include #include -#include "ide_simulation.h" +#include +#include #ifdef USE_UART -#include "uart.h" +# include "uart.h" +#endif + +#ifdef USE_SD +# include "sd.h" +#endif -unsigned int uart_read_register(uart *, int); -void uart_write_register(uart *, unsigned int, unsigned int); -void uart_hardware_initialization(uart *); -void uart_run_down(); +#ifdef USE_IDE +# include "ide_simulation.h" #endif /* @@ -45,8 +52,6 @@ void uart_run_down(); /* The top most 245 words of memory are reserverd for memory mapped IO devices */ #define IO_AREA_START 0xff00 #define SWITCH_REG 0xff12 -#define UART0_BASE_ADDRESS 0xff20 -#define IDE_BASE_ADDRESS 0xffe0 #define CYC_LO 0xff17 /* Cycle counter low, middle, high word and state register */ #define CYC_MID 0xff18 @@ -254,13 +259,9 @@ unsigned int access_memory(unsigned int address, unsigned int operation, unsigne { value = 0; if ((gbl$debug)) - printf("\tread_memory: IO-area access at 0x%04X: 0x%04X\n\r", address, value); + printf("\tread_memory: IO-area read access at 0x%04X\n\r", address); - if (address >= UART0_BASE_ADDRESS && address < UART0_BASE_ADDRESS + 8) /* Some UART0 operation */ - value = uart_read_register(&gbl$first_uart, address - UART0_BASE_ADDRESS); - else if (address >= IDE_BASE_ADDRESS && address < IDE_BASE_ADDRESS + 16) /* Some IDE operation */ - value = readIDEDeviceRegister(address - IDE_BASE_ADDRESS); - else if (address == SWITCH_REG) /* Read the switch register */ + if (address == SWITCH_REG) /* Read the switch register */ value = gbl$memory[SWITCH_REG]; else if (address == CYC_LO) /* Read low word of the cycle (instruction) counter. */ value = gbl$cycle_counter; @@ -280,6 +281,18 @@ unsigned int access_memory(unsigned int address, unsigned int operation, unsigne value = gbl$eae_result_hi; else if (address == EAE_CSR) value = gbl$eae_csr; +#ifdef USE_SD + else if (address >= SD_BASE_ADDRESS && address < SD_BASE_ADDRESS + 6) /* SD-card ccess */ + value = sd_read_register(address - SD_BASE_ADDRESS); +#endif +#ifdef USE_UART + else if (address >= UART0_BASE_ADDRESS && address < UART0_BASE_ADDRESS + 8) /* Some UART0 operation */ + value = uart_read_register(&gbl$first_uart, address - UART0_BASE_ADDRESS); +#endif +#ifdef USE_IDE + else if (address >= IDE_BASE_ADDRESS && address < IDE_BASE_ADDRESS + 16) /* Some IDE operation */ + value = readIDEDeviceRegister(address - IDE_BASE_ADDRESS); +#endif } } else if (operation == WRITE_MEMORY) @@ -291,15 +304,7 @@ unsigned int access_memory(unsigned int address, unsigned int operation, unsigne if ((gbl$debug)) printf("\twrite_memory: IO-area access at 0x%04X: 0x%04X\n\r", address, value); - if (address >= UART0_BASE_ADDRESS && address < UART0_BASE_ADDRESS + 8) /* Some UART0 operation */ - { - if ((gbl$debug)) - printf("\twrite uart register: %04X, %02X\n\t", address, value & 0xff); - uart_write_register(&gbl$first_uart, address - UART0_BASE_ADDRESS, value & 0xff); - } - else if (address >= IDE_BASE_ADDRESS && address < IDE_BASE_ADDRESS + 16) /* Some IDE operation */ - writeIDEDeviceRegister(address - IDE_BASE_ADDRESS, value); - else if (address == SWITCH_REG) /* Read the switch register */ + if (address == SWITCH_REG) /* Read the switch register */ gbl$memory[SWITCH_REG] = value; else if (address == CYC_STATE) { @@ -345,6 +350,22 @@ unsigned int access_memory(unsigned int address, unsigned int operation, unsigne gbl$eae_csr &= 0x7fff; /* Clear the busy bit just in case... */ } +#ifdef USE_UART + if (address >= UART0_BASE_ADDRESS && address < UART0_BASE_ADDRESS + 8) /* Some UART0 operation */ + { + if ((gbl$debug)) + printf("\twrite uart register: %04X, %02X\n\t", address, value & 0xff); + uart_write_register(&gbl$first_uart, address - UART0_BASE_ADDRESS, value & 0xff); + } +#endif +#ifdef USE_IDE + if (address >= IDE_BASE_ADDRESS && address < IDE_BASE_ADDRESS + 16) /* Some IDE operation */ + writeIDEDeviceRegister(address - IDE_BASE_ADDRESS, value); +#endif +#ifdef USE_SD + if (address >= SD_BASE_ADDRESS && address < SD_BASE_ADDRESS + 6) /* SD-card ccess */ + sd_write_register(address - SD_BASE_ADDRESS, value); +#endif } } else @@ -768,7 +789,6 @@ int execute() // NO, we must not since the PC has already been incremented during the fetch operation! // else if (source_mode == 0x2 && source_regaddr == 0xf) /* This is mode @R15++ */ // write_register(15, read_register(15) + 1); - break; default: printf("PANIK: Illegal instruction found: Opcode %0X at address %04X.\n", opcode, address); @@ -777,11 +797,10 @@ int execute() if (read_register(15) == gbl$breakpoint) { - printf("Breakpoint reached: %04X\n", address); + printf("Breakpoint reached: %04X\n", read_register(15)); return TRUE; } - /* write_register(15, read_register(15) + 1); */ /* Update program counter */ return FALSE; /* No HALT instruction executed */ } @@ -789,13 +808,20 @@ int execute() void run() { gbl$ctrl_c = FALSE; + +#ifdef USE_UART uart_hardware_initialization(&gbl$first_uart); +#endif + gbl$gather_statistics = TRUE; while (!execute() && !gbl$ctrl_c); if (gbl$ctrl_c) printf("\n\tAborted by CTRL-C!\n"); gbl$gather_statistics = FALSE; + +#ifdef USE_UART uart_run_down(); +#endif } void print_statistics() @@ -906,29 +932,50 @@ void dump_registers() int main(int argc, char **argv) { char command[STRING_LENGTH], *token, *delimiters = " ,", scratch[STRING_LENGTH]; - unsigned int start, stop, i, address, value, last_command_was_step = 0; + unsigned int start, stop, i, j, address, value, last_command_was_step = 0; + wordexp_t expanded_filename; FILE *handle; signal(SIGINT, signal_handler_ctrl_c); reset_machine(); + +#ifdef USE_IDE initializeIDEDevice(); +#endif - if (argc > 1) + if (*++argv) /* At least one argument */ { - if (!strcmp(argv[1], "-h")) + if (!strcmp(*argv, "-h")) + { printf("\nUsage:\n\ - \"qnice\" without arguments will start an interactive session\n\ - \"qnice -h\" will print this help text\n\ - \"qnice \" will run in batch mode and print statistics\n\n"); - else /* Assume that the first argument is a file name */ + \"qnice\" without arguments will start an interactive session\n\ + \"qnice -h\" will print this help text\n\ + \"qnice -a \" will attach an SD-card image file\n\ + \"qnice -a \" attaches an images and runs a file\n\ + \"qnice \" will run in batch mode and print statistics\n\n"); + return 0; + } +#ifdef USE_SD + else if (!strcmp(*argv, "-a")) /* We will try to attach an SD-disk image... */ { - if (load_binary_file(argv[1])) + if (!*++argv) /* No more arguments! */ + { + printf("Expected a filename after -a but none found.\n"); + return -1; + } + + sd_attach(*argv++); + } +#endif + + if (*argv) + { + if (load_binary_file(*argv)) return -1; run(); print_statistics(); } - } for (;;) @@ -937,20 +984,28 @@ int main(int argc, char **argv) fgets(command, STRING_LENGTH, stdin); chomp(command); if (feof(stdin)) + { +#ifdef USE_SD + sd_detach(); +#endif return 0; + } if (last_command_was_step && !strlen(command)) /* If STEP was the last command and this is empty, perform the next step. */ strcpy(command, "STEP"); -// upstr(command); - last_command_was_step = 0; tokenize(command, NULL); /* Initialize tokenizing */ if ((token = tokenize(NULL, delimiters))) { upstr(token); if (!strcmp(token, "QUIT") || !strcmp(token, "EXIT")) + { +#ifdef USE_SD + sd_detach(); +#endif return 0; + } else if (!strcmp(token, "CB")) gbl$breakpoint = -1; else if (!strcmp(token, "SB")) @@ -959,12 +1014,19 @@ int main(int argc, char **argv) { start = str2int(tokenize(NULL, delimiters)); stop = str2int(tokenize(NULL, delimiters)); + *scratch = (char) 0; for (i = start; i <= stop; i++) { if (!((i - start) % 8)) /* New row */ - printf("\n%04x: ", i); + { + scratch[16] = (char) 0; + printf("\t%s\n%04x: ", scratch, i); + j = 0; + } - printf("%04x ", access_memory(i, READ_MEMORY, 0)); + printf("%04x ", value = access_memory(i, READ_MEMORY, 0)); + scratch[j++] = isprint((value & 0xff00) > 8) ? (char) (value & 0xff00) > 8 : ' '; + scratch[j++] = isprint(value & 0xff) ? (char) value & 0xff : ' '; } printf("\n"); } @@ -974,7 +1036,8 @@ int main(int argc, char **argv) printf("SAVE expects at least a filename as its 1st parameter!\n"); else { - if (!(handle = fopen(token, "w"))) + wordexp(token, &expanded_filename, 0); + if (!(handle = fopen(expanded_filename.we_wordv[0], "w"))) printf("Unable to create file >>%s<<\n", token); else { @@ -992,8 +1055,25 @@ int main(int argc, char **argv) if (!(token = tokenize(NULL, delimiters))) printf("LOAD expects a filename as its 1st parameter!\n"); else - load_binary_file(token); + { + wordexp(token, &expanded_filename, 0); + load_binary_file(expanded_filename.we_wordv[0]); + } } +#ifdef USE_SD + else if (!strcmp(token, "ATTACH")) /* Attach a disk image to the SD-simulation */ + { + if (!(token = tokenize(NULL, delimiters))) + printf("ATTACH expects a filename as its 1st parameter!\n"); + else + { + wordexp(token, &expanded_filename, 0); + sd_attach(expanded_filename.we_wordv[0]); + } + } + else if (!strcmp(token, "DETACH")) + sd_detach(); +#endif else if (!strcmp(token, "RDUMP")) dump_registers(); else if (!strcmp(token, "SET")) @@ -1048,8 +1128,10 @@ int main(int argc, char **argv) } else if (!strcmp(token, "HELP")) printf("\n\ +ATTACH Attach a disk image file (only with SD-support)\n\ CB Clear Breakpoint\n\ DEBUG Toggle debug mode (for development only)\n\ +DETACH Detach a disk image file\n\ DIS , Disassemble a memory region\n\ DUMP , Dump a memory area, START and STOP can be\n\ hexadecimal or plain decimal\n\ diff --git a/emulator/sd.c b/emulator/sd.c new file mode 100644 index 00000000..ce05117d --- /dev/null +++ b/emulator/sd.c @@ -0,0 +1,143 @@ +/* +** SD-card emulator. +** +** 28-DEC-2016, B. Ulmann fecit +*/ + +#include "sd.h" +#include +#include +#include + +#undef DEBUG +#define VERBOSE + +FILE *image = (FILE *) 0; + +unsigned static int sd_addr_lo = 0, sd_addr_hi = 0, sd_data_pos = 0, sd_error = 0, sd_csr = 0; + +unsigned char sd_data[SD_SECTOR_SIZE]; + +#ifdef DEBUG +void dump_sd_buffer() +{ + int i; + + for (i = 0; i < SD_SECTOR_SIZE; i++) + { + if (!(i % 16)) printf("\n"); + printf("%02x ", sd_data[i]); + } + printf("\n"); +} +#endif + +void sd_attach(char *filename) +{ +#ifdef DEBUG + printf("sd_init: Open >>%s<<\n", filename); +#endif + + if (image) /* If there is already an image attached, detach it first. */ + sd_detach(); + + if (!(image = fopen(filename, "rb"))) + { + printf("Unable to attach SD-card image file >>%s< %04X\n", address & 0xffff, value & 0xffff); +#endif + + return value & 0xffff; +} diff --git a/emulator/sd.h b/emulator/sd.h new file mode 100644 index 00000000..29aa31c7 --- /dev/null +++ b/emulator/sd.h @@ -0,0 +1,21 @@ +/* +** Header file for the SD-card emulation. +** +** 28-DEC-2016, B. Ulmann fecit +*/ + +#define SD_BASE_ADDRESS 0xff24 + +#define SD_ADDR_LO 0 +#define SD_ADDR_HI 1 +#define SD_DATA_POS 2 +#define SD_DATA 3 +#define SD_ERROR 4 +#define SD_CSR 5 + +#define SD_SECTOR_SIZE 512 + +void sd_attach(char *); +void sd_detach(); +unsigned int sd_read_register(unsigned int); +void sd_write_register(unsigned int, unsigned int); diff --git a/emulator/uart.c b/emulator/uart.c index 26a4dd1a..a6b729e7 100644 --- a/emulator/uart.c +++ b/emulator/uart.c @@ -9,7 +9,6 @@ #undef TEST /* Define to perform stand alone test */ #define VERBOSE -#define DEBUG #include "uart.h" #include diff --git a/emulator/uart.h b/emulator/uart.h index bc64ec22..d59ced9b 100644 --- a/emulator/uart.h +++ b/emulator/uart.h @@ -2,8 +2,11 @@ ** This is the header file for the generic UART-emulation for the QNICE-emulator. ** ** 02-JUN-2008, B. Ulmann fecit +** 28-DEC-2016, B. Ulmann Cleanup... */ +#define UART0_BASE_ADDRESS 0xff20 + /* This structure contains all register data of the emulated UART */ typedef struct uart { @@ -46,3 +49,8 @@ typedef struct uart #define OPCR 13 #define SET_OUTPUT_PORT 14 #define RESET_OUTPUT_PORT 15 + +unsigned int uart_read_register(uart *, unsigned int); +void uart_write_register(uart *, unsigned int, unsigned int); +void uart_hardware_initialization(uart *); +void uart_run_down(); diff --git a/monitor/create_documentation.pl b/monitor/create_documentation.pl index 870f9501..0c735026 100644 --- a/monitor/create_documentation.pl +++ b/monitor/create_documentation.pl @@ -32,6 +32,9 @@ close $handle; } + $data =~ s/&/\\&/g; + $data =~ s/#/\\#/g; + while ($data =~ /;\*\*\**(.+?);\*\*\**/smg) { my $text = $1; diff --git a/monitor/fat32_library.asm b/monitor/fat32_library.asm index d6e0592e..395e5f47 100644 --- a/monitor/fat32_library.asm +++ b/monitor/fat32_library.asm @@ -77,10 +77,10 @@ FAT32$PRINT_DE_TIME .ASCII_W ":" ;* Wrapper to simplify the use of the generic FAT32$MOUNT function. Read the ;* documentation of FAT32$MOUNT to learn more. ;* -;* INPUT: R8 points to a 17 word large empty structure. This structure will +;* INPUT: R8 points to a 18 word large empty structure. This structure will ;* be filled by the mount function and it therefore becomes the device ;* handle that you need for subsequent FAT32 function calls. For being -;* on the safe side: Instead of hardcoding "17", use the constant +;* on the safe side: Instead of hardcoding "18", use the constant ;* FAT32$DEV_STRUCT_SIZE instead. ;* R9 partition number to mount (1 .. 4) ;* OUTPUT: R8 points to the handle (identical to the input value of R8) @@ -124,8 +124,9 @@ FAT32$MOUNT_SD INCRB ;* a 512-byte-sized sector using LBA mode. Read and write a byte from within ;* a buffer that contains the current sector. Reset the device. The function ;* signatures and behaviour needs to be equivalent to the SD card functions -;* that are part of this library. You need to pass pointers to these functions -;* to the mount function call in the mount initialization structure. +;* that are part of the library sd_library.asm. You need to pass pointers to +;* these functions to the mount function call in the mount initialization +;* structure. ;* ;* All subsequent calls to FAT32 functions expect as the first parameter a ;* pointer to the mount data structure (aka device handle) that is being @@ -134,7 +135,7 @@ FAT32$MOUNT_SD INCRB ;* type of hardware. ;* ;* INPUT: R8: pointer to the mount initialization structure that is build up -;* in the following form. Important: The structure is 17 words large, that +;* in the following form. Important: The structure is 18 words large, that ;* means that a call to FAT32$MOUNT will append more words to the structure ;* than the ones, that have to be pre-filled before calling FAT32$MOUNT: ;* word #0: pointer to a device reset function, similar to SD$RESET @@ -143,11 +144,11 @@ FAT32$MOUNT_SD INCRB ;* word #3: pointer to a byte read function, similar to SD$READ_BYTE ;* word #4: pointer to a byte write function, similar to SD$WRITE_BYTE ;* word #5: number of the partition to be mounted (0x0001 .. 0x0004) -;* word #6 .. word #17 : will be filled by by FAT32$MOUNT, their layout is +;* word #6 .. word #18 : will be filled by by FAT32$MOUNT, their layout is ;* as described in the FAT32$DEV_* constants beginning ;* from index #7 on. ;* -;* For being on the safe side: Instead of hardcoding "17" as the size of the +;* For being on the safe side: Instead of hardcoding "18" as the size of the ;* whole mount data structure (device handle) use the constant ;* FAT32$DEV_STRUCT_SIZE instead. ;* @@ -1617,7 +1618,12 @@ _F32_DF_SUCCESS MOVE 0, R9 ; operation was successful ; ..the length information, .. ; ..so we need to predecr. .. ; ..and then increase the .. - ; ..pointer to the next segm. + ; ..pointer to the next segm. + ; it now points to the '0' of + ; the current string + ADD 1, R4 ; now it points to the next .. + ; .. segment, i.e. to the .. + ; length information RBRA _F32_DF_NXSG, 1 ; process next path segment ; restore SP diff --git a/monitor/qmon.asm b/monitor/qmon.asm index 29f45b03..063845a5 100644 --- a/monitor/qmon.asm +++ b/monitor/qmon.asm @@ -596,11 +596,11 @@ QMON$LOAD_E1C SUB IO$HEX_NIBBLES, R10 ; get numeric representation of ;* Strings ;*************************************************************************************** -QMON$WELCOME .ASCII_P "\n\nSimple QNICE-monitor - Version 0.7 (Bernd Ulmann, December 2016)\n" +QMON$WELCOME .ASCII_P "\n\nSimple QNICE-monitor - Version 0.7 (Bernd Ulmann, sy2002, December 2016)\n" #ifdef RAM_MONITOR .ASCII_P "Running in RAM!\n" #endif - .ASCII_W "----------------------------------------------------------------\n\n" + .ASCII_W "------------------------------------------------------------------------\n\n" QMON$PROMPT .ASCII_W "QMON> " QMON$ILLCMDGRP .ASCII_W " *** Illegal command group ***\n" QMON$ILLCMD .ASCII_W " *** Illegal command ***\n" @@ -612,7 +612,7 @@ QMON$HELP .ASCII_P "ELP:\n\n" .ASCII_P " C(hange) D(ump) E(xamine) F(ill) L(oad) M(ove)\n" .ASCII_P " di(S)assemble\n" .ASCII_P " F(ile group):\n" - .ASCII_P " List (D)irectory C(hange directory) L(oad) R(run)\n" + .ASCII_P " List (D)irectory C(hange directory) L(oad) R(un)\n" .ASCII_P "\n General: CTRL-E performs a warm start whenever an\n" .ASCII_P " input from keyboard is expected.\n" .ASCII_P "\n M(emory)L(oad) can be used to load assembler output\n" diff --git a/monitor/sysdef.asm b/monitor/sysdef.asm index 87bde2cf..1e2836d2 100644 --- a/monitor/sysdef.asm +++ b/monitor/sysdef.asm @@ -377,7 +377,11 @@ IO$SD_CSR .EQU 0xFF29 ; Command and Status Register (write to execute comm ; SD-Opcodes (CSR): 0x0000 Reset SD card ; 0x0001 Read 512 bytes from the linear block address ; 0x0002 Write 512 bytes to the linear block address -; Bits 0..2 are write-only (reading always returns 0) +; Bits 0 .. 2 are write-only (reading always returns 0) +; Bits 13 .. 12 return the card type: 00 = no card / unknown card +; 01 = SD V1 +; 10 = SD V2 +; 11 = SDHC ; Bit 14 of the CSR is the error bit: 1, if the last operation failed. In such ; a case, the error code is in IO$SD_ERROR and ; you need to reset the controller to go on diff --git a/pore/boot_message.asm b/pore/boot_message.asm index 6b73b2b4..54a14bad 100644 --- a/pore/boot_message.asm +++ b/pore/boot_message.asm @@ -4,4 +4,4 @@ PORE$NEWLINE .ASCII_W "\n\n" ; PORE$RESETMSG .ASCII_W "QNICE-FPGA V1.38f [BETA/WIP] by sy2002 in December 2016 (GIT #" -PORE$RESETMSG .ASCII_W "QNICE-FPGA Version 1.4 by sy2002 in December 2016 (GIT COMMIT #85c85a3)\n" +PORE$RESETMSG .ASCII_W "QNICE-FPGA Version 1.41 by sy2002 in December 2016 (GIT COMMIT #ef4d4ce)\n" diff --git a/pore/boot_message.txt b/pore/boot_message.txt index b7b838fa..fec0a43c 100644 --- a/pore/boot_message.txt +++ b/pore/boot_message.txt @@ -4,4 +4,4 @@ PORE$NEWLINE .ASCII_W "\n\n" ; PORE$RESETMSG .ASCII_W "QNICE-FPGA V1.38f [BETA/WIP] by sy2002 in December 2016 (GIT #" -PORE$RESETMSG .ASCII_W "QNICE-FPGA Version 1.4 by sy2002 in December 2016 (GIT COMMIT # \ No newline at end of file +PORE$RESETMSG .ASCII_W "QNICE-FPGA Version 1.41 by sy2002 in December 2016 (GIT COMMIT # \ No newline at end of file diff --git a/qbin/sdcard.out b/qbin/sdcard.out index a4f1763b..9175f26a 100644 --- a/qbin/sdcard.out +++ b/qbin/sdcard.out @@ -235,7 +235,7 @@ 0x80EA 0xFF90 0x80EB 0x0008 0x80EC 0x0FA0 -0x80ED 0x948D +0x80ED 0x948F 0x80EE 0xFF90 0x80EF 0x0006 0x80F0 0xFF90 @@ -243,7 +243,7 @@ 0x80F2 0x0FA4 0x80F3 0x0020 0x80F4 0xFFB0 -0x80F5 0x131C +0x80F5 0x131E 0x80F6 0x0900 0x80F7 0x0D04 0x80F8 0xC83E @@ -282,7 +282,7 @@ 0x8119 0x0FA0 0x811A 0x844A 0x811B 0x0FA4 -0x811C 0x948D +0x811C 0x948F 0x811D 0x1FA4 0x811E 0x0003 0x811F 0x091C @@ -333,7 +333,7 @@ 0x814C 0xFFB0 0x814D 0x006E 0x814E 0x0FA0 -0x814F 0x948D +0x814F 0x948F 0x8150 0x1FA0 0x8151 0x0004 0x8152 0xB924 @@ -408,7 +408,7 @@ 0x8197 0xFFB0 0x8198 0x0023 0x8199 0x0FA0 -0x819A 0x948D +0x819A 0x948F 0x819B 0x1FA0 0x819C 0x0007 0x819D 0x0FA4 @@ -443,7 +443,7 @@ 0x81BA 0xFFA0 0x81BB 0xFF2C 0x81BC 0x0F98 -0x81BD 0x948D +0x81BD 0x948F 0x81BE 0x1518 0x81BF 0xCF99 0x81C0 0x0020 @@ -899,7 +899,7 @@ 0x8382 0x000B 0x8383 0x0D28 0x8384 0xFFB0 -0x8385 0x10D9 +0x8385 0x10DB 0x8386 0x0B20 0x8387 0xFF90 0x8388 0x0008 @@ -3056,7 +3056,7 @@ 0x8BEF 0x0FA4 0x8BF0 0x01FE 0x8BF1 0xFFB0 -0x8BF2 0x0759 +0x8BF2 0x075B 0x8BF3 0xCFA8 0x8BF4 0xAA55 0x8BF5 0xFFA3 @@ -3117,7 +3117,7 @@ 0x8C2C 0x1FA4 0x8C2D 0x0008 0x8C2E 0xFFB0 -0x8C2F 0x072F +0x8C2F 0x0731 0x8C30 0x0004 0x8C31 0x1F84 0x8C32 0x0006 @@ -3144,7 +3144,7 @@ 0x8C47 0x0FA4 0x8C48 0x0000 0x8C49 0xFFB0 -0x8C4A 0x06EF +0x8C4A 0x06F1 0x8C4B 0xCFA8 0x8C4C 0x00E9 0x8C4D 0xFFA3 @@ -3156,7 +3156,7 @@ 0x8C53 0x0FA4 0x8C54 0x0002 0x8C55 0xFFB0 -0x8C56 0x06E3 +0x8C56 0x06E5 0x8C57 0xCFA8 0x8C58 0x0090 0x8C59 0xFFAB @@ -3164,7 +3164,7 @@ 0x8C5B 0x0FA4 0x8C5C 0x0016 0x8C5D 0xFFB0 -0x8C5E 0x06ED +0x8C5E 0x06EF 0x8C5F 0xCFA8 0x8C60 0x0000 0x8C61 0xFFA3 @@ -3174,7 +3174,7 @@ 0x8C65 0x0FA4 0x8C66 0x01FE 0x8C67 0xFFB0 -0x8C68 0x06E3 +0x8C68 0x06E5 0x8C69 0xCFA8 0x8C6A 0xAA55 0x8C6B 0xFFAB @@ -3182,7 +3182,7 @@ 0x8C6D 0x0FA4 0x8C6E 0x000B 0x8C6F 0xFFB0 -0x8C70 0x06DB +0x8C70 0x06DD 0x8C71 0xCFA8 0x8C72 0x0200 0x8C73 0xFFAB @@ -3190,7 +3190,7 @@ 0x8C75 0x0FA4 0x8C76 0x0010 0x8C77 0xFFB0 -0x8C78 0x06C1 +0x8C78 0x06C3 0x8C79 0xCFA8 0x8C7A 0x0002 0x8C7B 0xFFAB @@ -3205,24 +3205,24 @@ 0x8C84 0x0FA4 0x8C85 0x0024 0x8C86 0xFFB0 -0x8C87 0x06D7 +0x8C87 0x06D9 0x8C88 0x0A04 0x8C89 0x0B08 0x8C8A 0x0FA4 0x8C8B 0x002C 0x8C8C 0xFFB0 -0x8C8D 0x06D1 +0x8C8D 0x06D3 0x8C8E 0x0A0C 0x8C8F 0x0B10 0x8C90 0x0FA4 0x8C91 0x000D 0x8C92 0xFFB0 -0x8C93 0x06A6 +0x8C93 0x06A8 0x8C94 0x0A14 0x8C95 0x0FA4 0x8C96 0x000E 0x8C97 0xFFB0 -0x8C98 0x06B3 +0x8C98 0x06B5 0x8C99 0x0A18 0x8C9A 0x0020 0x8C9B 0x1FA0 @@ -3256,7 +3256,7 @@ 0x8CB7 0x0128 0x8CB8 0x022C 0x8CB9 0xFFB0 -0x8CBA 0x06B4 +0x8CBA 0x06B6 0x8CBB 0xCFA8 0x8CBC 0x0000 0x8CBD 0xFFAB @@ -3362,7 +3362,7 @@ 0x8D21 0x0FAC 0x8D22 0x0000 0x8D23 0xFFB0 -0x8D24 0x059B +0x8D24 0x059D 0x8D25 0x0020 0x8D26 0x3FB8 0x8D27 0x0100 @@ -3382,7 +3382,7 @@ 0x8D35 0x0804 0x8D36 0x0908 0x8D37 0xFFB0 -0x8D38 0x04C0 +0x8D38 0x04C2 0x8D39 0xC93E 0x8D3A 0x0000 0x8D3B 0xFFA3 @@ -3399,7 +3399,7 @@ 0x8D46 0x0350 0x8D47 0x0424 0x8D48 0xFFB0 -0x8D49 0x05F0 +0x8D49 0x05F2 0x8D4A 0xCA3E 0x8D4B 0x0000 0x8D4C 0xFFAB @@ -3434,7 +3434,7 @@ 0x8D69 0x1FA4 0x8D6A 0x000B 0x8D6B 0xFFB0 -0x8D6C 0x05CD +0x8D6C 0x05CF 0x8D6D 0x0230 0x8D6E 0x1FB0 0x8D6F 0x0101 @@ -3459,7 +3459,7 @@ 0x8D82 0x0020 0x8D83 0x0424 0x8D84 0xFFB0 -0x8D85 0x05B4 +0x8D85 0x05B6 0x8D86 0x9C28 0x8D87 0xCA18 0x8D88 0xFFA3 @@ -3469,7 +3469,7 @@ 0x8D8C 0x1FA4 0x8D8D 0x000D 0x8D8E 0xFFB0 -0x8D8F 0x05AA +0x8D8F 0x05AC 0x8D90 0xC61C 0x8D91 0xFFAB 0x8D92 0x0001 @@ -3492,7 +3492,7 @@ 0x8DA3 0x1FA4 0x8DA4 0x0001 0x8DA5 0xFFB0 -0x8DA6 0x0593 +0x8DA6 0x0595 0x8DA7 0x1FA4 0x8DA8 0x0002 0x8DA9 0x3FB8 @@ -3510,7 +3510,7 @@ 0x8DB5 0x1FA4 0x8DB6 0x000E 0x8DB7 0xFFB0 -0x8DB8 0x0581 +0x8DB8 0x0583 0x8DB9 0x1FA4 0x8DBA 0x0002 0x8DBB 0x3FB8 @@ -3528,7 +3528,7 @@ 0x8DC7 0x1FA4 0x8DC8 0x001C 0x8DC9 0xFFB0 -0x8DCA 0x056F +0x8DCA 0x0571 0x8DCB 0x1FA4 0x8DCC 0x0002 0x8DCD 0x3FB8 @@ -3551,7 +3551,7 @@ 0x8DDE 0x040D 0x8DDF 0x0120 0x8DE0 0xFFB0 -0x8DE1 0x0417 +0x8DE1 0x0419 0x8DE2 0x0350 0x8DE3 0xCFA4 0x8DE4 0x0000 @@ -3598,7 +3598,7 @@ 0x8E0D 0x0020 0x8E0E 0x0424 0x8E0F 0xFFB0 -0x8E10 0x0529 +0x8E10 0x052B 0x8E11 0x0A1A 0x8E12 0x1FA4 0x8E13 0x0001 @@ -3608,7 +3608,7 @@ 0x8E17 0xFFF7 0x8E18 0x0D20 0x8E19 0xFFB0 -0x8E1A 0x0509 +0x8E1A 0x050B 0x8E1B 0x1FB4 0x8E1C 0x000B 0x8E1D 0xC82C @@ -3619,7 +3619,7 @@ 0x8E22 0x1FA4 0x8E23 0x000B 0x8E24 0xFFB0 -0x8E25 0x0514 +0x8E25 0x0516 0x8E26 0x0230 0x8E27 0x1FB0 0x8E28 0x0101 @@ -3649,7 +3649,7 @@ 0x8E40 0x1FA4 0x8E41 0x000C 0x8E42 0xFFB0 -0x8E43 0x04F6 +0x8E43 0x04F8 0x8E44 0x3FB8 0x8E45 0x0100 0x8E46 0x0F8C @@ -3668,7 +3668,7 @@ 0x8E53 0x0830 0x8E54 0x0560 0x8E55 0xFFB0 -0x8E56 0x05AC +0x8E56 0x05AE 0x8E57 0x0815 0x8E58 0x0C20 0x8E59 0x3FB8 @@ -3690,7 +3690,7 @@ 0x8E69 0x1FA4 0x8E6A 0x0001 0x8E6B 0xFFB0 -0x8E6C 0x04CD +0x8E6C 0x04CF 0x8E6D 0xC63E 0x8E6E 0x0008 0x8E6F 0xFFA4 @@ -3707,7 +3707,7 @@ 0x8E7A 0x0830 0x8E7B 0x0A20 0x8E7C 0xFFB0 -0x8E7D 0x0585 +0x8E7D 0x0587 0x8E7E 0x0828 0x8E7F 0x0C20 0x8E80 0xFFA0 @@ -3724,7 +3724,7 @@ 0x8E8B 0x0830 0x8E8C 0x0A20 0x8E8D 0xFFB0 -0x8E8E 0x0574 +0x8E8E 0x0576 0x8E8F 0x0828 0x8E90 0x0C20 0x8E91 0xCA3E @@ -3759,7 +3759,7 @@ 0x8EAE 0x1FA4 0x8EAF 0x001C 0x8EB0 0xFFB0 -0x8EB1 0x04AD +0x8EB1 0x04AF 0x8EB2 0x0220 0x8EB3 0x1FA0 0x8EB4 0x0102 @@ -3773,7 +3773,7 @@ 0x8EBC 0x1FA4 0x8EBD 0x0018 0x8EBE 0xFFB0 -0x8EBF 0x048C +0x8EBF 0x048E 0x8EC0 0x0220 0x8EC1 0x1FA0 0x8EC2 0x0104 @@ -3804,7 +3804,7 @@ 0x8EDB 0x1FA4 0x8EDC 0x0016 0x8EDD 0xFFB0 -0x8EDE 0x046D +0x8EDE 0x046F 0x8EDF 0x0220 0x8EE0 0x1FA0 0x8EE1 0x0107 @@ -3835,7 +3835,7 @@ 0x8EFA 0x1FA4 0x8EFB 0x0014 0x8EFC 0xFFB0 -0x8EFD 0x044E +0x8EFD 0x0450 0x8EFE 0x0220 0x8EFF 0x1FA0 0x8F00 0x010B @@ -3845,7 +3845,7 @@ 0x8F04 0x1FA4 0x8F05 0x001A 0x8F06 0xFFB0 -0x8F07 0x0444 +0x8F07 0x0446 0x8F08 0x0220 0x8F09 0x1FA0 0x8F0A 0x010A @@ -3897,7 +3897,7 @@ 0x8F38 0xFFA0 0x8F39 0x0007 0x8F3A 0xFFB0 -0x8F3B 0x0384 +0x8F3B 0x0386 0x8F3C 0x0928 0x8F3D 0x0824 0x8F3E 0x1FA4 @@ -3933,7 +3933,7 @@ 0x8F5C 0xFFA0 0x8F5D 0x0022 0x8F5E 0xFFB0 -0x8F5F 0x0299 +0x8F5F 0x029B 0x8F60 0x0928 0x8F61 0xFFAB 0x8F62 0x001D @@ -3946,7 +3946,7 @@ 0x8F69 0x0004 0x8F6A 0x0964 0x8F6B 0xFFB0 -0x8F6C 0x03CD +0x8F6C 0x03CF 0x8F6D 0x0720 0x8F6E 0x0A24 0x8F6F 0x0FA8 @@ -4009,7 +4009,7 @@ 0x8FA8 0x0200 0x8FA9 0xBB2C 0x8FAA 0xFFB0 -0x8FAB 0x03FE +0x8FAB 0x0400 0x8FAC 0x0810 0x8FAD 0x0914 0x8FAE 0xC43E @@ -4033,7 +4033,7 @@ 0x8FC0 0x0200 0x8FC1 0x0020 0x8FC2 0xFFB0 -0x8FC3 0x0235 +0x8FC3 0x0237 0x8FC4 0xCFA4 0x8FC5 0x0000 0x8FC6 0xFFA3 @@ -4291,7 +4291,7 @@ 0x90C2 0x000B 0x90C3 0x0D28 0x90C4 0xFFB0 -0x90C5 0x0399 +0x90C5 0x039B 0x90C6 0xC73E 0x90C7 0x0000 0x90C8 0xFFAB @@ -4351,16 +4351,16 @@ 0x90FE 0x1F84 0x90FF 0x0001 0x9100 0xFFB0 -0x9101 0x00E8 +0x9101 0x00EA 0x9102 0x0120 0x9103 0x0A24 0x9104 0xFFB0 -0x9105 0x030C +0x9105 0x030E 0x9106 0x0908 0x9107 0xC83E 0x9108 0x0000 0x9109 0xFFA3 -0x910A 0x00C5 +0x910A 0x00C7 0x910B 0x080C 0x910C 0x0D10 0x910D 0x3FB4 @@ -4378,7 +4378,7 @@ 0x9119 0xC93E 0x911A 0x0000 0x911B 0xFFAB -0x911C 0x00AF +0x911C 0x00B1 0x911D 0x0520 0x911E 0x0624 0x911F 0x0FA8 @@ -4391,7 +4391,7 @@ 0x9126 0x0003 0x9127 0x0B24 0x9128 0xFFA0 -0x9129 0x00A2 +0x9129 0x00A4 0x912A 0xCA3E 0x912B 0x0000 0x912C 0xFFAB @@ -4403,11 +4403,11 @@ 0x9132 0x0FA4 0x9133 0xEE20 0x9134 0xFFA0 -0x9135 0x0096 +0x9135 0x0098 0x9136 0x0FA4 0x9137 0xEE19 0x9138 0xFFA0 -0x9139 0x0092 +0x9139 0x0094 0x913A 0x061C 0x913B 0x1F9C 0x913C 0x0101 @@ -4543,720 +4543,722 @@ 0x91BE 0x0004 0x91BF 0x0624 0x91C0 0xFFB0 -0x91C1 0x0028 +0x91C1 0x002A 0x91C2 0x0918 0x91C3 0x0FA4 0x91C4 0x0000 0x91C5 0x3F8C 0x91C6 0x0001 0x91C7 0xFFA3 -0x91C8 0x0003 +0x91C8 0x0005 0x91C9 0x14D0 -0x91CA 0xFFA0 -0x91CB 0xFF47 -0x91CC 0x1FB4 -0x91CD 0x0009 +0x91CA 0x1F90 +0x91CB 0x0001 +0x91CC 0xFFA0 +0x91CD 0xFF45 0x91CE 0x1FB4 -0x91CF 0x010C -0x91D0 0x1234 -0x91D1 0x0020 -0x91D2 0x3FB8 -0x91D3 0x0100 -0x91D4 0xCC3E -0x91D5 0x0000 -0x91D6 0xFFAB -0x91D7 0x0004 -0x91D8 0xC93E -0x91D9 0x0000 -0x91DA 0xFFA3 -0x91DB 0x000B -0x91DC 0x081C -0x91DD 0x1F9C -0x91DE 0x000F -0x91DF 0x031D -0x91E0 0x081C -0x91E1 0x1F9C -0x91E2 0x0010 -0x91E3 0x041D -0x91E4 0x0028 -0x91E5 0x012C -0x91E6 0x0230 -0x91E7 0x3FB8 -0x91E8 0x0100 -0x91E9 0x0DBC -0x91EA 0x0018 -0x91EB 0x1F98 -0x91EC 0x000D -0x91ED 0x001C -0x91EE 0x1F9C -0x91EF 0x000F -0x91F0 0x065D -0x91F1 0x0018 -0x91F2 0x1F98 -0x91F3 0x000E -0x91F4 0x001C -0x91F5 0x1F9C -0x91F6 0x0010 -0x91F7 0x065D -0x91F8 0x0DBC -0x91F9 0x1FB8 -0x91FA 0x0100 -0x91FB 0x0800 -0x91FC 0x0A04 -0x91FD 0x0B08 -0x91FE 0x0C0C -0x91FF 0x1FB8 -0x9200 0x0100 -0x9201 0x0800 -0x9202 0x1F80 -0x9203 0x0000 -0x9204 0x0040 -0x9205 0x0804 -0x9206 0xB30C -0x9207 0x0108 -0x9208 0x1F88 -0x9209 0x0001 -0x920A 0xC24C -0x920B 0xFFAB -0x920C 0x000A -0x920D 0x0108 -0x920E 0x1F88 -0x920F 0x0002 -0x9210 0xC24C -0x9211 0xFFAB -0x9212 0x0004 -0x9213 0x0FA4 -0x9214 0xEE17 -0x9215 0xFFA0 -0x9216 0x00A0 -0x9217 0x0008 -0x9218 0x1F88 -0x9219 0x0011 -0x921A 0xC109 -0x921B 0xFFA3 -0x921C 0x0017 -0x921D 0x0108 -0x921E 0x1F88 -0x921F 0x0001 -0x9220 0x0264 -0x9221 0x0108 -0x9222 0x1F88 -0x9223 0x0002 -0x9224 0x0268 -0x9225 0x0108 -0x9226 0x1F88 -0x9227 0x0003 -0x9228 0x026C -0x9229 0x0020 -0x922A 0xFFB0 -0x922B 0x0094 -0x922C 0x0008 -0x922D 0x1F88 -0x922E 0x0011 -0x922F 0x0109 -0x9230 0xC93E -0x9231 0x0000 -0x9232 0xFFAB -0x9233 0x0083 -0x9234 0x0108 -0x9235 0x1F88 -0x9236 0x0004 -0x9237 0x024C -0x9238 0xC33E -0x9239 0x0200 -0x923A 0xFFAB -0x923B 0x0071 -0x923C 0x0F89 -0x923D 0x0000 -0x923E 0x0F8C +0x91CF 0x0009 +0x91D0 0x1FB4 +0x91D1 0x010C +0x91D2 0x1234 +0x91D3 0x0020 +0x91D4 0x3FB8 +0x91D5 0x0100 +0x91D6 0xCC3E +0x91D7 0x0000 +0x91D8 0xFFAB +0x91D9 0x0004 +0x91DA 0xC93E +0x91DB 0x0000 +0x91DC 0xFFA3 +0x91DD 0x000B +0x91DE 0x081C +0x91DF 0x1F9C +0x91E0 0x000F +0x91E1 0x031D +0x91E2 0x081C +0x91E3 0x1F9C +0x91E4 0x0010 +0x91E5 0x041D +0x91E6 0x0028 +0x91E7 0x012C +0x91E8 0x0230 +0x91E9 0x3FB8 +0x91EA 0x0100 +0x91EB 0x0DBC +0x91EC 0x0018 +0x91ED 0x1F98 +0x91EE 0x000D +0x91EF 0x001C +0x91F0 0x1F9C +0x91F1 0x000F +0x91F2 0x065D +0x91F3 0x0018 +0x91F4 0x1F98 +0x91F5 0x000E +0x91F6 0x001C +0x91F7 0x1F9C +0x91F8 0x0010 +0x91F9 0x065D +0x91FA 0x0DBC +0x91FB 0x1FB8 +0x91FC 0x0100 +0x91FD 0x0800 +0x91FE 0x0A04 +0x91FF 0x0B08 +0x9200 0x0C0C +0x9201 0x1FB8 +0x9202 0x0100 +0x9203 0x0800 +0x9204 0x1F80 +0x9205 0x0000 +0x9206 0x0040 +0x9207 0x0804 +0x9208 0xB30C +0x9209 0x0108 +0x920A 0x1F88 +0x920B 0x0001 +0x920C 0xC24C +0x920D 0xFFAB +0x920E 0x000A +0x920F 0x0108 +0x9210 0x1F88 +0x9211 0x0002 +0x9212 0xC24C +0x9213 0xFFAB +0x9214 0x0004 +0x9215 0x0FA4 +0x9216 0xEE17 +0x9217 0xFFA0 +0x9218 0x00A0 +0x9219 0x0008 +0x921A 0x1F88 +0x921B 0x0011 +0x921C 0xC109 +0x921D 0xFFA3 +0x921E 0x0017 +0x921F 0x0108 +0x9220 0x1F88 +0x9221 0x0001 +0x9222 0x0264 +0x9223 0x0108 +0x9224 0x1F88 +0x9225 0x0002 +0x9226 0x0268 +0x9227 0x0108 +0x9228 0x1F88 +0x9229 0x0003 +0x922A 0x026C +0x922B 0x0020 +0x922C 0xFFB0 +0x922D 0x0094 +0x922E 0x0008 +0x922F 0x1F88 +0x9230 0x0011 +0x9231 0x0109 +0x9232 0xC93E +0x9233 0x0000 +0x9234 0xFFAB +0x9235 0x0083 +0x9236 0x0108 +0x9237 0x1F88 +0x9238 0x0004 +0x9239 0x024C +0x923A 0xC33E +0x923B 0x0200 +0x923C 0xFFAB +0x923D 0x0071 +0x923E 0x0F89 0x923F 0x0000 -0x9240 0x0108 -0x9241 0x1F88 -0x9242 0x0003 -0x9243 0x0250 -0x9244 0x1F90 -0x9245 0x0001 -0x9246 0x0008 -0x9247 0x1F88 -0x9248 0x000C -0x9249 0x0248 -0x924A 0x3F88 -0x924B 0x0001 -0x924C 0xC408 -0x924D 0xFFA4 -0x924E 0x0016 -0x924F 0x0108 -0x9250 0x1F88 -0x9251 0x0003 -0x9252 0x0409 -0x9253 0x0020 -0x9254 0x0108 -0x9255 0x1F88 -0x9256 0x0001 -0x9257 0x0264 -0x9258 0x0108 -0x9259 0x1F88 -0x925A 0x0002 -0x925B 0x0268 -0x925C 0x042C -0x925D 0xFFB0 -0x925E 0x0061 -0x925F 0x0028 -0x9260 0x1FA8 -0x9261 0x0011 -0x9262 0x0129 -0x9263 0xFFA0 -0x9264 0x0052 -0x9265 0x0108 -0x9266 0x1F88 -0x9267 0x0003 -0x9268 0x0F89 -0x9269 0x0000 -0x926A 0x0108 -0x926B 0x1F88 -0x926C 0x0004 -0x926D 0x0F89 -0x926E 0x0000 -0x926F 0x0124 -0x9270 0x1FA4 -0x9271 0x0002 -0x9272 0x0964 -0x9273 0x0120 -0x9274 0x1FA0 -0x9275 0x0001 -0x9276 0x0860 -0x9277 0xBB2C -0x9278 0x0FA8 -0x9279 0x0080 -0x927A 0xFFB0 -0x927B 0x012E -0x927C 0x0A30 -0x927D 0x0008 -0x927E 0x1F88 +0x9240 0x0F8C +0x9241 0x0000 +0x9242 0x0108 +0x9243 0x1F88 +0x9244 0x0003 +0x9245 0x0250 +0x9246 0x1F90 +0x9247 0x0001 +0x9248 0x0008 +0x9249 0x1F88 +0x924A 0x000C +0x924B 0x0248 +0x924C 0x3F88 +0x924D 0x0001 +0x924E 0xC408 +0x924F 0xFFA4 +0x9250 0x0016 +0x9251 0x0108 +0x9252 0x1F88 +0x9253 0x0003 +0x9254 0x0409 +0x9255 0x0020 +0x9256 0x0108 +0x9257 0x1F88 +0x9258 0x0001 +0x9259 0x0264 +0x925A 0x0108 +0x925B 0x1F88 +0x925C 0x0002 +0x925D 0x0268 +0x925E 0x042C +0x925F 0xFFB0 +0x9260 0x0061 +0x9261 0x0028 +0x9262 0x1FA8 +0x9263 0x0011 +0x9264 0x0129 +0x9265 0xFFA0 +0x9266 0x0052 +0x9267 0x0108 +0x9268 0x1F88 +0x9269 0x0003 +0x926A 0x0F89 +0x926B 0x0000 +0x926C 0x0108 +0x926D 0x1F88 +0x926E 0x0004 +0x926F 0x0F89 +0x9270 0x0000 +0x9271 0x0124 +0x9272 0x1FA4 +0x9273 0x0002 +0x9274 0x0964 +0x9275 0x0120 +0x9276 0x1FA0 +0x9277 0x0001 +0x9278 0x0860 +0x9279 0xBB2C +0x927A 0x0FA8 +0x927B 0x0080 +0x927C 0xFFB0 +0x927D 0x012E +0x927E 0x0A30 0x927F 0x0008 -0x9280 0x0248 -0x9281 0x000C -0x9282 0x1F8C -0x9283 0x0009 -0x9284 0x034C -0x9285 0x1220 -0x9286 0x2324 -0x9287 0x0028 -0x9288 0x1FA8 -0x9289 0x0011 -0x928A 0x0129 -0x928B 0x0FA8 -0x928C 0x0001 -0x928D 0x002C -0x928E 0xFFB0 -0x928F 0xFE49 -0x9290 0xC83E -0x9291 0x0000 -0x9292 0xFFA3 -0x9293 0x0003 -0x9294 0x0824 -0x9295 0xFFA0 -0x9296 0x0020 -0x9297 0x0020 -0x9298 0x0C24 -0x9299 0x5FA4 -0x929A 0x0002 -0x929B 0xFFB0 -0x929C 0x00C2 -0x929D 0x0108 -0x929E 0x1F88 -0x929F 0x0001 -0x92A0 0x0A09 -0x92A1 0x0108 -0x92A2 0x1F88 -0x92A3 0x0002 -0x92A4 0x0B09 -0x92A5 0x0020 -0x92A6 0x0A24 -0x92A7 0x0B28 -0x92A8 0xBB2C -0x92A9 0xFFB0 -0x92AA 0x0015 -0x92AB 0xFFA0 -0x92AC 0x000A -0x92AD 0xC33E -0x92AE 0x0200 -0x92AF 0xFFAC -0x92B0 0x0004 -0x92B1 0x0FA4 -0x92B2 0xEE18 -0x92B3 0xFFA0 -0x92B4 0x0002 -0x92B5 0x0FA4 -0x92B6 0x0000 -0x92B7 0x3FB8 -0x92B8 0x0100 -0x92B9 0x0020 -0x92BA 0x0128 -0x92BB 0x022C -0x92BC 0x0330 -0x92BD 0x3FB8 -0x92BE 0x0100 -0x92BF 0x0DBC -0x92C0 0x1FB8 -0x92C1 0x0100 -0x92C2 0x0A00 -0x92C3 0x0B04 -0x92C4 0x1FB8 -0x92C5 0x0100 -0x92C6 0x0800 -0x92C7 0x1F80 -0x92C8 0x000C -0x92C9 0x0040 -0x92CA 0x3F80 -0x92CB 0x0001 -0x92CC 0xCB00 -0x92CD 0xFFAC -0x92CE 0x0004 -0x92CF 0x0FA4 -0x92D0 0xEE16 -0x92D1 0xFFA0 -0x92D2 0x004A -0x92D3 0xCA3E -0x92D4 0x0000 -0x92D5 0xFFAB -0x92D6 0x0008 -0x92D7 0xC93E -0x92D8 0x0001 -0x92D9 0xFFA4 -0x92DA 0x0004 -0x92DB 0x0FA4 -0x92DC 0xEE17 -0x92DD 0xFFA0 -0x92DE 0x003E -0x92DF 0x0800 -0x92E0 0x0B04 -0x92E1 0x0920 -0x92E2 0x0A24 -0x92E3 0x3FA0 -0x92E4 0x0002 -0x92E5 0x4FA4 -0x92E6 0x0000 -0x92E7 0x0028 -0x92E8 0x1FA8 -0x92E9 0x000C -0x92EA 0x0A68 -0x92EB 0x0FAC -0x92EC 0x0000 -0x92ED 0xFFB0 -0x92EE 0x0080 -0x92EF 0x0008 -0x92F0 0x1F88 -0x92F1 0x000A -0x92F2 0x0248 -0x92F3 0x1220 -0x92F4 0x2FA4 -0x92F5 0x0000 -0x92F6 0x2FA8 +0x9280 0x1F88 +0x9281 0x0008 +0x9282 0x0248 +0x9283 0x000C +0x9284 0x1F8C +0x9285 0x0009 +0x9286 0x034C +0x9287 0x1220 +0x9288 0x2324 +0x9289 0x0028 +0x928A 0x1FA8 +0x928B 0x0011 +0x928C 0x0129 +0x928D 0x0FA8 +0x928E 0x0001 +0x928F 0x002C +0x9290 0xFFB0 +0x9291 0xFE47 +0x9292 0xC83E +0x9293 0x0000 +0x9294 0xFFA3 +0x9295 0x0003 +0x9296 0x0824 +0x9297 0xFFA0 +0x9298 0x0020 +0x9299 0x0020 +0x929A 0x0C24 +0x929B 0x5FA4 +0x929C 0x0002 +0x929D 0xFFB0 +0x929E 0x00C2 +0x929F 0x0108 +0x92A0 0x1F88 +0x92A1 0x0001 +0x92A2 0x0A09 +0x92A3 0x0108 +0x92A4 0x1F88 +0x92A5 0x0002 +0x92A6 0x0B09 +0x92A7 0x0020 +0x92A8 0x0A24 +0x92A9 0x0B28 +0x92AA 0xBB2C +0x92AB 0xFFB0 +0x92AC 0x0015 +0x92AD 0xFFA0 +0x92AE 0x000A +0x92AF 0xC33E +0x92B0 0x0200 +0x92B1 0xFFAC +0x92B2 0x0004 +0x92B3 0x0FA4 +0x92B4 0xEE18 +0x92B5 0xFFA0 +0x92B6 0x0002 +0x92B7 0x0FA4 +0x92B8 0x0000 +0x92B9 0x3FB8 +0x92BA 0x0100 +0x92BB 0x0020 +0x92BC 0x0128 +0x92BD 0x022C +0x92BE 0x0330 +0x92BF 0x3FB8 +0x92C0 0x0100 +0x92C1 0x0DBC +0x92C2 0x1FB8 +0x92C3 0x0100 +0x92C4 0x0A00 +0x92C5 0x0B04 +0x92C6 0x1FB8 +0x92C7 0x0100 +0x92C8 0x0800 +0x92C9 0x1F80 +0x92CA 0x000C +0x92CB 0x0040 +0x92CC 0x3F80 +0x92CD 0x0001 +0x92CE 0xCB00 +0x92CF 0xFFAC +0x92D0 0x0004 +0x92D1 0x0FA4 +0x92D2 0xEE16 +0x92D3 0xFFA0 +0x92D4 0x004A +0x92D5 0xCA3E +0x92D6 0x0000 +0x92D7 0xFFAB +0x92D8 0x0008 +0x92D9 0xC93E +0x92DA 0x0001 +0x92DB 0xFFA4 +0x92DC 0x0004 +0x92DD 0x0FA4 +0x92DE 0xEE17 +0x92DF 0xFFA0 +0x92E0 0x003E +0x92E1 0x0800 +0x92E2 0x0B04 +0x92E3 0x0920 +0x92E4 0x0A24 +0x92E5 0x3FA0 +0x92E6 0x0002 +0x92E7 0x4FA4 +0x92E8 0x0000 +0x92E9 0x0028 +0x92EA 0x1FA8 +0x92EB 0x000C +0x92EC 0x0A68 +0x92ED 0x0FAC +0x92EE 0x0000 +0x92EF 0xFFB0 +0x92F0 0x0080 +0x92F1 0x0008 +0x92F2 0x1F88 +0x92F3 0x000A +0x92F4 0x0248 +0x92F5 0x1220 +0x92F6 0x2FA4 0x92F7 0x0000 -0x92F8 0x2FAC +0x92F8 0x2FA8 0x92F9 0x0000 -0x92FA 0x0008 -0x92FB 0x1F88 -0x92FC 0x000B -0x92FD 0x0248 -0x92FE 0x1224 -0x92FF 0x2FA8 -0x9300 0x0000 -0x9301 0x2FAC +0x92FA 0x2FAC +0x92FB 0x0000 +0x92FC 0x0008 +0x92FD 0x1F88 +0x92FE 0x000B +0x92FF 0x0248 +0x9300 0x1224 +0x9301 0x2FA8 0x9302 0x0000 -0x9303 0x1120 -0x9304 0x2FA4 -0x9305 0x0000 -0x9306 0x2FA8 +0x9303 0x2FAC +0x9304 0x0000 +0x9305 0x1120 +0x9306 0x2FA4 0x9307 0x0000 -0x9308 0x2FAC +0x9308 0x2FA8 0x9309 0x0000 -0x930A 0xCFAC +0x930A 0x2FAC 0x930B 0x0000 -0x930C 0xFFA3 -0x930D 0x0008 -0x930E 0xCFA8 -0x930F 0x0000 -0x9310 0xFFA3 -0x9311 0x0004 -0x9312 0x0FA4 -0x9313 0xEE14 -0x9314 0xFFA0 -0x9315 0x0007 -0x9316 0x0FA8 -0x9317 0x0001 -0x9318 0x002C -0x9319 0xFFB0 -0x931A 0xFDBE -0x931B 0x0824 -0x931C 0x0020 -0x931D 0x3FB8 -0x931E 0x0100 -0x931F 0x0028 -0x9320 0x012C -0x9321 0x3FB8 -0x9322 0x0100 -0x9323 0x0DBC -0x9324 0x1FB8 -0x9325 0x0100 -0x9326 0x0F80 -0x9327 0x000B -0x9328 0xB104 -0x9329 0x6F84 -0x932A 0x0001 -0x932B 0xFFA9 -0x932C 0x0002 -0x932D 0xAF84 -0x932E 0x0080 -0x932F 0x1884 -0x9330 0x9F84 -0x9331 0x00FF -0x9332 0x3F80 -0x9333 0x0001 -0x9334 0xFFAB -0x9335 0xFFF3 -0x9336 0x0120 -0x9337 0x3FB8 -0x9338 0x0100 -0x9339 0x0DBC -0x933A 0x1FB8 -0x933B 0x0100 -0x933C 0x0800 -0x933D 0x0B04 -0x933E 0x0C08 -0x933F 0x082C -0x9340 0x0920 -0x9341 0x0FA8 -0x9342 0x0003 -0x9343 0xFFB0 -0x9344 0xFD94 -0x9345 0x0828 -0x9346 0x0020 -0x9347 0x012C -0x9348 0x0230 -0x9349 0x3FB8 -0x934A 0x0100 -0x934B 0x0DBC -0x934C 0x1FB8 -0x934D 0x0100 -0x934E 0x0800 -0x934F 0x0904 -0x9350 0xFFB0 -0x9351 0xFFE8 -0x9352 0x0A08 -0x9353 0x1FA4 -0x9354 0x0001 -0x9355 0xFFB0 -0x9356 0xFFE3 -0x9357 0x0A0C -0x9358 0x7328 -0x9359 0xA228 -0x935A 0x0020 -0x935B 0x0124 -0x935C 0x3FB8 -0x935D 0x0100 -0x935E 0x0DBC -0x935F 0x1FB8 -0x9360 0x0100 -0x9361 0x0900 -0x9362 0xFFB0 -0x9363 0xFFE8 -0x9364 0x0A04 -0x9365 0x1FA4 -0x9366 0x0002 -0x9367 0xFFB0 -0x9368 0xFFE3 -0x9369 0x0A2C -0x936A 0x0128 -0x936B 0x0024 -0x936C 0x3FB8 -0x936D 0x0100 -0x936E 0x0DBC -0x936F 0x1FB8 -0x9370 0x0100 +0x930C 0xCFAC +0x930D 0x0000 +0x930E 0xFFA3 +0x930F 0x0008 +0x9310 0xCFA8 +0x9311 0x0000 +0x9312 0xFFA3 +0x9313 0x0004 +0x9314 0x0FA4 +0x9315 0xEE14 +0x9316 0xFFA0 +0x9317 0x0007 +0x9318 0x0FA8 +0x9319 0x0001 +0x931A 0x002C +0x931B 0xFFB0 +0x931C 0xFDBC +0x931D 0x0824 +0x931E 0x0020 +0x931F 0x3FB8 +0x9320 0x0100 +0x9321 0x0028 +0x9322 0x012C +0x9323 0x3FB8 +0x9324 0x0100 +0x9325 0x0DBC +0x9326 0x1FB8 +0x9327 0x0100 +0x9328 0x0F80 +0x9329 0x000B +0x932A 0xB104 +0x932B 0x6F84 +0x932C 0x0001 +0x932D 0xFFA9 +0x932E 0x0002 +0x932F 0xAF84 +0x9330 0x0080 +0x9331 0x1884 +0x9332 0x9F84 +0x9333 0x00FF +0x9334 0x3F80 +0x9335 0x0001 +0x9336 0xFFAB +0x9337 0xFFF3 +0x9338 0x0120 +0x9339 0x3FB8 +0x933A 0x0100 +0x933B 0x0DBC +0x933C 0x1FB8 +0x933D 0x0100 +0x933E 0x0800 +0x933F 0x0B04 +0x9340 0x0C08 +0x9341 0x082C +0x9342 0x0920 +0x9343 0x0FA8 +0x9344 0x0003 +0x9345 0xFFB0 +0x9346 0xFD92 +0x9347 0x0828 +0x9348 0x0020 +0x9349 0x012C +0x934A 0x0230 +0x934B 0x3FB8 +0x934C 0x0100 +0x934D 0x0DBC +0x934E 0x1FB8 +0x934F 0x0100 +0x9350 0x0800 +0x9351 0x0904 +0x9352 0xFFB0 +0x9353 0xFFE8 +0x9354 0x0A08 +0x9355 0x1FA4 +0x9356 0x0001 +0x9357 0xFFB0 +0x9358 0xFFE3 +0x9359 0x0A0C +0x935A 0x7328 +0x935B 0xA228 +0x935C 0x0020 +0x935D 0x0124 +0x935E 0x3FB8 +0x935F 0x0100 +0x9360 0x0DBC +0x9361 0x1FB8 +0x9362 0x0100 +0x9363 0x0900 +0x9364 0xFFB0 +0x9365 0xFFE8 +0x9366 0x0A04 +0x9367 0x1FA4 +0x9368 0x0002 +0x9369 0xFFB0 +0x936A 0xFFE3 +0x936B 0x0A2C +0x936C 0x0128 +0x936D 0x0024 +0x936E 0x3FB8 +0x936F 0x0100 +0x9370 0x0DBC 0x9371 0x1FB8 0x9372 0x0100 -0x9373 0x0800 -0x9374 0x0904 -0x9375 0x0A08 -0x9376 0x0B0C -0x9377 0x0020 -0x9378 0x0224 -0x9379 0xFF90 -0x937A 0x0028 -0x937B 0x3FB8 -0x937C 0x0100 -0x937D 0x0A00 -0x937E 0x0B04 -0x937F 0xB208 -0x9380 0xB30C -0x9381 0x1FB8 -0x9382 0x0100 -0x9383 0x0120 -0x9384 0x0224 -0x9385 0xFF90 -0x9386 0x0028 -0x9387 0x3FB8 -0x9388 0x0100 -0x9389 0x1A04 -0x938A 0x2B08 -0x938B 0x2F8C -0x938C 0x0000 -0x938D 0x1FB8 -0x938E 0x0100 -0x938F 0x0020 -0x9390 0x0324 -0x9391 0xFF90 -0x9392 0x0028 -0x9393 0x3FB8 -0x9394 0x0100 -0x9395 0x1A04 -0x9396 0x2B08 -0x9397 0x2F8C -0x9398 0x0000 -0x9399 0x1FB8 -0x939A 0x0100 -0x939B 0x0120 -0x939C 0x0324 -0x939D 0xFF90 -0x939E 0x0028 -0x939F 0x3FB8 -0x93A0 0x0100 -0x93A1 0x1A08 -0x93A2 0x2B0C -0x93A3 0x032C -0x93A4 0x0228 -0x93A5 0x0124 -0x93A6 0x0020 -0x93A7 0x3FB8 -0x93A8 0x0100 -0x93A9 0x0DBC -0x93AA 0x1FB8 -0x93AB 0x0100 -0x93AC 0xB000 -0x93AD 0xB104 -0x93AE 0xB208 -0x93AF 0xB30C -0x93B0 0xCB00 -0x93B1 0xFFAB -0x93B2 0x0005 -0x93B3 0xCA00 -0x93B4 0xFFAB -0x93B5 0x0002 -0x93B6 0xFFA0 -0x93B7 0x0044 -0x93B8 0x0F90 -0x93B9 0x001F -0x93BA 0x9FB8 -0x93BB 0xFFFD -0x93BC 0x5F88 -0x93BD 0x0001 -0x93BE 0xFFAA -0x93BF 0x0006 -0x93C0 0xAFB8 -0x93C1 0x0002 -0x93C2 0x5F8C -0x93C3 0x0001 -0x93C4 0xFFA0 -0x93C5 0x0004 -0x93C6 0x9FB8 -0x93C7 0xFFFD -0x93C8 0x5F8C -0x93C9 0x0001 -0x93CA 0x0418 -0x93CB 0xC43E -0x93CC 0x000F -0x93CD 0xFFAC -0x93CE 0x0005 -0x93CF 0x0914 -0x93D0 0x3F98 -0x93D1 0x0010 -0x93D2 0xFFA0 -0x93D3 0x0001 -0x93D4 0x0814 -0x93D5 0x9FB8 -0x93D6 0xFFFB -0x93D7 0x6614 -0x93D8 0x9F94 -0x93D9 0x0001 -0x93DA 0x9F88 -0x93DB 0xFFFE -0x93DC 0xA508 -0x93DD 0x0214 -0x93DE 0x0318 -0x93DF 0x3A14 -0x93E0 0x4B18 -0x93E1 0xFFA2 -0x93E2 0x0015 -0x93E3 0x060C -0x93E4 0x0508 -0x93E5 0x0F9C -0x93E6 0x0001 -0x93E7 0xC43E -0x93E8 0x000F -0x93E9 0xFFAC -0x93EA 0x0009 -0x93EB 0x0418 -0x93EC 0x3F98 -0x93ED 0x0010 -0x93EE 0x9FB8 -0x93EF 0xFFFD -0x93F0 0x561C -0x93F1 0xA704 -0x93F2 0xFFA0 -0x93F3 0x0004 -0x93F4 0x9FB8 -0x93F5 0xFFFD -0x93F6 0x541C -0x93F7 0xA700 -0x93F8 0x3F90 -0x93F9 0x0001 -0x93FA 0xFFAC -0x93FB 0xFFBE -0x93FC 0x0124 -0x93FD 0x0020 -0x93FE 0x032C -0x93FF 0x0228 -0x9400 0x3FB8 -0x9401 0x0100 -0x9402 0x0DBC -0x9403 0x1FB8 -0x9404 0x0100 -0x9405 0xC83E -0x9406 0x0040 -0x9407 0xFFAC -0x9408 0x0006 -0x9409 0xC83E -0x940A 0x005A -0x940B 0xFFA4 -0x940C 0x0002 -0x940D 0x1FA0 -0x940E 0x0020 -0x940F 0x3FB8 -0x9410 0x0100 -0x9411 0x0DBC -0x9412 0x1FB8 -0x9413 0x0100 -0x9414 0x0D80 -0x9415 0x0F88 -0x9416 0x0001 -0x9417 0x0804 -0x9418 0xC17E -0x9419 0x0000 -0x941A 0xFFA3 -0x941B 0x0003 -0x941C 0x1204 -0x941D 0xFFA0 -0x941E 0xFFF9 -0x941F 0x0108 -0x9420 0xB618 -0x9421 0xB71C -0x9422 0xC804 -0x9423 0xFFA3 -0x9424 0x0034 -0x9425 0xC1E4 -0x9426 0xFFA3 -0x9427 0x0005 -0x9428 0xC120 -0x9429 0xFFA3 -0x942A 0x0002 -0x942B 0xFFA0 -0x942C 0xFFF8 -0x942D 0x020C -0x942E 0x310C -0x942F 0xC33E -0x9430 0x0001 -0x9431 0xFFAB -0x9432 0x0003 -0x9433 0xC164 -0x9434 0xFFA3 -0x9435 0x001F -0x9436 0x1F98 -0x9437 0x0001 -0x9438 0x3334 -0x9439 0x3FB4 -0x943A 0x0002 -0x943B 0x131C -0x943C 0x1F9C -0x943D 0x0002 -0x943E 0xC164 -0x943F 0xFFAB -0x9440 0x0008 -0x9441 0x1FB4 -0x9442 0x0001 -0x9443 0x3F9C +0x9373 0x1FB8 +0x9374 0x0100 +0x9375 0x0800 +0x9376 0x0904 +0x9377 0x0A08 +0x9378 0x0B0C +0x9379 0x0020 +0x937A 0x0224 +0x937B 0xFF90 +0x937C 0x0028 +0x937D 0x3FB8 +0x937E 0x0100 +0x937F 0x0A00 +0x9380 0x0B04 +0x9381 0xB208 +0x9382 0xB30C +0x9383 0x1FB8 +0x9384 0x0100 +0x9385 0x0120 +0x9386 0x0224 +0x9387 0xFF90 +0x9388 0x0028 +0x9389 0x3FB8 +0x938A 0x0100 +0x938B 0x1A04 +0x938C 0x2B08 +0x938D 0x2F8C +0x938E 0x0000 +0x938F 0x1FB8 +0x9390 0x0100 +0x9391 0x0020 +0x9392 0x0324 +0x9393 0xFF90 +0x9394 0x0028 +0x9395 0x3FB8 +0x9396 0x0100 +0x9397 0x1A04 +0x9398 0x2B08 +0x9399 0x2F8C +0x939A 0x0000 +0x939B 0x1FB8 +0x939C 0x0100 +0x939D 0x0120 +0x939E 0x0324 +0x939F 0xFF90 +0x93A0 0x0028 +0x93A1 0x3FB8 +0x93A2 0x0100 +0x93A3 0x1A08 +0x93A4 0x2B0C +0x93A5 0x032C +0x93A6 0x0228 +0x93A7 0x0124 +0x93A8 0x0020 +0x93A9 0x3FB8 +0x93AA 0x0100 +0x93AB 0x0DBC +0x93AC 0x1FB8 +0x93AD 0x0100 +0x93AE 0xB000 +0x93AF 0xB104 +0x93B0 0xB208 +0x93B1 0xB30C +0x93B2 0xCB00 +0x93B3 0xFFAB +0x93B4 0x0005 +0x93B5 0xCA00 +0x93B6 0xFFAB +0x93B7 0x0002 +0x93B8 0xFFA0 +0x93B9 0x0044 +0x93BA 0x0F90 +0x93BB 0x001F +0x93BC 0x9FB8 +0x93BD 0xFFFD +0x93BE 0x5F88 +0x93BF 0x0001 +0x93C0 0xFFAA +0x93C1 0x0006 +0x93C2 0xAFB8 +0x93C3 0x0002 +0x93C4 0x5F8C +0x93C5 0x0001 +0x93C6 0xFFA0 +0x93C7 0x0004 +0x93C8 0x9FB8 +0x93C9 0xFFFD +0x93CA 0x5F8C +0x93CB 0x0001 +0x93CC 0x0418 +0x93CD 0xC43E +0x93CE 0x000F +0x93CF 0xFFAC +0x93D0 0x0005 +0x93D1 0x0914 +0x93D2 0x3F98 +0x93D3 0x0010 +0x93D4 0xFFA0 +0x93D5 0x0001 +0x93D6 0x0814 +0x93D7 0x9FB8 +0x93D8 0xFFFB +0x93D9 0x6614 +0x93DA 0x9F94 +0x93DB 0x0001 +0x93DC 0x9F88 +0x93DD 0xFFFE +0x93DE 0xA508 +0x93DF 0x0214 +0x93E0 0x0318 +0x93E1 0x3A14 +0x93E2 0x4B18 +0x93E3 0xFFA2 +0x93E4 0x0015 +0x93E5 0x060C +0x93E6 0x0508 +0x93E7 0x0F9C +0x93E8 0x0001 +0x93E9 0xC43E +0x93EA 0x000F +0x93EB 0xFFAC +0x93EC 0x0009 +0x93ED 0x0418 +0x93EE 0x3F98 +0x93EF 0x0010 +0x93F0 0x9FB8 +0x93F1 0xFFFD +0x93F2 0x561C +0x93F3 0xA704 +0x93F4 0xFFA0 +0x93F5 0x0004 +0x93F6 0x9FB8 +0x93F7 0xFFFD +0x93F8 0x541C +0x93F9 0xA700 +0x93FA 0x3F90 +0x93FB 0x0001 +0x93FC 0xFFAC +0x93FD 0xFFBE +0x93FE 0x0124 +0x93FF 0x0020 +0x9400 0x032C +0x9401 0x0228 +0x9402 0x3FB8 +0x9403 0x0100 +0x9404 0x0DBC +0x9405 0x1FB8 +0x9406 0x0100 +0x9407 0xC83E +0x9408 0x0040 +0x9409 0xFFAC +0x940A 0x0006 +0x940B 0xC83E +0x940C 0x005A +0x940D 0xFFA4 +0x940E 0x0002 +0x940F 0x1FA0 +0x9410 0x0020 +0x9411 0x3FB8 +0x9412 0x0100 +0x9413 0x0DBC +0x9414 0x1FB8 +0x9415 0x0100 +0x9416 0x0D80 +0x9417 0x0F88 +0x9418 0x0001 +0x9419 0x0804 +0x941A 0xC17E +0x941B 0x0000 +0x941C 0xFFA3 +0x941D 0x0003 +0x941E 0x1204 +0x941F 0xFFA0 +0x9420 0xFFF9 +0x9421 0x0108 +0x9422 0xB618 +0x9423 0xB71C +0x9424 0xC804 +0x9425 0xFFA3 +0x9426 0x0034 +0x9427 0xC1E4 +0x9428 0xFFA3 +0x9429 0x0005 +0x942A 0xC120 +0x942B 0xFFA3 +0x942C 0x0002 +0x942D 0xFFA0 +0x942E 0xFFF8 +0x942F 0x020C +0x9430 0x310C +0x9431 0xC33E +0x9432 0x0001 +0x9433 0xFFAB +0x9434 0x0003 +0x9435 0xC164 +0x9436 0xFFA3 +0x9437 0x001F +0x9438 0x1F98 +0x9439 0x0001 +0x943A 0x3334 +0x943B 0x3FB4 +0x943C 0x0002 +0x943D 0x131C +0x943E 0x1F9C +0x943F 0x0002 +0x9440 0xC164 +0x9441 0xFFAB +0x9442 0x0008 +0x9443 0x1FB4 0x9444 0x0001 -0x9445 0x3F8C +0x9445 0x3F9C 0x9446 0x0001 -0x9447 0x1F84 +0x9447 0x3F8C 0x9448 0x0001 -0x9449 0x0110 -0x944A 0x0D14 -0x944B 0x0315 -0x944C 0x1F96 -0x944D 0x0001 -0x944E 0x0496 -0x944F 0x3F8C -0x9450 0x0001 -0x9451 0xFFAB -0x9452 0xFFFB -0x9453 0x0F95 -0x9454 0x0000 -0x9455 0x0108 -0x9456 0xC120 -0x9457 0xFFAB -0x9458 0xFFCC -0x9459 0x0620 -0x945A 0x0724 -0x945B 0x0037 -0x945C 0x3FB8 -0x945D 0x0100 -0x945E 0x0DBC -0x945F 0x1FB8 -0x9460 0x0100 -0x9461 0x0800 -0x9462 0x0904 -0x9463 0x0A08 -0x9464 0x0A0C -0x9465 0xB410 -0x9466 0x1F8C -0x9467 0x000A -0x9468 0x0F8D -0x9469 0x0000 -0x946A 0xBB2C -0x946B 0x0FA8 -0x946C 0x000A -0x946D 0xFFB0 -0x946E 0xFF3B -0x946F 0x1FA8 -0x9470 0x0030 -0x9471 0x0A0F -0x9472 0x1F90 -0x9473 0x0001 -0x9474 0xC83E -0x9475 0x0000 -0x9476 0xFFA3 -0x9477 0x0002 -0x9478 0xFFA0 -0x9479 0xFFF1 -0x947A 0xC308 -0x947B 0xFFA3 -0x947C 0x0004 -0x947D 0x0F8F -0x947E 0x0020 -0x947F 0xFFA0 -0x9480 0xFFF9 -0x9481 0x0020 -0x9482 0x0124 -0x9483 0x0228 -0x9484 0x0A2C -0x9485 0x0F9C -0x9486 0x000A -0x9487 0x341C -0x9488 0x172C -0x9489 0x0430 -0x948A 0x3FB8 -0x948B 0x0100 -0x948C 0x0DBC -0x948D 0x0000 +0x9449 0x1F84 +0x944A 0x0001 +0x944B 0x0110 +0x944C 0x0D14 +0x944D 0x0315 +0x944E 0x1F96 +0x944F 0x0001 +0x9450 0x0496 +0x9451 0x3F8C +0x9452 0x0001 +0x9453 0xFFAB +0x9454 0xFFFB +0x9455 0x0F95 +0x9456 0x0000 +0x9457 0x0108 +0x9458 0xC120 +0x9459 0xFFAB +0x945A 0xFFCC +0x945B 0x0620 +0x945C 0x0724 +0x945D 0x0037 +0x945E 0x3FB8 +0x945F 0x0100 +0x9460 0x0DBC +0x9461 0x1FB8 +0x9462 0x0100 +0x9463 0x0800 +0x9464 0x0904 +0x9465 0x0A08 +0x9466 0x0A0C +0x9467 0xB410 +0x9468 0x1F8C +0x9469 0x000A +0x946A 0x0F8D +0x946B 0x0000 +0x946C 0xBB2C +0x946D 0x0FA8 +0x946E 0x000A +0x946F 0xFFB0 +0x9470 0xFF3B +0x9471 0x1FA8 +0x9472 0x0030 +0x9473 0x0A0F +0x9474 0x1F90 +0x9475 0x0001 +0x9476 0xC83E +0x9477 0x0000 +0x9478 0xFFA3 +0x9479 0x0002 +0x947A 0xFFA0 +0x947B 0xFFF1 +0x947C 0xC308 +0x947D 0xFFA3 +0x947E 0x0004 +0x947F 0x0F8F +0x9480 0x0020 +0x9481 0xFFA0 +0x9482 0xFFF9 +0x9483 0x0020 +0x9484 0x0124 +0x9485 0x0228 +0x9486 0x0A2C +0x9487 0x0F9C +0x9488 0x000A +0x9489 0x341C +0x948A 0x172C +0x948B 0x0430 +0x948C 0x3FB8 +0x948D 0x0100 +0x948E 0x0DBC +0x948F 0x0000 diff --git a/test_programs/cpu_test.asm b/test_programs/cpu_test.asm index 87f1daf2..e2337b00 100644 --- a/test_programs/cpu_test.asm +++ b/test_programs/cpu_test.asm @@ -6,7 +6,13 @@ ; during this stage the test program will halt the processor. The halt address corresponds to ; the failing test. ; + ; Turn on switch SW2 to put QNICE-FPGA into debugging mode, i.e. the TIL register will show + ; the address where the HALT occured. + ; ; 05-MAY-2016 Bernd Ulmann + ; 30-DEC-2016 sy2002: Added these testcases: ADD R4, @--R4; ADD @--R4, R4; + ; ADD @--R4, @R4; ADD @R4, @--R4; + ; ADD @--R4, @--R4 ; #include "../dist_kit/sysdef.asm" #include "../dist_kit/monitor.def" @@ -49,7 +55,7 @@ M3_1 SUB 0x0001, R1 ; If we end up here, the second memory cell in M2_SCRATCH did either not contain ; 0x1234 or the value could not be retrieved. HALT - ; Now we test ADD @R0++, @R0: + ; Now we test OR @R0++, @R0: M4 MOVE M2_SCRATCH, R0 MOVE 0x5555, @R0++ MOVE 0xAAAA, @R0 @@ -58,6 +64,48 @@ M4 MOVE M2_SCRATCH, R0 CMP 0xFFFF, @R0 RBRA M5, Z HALT -M5 + ; test ADD R4, @--R4 +M5_VAR .DW 0x0004, 0xFFFF, 0x4444, 0x9876, 0x5432, 0x2309 +M5 MOVE M5_VAR, R4 + ADD 1, R4 + ADD R4, @--R4 + MOVE @R4, R4 + CMP @R4, 0x2309 + RBRA M6, Z + HALT + ; test ADD @--R4, R4 + ; for more details, see test_programs/predec.asm +M6_VAR .DW 0x0003, 0xAAAA, 0xFFFF, 0xCCCC, 0xBBBB, 0xEEEE +M6 MOVE M6_VAR, R4 ; now points to 0x0003 + ADD 1, R4 ; now points to 0xAAAA + ADD @--R4, R4 ; now should point to 0xCCCC + CMP 0xCCCC, @R4 + RBRA M7, Z + HALT + ; test ADD @--R4, @R4 +M7_VAR .DW 0xAAAA, 0x1234, 0xBBBB +M7 MOVE M7_VAR, R4 + ADD 2, R4 + ADD @--R4, @R4 + CMP @R4, 0x2468 + RBRA M8, Z + HALT + ; test ADD @--R4, @--R4 +M8_VAR .DW 0x5555, 0x0076, 0x1900, 0xDDDD, 0x9999, 0x8888 +M8 MOVE M8_VAR, R4 + ADD 3, R4 + ADD @--R4, @--R4 + CMP @R4, 0x1976 + RBRA M9, Z + HALT + ; ADD @R4, @--R4 +M9_VAR .DW 0x1100, 0x4455 +M9 MOVE M9_VAR, R4 + ADD 1, R4 + ADD @R4, @--R4 + CMP @R4, 0x5555 + RBRA CPU_OK, Z + HALT + ; If we end up here we can be pretty sure that the CPU is working. - SYSCALL(exit, 1) +CPU_OK SYSCALL(exit, 1) diff --git a/test_programs/mt-divu32.asm b/test_programs/mt-divu32.asm index 47c15ed9..9470aa3f 100644 --- a/test_programs/mt-divu32.asm +++ b/test_programs/mt-divu32.asm @@ -1,7 +1,7 @@ ; Test the divu32 routine of the Monitor ; derived from the original code from 32bit-div.asm ; -; done by sy2002 in Octiber 2016 +; done by sy2002 in October 2016 #include "../dist_kit/sysdef.asm" #include "../dist_kit/monitor.def" diff --git a/test_programs/mt-h2dstr.asm b/test_programs/mt-h2dstr.asm index f8d58b00..229dd3b2 100644 --- a/test_programs/mt-h2dstr.asm +++ b/test_programs/mt-h2dstr.asm @@ -1,6 +1,6 @@ ; Test the h2dstr routine of the Monitor ; -; done by sy2002 in Octiber 2016 +; done by sy2002 in October 2016 #include "../dist_kit/sysdef.asm" #include "../dist_kit/monitor.def" diff --git a/test_programs/mt-mulu32.asm b/test_programs/mt-mulu32.asm index e48c58ba..339fd524 100644 --- a/test_programs/mt-mulu32.asm +++ b/test_programs/mt-mulu32.asm @@ -1,7 +1,7 @@ ; Test the mulu32 routine of the Monitor ; derived from the original code from 32bit-mul.asm ; -; done by sy2002 in Octiber 2016 +; done by sy2002 in October 2016 #include "../dist_kit/sysdef.asm" #include "../dist_kit/monitor.def" diff --git a/test_programs/mt-strcmp.asm b/test_programs/mt-strcmp.asm new file mode 100644 index 00000000..d9be371a --- /dev/null +++ b/test_programs/mt-strcmp.asm @@ -0,0 +1,62 @@ +; Test the strcmp routine of the Monitor +; +; done by sy2002 in December 2016 + +#include "../dist_kit/sysdef.asm" +#include "../dist_kit/monitor.def" + + .ORG 0x8000 + + MOVE STR_TITLE, R8 + SYSCALL(puts, 1) + + MOVE STR_INPUT1, R8 + SYSCALL(puts, 1) + MOVE STRING1, R8 + SYSCALL(gets, 1) + SYSCALL(crlf, 1) + + MOVE STR_INPUT2, R8 + SYSCALL(puts, 1) + MOVE STRING2, R8 + SYSCALL(gets, 1) + SYSCALL(crlf, 1) + + MOVE STRING1, R8 + MOVE STRING2, R9 + SYSCALL(strcmp, 1) + + MOVE STR_RESULT, R8 + SYSCALL(puts, 1) + MOVE R10, R8 + SYSCALL(puthex, 1) + SYSCALL(crlf,1) + + CMP R10, 0 + RBRA TEST_LT, !Z + MOVE STR_EQ, R8 + RBRA END, 1 + +TEST_LT CMP R10, 0 + RBRA IS_GT, V + MOVE STR_LT, R8 + RBRA END, 1 + +IS_GT MOVE STR_GT, R8 + RBRA END, 1 + +END SYSCALL(puts, 1) + SYSCALL(exit, 1) + +STR_TITLE .ASCII_P "strcmp - Monitor string library test\n" + .ASCII_W "done by sy2002 in December 2016\n" +STR_INPUT1 .ASCII_W "Enter string #1: " +STR_INPUT2 .ASCII_W "Enter string #2: " +STR_RESULT .ASCII_W "strcmp(string #1, string#2) = " +STR_CONCLUSION .ASCII_W "Conclusion: " +STR_EQ .ASCII_W "string #1 == string #2\n" +STR_LT .ASCII_W "string #1 < string #2\n" +STR_GT .ASCII_W "string #1 > string #2\n" + +STRING1 .BLOCK 200 +STRING2 .BLOCK 200 diff --git a/test_programs/predec.asm b/test_programs/predec.asm new file mode 100644 index 00000000..713cc19b --- /dev/null +++ b/test_programs/predec.asm @@ -0,0 +1,88 @@ +; Test pre-decrement-indirect-and-then-work-with-it +; +; This test program was used to document and to test, after in Release 1.4 +; a CPU bug was discovered, that lead to the strange effect, that in the +; emulator, things like "F" "R" qbin/mandel.out did not work, but in hardware +; it indeed did work. At first, this looked like an emulator bug, but in the +; end it became clear, that the FAT32 implementation relied on a CPU bug to +; work correctly :-) +; +; The original sdcard.asm (and therefore the Monitor's FAT32 implementation) +; contained a statement like this: +; +; ============================================================================ +; ADD @--R4, R4 ; R4 was incremented to skip.. +; ; ..the length information, .. +; ; ..so we need to predecr. .. +; ; ..and then increase the .. +; ; ..pointer to the next segm. +; ============================================================================ +; +; It expected from the CPU the following semantics: +; +; ============================================================================ +; int* a = r4; +; int* b = r4; +; --a; +; b += (*a); +; r4 = b; +; ============================================================================ +; +; In other words: It relied on a CPU bug, that had the implication that the +; second operand still had the old value, even when pre-decremented in the +; first part of the command. Obviously, the right semantics need to be: +; +; ============================================================================ +; int* a = r4; +; --a; +; a += (*a); +; r4 = a; +; ============================================================================ +; +; This test program therefore checks, if the correct behaviour is shown. +; +; done by sy2002 in December 2016 + +#include "../dist_kit/sysdef.asm" +#include "../dist_kit/monitor.def" + + .ORG 0x8000 + + MOVE STR_TITLE, R8 + SYSCALL(puts, 1) + + MOVE DATA, R4 ; now points to 0x0003 + ADD 1, R4 ; now points to 0xAAAA + + ; what this should do, if the CPU works correctly: + ; 1. decrease R4 by 1, so it now points to 0x0003 + ; 2. add 0x0003 to R4 so it now points to 0xCCCC + ; + ; what the buggy CPU did: + ; 1. remember R4 + ; 2. decrease R4 by 1 so it now points to 0x0003 + ; 3. add 0x0003 to the remembered value, so that it now + ; pointed to 0xBBBB + ADD @--R4, R4 + + CMP @R4, 0xCCCC + RBRA BUG, !Z + MOVE STR_OK, R8 + SYSCALL(puts, 1) + SYSCALL(crlf, 1) + SYSCALL(exit, 1) + +BUG MOVE STR_BUG, R8 + SYSCALL(puts, 1) + MOVE @R4, R8 + SYSCALL(puthex, 1) + SYSCALL(crlf, 1) + SYSCALL(exit, 1) + +DATA .DW 0x0003, 0xAAAA, 0xFFFF, 0xCCCC, 0xBBBB, 0x0001, 0x0002 + +STR_TITLE .ASCII_P "Test the infamous ADD @--R4, R4 behaviour\n" + .ASCII_P "done by sy2002 in December 2016\n\n" + .ASCII_W "CPU condition = " +STR_OK .ASCII_W "OK" +STR_BUG .ASCII_W "BUGGY! wrong value = " diff --git a/test_programs/regbank.asm b/test_programs/regbank.asm index 67b2d5c9..e3bf2ec3 100644 --- a/test_programs/regbank.asm +++ b/test_programs/regbank.asm @@ -9,10 +9,16 @@ ; small stack on RAM is utilized using two nested function calls ; ; Everything works correct, if the TIL displays the following sequence in -; a loop: 8080, 0000, 1700, 0000 +; a loop: 8080, 0000, 1700, 0000, ... +; +; Optional: If you define OUTPUT_STDOUT, then in parallel to seeing the values +; on TIL, they are also printed on stdout. This only works, if you run this +; test within the Monitor environment. ; ; done by sy2002 in August 2015 -; improved in January 2016 +; improved in January 2016, December 2016 + +#undef OUTPUT_STDOUT IO$TIL_BASE .EQU 0xFF10 ; Address of TIL-display @@ -92,11 +98,20 @@ CHECK_LOOP ADD R10, R14 ; next bank ; input: R8 = register, R9 = expected value, R12 = TIL BASE DISPLAY_REG ADD NEXT_BANK, R14 ; next register bank MOVE R8, @R12 ; display value on TIL +#ifdef OUTPUT_STDOUT + ASUB 0x0026, 1 ; SYSCALL(puthex, 1) + ASUB 0x000A, 1 ; SYSCALL(crlf, 1) +#endif RSUB DELAY, 1 ; wait 1 second MOVE VAR_DIFF, R0 ; memory location of variable MOVE R8, @R0 ; store register value in var SUB R9, @R0 ; subtract expected value MOVE @R0, @R12 ; display difference reg vs. expct + MOVE @R0, R8 +#ifdef OUTPUT_STDOUT + ASUB 0x0026, 1 ; SYSCALL(puthex, 1) + ASUB 0x000A, 1 ; SYSCALL(crlf, 1) +#endif RSUB DELAY, 1 ; wait 1 second SUB NEXT_BANK, R14 ; previous register bank MOVE @R13++, R15 ; return from sub routine diff --git a/test_programs/sdcard.asm b/test_programs/sdcard.asm index f93d0802..fd487313 100644 --- a/test_programs/sdcard.asm +++ b/test_programs/sdcard.asm @@ -2658,7 +2658,12 @@ _F32_DF_SUCCESS MOVE 0, R9 ; operation was successful ; ..the length information, .. ; ..so we need to predecr. .. ; ..and then increase the .. - ; ..pointer to the next segm. + ; ..pointer to the next segm. + ; it now points to the '0' of + ; the current string + ADD 1, R4 ; now it points to the next .. + ; .. segment, i.e. to the .. + ; length information RBRA _F32_DF_NXSG, 1 ; process next path segment ; restore SP diff --git a/test_programs/split_str.asm b/test_programs/split_str.asm index 522b4a2d..e5ef38da 100644 --- a/test_programs/split_str.asm +++ b/test_programs/split_str.asm @@ -16,19 +16,11 @@ MOVE STR_TITLE, R8 SYSCALL(puts, 1) - ; read string - MOVE STRBUFFER, R0 + ; read string MOVE STR_STRING, R8 - SYSCALL(puts, 1) -INPUT_LOOP SYSCALL(getc, 1) - SYSCALL(putc, 1) - CMP R8, 0x000D ; accept CR as line end - RBRA INPUT_END, Z - CMP R8, 0x000A ; accept LF as line end - RBRA INPUT_END, Z - MOVE R8, @R0++ ; store character - RBRA INPUT_LOOP, 1 -INPUT_END MOVE 0, @R0 ; add zero terminator + SYSCALL(puts, 1) + MOVE STRBUFFER, R8 + SYSCALL(gets, 1) SYSCALL(crlf, 1) ; read delimiter diff --git a/vhdl/env1_globals.vhd b/vhdl/env1_globals.vhd index d94b53fb..ba2709f5 100644 --- a/vhdl/env1_globals.vhd +++ b/vhdl/env1_globals.vhd @@ -11,13 +11,13 @@ package env1_globals is -- file name and file size (in lines) of the file that is converted to the ROM located at 0x0000 constant ROM_FILE : string := "../monitor/monitor.rom"; -constant ROM_SIZE : natural := 6460; +constant ROM_SIZE : natural := 6477; --constant ROM_FILE : string := "../demos/q-tris.rom"; --constant ROM_SIZE : natural := 4544; -- file name of file and file size (in lines) of the file containing the Power On & Reset Execution (PORE) ROM constant PORE_ROM_FILE : string := "../pore/pore.rom"; -constant PORE_ROM_SIZE : natural := 476; +constant PORE_ROM_SIZE : natural := 477; -- size of lower register bank: should be 256 -- set to 16 during development for faster synthesis, routing, etc. diff --git a/vhdl/qnice_cpu.vhd b/vhdl/qnice_cpu.vhd index 44bed815..66f181fc 100644 --- a/vhdl/qnice_cpu.vhd +++ b/vhdl/qnice_cpu.vhd @@ -341,6 +341,12 @@ begin -- put pre decremented address on the data bus for reading fsmCpuAddr <= reg_read_data1 - 1; + -- in case the destination register is equal to the source register, + -- make sure, that the buffer flip/flop Dst_Value is updated + if Dst_RegNo = Src_RegNo then + fsmDst_Value <= reg_read_data1 - 1; + end if; + -- write back the decremented values -- special handling of SR and PC as they are not stored in the register file case Src_RegNo is