🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.amstrad.8bit
Article #14

Re: Good free and open source Z80 emulation code?

#14
From: M.O.B. i L.
Date: Mon, 06 Dec 2010 21:03
76 lines
5199 bytes
Philip Kendall wrote:
> On 04/12/10 21:03, M.O.B. i L. wrote:
>>
>> This is LGPL and probably handles all undocumented instructions:
>> Filename: tilem0.975win32bin.zip
> 
> [ ... ]
> 
>> http://www.ticalc.org/archives/files/fileinfo/412/41292.html
> 
> Doesn't look to me like it does:
> 
> static opcode_fn opcode_fd_cb[256] = {
>         no_op_xx, no_op_xx, no_op_xx, no_op_xx, no_op_xx, no_op_xx,
> 
> All those opcodes have an effect.

You're probably right. I've found this page that explains what these 
opcodes should do: <http://www.z80.info/decoding.htm#ddcb>.

I thought it supported all Z80 instructions because one of the 
developers has made an assembler that runs on the calculator (TI-83 
Plus/TI-84 Plus/Silver Edition), that supported undocumented 
instructions (but perhaps not all): 
<http://www.ticalc.org/archives/files/fileinfo/431/43140.html>.

Here is a quote from the manual of the assembler:
"
*Z80 instructions*

Mimas supports all of the Z80 instructions, both documented and 
undocumented. For details of the documented instructions, see the 
official Z80 documentation.

For convenience, when setting, resetting, or testing a system flag, you 
can simply type the name of the flag (or select it from the System Flags 
menu), omitting the IY offset. For instance, SET textInverse will be 
automatically replaced with SET textInverse, (IY + textFlags).

The undocumented instructions are described below. Note, however, that 
undocumented instructions will not work on the TI-Nspire, so you should 
avoid using them in programs that are intended to be portable.

*IX/IY Half Registers*
     The upper and lower halves of the IX and IY registers can be 
manipulated independently, just as H and L can; these �half registers� 
are referred to as IXH, IXL, IYH, and IYL. Half registers can be used in 
all of the basic 8-bit operations (ADD, SUB, ADC, SBC, AND, OR, XOR, CP, 
INC, DEC), can have constant values loaded into them, and can be loaded 
to and from the A, B, C, D, and E registers.
*Shift Left Inverted*
     SLIA is similar to the documented SLA, except that the low bit of 
the result is set to 1 instead of 0. (SLIA arg has the same effect as 
SCF followed by RL arg.) SLIA can be used with any of the same arguments 
that can be used with SLA.
*Shift/Rotate/Set/Reset Bit with Copy*
     The instructions SLA, SRA, SLIA, SRL, RL, RLC, RR, and RRC can be 
used with two arguments, where the first is one of the registers B, C, 
D, E, H, L, and A, and the second is an indexed address (either (IX+n) 
or (IY+n).) The instructions SET and RES can be used with three 
arguments, where the first is a bit number, the second is a register, 
and the third is an indexed address. This means that a value is read 
from that indexed address, the appropriate operation is performed on 
that value, and the result is both written back to memory and also 
copied into the given register. For instance, SLA H,(IX+2) has the same 
effect as LD H,(IX+2) / SLA H / LD (IX+2),H. SET 3,H,(IX+2) has the same 
effect as LD H,(IX+2) / SET 3,H / LD (IX+2),H.
*Test-Only Input*
     IN (C) reads a byte from I/O port C, without storing it anywhere, 
but sets or clears the sign, zero, and parity flags according to the 
input value, just as the documented IN r,(C) instructions do. (IN (C) 
has essentially the same effect as PUSH BC / IN B,(C) / POP BC.)
*Zero Output*
     OUT (C),0 writes a zero byte to I/O port C. (OUT (C),0 has 
essentially the same effect as PUSH BC / LD B,0 / OUT (C),B / POP BC.)
"
Technical Details
Message-ID: <idjj3p$f9$1@news.eternal-september.org>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!feeder.news-service.com!85.214.198.2.MISMATCH!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail
References: <4c76a483$0$7656$9b4e6d93@newsspool1.arcor-online.net> <ideab2$m1n$1@news.eternal-september.org> <4cfc9399$0$2517$db0fefd9@news.zen.co.uk>

Show Full Headers
Complete Article Headers
X-Google-Thread: 104bef,4b5ff00851098528
X-Google-NewGroupId: yes
X-Google-Thread: 1056fb,4b5ff00851098528
X-Google-NewGroupId: yes
X-Google-Thread: f4600,4b5ff00851098528
X-Google-NewGroupId: yes
X-Google-Thread: ff992,879b49e4107bc48c,start
X-Google-NewGroupId: yes
X-Google-Attributes: gid1c41c1bad0,gid90a0fdbda9,gidb45012b10c,gid378b261f3f,domainid0,public,usenet
X-Google-Language: ENGLISH,CP1252
Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!feeder.news-service.com!85.214.198.2.MISMATCH!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail
From: "M.O.B. i L." <mikaelb@df.lth.se>
Newsgroups: comp.sys.amstrad.8bit,comp.sys.msx,comp.sys.sinclair,bit.listserv.calc-ti
Subject: Re: Good free and open source Z80 emulation code?
Date: Mon, 06 Dec 2010 22:03:52 +0100
Organization: Lund University, Sweden
Lines: 76
Message-ID: <idjj3p$f9$1@news.eternal-september.org>
References: <4c76a483$0$7656$9b4e6d93@newsspool1.arcor-online.net> <ideab2$m1n$1@news.eternal-september.org> <4cfc9399$0$2517$db0fefd9@news.zen.co.uk>
Mime-Version: 1.0
Content-Type: text/plain; charset=windows-1252; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Mon, 6 Dec 2010 21:03:53 +0000 (UTC)
Injection-Info: mx02.eternal-september.org; posting-host="btbnszkesoXscaVKq8T6QA";
 logging-data="489"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18bfZvASzNOx084gqzKpEr5"
User-Agent: Thunderbird 2.0.0.24 (Windows/20100228)
In-Reply-To: <4cfc9399$0$2517$db0fefd9@news.zen.co.uk>
Cancel-Lock: sha1:kC+bXBFdX2AZhRPeTd6nj8rXwSU=