Skip to main content
Commonmark migration
Source Link

I'm building my own Z80 computer but I'm having a very strange problem. Consider this code:

ld a,0xaa
out (00),a
jp a

That works as expected, outputting 0xaa on port 0x00. Now consider this code:

 ld a,0xaa
hello:
 out (00),a
 inc a
 jp hello

This outputs exactly 87 times to port 0x00, then it crashes. I took a look at the buses to see what's happening and it seems that it accesses incrementally addresses on memory when it's not needed. I read a year ago that this was a thing due to Z80's architecture, but the problem happens when this incremental access reaches 10000000(bin). This is what I see in the logic analyser:

analyzer

The increment is happening on address 3 4 5 6 7 and 8, and when the 8th modulates, iorq stops and the CPU does weird stuff. Can any one please help?


###EDIT:

EDIT:

I found the answer but if you have the same or similar issue, you should definitely read Spektre's and tofro's answers because they list a lot of very possible problems that could cause this.

I'm building my own Z80 computer but I'm having a very strange problem. Consider this code:

ld a,0xaa
out (00),a
jp a

That works as expected, outputting 0xaa on port 0x00. Now consider this code:

 ld a,0xaa
hello:
 out (00),a
 inc a
 jp hello

This outputs exactly 87 times to port 0x00, then it crashes. I took a look at the buses to see what's happening and it seems that it accesses incrementally addresses on memory when it's not needed. I read a year ago that this was a thing due to Z80's architecture, but the problem happens when this incremental access reaches 10000000(bin). This is what I see in the logic analyser:

analyzer

The increment is happening on address 3 4 5 6 7 and 8, and when the 8th modulates, iorq stops and the CPU does weird stuff. Can any one please help?


###EDIT:

I found the answer but if you have the same or similar issue, you should definitely read Spektre's and tofro's answers because they list a lot of very possible problems that could cause this.

I'm building my own Z80 computer but I'm having a very strange problem. Consider this code:

ld a,0xaa
out (00),a
jp a

That works as expected, outputting 0xaa on port 0x00. Now consider this code:

 ld a,0xaa
hello:
 out (00),a
 inc a
 jp hello

This outputs exactly 87 times to port 0x00, then it crashes. I took a look at the buses to see what's happening and it seems that it accesses incrementally addresses on memory when it's not needed. I read a year ago that this was a thing due to Z80's architecture, but the problem happens when this incremental access reaches 10000000(bin). This is what I see in the logic analyser:

analyzer

The increment is happening on address 3 4 5 6 7 and 8, and when the 8th modulates, iorq stops and the CPU does weird stuff. Can any one please help?


EDIT:

I found the answer but if you have the same or similar issue, you should definitely read Spektre's and tofro's answers because they list a lot of very possible problems that could cause this.

So i'mI'm building my own z80Z80 computer but i'mI'm having a very strange problem. thisConsider this code:

ld a,0xaa
out (00),a
jp a

That works as expected, outputting 0xaa on port 0x00 but. Now consider this code:

 ld a,0xaa
hello:
 out (00),a
 inc a
 jp hello

This outputs exactly 87 times into port 0x00, then it crashes. iI took a look inat the buses to see what's happening and it seems that it accesses incrementally addresses on memory when it's not needed. iI read a year ago that this was a thing due to z80'sZ80's architecture, but the problem happens when this incremental access reaches 10000000(bin).this This is the what iI see in the logic analizeranalyser:

analyzer

theThe increment is happening on address 3 4 5 6 7 and 8.and, and when the 8th modulates, iorq stops and the cpuCPU does weird stuff. can Can any one please help?

 

EDIT: ###EDIT:

iI found the answer but if you have the same or similar issue, you should definitely read Spektre's and tofro's answers because they listslist a lot of very possible problems that could cause this.

So i'm building my own z80 computer but i'm having a very strange problem. this code

ld a,0xaa
out (00),a
jp a

works as expected, outputting 0xaa on port 0x00 but this code:

 ld a,0xaa
hello:
 out (00),a
 inc a
 jp hello

outputs exactly 87 times in 0x00, then it crashes. i took a look in the buses to see what's happening and it seems that it accesses incrementally addresses on memory when it's not needed. i read a year ago that this was a thing due to z80's architecture but the problem happens when this incremental access reaches 10000000(bin).this is the what i see in the logic analizer

analyzer

