test for bit n,(hl)
ZXNet echo conference «zxnet.pc»
From Stanislav Lomakin → To All 27 February 2006
Hello, Vladimir Kladov
thanks to Wlodek and CHRV we now have something to think about ;)
took part in testing:
Z0840008,T34VM1,KR1858VM3,Z084C0010,KR1858VM1 from CHRV,
Wlodek's pentagon with an unknown crystal (however, not one of
above)
For relatives Z084C00010, Z0840008 everything is the same.
the remaining crystals differ either in memptr or in other flags.
so, memptr, the internal register of z80, from the high byte of which 3 and 5 are taken
F bits when executing opcode bit n,(hl). according to the test results
the following picture emerges (here points that coincide with
nocash-doc, minus - non-matching or missing, squiggle - neither,
no matter what):
+LD A,(addr)
memptr=addr+1
~LD(addr),A
for Z0840008, Z084C00010, KR1858VM3: memptr=A*0x100
on the Wlodek Pentagon, T34VM1, KR1858VM1: memptr=0
~LD (addr), rp; LD rp,(addr)
memptr=addr+1
+EX (SP),rp
memptr=rp
+ ADD/ADC/SBC rp,rp2
memptr=rp+1
+ RLD/RRD
memptr=HL+1
+ JP/JR/CALL/DJNZ/RET/RETI/?RST? addr (on transition)
memptr=addr
+ JP/CALL for negative condition
memptr=addr
+ IN A,(port)
memptr=full_port_address(A*0x100+port) + 1
- OUT (port),A
for Z0840008, Z084C00010, KR1858VM3: memptr=full_port_address(A*0x100+port)
for Wlodek's pentagon, T34VM1, KR1858VM1: memptr=0
+ IN A(C)
memptr=BC+1
+ OUT (C),A
memptr=BC+1
- CPI/CPD/CPIR/CPDRthe most incomprehensible thing... sometimes memptr changes, it is unclear on what basis.
[in this test all cpi are reset to zero memptr, cpd are left as is, all cpir
change it is not clear how (the first two are reset, the rest, which at BC = 5
set the 3rd bit), the first two cpdr are left as is, the next three (BC=5)
set the 3rd bit]
- INI/INIR/OTI/OTIR/IND/INDR/OUTD/OTDR
or just memptr=0, or something more cunning, an investigation is underway...
- interruptions:
as during a normal transition. that is, memptr=address of the interrupt handler
+ any instruction with (IX/IY+d)
memptr=IX/IY+d
Nothing suspicious was noticed behind the rest of the instructions.
I am attaching an archive with the test results and the test itself (source for sjasmplus,
messed up quickly and on the knee, I apologize :)
File: btest_n_res.zip http://zx.pk.ru/attachment.php?attachmentid=2694