0

I'm using a Z80 "emulator" (Cedar Logic) in Windows, and I would like to develop a program using this chip that takes in an array of 15 numbers, and shows me the max and min of them. I do not know much about machine code.

Any help is much appreciated, even a little hint as to what the correct approach is.

Konamiman
  • 49,681
  • 17
  • 108
  • 138
Lorenzo Battilocchi
  • 862
  • 1
  • 10
  • 26
  • 1
    I didn't know what is Cedar-logic, so I felt lucky on google: *"By using Cedar-Logic’s simulated wires, the Z-80 chip fetches and executes instruction op-codes and stores and loads data from a Cedar-Logic simulated RAM chip."* => looks like some particular kind of simulator, delve into its documentation, how to work with its simulated RAM. Looks like the simulated RAM is shared with Z80 addressing space, so you have to put the code together with data, like in any other Z80 machine. Pick some Z80 assembler (has it built-in one?), and compile some example sources first, learn to debug it. – Ped7g Apr 05 '17 at 17:21
  • 2
    But if you are particularly interested into Z80 assembly programming, maybe you should pick some full machine, like ZX Spectrum (which has great emulators, assemblers, and everything is documented, plus you can find some assembly sources, mostly of graphical effect and similar). As this thing looks like you have to not only somehow program up that Z80 chip, but also connect it to signal wires in meaningful way (ie build your own machine) first. I would probably learn these things separately, it's two completely different topics (electronics vs assembly programming). – Ped7g Apr 05 '17 at 17:23
  • yes, as far as z80 programming goes, use some form or flavor of instruction set simulator, this appears to go beyond that with some circuit design and simulation. save that until after you are well versed in z80 programming, and tools to create z80 programs to feed those emulators or that circuit thing (or a real z80). Google z80 instruction set simulator and then choose from the very long list of possibilities. sdcc supports z80 I think if not just get (or write) an assembler. – old_timer Apr 05 '17 at 17:56
  • 2
    I wrote an example in Z80 assembly to search through 15 bytes array and store min/max back into memory https://pastebin.com/fP3dq9Dx (can be compiled for example by http://clrhome.org/asm/ online assembler), but I was not able to simply load it into some nice z80 simulator including debugger, so I didn't verify if it works (it should, I have wrote enough Z80 assembly on paper 25 years ago to not completely forget it). I have no idea how to get this into Cedar Logic memory, maybe it can load binary files from disk? – Ped7g Apr 05 '17 at 18:24
  • @Ped7g Thank you very much! – Lorenzo Battilocchi Apr 22 '17 at 18:47

0 Answers0