the increment is happening on address 3 4 5 6 7 and 8.and when the 8th modulates, iorq stops and the cpu does weird stuff. can any one please help?

EDIT:

i found the answer but if you have the same or similar issue, you should definitely read Spektre's and tofro's answers because they lists a lot of very possible problems that could cause this

I'm building my own Z80 computer but I'm having a very strange problem. Consider this code:

ld a,0xaa
out (00),a
jp a

That works as expected, outputting 0xaa on port 0x00. Now consider this code:

 ld a,0xaa
hello:
 out (00),a
 inc a
 jp hello

This outputs exactly 87 times to port 0x00, then it crashes. I took a look at the buses to see what's happening and it seems that it accesses incrementally addresses on memory when it's not needed. I read a year ago that this was a thing due to Z80's architecture, but the problem happens when this incremental access reaches 10000000(bin). This is what I see in the logic analyser:

analyzer

The increment is happening on address 3 4 5 6 7 and 8, and when the 8th modulates, iorq stops and the CPU does weird stuff. Can any one please help?

 

###EDIT:

I found the answer but if you have the same or similar issue, you should definitely read Spektre's and tofro's answers because they list a lot of very possible problems that could cause this.

deleted 34 characters in body
Source Link
C32
  • 394
  • 2
  • 12

So i'm building my own z80 computer but i'm having a very strange problem. this code

ld a,0xaa
out (00),a
jp a

works as expected, outputting 0xaa on port 0x00 but this code:

 ld a,0xaa
hello:
 out (00),a
 inc a
 jp hello

outputs exactly 87 times in 0x00, then it crashes. i took a look in the buses to see what's happening and it seems that it accesses incrementally addresses on memory when it's not needed. i read a year ago that this was a thing due to z80's architecture but the problem happens when this incremental access reaches 10000000(bin).this is the what i see in the logic analizer

analyzer

the increment is happening on address 3 4 5 6 7 and 8.and when the 8th modulates, iorq stops and the cpu does weird stuff. can any one please help?

EDIT: 

i accepted tofro's answer because it was closer tofound the solutionanswer but if you have the same or similar issue, you should definitely read Spektre's awesome answerand tofro's answers because itthey lists a lot of very possible problems that could cause this

So i'm building my own z80 computer but i'm having a very strange problem. this code

ld a,0xaa
out (00),a
jp a

works as expected, outputting 0xaa on port 0x00 but this code:

 ld a,0xaa
hello:
 out (00),a
 inc a
 jp hello

outputs exactly 87 times in 0x00, then it crashes. i took a look in the buses to see what's happening and it seems that it accesses incrementally addresses on memory when it's not needed. i read a year ago that this was a thing due to z80's architecture but the problem happens when this incremental access reaches 10000000(bin).this is the what i see in the logic analizer

analyzer

the increment is happening on address 3 4 5 6 7 and 8.and when the 8th modulates, iorq stops and the cpu does weird stuff. can any one please help?

EDIT: i accepted tofro's answer because it was closer to the solution but if you have the same or similar issue, you should definitely read Spektre's awesome answer because it lists a lot of very possible problems that could cause this

So i'm building my own z80 computer but i'm having a very strange problem. this code

ld a,0xaa
out (00),a
jp a

works as expected, outputting 0xaa on port 0x00 but this code:

 ld a,0xaa
hello:
 out (00),a
 inc a
 jp hello

outputs exactly 87 times in 0x00, then it crashes. i took a look in the buses to see what's happening and it seems that it accesses incrementally addresses on memory when it's not needed. i read a year ago that this was a thing due to z80's architecture but the problem happens when this incremental access reaches 10000000(bin).this is the what i see in the logic analizer

analyzer

the increment is happening on address 3 4 5 6 7 and 8.and when the 8th modulates, iorq stops and the cpu does weird stuff. can any one please help?

EDIT: 

i found the answer but if you have the same or similar issue, you should definitely read Spektre's and tofro's answers because they lists a lot of very possible problems that could cause this

added 8 characters in body
Source Link
C32
  • 394
  • 2
  • 12
Loading
added 239 characters in body
Source Link
C32
  • 394
  • 2
  • 12
Loading
deleted 1 character in body
Source Link
C32
  • 394
  • 2
  • 12
Loading
deleted 2 characters in body
Source Link
C32
  • 394
  • 2
  • 12
Loading
Source Link
C32
  • 394
  • 2
  • 12
Loading