@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.
- package/README.md +20 -2
- package/dist/chunker.js +187 -0
- package/dist/embedder.js +250 -0
- package/dist/server.js +6 -1
- package/dist/server_tools.js +6 -5
- package/dist/vectordb.js +94 -35
- package/package.json +4 -8
- package/resources/audio/chipsfmpacpr1_en.md +209 -0
- package/resources/audio/chipsfmpacpr2_en.md +170 -0
- package/resources/audio/toc.json +12 -0
- package/resources/book--msx-top-secret-3/MTS3-Appendix-English-Upd2.pdf +0 -0
- package/resources/book--msx-top-secret-3/MTS3-Complete-English.pdf +0 -0
- package/resources/book--msx-top-secret-3/mts3-appendix-english-upd2.md +25863 -0
- package/resources/book--msx-top-secret-3/mts3-complete-english.md +44895 -0
- package/resources/book--msx2-technical-handbook/toc.json +1 -1
- package/resources/book--the-msx-red-book/Chapter1_Programmable_Peripheral_Interface.md +112 -0
- package/resources/book--the-msx-red-book/Chapter2_Video_Display_Processor.md +308 -0
- package/resources/book--the-msx-red-book/Chapter3_Programmable_Sound_Generator.md +168 -0
- package/resources/book--the-msx-red-book/Chapter4_ROM_BIOS.md +2528 -0
- package/resources/book--the-msx-red-book/Chapter5_ROM_BASIC_Interpreter.md +3975 -0
- package/resources/book--the-msx-red-book/Chapter6_Memory_Map.md +1963 -0
- package/resources/book--the-msx-red-book/Chapter7_Machine_Code_Programs.md +1238 -0
- package/resources/book--the-msx-red-book/Introduction.md +104 -0
- package/resources/book--the-msx-red-book/toc.json +38 -3
- package/resources/processors/toc.json +3 -3
- package/resources/processors/z80-undocumented.md +141 -0
- package/resources/programming/asm_develop_a_program_in_cartridge_rom.md +1881 -0
- package/resources/programming/toc.json +6 -0
- package/resources/sdcc/1_Introduction.md +199 -0
- package/resources/sdcc/2_Installing_SDCC.md +533 -0
- package/resources/sdcc/3_Using_SDCC.md +1758 -0
- package/resources/sdcc/4_Notes_on_supported_Processors.md +1638 -0
- package/resources/sdcc/5_Debugging.md +210 -0
- package/resources/sdcc/6_Tips_and_Support.md +258 -0
- package/resources/sdcc/7_SDCC_Technical_Data.md +489 -0
- package/resources/sdcc/8_Compiler_internals.md +477 -0
- package/resources/sdcc/toc.json +44 -2
- package/resources/system/how_to_detect_ram.md +14 -0
- package/resources/system/mrc_wiki_megarom_mappers.md +533 -0
- package/resources/system/the_memory.md +118 -0
- package/resources/system/toc.json +18 -0
- package/vector-db/__manifest/_transactions/0-675ee228-bffb-4636-80e5-cdfde25cc4fe.txn +2 -0
- package/vector-db/__manifest/_versions/18446744073709551614.manifest +0 -0
- package/vector-db/__manifest/_versions/latest_version_hint.json +1 -0
- package/vector-db/msxdocs.lance/_indices/37194b01-2a25-40d1-ac38-7fbe254df5ea/metadata.lance +0 -0
- package/vector-db/msxdocs.lance/_indices/37194b01-2a25-40d1-ac38-7fbe254df5ea/part_2_docs.lance +0 -0
- package/vector-db/msxdocs.lance/_indices/37194b01-2a25-40d1-ac38-7fbe254df5ea/part_2_invert.lance +0 -0
- package/vector-db/msxdocs.lance/_indices/37194b01-2a25-40d1-ac38-7fbe254df5ea/part_2_tokens.lance +0 -0
- package/vector-db/msxdocs.lance/_transactions/0-dd155672-40e6-4c6a-942f-7fcbe8c3dbd0.txn +0 -0
- package/vector-db/msxdocs.lance/_transactions/1-e7230cbd-ce8e-465c-9b85-b91443862427.txn +0 -0
- package/vector-db/msxdocs.lance/_versions/18446744073709551613.manifest +0 -0
- package/vector-db/msxdocs.lance/_versions/18446744073709551614.manifest +0 -0
- package/vector-db/msxdocs.lance/_versions/latest_version_hint.json +1 -0
- package/vector-db/msxdocs.lance/data/000100110110001011110001fc578141d296825d0bea11c95d.lance +0 -0
- package/resources/book--the-msx-red-book/the_msx_red_book.md +0 -10349
- package/resources/processors/z80-undocumented.tex +0 -5617
- package/resources/sdcc/lyx2md.py +0 -745
- package/resources/sdcc/sdccman.lyx +0 -81574
- package/resources/sdcc/sdccman.md +0 -5557
- package/vector-db/index.json +0 -1
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
<a name="contents"></a>
|
|
2
|
+
# Contents
|
|
3
|
+
|
|
4
|
+
[Introduction](#introduction)
|
|
5
|
+
|
|
6
|
+
1. [Programmable Peripheral Interface](#chapter_1)
|
|
7
|
+
+ [PPI Port A (I/O Port A8H)](#ppi_port_a)
|
|
8
|
+
+ [Expanders](#expanders)
|
|
9
|
+
+ [PPI Port B (I/O Port A9H)](#ppi_port_b)
|
|
10
|
+
+ [PPI Port C (I/O Port AAH)](#ppi_port_c)
|
|
11
|
+
+ [PPI Mode Port (I/O Port ABH)](#ppi_mode_port)
|
|
12
|
+
2. [Video Display Processor](#chapter_2)
|
|
13
|
+
+ [Data Port (I/O Port 98H)](#data_port)
|
|
14
|
+
+ [Command Port (I/O Port 99H)](#command_port)
|
|
15
|
+
+ [Address Register](#address_register)
|
|
16
|
+
+ [VDP Status Register](#vdp_status_register)
|
|
17
|
+
+ [VDP Mode Registers](#vdp_mode_registers)
|
|
18
|
+
+ [Mode Register 0](#mode_register_0)
|
|
19
|
+
+ [Mode Register 1](#mode_register_1)
|
|
20
|
+
+ [Mode Register 2](#mode_register_2)
|
|
21
|
+
+ [Mode Register 3](#mode_register_3)
|
|
22
|
+
+ [Mode Register 4](#mode_register_4)
|
|
23
|
+
+ [Mode Register 5](#mode_register_5)
|
|
24
|
+
+ [Mode Register 6](#mode_register_6)
|
|
25
|
+
+ [Mode Register 7](#mode_register_7)
|
|
26
|
+
+ [Screen Modes](#screen_modes)
|
|
27
|
+
+ [40x24 Text Mode](#40x24_text_mode)
|
|
28
|
+
+ [32x24 Text Mode](#32x24_text_mode)
|
|
29
|
+
+ [Graphics Mode](#graphics_mode)
|
|
30
|
+
+ [Multicolour Mode](#multicolour_mode)
|
|
31
|
+
+ [Sprites](#sprites)
|
|
32
|
+
3. [Programmable Sound Generator](#chapter_3)
|
|
33
|
+
+ [Address Port (I/O port A0H)](#address_port)
|
|
34
|
+
+ [Data Write Port (I/O port A1H)](#data_write_port)
|
|
35
|
+
+ [Data Read Port (I/O port A2H)](#data_read_port)
|
|
36
|
+
+ [Registers 0 and 1](#registers_0_and_1)
|
|
37
|
+
+ [Registers 2 and 3](#registers_2_and_3)
|
|
38
|
+
+ [Registers 4 and 5](#registers_4_and_5)
|
|
39
|
+
+ [Register 6](#register_6)
|
|
40
|
+
+ [Register 7](#register_7)
|
|
41
|
+
+ [Register 8](#register_8)
|
|
42
|
+
+ [Register 9](#register_9)
|
|
43
|
+
+ [Register 10](#register_10)
|
|
44
|
+
+ [Registers 11 and 12](#registers_11_and_12)
|
|
45
|
+
+ [Register 13](#register_13)
|
|
46
|
+
+ [Register 14](#register_14)
|
|
47
|
+
+ [Register 15](#register_15)
|
|
48
|
+
4. [ROM BIOS](#chapter_4)
|
|
49
|
+
+ [Data Areas](#data_areas)
|
|
50
|
+
+ [Terminology](#terminology)
|
|
51
|
+
5. [ROM BASIC Interpreter](#chapter_5)
|
|
52
|
+
6. [Memory Map](#chapter_6)
|
|
53
|
+
+ [Workspace Area](#workspace_area)
|
|
54
|
+
+ [The Hooks](#the_hooks)
|
|
55
|
+
7. [Machine Code Programs](#chapter_7)
|
|
56
|
+
+ [Keyboard Matrix](#keyboard_matrix)
|
|
57
|
+
+ [40 Column Graphics Text](#40_column_graphics_text)
|
|
58
|
+
+ [String Bubble Sort](#string_bubble_sort)
|
|
59
|
+
+ [Graphics Screen Dump](#graphics_screen_dump)
|
|
60
|
+
+ [Character Editor](#character_editor)
|
|
61
|
+
|
|
62
|
+
Contents Copyright 1985 Avalon Software<br>
|
|
63
|
+
Iver Lane, Cowley, Middx, UB8 2JD
|
|
64
|
+
|
|
65
|
+
MSX is a trademark of Microsoft Corp.<br>
|
|
66
|
+
Z80 is a trademark of Zilog Corp.<br>
|
|
67
|
+
ACADEMY is trademark of Alfred.
|
|
68
|
+
|
|
69
|
+
<br><br><br>
|
|
70
|
+
|
|
71
|
+
<a name="introduction"></a>
|
|
72
|
+
# Introduction
|
|
73
|
+
|
|
74
|
+
## <a name="aims"></a>Aims
|
|
75
|
+
|
|
76
|
+
This book is about MSX computers and how they work. For technical and commercial reasons MSX computer manufacturers only make a limited amount of information available to the end user about the design of their machines. Usually this will be a fairly detailed description of Microsoft MSX BASIC together with a broad outline of the system hardware. While this level of documentation is adequate for the casual user it will inevitably prove limiting to anyone engaged in more sophisticated programming.
|
|
77
|
+
|
|
78
|
+
The aim of this book is to provide a description of the standard MSX hardware and software at a level of detail sufficient to satisfy that most demanding of users, the machine code programmer. It is not an introductory course on programming and is necessarily of a rather technical nature. It is assumed that you already possess, or intend to acquire by other means, an understanding of the Z80 Microprocessor at the machine code level. As there are so many general purpose books already in existence about the Z80 any description of its characteristics would simply duplicate widely available information.
|
|
79
|
+
|
|
80
|
+
<a name="organization"></a>
|
|
81
|
+
## Organization
|
|
82
|
+
|
|
83
|
+
The MSX Standard specifies the following as the major functional components in any MSX computer:
|
|
84
|
+
|
|
85
|
+
1. Zilog Z80 Microprocessor
|
|
86
|
+
2. Intel 8255 Programmable Peripheral Interface
|
|
87
|
+
3. Texas 9929 Video Display Processor
|
|
88
|
+
4. General Instrument 8910 Programmable Sound Generator
|
|
89
|
+
5. 32 KB MSX BASIC ROM
|
|
90
|
+
6. 8 KB RAM minimum
|
|
91
|
+
|
|
92
|
+
Although there are obviously a great many additional components involved in the design of an MSX computer they are all small-scale, non-programmable ones and therefore "invisible" to the user. Manufacturers generally have considerable freedom in the selection of these small-scale components. The programmable components cannot be varied and therefore all MSX machines are identical as far as the programmer is concerned.
|
|
93
|
+
|
|
94
|
+
[Chapters 1](#chapter_1), [2](#chapter_2) and [3](#chapter_3) describe the operation of the Programmable Peripheral Interface, Video Display Processor and Programmable Sound Generator respectively. These three devices provide the interface between the Z80 and the peripheral hardware on a standard MSX machine. All occupy positions on the Z80 I/O (Input/Output) Bus.
|
|
95
|
+
|
|
96
|
+
[Chapter 4](#chapter_4) covers the software contained in the first part of the MSX ROM. This section of the ROM is concerned with controlling the machine hardware at the fine detail level and is known as the ROM BIOS (Basic Input Output System). It is structured in such a way that most of the functions a machine code programmer requires, such as keyboard and video drivers, are readily available.
|
|
97
|
+
|
|
98
|
+
[Chapter 5](#chapter_5) describes the software contained in the remainder of the ROM, the Microsoft MSX BASIC Interpreter. Although this is largely a text-driven program, and consequently of less use to the programmer, a close examination reveals many points not documented by manufacturers.
|
|
99
|
+
|
|
100
|
+
[Chapter 6](#chapter_6) is concerned with the organization of system memory. Particular attention is paid to the Workspace Area, that section of RAM from F380H to FFFFH, as this is used as a scratchpad by the BIOS and the BASIC Interpreter and contains much information of use to any application program.
|
|
101
|
+
|
|
102
|
+
[Chapter 7](#chapter_7) gives some examples of machine code programs that make use of ROM features to minimize design effort.
|
|
103
|
+
|
|
104
|
+
It is believed that this book contains zero defects, if you know otherwise the author would be delighted to hear from you. This book is dedicated to the Walking Nightmare.
|
|
@@ -4,9 +4,44 @@
|
|
|
4
4
|
"external_url": "https://github.com/gseidler/The-MSX-Red-Book",
|
|
5
5
|
"toc": [
|
|
6
6
|
{
|
|
7
|
-
"title": "
|
|
8
|
-
"uri": "msxdocs://book--the-msx-red-book/
|
|
9
|
-
"description": "The
|
|
7
|
+
"title": "Introduction",
|
|
8
|
+
"uri": "msxdocs://book--the-msx-red-book/Introduction",
|
|
9
|
+
"description": "The aim of this book is to provide a description of the standard MSX hardware and software at a level of detail sufficient to satisfy that most demanding of users, the machine code programmer."
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
"title": "Chapter1. Programmable Peripheral Interface",
|
|
13
|
+
"uri": "msxdocs://book--the-msx-red-book/Chapter1_Programmable_Peripheral_Interface",
|
|
14
|
+
"description": "Chapter1, Chapter2 and Chapter3 describe the operation of the Programmable Peripheral Interface, Video Display Processor and Programmable Sound Generator respectively. These three devices provide the interface between the Z80 and the peripheral hardware on a standard MSX machine. All occupy positions on the Z80 I/O (Input/Output) Bus."
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"title": "Chapter2. Video Display Processor",
|
|
18
|
+
"uri": "msxdocs://book--the-msx-red-book/Chapter2_Video_Display_Processor",
|
|
19
|
+
"description": "Chapter1, Chapter2 and Chapter3 describe the operation of the Programmable Peripheral Interface, Video Display Processor and Programmable Sound Generator respectively. These three devices provide the interface between the Z80 and the peripheral hardware on a standard MSX machine. All occupy positions on the Z80 I/O (Input/Output) Bus."
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"title": "Chapter3. Programmable Sound Generator",
|
|
23
|
+
"uri": "msxdocs://book--the-msx-red-book/Chapter3_Programmable_Sound_Generator",
|
|
24
|
+
"description": "Chapter1, Chapter2 and Chapter3 describe the operation of the Programmable Peripheral Interface, Video Display Processor and Programmable Sound Generator respectively. These three devices provide the interface between the Z80 and the peripheral hardware on a standard MSX machine. All occupy positions on the Z80 I/O (Input/Output) Bus."
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"title": "Chapter4. ROM BIOS",
|
|
28
|
+
"uri": "msxdocs://book--the-msx-red-book/Chapter4_ROM_BIOS",
|
|
29
|
+
"description": "Chapter4 covers the software contained in the first part of the MSX ROM. This section of the ROM is concerned with controlling the machine hardware at the fine detail level and is known as the ROM BIOS (Basic Input Output System). It is structured in such a way that most of the functions a machine code programmer requires, such as keyboard and video drivers, are readily available."
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"title": "Chapter5. ROM BASIC Interpreter",
|
|
33
|
+
"uri": "msxdocs://book--the-msx-red-book/Chapter5_ROM_BASIC_Interpreter",
|
|
34
|
+
"description": "Chapter5 describes the software contained in the remainder of the ROM, the Microsoft MSX BASIC Interpreter. Although this is largely a text-driven program, and consequently of less use to the programmer, a close examination reveals many points not documented by manufacturers."
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"title": "Chapter6. Memory Map",
|
|
38
|
+
"uri": "msxdocs://book--the-msx-red-book/Chapter6_Memory_Map",
|
|
39
|
+
"description": "Chapter6 is concerned with the organization of system memory. Particular attention is paid to the Workspace Area, that section of RAM from F380H to FFFFH, as this is used as a scratchpad by the BIOS and the BASIC Interpreter and contains much information of use to any application program."
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
"title": "Chapter7. Machine Code Programs",
|
|
43
|
+
"uri": "msxdocs://book--the-msx-red-book/Chapter7_Machine_Code_Programs",
|
|
44
|
+
"description": "Chapter7 gives some examples of machine code programs that make use of ROM features to minimize design effort."
|
|
10
45
|
}
|
|
11
46
|
]
|
|
12
47
|
}
|
|
@@ -15,10 +15,10 @@
|
|
|
15
15
|
"description": "This comprehensive instruction set reference provides a complete tabular listing of all Z80 processor instructions plus R800-specific extensions (MULUB/MULUW multiplication instructions), including documented and undocumented opcodes with precise timing data for MSX systems. It details instruction timing across four scenarios (Z80, Z80+M1 waits, R800, R800+waits), hexadecimal opcodes, instruction sizes, and MSX-specific timing considerations including M1 wait states, memory access patterns, I/O timing, and R800 internal/external memory performance characteristics. Essential for MSX assembly programming, emulator development, performance optimization, cycle-accurate timing calculations, and understanding the behavioral differences between Z80 and R800 processors in MSX environments."
|
|
16
16
|
},
|
|
17
17
|
{
|
|
18
|
-
"title": "
|
|
18
|
+
"title": "Z80 Undocumented Opcodes",
|
|
19
19
|
"uri": "msxdocs://processors/z80-undocumented",
|
|
20
|
-
"external_url": "
|
|
21
|
-
"description": "
|
|
20
|
+
"external_url": "https://www.cpcwiki.eu/index.php/Z80_-_undocumented_opcodes",
|
|
21
|
+
"description": "Reference for Z80 undocumented opcodes, covering the SLL (CB prefix) shift instruction, access to the hidden 8-bit index sub-registers IXH, IXL, IYH, IYL via DD/FD prefixes, and duplicate/unofficial ED-prefix instructions. Useful for advanced Z80 assembly programming where extra registers or non-standard shifts provide performance benefits."
|
|
22
22
|
}
|
|
23
23
|
]
|
|
24
24
|
}
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
# Z80 - undocumented opcodes
|
|
2
|
+
|
|
3
|
+
The Z80 CPU contains several undocumented opcodes, which can be quite helpful sometimes. The most useful undocumented opcodes are probably these ones, which split up the 16bit index registers IX and IY in 8bit registers called IXL,IXH,IYL and IYH.
|
|
4
|
+
|
|
5
|
+
Please note, that many Z80 successors like the Z180 are NOT able to execute some of the following opcodes properly.
|
|
6
|
+
|
|
7
|
+
This is just an overview. Parts of this article have been copied from the ["The Undocumented Z80 Documented"](http://www.myquest.nl/z80undocumented/) originally by Sean Young and currently maintained by Jan Wilmans, which is one of the most comprehensive descriptions around.
|
|
8
|
+
|
|
9
|
+
## CB prefix
|
|
10
|
+
|
|
11
|
+
Of the 247 opcodes that use the prefix &CB, the block &CB &30 to &CB &37 is undocumented officially. These commands shift the operand register left and set its lowest bit to 1.
|
|
12
|
+
|
|
13
|
+
This is in contrast to `SRL` (Shift Right Logical), which shifts right and clears the highest bit. Some believe these opcodes were supposed to be Shift Left Logical but that the setting of the lowest bit represents a bug in the Z80, claiming this is why the opcodes are undocumented. Others call the opcodes `SLIA`, for Shift Left Inverted Arithmetic.
|
|
14
|
+
|
|
15
|
+
Regardless of the story behind this operation, its effective result is `register = (register * 2) + 1`, something that does have its uses and has been employed in various programming contexts for that reason.
|
|
16
|
+
|
|
17
|
+
```
|
|
18
|
+
CB30 SLL B
|
|
19
|
+
CB31 SLL C
|
|
20
|
+
CB32 SLL D
|
|
21
|
+
CB33 SLL E
|
|
22
|
+
CB34 SLL H
|
|
23
|
+
CB35 SLL L
|
|
24
|
+
CB36 SLL (HL)
|
|
25
|
+
CB37 SLL A
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## DD and FD prefixes
|
|
29
|
+
|
|
30
|
+
The &DD or &FD prefixes are documented as causing operations using the 16-bit register HL to instead work with either of the 16-bit indexing registers IX or IY; if the operations access a memory location (i.e. normally `LD A,(HL)`, etc.), the opcodes must additionally include an extra byte that specifies a signed displacement (-128 to +127) from IX/IY.
|
|
31
|
+
|
|
32
|
+
However, Zilog have not documented the fact that these prefixes also affect opcodes that usually refer to the 8-bit components of HL, i.e. H and L. Thus, one gains access to the additional registers IXH, IXL, IYH, and IYL, for almost all commands that normally use H or L. It is even possible to do things like `LD IXH,IXL` (although you cannot combine IX and IY in the same instruction, for obvious reasons). These registers can be useful in routines that must process and/or store a lot of numbers. Thankfully, they are not as slow as their 16-bit counterparts: whereas access to (IX+d) is usually slower by 3 NOPs than the equivalent operation upon (HL), using the 8-bit components is (like `PUSH IX`, etc.) only 1 `NOP` slower, and this is only due to the need to parse the prefixing byte.
|
|
33
|
+
|
|
34
|
+
```
|
|
35
|
+
DB #DD:LD H,A --> LD IXH,A
|
|
36
|
+
DB #FD:LD B,L --> LD B,IYL
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
> **Note:** These registers are called LX, LY, HX, and HY by WinAPE's debugger, although its assembler uses the names given above.
|
|
40
|
+
|
|
41
|
+
## ED prefix
|
|
42
|
+
|
|
43
|
+
There are a number of undocumented EDxx instructions, of which most are duplicates of documented instructions. Any instruction not listed has no effect (same behaviour as 2 `NOP` instructions).
|
|
44
|
+
|
|
45
|
+
The complete list except for the block instructions:
|
|
46
|
+
|
|
47
|
+
```
|
|
48
|
+
ED40 IN B,(C) ED60 IN H,(C)
|
|
49
|
+
ED41 OUT (C),B ED61 OUT (C),H
|
|
50
|
+
ED42 SBC HL,BC ED62 SBC HL,HL
|
|
51
|
+
ED43 LD (nn),BC ED63 LD (nn),HL
|
|
52
|
+
ED44 NEG ED64 NEG *
|
|
53
|
+
ED45 RETN ED65 RETN *
|
|
54
|
+
ED46 IM 0 ED66 IM 0 *
|
|
55
|
+
ED47 LD I,A ED67 RRD
|
|
56
|
+
ED48 IN C,(C) ED68 IN L,(C)
|
|
57
|
+
ED49 OUT (C),C ED69 OUT (C),L
|
|
58
|
+
ED4A ADC HL,BC ED6A ADC HL,HL
|
|
59
|
+
ED4B LD BC,(nn) ED6B LD HL,(nn)
|
|
60
|
+
ED4C NEG * ED6C NEG *
|
|
61
|
+
ED4D RETI ED6D RETN *
|
|
62
|
+
ED4E IM 0 * ED6E IM 0 *
|
|
63
|
+
ED4F LD R,A ED6F RLD
|
|
64
|
+
ED50 IN D,(C) ED70 IN (C) / IN F,(C) *
|
|
65
|
+
ED51 OUT (C),D ED71 OUT (C),0 *
|
|
66
|
+
ED52 SBC HL,DE ED72 SBC HL,SP
|
|
67
|
+
ED53 LD (nn),DE ED73 LD (nn),SP
|
|
68
|
+
ED54 NEG * ED74 NEG *
|
|
69
|
+
ED55 RETN * ED75 RETN *
|
|
70
|
+
ED56 IM 1 ED76 IM 1 *
|
|
71
|
+
ED57 LD A,I ED77 NOP *
|
|
72
|
+
ED58 IN E,(C) ED78 IN A,(C)
|
|
73
|
+
ED59 OUT (C),E ED79 OUT (C),A
|
|
74
|
+
ED5A ADC HL,DE ED7A ADC HL,SP
|
|
75
|
+
ED5B LD DE,(nn) ED7B LD SP,(nn)
|
|
76
|
+
ED5C NEG * ED7C NEG *
|
|
77
|
+
ED5D RETN * ED7D RETN *
|
|
78
|
+
ED5E IM 2 ED7E IM 2 *
|
|
79
|
+
ED5F LD A,R ED7F NOP *
|
|
80
|
+
* = undocumented opcodes
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
## DDCB prefix
|
|
84
|
+
|
|
85
|
+
The undocumented DDCB instructions store the result (if any) of the operation in one of the seven all-purpose registers, which one depends on the lower 3 bits of the last byte of the opcode (not operand, so not the offset).
|
|
86
|
+
```
|
|
87
|
+
000 B
|
|
88
|
+
001 C
|
|
89
|
+
010 D
|
|
90
|
+
011 E
|
|
91
|
+
100 H
|
|
92
|
+
101 L
|
|
93
|
+
110 (none: documented opcode)
|
|
94
|
+
111 A
|
|
95
|
+
```
|
|
96
|
+
The documented DDCB0106 is `RLC (IX+01h)`. So, clear the lower three bits (DDCB0100) and something is done to register B. The result of the `RLC` (which is stored in (IX+01h)) is now also stored in register B. Effectively, it does the following:
|
|
97
|
+
```
|
|
98
|
+
LD B,(IX+01h)
|
|
99
|
+
RLC B
|
|
100
|
+
LD (IX+01h),B
|
|
101
|
+
```
|
|
102
|
+
So you get double value for money. The result is stored in B and (IX+01h). The most common notation is: `RLC (IX+01h),B`
|
|
103
|
+
|
|
104
|
+
I’ve once seen this notation:
|
|
105
|
+
```
|
|
106
|
+
RLC (IX+01h)
|
|
107
|
+
LD B,(IX+01h)
|
|
108
|
+
```
|
|
109
|
+
That’s not correct: B contains the rotated value, even if (IX+01h) points to ROM. The DDCB `SET` and `RES` instructions do the same thing as the shift/rotate instructions:
|
|
110
|
+
```
|
|
111
|
+
DDCB10C0 SET 0,(IX+10h),B
|
|
112
|
+
DDCB10C1 SET 0,(IX+10h),C
|
|
113
|
+
DDCB10C2 SET 0,(IX+10h),D
|
|
114
|
+
DDCB10C3 SET 0,(IX+10h),E
|
|
115
|
+
DDCB10C4 SET 0,(IX+10h),H
|
|
116
|
+
DDCB10C5 SET 0,(IX+10h),L
|
|
117
|
+
DDCB10C6 SET 0,(IX+10h) - documented instruction
|
|
118
|
+
DDCB10C7 SET 0,(IX+10h),A
|
|
119
|
+
```
|
|
120
|
+
So for example with the last instruction, the value of (IX+10h) with bit 0 set is also stored in register A.
|
|
121
|
+
|
|
122
|
+
The DDCB `BIT` instructions do not store any value; they merely test a bit. That’s why the undocumented DDCB `BIT` instructions are no different from the official ones:
|
|
123
|
+
```
|
|
124
|
+
DDCB d 78 BIT 7,(IX+d)
|
|
125
|
+
DDCB d 79 BIT 7,(IX+d)
|
|
126
|
+
DDCB d 7A BIT 7,(IX+d)
|
|
127
|
+
DDCB d 7B BIT 7,(IX+d)
|
|
128
|
+
DDCB d 7C BIT 7,(IX+d)
|
|
129
|
+
DDCB d 7D BIT 7,(IX+d)
|
|
130
|
+
DDCB d 7E BIT 7,(IX+d) - documented instruction
|
|
131
|
+
DDCB d 7F BIT 7,(IX+d)
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
## FDCB prefix
|
|
135
|
+
|
|
136
|
+
Same as for the DDCB prefix, though IY is used instead of IX.
|
|
137
|
+
|
|
138
|
+
## Web links
|
|
139
|
+
|
|
140
|
+
* ["The Undocumented Z80 Documented" by Sean Young Version 0.91, 18th September, 2005](http://www.myquest.nl/z80undocumented/z80-documented-v0.91.pdf) at [Jan Wilmans' Website](http://www.myquest.nl/z80undocumented/)
|
|
141
|
+
* [Short information about the internal "MEMPTR" 16bit register of the Z80 and its influence on the F-Register)](http://www.grimware.org/lib/exe/fetch.php/documentations/devices/z80/z80.memptr.eng.txt)
|