@nataliapc/mcp-openmsx 1.2.10 → 1.2.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. package/README.md +20 -2
  2. package/dist/chunker.js +187 -0
  3. package/dist/embedder.js +250 -0
  4. package/dist/server.js +6 -1
  5. package/dist/server_tools.js +6 -5
  6. package/dist/vectordb.js +94 -35
  7. package/package.json +4 -8
  8. package/resources/audio/chipsfmpacpr1_en.md +209 -0
  9. package/resources/audio/chipsfmpacpr2_en.md +170 -0
  10. package/resources/audio/toc.json +12 -0
  11. package/resources/book--msx-top-secret-3/MTS3-Appendix-English-Upd2.pdf +0 -0
  12. package/resources/book--msx-top-secret-3/MTS3-Complete-English.pdf +0 -0
  13. package/resources/book--msx-top-secret-3/mts3-appendix-english-upd2.md +25863 -0
  14. package/resources/book--msx-top-secret-3/mts3-complete-english.md +44895 -0
  15. package/resources/book--msx2-technical-handbook/toc.json +1 -1
  16. package/resources/book--the-msx-red-book/Chapter1_Programmable_Peripheral_Interface.md +112 -0
  17. package/resources/book--the-msx-red-book/Chapter2_Video_Display_Processor.md +308 -0
  18. package/resources/book--the-msx-red-book/Chapter3_Programmable_Sound_Generator.md +168 -0
  19. package/resources/book--the-msx-red-book/Chapter4_ROM_BIOS.md +2528 -0
  20. package/resources/book--the-msx-red-book/Chapter5_ROM_BASIC_Interpreter.md +3975 -0
  21. package/resources/book--the-msx-red-book/Chapter6_Memory_Map.md +1963 -0
  22. package/resources/book--the-msx-red-book/Chapter7_Machine_Code_Programs.md +1238 -0
  23. package/resources/book--the-msx-red-book/Introduction.md +104 -0
  24. package/resources/book--the-msx-red-book/toc.json +38 -3
  25. package/resources/processors/toc.json +3 -3
  26. package/resources/processors/z80-undocumented.md +141 -0
  27. package/resources/programming/asm_develop_a_program_in_cartridge_rom.md +1881 -0
  28. package/resources/programming/toc.json +6 -0
  29. package/resources/sdcc/1_Introduction.md +199 -0
  30. package/resources/sdcc/2_Installing_SDCC.md +533 -0
  31. package/resources/sdcc/3_Using_SDCC.md +1758 -0
  32. package/resources/sdcc/4_Notes_on_supported_Processors.md +1638 -0
  33. package/resources/sdcc/5_Debugging.md +210 -0
  34. package/resources/sdcc/6_Tips_and_Support.md +258 -0
  35. package/resources/sdcc/7_SDCC_Technical_Data.md +489 -0
  36. package/resources/sdcc/8_Compiler_internals.md +477 -0
  37. package/resources/sdcc/toc.json +44 -2
  38. package/resources/system/how_to_detect_ram.md +14 -0
  39. package/resources/system/mrc_wiki_megarom_mappers.md +533 -0
  40. package/resources/system/the_memory.md +118 -0
  41. package/resources/system/toc.json +18 -0
  42. package/vector-db/__manifest/_transactions/0-675ee228-bffb-4636-80e5-cdfde25cc4fe.txn +2 -0
  43. package/vector-db/__manifest/_versions/18446744073709551614.manifest +0 -0
  44. package/vector-db/__manifest/_versions/latest_version_hint.json +1 -0
  45. package/vector-db/msxdocs.lance/_indices/37194b01-2a25-40d1-ac38-7fbe254df5ea/metadata.lance +0 -0
  46. package/vector-db/msxdocs.lance/_indices/37194b01-2a25-40d1-ac38-7fbe254df5ea/part_2_docs.lance +0 -0
  47. package/vector-db/msxdocs.lance/_indices/37194b01-2a25-40d1-ac38-7fbe254df5ea/part_2_invert.lance +0 -0
  48. package/vector-db/msxdocs.lance/_indices/37194b01-2a25-40d1-ac38-7fbe254df5ea/part_2_tokens.lance +0 -0
  49. package/vector-db/msxdocs.lance/_transactions/0-dd155672-40e6-4c6a-942f-7fcbe8c3dbd0.txn +0 -0
  50. package/vector-db/msxdocs.lance/_transactions/1-e7230cbd-ce8e-465c-9b85-b91443862427.txn +0 -0
  51. package/vector-db/msxdocs.lance/_versions/18446744073709551613.manifest +0 -0
  52. package/vector-db/msxdocs.lance/_versions/18446744073709551614.manifest +0 -0
  53. package/vector-db/msxdocs.lance/_versions/latest_version_hint.json +1 -0
  54. package/vector-db/msxdocs.lance/data/000100110110001011110001fc578141d296825d0bea11c95d.lance +0 -0
  55. package/resources/book--the-msx-red-book/the_msx_red_book.md +0 -10349
  56. package/resources/processors/z80-undocumented.tex +0 -5617
  57. package/resources/sdcc/lyx2md.py +0 -745
  58. package/resources/sdcc/sdccman.lyx +0 -81574
  59. package/resources/sdcc/sdccman.md +0 -5557
  60. package/vector-db/index.json +0 -1
