Re: Z-80 code question about a loop that depends on the contents of the refresh register

2016-12-30 Thread Maciej W. Rozycki
On Wed, 14 Dec 2016, Tony Duell wrote: > What I need to do is find exactly how the flags are set by the > LD A,R It's been long since I did anything with the Z80, but offhand all flags are set as with ALU operations according to the value loaded into the accumulator (same with LD A,I, but not

Re: Z-80 code question about a loop that depends on the contents of the refresh register

2016-12-15 Thread allison
On 12/15/2016 02:12 AM, Ethan Dicks wrote: > On Wed, Dec 14, 2016 at 2:08 AM, Alexis Kotlowy > wrote: >> On 14/12/2016 09:19, Ethan Dicks wrote: >>> So far, this loop hangs on all three emulators I've tried - simh's >>> altairz80, simcpm010 for AmigaDOS, and EMUZ80 for Raspberry Pi... >> Have you

Re: Z-80 code question about a loop that depends on the contents of the refresh register

2016-12-14 Thread Ethan Dicks
On Wed, Dec 14, 2016 at 2:08 AM, Alexis Kotlowy wrote: > On 14/12/2016 09:19, Ethan Dicks wrote: >> So far, this loop hangs on all three emulators I've tried - simh's >> altairz80, simcpm010 for AmigaDOS, and EMUZ80 for Raspberry Pi... > > Have you tried running it on ZEMU? (Windows only unfortuna

Re: Z-80 code question about a loop that depends on the contents of the refresh register

2016-12-14 Thread allison
On 12/14/16 11:33 AM, Ethan Dicks wrote: On Wed, Dec 14, 2016 at 2:08 AM, Alexis Kotlowy wrote: On 14/12/2016 09:19, Ethan Dicks wrote: So far, this loop hangs on all three emulators I've tried - simh's altairz80, simcpm010 for AmigaDOS, and EMUZ80 for Raspberry Pi. I'm guessing none of the

Re: Z-80 code question about a loop that depends on the contents of the refresh register

2016-12-14 Thread Ethan Dicks
On Wed, Dec 14, 2016 at 4:26 PM, allison wrote: >>> On 14/12/2016 09:19, Ethan Dicks wrote: So far, this loop hangs on all three emulators I've tried - simh's altairz80, simcpm010 for AmigaDOS, and EMUZ80 for Raspberry Pi. I'm guessing none of these environments emulate spec

Re: Z-80 code question about a loop that depends on the contents of the refresh register

2016-12-14 Thread Tony Duell
>> I can't find any information on what the MSB is set to when the >> accumulator is loaded with R, and what the Sign flag is set to. The >> datasheet says the Sign and Zero flags are changed by the instruction. >> If either of these flags are set, the routine enters an infinite loop. > > Tony Duel

Re: Z-80 code question about a loop that depends on the contents of the refresh register

2016-12-14 Thread Ethan Dicks
On Wed, Dec 14, 2016 at 2:08 AM, Alexis Kotlowy wrote: > On 14/12/2016 09:19, Ethan Dicks wrote: >> So far, this loop hangs on all three emulators I've tried - simh's >> altairz80, simcpm010 for AmigaDOS, and EMUZ80 for Raspberry Pi. I'm >> guessing none of these environments emulate specific be

Re: Z-80 code question about a loop that depends on the contents of the refresh register

2016-12-14 Thread Alexis Kotlowy
On 14/12/2016 09:19, Ethan Dicks wrote: Hi, All, So far, this loop hangs on all three emulators I've tried - simh's altairz80, simcpm010 for AmigaDOS, and EMUZ80 for Raspberry Pi. I'm guessing none of these environments emulate specific behavior of the Refresh register? Does anyone have a

Re: Z-80 code question about a loop that depends on the contents of the refresh register

2016-12-13 Thread Tony Duell
On Tue, Dec 13, 2016 at 10:49 PM, Ethan Dicks wrote: > Hi, All, > > I'm disassembling a vintage program and ran across this bit of code > that is causing emulators to hang... > > MYSUB: > LD A,R > JP M, MYSUB > JR Z, MYSUB > CP 0x65 > RET M > LD A, 0x32 > RET > > > I know plenty of 8

Re: Z-80 code question about a loop that depends on the contents of the refresh register

2016-12-13 Thread Ethan Dicks
On Tue, Dec 13, 2016 at 5:51 PM, Ethan Dicks wrote: > On Tue, Dec 13, 2016 at 5:49 PM, Ethan Dicks wrote: >> I'm disassembling a vintage program... >> >> MYSUB: >> LD A,R... I'm now thinking this is the RNG which is supposed to return a number from 0-100 in most cases, for calculating probabil

Z-80 code question about a loop that depends on the contents of the refresh register

2016-12-13 Thread Ethan Dicks
Hi, All, I'm disassembling a vintage program and ran across this bit of code that is causing emulators to hang... MYSUB: LD A,R JP M, MYSUB JR Z, MYSUB CP 0x65 RET M LD A, 0x32 RET I know plenty of 8-bit assembler (mostly 6502, 1802, and a couple others), but I'm by no means exper

Re: Z-80 code question about a loop that depends on the contents of the refresh register

2016-12-13 Thread Ethan Dicks
On Tue, Dec 13, 2016 at 5:49 PM, Ethan Dicks wrote: > I'm disassembling a vintage program... > > MYSUB: > LD A,R... > > So far, this loop hangs on all three emulators I've tried - simh's > altairz80, simcpm010 for AmigaDOS, and EMUZ80 for Raspberry Pi. I'm > guessing none of these environments