@@ -32,6 +32,12 @@
32
32
  "external_url": "https://map.grauw.nl/articles/mult_div_shifts.php",
33
33
  "description": "Comprehensive guide to optimized mathematical operations in Z80 assembly for MSX. Covers fast multiplication and division techniques using bit shifts, generic multiplication routines, division algorithms, and square root calculations. Essential for performance-critical MSX programming where the Z80 lacks built-in multiplication instructions."
34
34
  },
35
+ {
36
+ "title": "[ASM] Develop a program in a cartridge ROM",
37
+ "uri": "msxdocs://programming/asm_develop_a_program_in_cartridge_rom",
38
+ "external_url": "https://www.msx.org/wiki/Develop_a_program_in_cartridge_ROM",
39
+ "description": "Complete guide to writing MSX ROM cartridge programs in assembly. Covers the 16-byte ROM header structure (INIT, STATEMENT, DEVICE, TEXT), creating ROMs with and without mapper (up to 128KB with ASCII 16k mapper), disk support methods, RAM search and allocation, and practical examples for Glass, Sjasm, tniASM and Zasm assemblers."
40
+ },
35
41
  {
36
42
  "title": "[ASM] Get slot ID of any page",
37
43
  "uri": "msxdocs://programming/asm_getslot",
@@ -0,0 +1,199 @@
1
+ # SDCC Compiler User Guide
2
+
3
+ SDCC LatexCommand input filename "sdcc_version" literal "true"
4
+ $Date:: 2024-01-29 $
5
+ $Revision: 14650 $
6
+
7
+ The above strings enclosed in $ are automatically updated by Subversion
8
+
9
+ LatexCommand tableofcontents
10
+
11
+ ## Introduction
12
+
13
+ ### About SDCC
14
+
15
+ **SDCC** (*S* mall *D* evice *CC* ompiler) is free open source, retargettable, optimizing standard (ANSI C89 / ISO C90, ISO C99, ISO C11 / ISO C17) C compiler suite originally written by **Sandeep Dutta** designed for 8 bit Microprocessors. The current version targets Intel MCS-51 based Microprocessors (8031, 8032, 8051, 8052, mcs51 CPU, etc.), Dallas DS80C390 variants, NXP (formerly Freescale/Motorola) HC08 based (HC08, S08), Zilog Z80 based MCUs (Z80, Z180, eZ80 in Z80 mode, SM83, Rabbit 2000/3000, Rabbit 3000A, Toshiba TLCS-90, Zilog eZ80 in Z80 mode, ASCII R800), STMicroelectronics STM8, Padauk PDK14 and PDK15. It can be retargeted for other microprocessors; support for Padauk PDK13 and MOS6502 is under development, whereas Microchip PIC is currently unmaintained. The entire source code for the compiler is distributed under GPL. SDCC uses a modified version of sdas (sdasgb, sdas6808, sdas8051, sdasz80) & sdld, free open source retargetable assembler & linker. SDCC has extensive language extensions suitable for utilizing various microcontrollers and underlying hardware effectively.
16
+ You might also want to have a look at the wiki https://sourceforge.net/p/sdcc/wiki/.
17
+
18
+ In addition to the MCU specific optimizations SDCC also does a host of standard optimizations like:
19
+
20
+ - global sub expression elimination,
21
+ - loop optimizations (loop invariant, strength reduction of induction variables and loop reversing),
22
+ - constant folding & propagation,
23
+ - copy propagation,
24
+ - dead code elimination
25
+ - jump tables for *switch* statements.
26
+ For the back-end SDCC uses a global register allocation scheme which should be well suited for other 8 bit MCUs.
27
+
28
+ The peep hole optimizer uses a rule based substitution mechanism which is MCU independent.
29
+
30
+ Supported data-types are:
31
+
32
+ | type | width | default | signed range | unsigned range |
33
+ | --- | --- | --- | --- | --- |
34
+ | _Bool / bool | 8 bits, 1 byte | unsigned | - | 0, 1 |
35
+ | char | 8 bits, 1 byte | unsigned | -128, +127 | 0, +255 |
36
+ | short | 16 bits, 2 bytes | signed | -32.768, +32.767 | 0, +65.535 |
37
+ | int | 16 bits, 2 bytes | signed | -32.768, +32.767 | 0, +65.535 |
38
+ | long | 32 bits, 4 bytes | signed | -2.147.483.648, +2.147.483.647 | 0, +4.294.967.295 |
39
+ | long long status open Incomplete support in the pic14 and pic16 backends. | 64 bits, 8 bytes | signed | | |
40
+ | _BitInt status open Incomplete support in the pic14 and pic16 backends. | 8 to 64 bits, 1 to 8 bytes | | | |
41
+ | float | 4 bytes similar to IEEE 754 | signed | | 1.175494351E-38, 3.402823466E+38 |
42
+ | pointer | 1, 2, 3 or 4 bytes | generic | | |
43
+ | __bit status open Only supported in the mcs51, ds390, ds400 backends. | 1 bit | unsigned | - | 0, 1 |
44
+ | __bit status open Only supported in the mcs51, ds390, ds400 backends. | 1 bit | unsigned | - | 0, 1 |
45
+
46
+ The compiler also allows *inline assembler code* to be embedded anywhere in a function. In addition, routines developed in assembly can also be called.
47
+
48
+ SDCC also provides an option (--cyclomatic) to report the relative complexity of a function. These functions can then be further optimized, or hand coded in assembly if needed.
49
+
50
+ SDCC also comes with a companion source level debugger SDCDB. The debugger currently uses ucSim, a free open source simulator for 8051 and other micro-controllers.
51
+
52
+ The latest SDCC version can be downloaded from http://sdcc.sourceforge.net/snap.php. *Please note: the compiler will probably always be some steps ahead of this documentation *** Status of documentation Obviously this has pros and cons.
53
+
54
+ ### SDCC Suite Licenses
55
+
56
+ SDCC suite is a collection of several components derived from different sources with different licenses:
57
+
58
+ - executables:
59
+ - sdcc compiler:
60
+ sdcc compiler is licensed under the GPLv2 (GPLv3 might apply depending on the libraries used when building).
61
+ The code or object files generated by SDCC suite are not licensed, so they can be used in FLOSS or proprietary (closed source) applications.
62
+ - sdcpp preprocessor:
63
+ derived from GCC cpp preprocessor http://gcc.gnu.org/; GPLv3 license
64
+ - sdas assemblers and sdld linker:
65
+ derived from ASXXXX https://shop-pdp.net/ashtml/; GPLv3 license
66
+ - SDCC run-time libraries:
67
+ The great majority of SDCC run-time libraries are licensed under the GPLv2+LE which allows linking of SDCC run-time libraries with proprietary (closed source) applications.
68
+ A possible exception are pic device libraries and header files which are generated from Microchip header (.inc) and linker script (.lkr) files. Microchip requires that "The header files should state that they are only to be used with authentic Microchip devices" which makes them incompatible with the GPL, if Microchip has any copyright in them (which might depend on local copyright laws). Pic device libraries and header files are located at non-free/lib and non-free/include directories respectively. SDCC should be run with the **--** use-non-free **range none pageformat default --use-non-free** command line option in order to include non-free header files and libraries.
69
+ - sdbinutils utilities (sdar, sdranlib, sdnm, sdobjcopy):
70
+ derived from GNU Binutils http://www.gnu.org/software/binutils/; GPLv3 license
71
+ - ucsim simulators:
72
+ GPLv2 license
73
+ - sdcdb debugger:
74
+ GPLv2 license
75
+ - gcc-test regression tests:
76
+ derived from gcc-testsuite; no license explicitely specified, but since it is a part of GCC is probably GPLv3 licensed
77
+ - packihx:
78
+ public domain
79
+ - makebin:
80
+ zlib/libpng License
81
+ - pic libraries in device/non-free:
82
+ Microchip Technology Inc. claims to have copyrights on this, and their term are non-free. However, a more common opinion is that Microchip Technology Inc. is just claiming a copyright on uncopyrightable facts.
83
+ - libraries:
84
+ - dbuf library:
85
+ zlib/libpng License
86
+ - Boost C++ libraries:
87
+ http://www.boost.org/; Boost Software License 1.0 (BSL-1.0)
88
+ Links to licenses:
89
+
90
+ - GPLv2 license: http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
91
+ - LGPLv2.1 license: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html
92
+ - GPLv3 license: http://www.gnu.org/licenses/gpl.html
93
+ - zlib/libpng License: http://www.opensource.org/licenses/Zlib
94
+ - Boost Software License 1.0 (BSL-1.0): http://www.opensource.org/licenses/BSL-1.0
95
+
96
+ ### Documentation
97
+
98
+ This documentation is maintained using a free open source word processor (\SpecialChar LyX) http://www.lyx.org/.
99
+
100
+ ### Typographic conventions
101
+
102
+ Throughout this manual, we will use the following convention. Commands you have to type in are printed in **"sans serif"**. Code samples are printed in typewriter font. Interesting items and new terms are printed in *italic.
103
+
104
+ ### Compatibility with previous versions
105
+
106
+ Newer versions have usually numerous bug fixes compared with the previous version. But we also sometimes introduce some incompatibilities with older versions. Not just for the fun of it, but to make the compiler more stable, efficient and Standard-compliance (see section Standard-Compliance for Standard-Compliance). This is a list of such changes. It would be fine to add to each item, in which version was it changed.
107
+
108
+ - short is now equivalent to int (16 bits), it used to be equivalent to char (8 bits) which is not ANSI compliant. To maintain compatibility, old programs could be compiled using the --short-is-8bits command line option (option removed after the 3.6.0 release).
109
+ - the default directory for gcc-builds where include, library and documentation files are stored is now in /usr/local/share.
110
+ - char type parameters to vararg, va arg functions are casted to int unless explicitly casted and neither of the **--std-c90, --std-c99, --std-c11 or --std-c23** command line options is used, e.g.:
111
+ `char a=3;
112
+ printf ("%d %c\ n", a, (char)a);
113
+ `
114
+ will push a as an int and as a char resp if none of the above command line options are not defined,
115
+ will push a as two ints if none of the above command line option is defined.
116
+ - pointer type parameters to vararg, va arg functions are casted to generic pointers on Harvard architectures (e.g. mcs51, ds390) unless explicitly casted and neither of the **--std-c90, --std-c99, --std-c11** or **--std-c23** command line options is used.
117
+ - option --regextend has been removed.
118
+ - option --noregparms has been removed.
119
+ - option --stack-after-data has been removed.
120
+ - __bit range none pageformat default bit and __sbit range none pageformat default sbit types now consistently behave like the C99 _Bool type with respect to type conversion range none pageformat default type conversion range none pageformat default type promotion. The most common incompatibility resulting from this change is related to bit toggling range none pageformat default Bit toggling idioms, e.g.:
121
+ __bit b;
122
+ b = ~ range none pageformat default ~ Operator b; /* equivalent to b=1 instead of toggling b */
123
+ b =!b; /* toggles b */
124
+ In previous versions, both forms would have toggled the bit.
125
+ - in older versions, the preprocessor was always called with **--std-c99 range none pageformat default --std-c99** regardless of the **--std-xxx** setting. This is no longer true, and can cause compilation failures on code built with **--std-c90 range none pageformat default --std-c90** but using c99 preprocessor features, such as one-line (//) comments
126
+ - in versions older than 2.8.4 the pic16 *printf() and printf_tiny() library functions supported undocumented and not standard compliant 'b' binary format specifier ("%b", "%hb" and "%lb"). The 'b' specifier is now disabled by default. It can be enabled by defining BINARY_SPECIFIER macro in files device/lib/pic16/libc/stdio/vfprintf.c and device/lib/pic16/libc/stdio/printf_tiny.c and recompiling the library.
127
+ - in versions older then 2.8.5 the unnamed bit-field structure members participated in initialization, which is not conforming with ISO/IEC 9899:1999 standard (see section Section 6.7.8 Initialization, clause 9)
128
+
129
+ Old behaviour, before version 2.8.5:
130
+ ```c
131
+ struct {
132
+ int a: 2;
133
+ char: 2;
134
+ int b: 2;
135
+ } s = {1, 2, 3};
136
+ /* s.a = 1, s.b = 3 */
137
+ ```
138
+ New behaviour:
139
+ ```c
140
+ struct {
141
+ int a: 2;
142
+ char: 2;
143
+ int b: 2;
144
+ } s = {1, 2};
145
+ /* s.a = 1, s.b = 2 */
146
+ ```
147
+ - In 2.9.0 libraries included in SDCC packages, are in ar format. See section Using sdar to Create and Manage Libraries.
148
+ - In 3.0.0 targets for xa51 and avr are disabled by default.
149
+ - In 3.0.0 sdldgb and sdldz80 don't support generation of Game Boy binary image format. The makebin utility can be used to convert Intel Hex format to Game Boy binary image format.
150
+ - In 3.0.0 sdldgb and sdldz80 don't support generation of rrgb (Game Boy simulator) map file and no$gmb symbol file formats. The as2gbmap utility can be used to convert sdld map format to rrgb and no$gmb file formats.
151
+ - In 3.1.0 asranlib utility was renamed to sdranlib.
152
+ - In 3.1.0 pic14 target, structured access to SFR via is deprecated and replaced by. It will be obsoleted (removed) in one of next SDCC releases. See section Naming of special function registers.
153
+ - sdar archive managing utility and sdnm utilities were introduced in version 3.2.0. sdar, sdranlib and sdnm are derived from GNU Binutils package.
154
+ - In 3.2.0 the sdcclib utility is deprecated. Sdar utility should be used to create SDCC object file archives. Sdcclib utility will become obsolete in one of next SDCC releases and will be removed from SDCC packages.
155
+ - In 3.2.0 special SDCC keywords which are not preceded by a double underscore are obsoleted (removed). See section Standard-Compliance Standard-Compliance.
156
+ - In 3.2.0 compiler macro definitions not starting with double underscore characters are deprecated if `--std-cXX` command line option is defined. They have been obsoleted (removed) after the 3.4.0 release (except for the macro SDCC, which has been removed after the 3.6.0 release (and brought back for mcs51 for the 3.7.0 release)).
157
+ - In 3.2.0 new compiler macros for processor definition were introduced for pic14 and pic16 targets:`-D__SDCC_PIC16XXXX` and `-D__SDCC_PIC18FXXX` respectively. The pic16 macro definition `-D__18fXXX` is deprecated. It was obsoleted (removed) after the 3.4.0 release.
158
+ - In 3.2.0 pragma config for pic16 target was introduced. See section Pragmas
159
+ - In 3.2.0 new inline assembler format `__asm__ (" inline_assembler_code");` as an addition to `__asm... __endasem;` format introduced. See section Inline Assembler Code
160
+ - sdobjcopy utility was introduced in version 3.3.0. It is derived from GNU Binutils package.
161
+ - Before 3.4.0 release, intrinsic named address spaces were called" storage classes" in this manual.
162
+ - In 3.6.0, the default for char changed from signed to unsigned.
163
+ - In 3.7.0, the prototype for putchar() changed from `void putchar(char)` to `int putchar(int)`.
164
+ - In 3.7.0 mcs51 and ds390 got a full _Bool/bool type, separate from __bit.
165
+ - In 3.7.0, the option **`--nojtbound`** and the corresponding pragma have been deprecated.
166
+ - In 3.7.0, the prototype for `getchar()`changed from `char getchar(void)` to `int getchar(void)`.
167
+ - In 3.8.6, the deprecated sdcclib was removed.
168
+ - In 4.0.3, _itoa, _uitoa, _ltoa, _ultoa were renamed to __itoa, __uitoa, __ltoa, __ultoa.
169
+ - In 4.1.1, typeof.h has been removed.
170
+ - In 4.1.3, support for **`--oldralloc`** has been removed for the z80-related backends.
171
+ - In 4.1.10, the default calling convention switched from `__sdccall(0)` to `__sdccall(1)` for stm8 and gbz80.
172
+ - In 4.1.10, support for **`--profile`** has been removed for gbz80.
173
+ - In 4.1.11, the minimum Z80N Core version for the z80n port has been raised from 1.0 to 2.0.
174
+ - In 4.1.12, the default calling convention switched from `__sdccall(0)` to `__sdccall(1)` for z80, z180 and z80n.
175
+ - In 4.1.12, support for **`--profile`** has been removed for z80, z180, z80n.
176
+ - In 4.1.13, support for **`--profile`** has been removed.
177
+ - In 4.1.14, the gbz80 port was renamed to sm83.
178
+ - In 4.2.3, support for non-parenthesized arguments to `__using` and `__interrupt` was dropped.
179
+ - In 4.2.3, support for non-parenthesized arguments to __at that are not constants was dropped.
180
+ - In 4.2.4, the placement of `__at` in declarations was restricted.
181
+ - In 4.2.6, bool is chosen as the underlying integer type for enumerations with just two values.
182
+ - In 4.2.9, support for **`--pedantic-parse-number`** and #pragma pedantic_parse_numer was dropped.
183
+ - In 4.2.9, support for #pragma sdcc_hash was dropped, necessitating a wrapper macro for literal" #" characters in macro bodies.
184
+ - In 4.2.9, support for arguments to -MMD was dropped. The output file can be specified via -MF instead.
185
+ - In 4.2.10, `_sdcc_external_startup` was renamed to `__sdcc_external_startup` and support for it was added to further ports.
186
+ - In 4.2.13, for the sm83 port, `__sfr` addresses need to be specified using the full 16-bit address.
187
+ - In 4.2.14, byte order in output from the %p specifier of printf()-family functions was corrected for big-endian platforms (stm8, hc08, s08, mos6502) to match uintptr_t.
188
+ - In 4.3.1, `__builtin_rlc`, `__builtin_rrc` and `__builtin_swap` were replaced by `__builtin_rot`.
189
+ - In 4.3.6, support for **`--parms-in-bank1`** was removed from the mcs51 port.
190
+ - In 4.4.1, the address width in.rel files was increased from 24 bits to 32 bits for the z80 (and related) ports.
191
+ - In 4.5.2, the C23 standard library bit and byte utilities (stdbit.h) more closely follow the final ISO C23 standard instead of the 2022 C2X draft.
192
+
193
+ ### System Requirements
194
+
195
+ What do you need before you start installation of SDCC? A computer, and a desire to compute. The preferred method of installation is to compile SDCC from source using GNU GCC and make. For Windows some pre-compiled binary distributions are available for your convenience. You should have some experience with command line tools and compiler use.
196
+
197
+ ### Other Resources
198
+
199
+ The SDCC home page at http://sdcc.sourceforge.net/ is a great place to find distribution sets. You can also find links to the user mailing lists that offer help or discuss SDCC with other SDCC users. Web links to other SDCC related sites can also be found here. This document can be found in the doc directory of the source package. The latest snapshot build version of this document in pdf format is available at http://sdcc.sourceforge.net/doc/sdccman.pdf. Some of the other tools (simulator and assembler) included with SDCC contain their own documentation and can be found in the source distribution. If you want the latest unreleased software, the complete source package is available directly from Subversion on http://sourceforge.net/p/sdcc/code/8805/tree/trunk/sdcc/.