Questions tagged [z80]

The Z80 is an 8-bit CPU designed by Zilog to be a backwards-compatible enhancement of the Intel 8080. It has been in continuous wide use since 1976 and was formerly popular in microcomputers, such as models of the Tandy (Radio Shack) TRS-80 microcomputer and their derivatives, the ZX Spectrum and the MSX standard. Presently its main use is in embedded systems.

Resources on the Internet:

The Zilog Z80 CPU User Manual

Rodnay Zaks wrote a classic book on the Z80: Programming the Z80

See also:

182 questions
2
votes
2 answers

Using hexcode in ti basic program on ti 84+

Recently I have been reading about different hex codes that do cool stuff like Archiving something inside a program among other things. The way I try to incorporate these into my (ti 84+)basic coding is by using a separate program and "calling it"( …
Moshe Goldberg
  • 461
  • 2
  • 15
2
votes
2 answers

ti-83+ assembly pixel moving program not working

I made this code to move a pixel around in the screen area using the arrow keys and the enter button to stop the program. It does seem to work better with all the suggestions so far, but its placement of the pixel is messed up. #include …
pi_squared
  • 91
  • 6
2
votes
4 answers

how can a label in assembly know its runtime address?

I am learning assembly (z80 and x86) and am now coming to grips with building binaries using an assembler. How is it possible to use labels with absolute (as opposed to relative) addresses? From what I understand, an assembler will translate a label…
Rick
  • 8,366
  • 8
  • 47
  • 76
2
votes
2 answers

How do I determine the start and end of instructions in an object file?

So, I've been trying to write an emulator, or at least understand how stuff works. I have a decent grasp of assembly, particularly z80 and x86, but I've never really understood how an object file (or in my case, a .gb ROM file) indicates the start…
Christopher Wirt
  • 1,108
  • 1
  • 10
  • 21
2
votes
5 answers

Looking for programs on audio tape/cassette containing programs for Sinclair ZX80 PC?

OK, so back before ice age, I recall having a Sinclair ZX80 PC (with TV as a display, and a cassette tape player as storage device). Obviously, the programs on cassette tapes made a very distinct sound (er... noise) when playing the tape... I was…
DVK
  • 126,886
  • 32
  • 213
  • 327
2
votes
1 answer

GameBoy ISA (Writing an Emulator)

I am working on a GameBoy emulator in C. Right now I am working on the CPU.c file and I am a little confused on some instructions that I see listed here: http://realboyemulator.files.wordpress.com/2013/01/gbcpuman.pdf If you refer to page 66 of the…
Bubo
  • 768
  • 4
  • 18
  • 34
2
votes
3 answers

Z80 Instruction Register Size

I am writing a Z80 emulator and I am confused as to how large the instruction register is. In the Z80 manual it states that the instructions are from 1 to 4 bytes long, am I given to assume that the Z80 has a 32Bit instruction register? If not then…
lilroo
  • 2,928
  • 7
  • 25
  • 34
2
votes
2 answers

How do I convert a hexadecimal offset to a two-byte pointer in VB.NET?

I'm working on a specialty hexadecimal editor that includes a Z80 two-byte pointer converter. The mathematics behind the conversion are like so: Take the offset that you wish to point to. Take the last four digits of the offset, and cut off the…
AlexTheRose
  • 125
  • 1
  • 1
  • 8
2
votes
3 answers

sdcc not accepting code

I have an issue with SDCC. My code (which I am attempting to port from another compiler) uses structs with flexible array members. However, when I try to compile the following code: /** header of string list */ typedef struct { int nCount; …
George Hilliard
  • 15,402
  • 9
  • 58
  • 96
2
votes
1 answer

m80 macro assembler org directive

I am using Microsoft's ancient m80 macro assembler and haven't run into any major problems for a while. However, I am now trying to use the ORG directive with a hex number and it fails. This works: ;; Tell the assembler that this is z80 code …
Andrew J. Brehm
  • 4,448
  • 8
  • 45
  • 70
2
votes
1 answer

How to output current value of flags register Z80?

I want to debug my program, but I need to know the value of the flags register, but im stuck figuring out the instructions to do so. For z80 processor. [My only guess is to use jp *, nn and then set bits in register A depending on the jumps to test…
2
votes
1 answer

z80 assembler issues with "IM 1" instruction

Code STACK .EQU 2099H .ORG 0000H ld SP, STACK jp 2000H .ORG 0038H jp service_routine .ORG 2000H EI IM 1 ; <------- THIS LINE LD A, 00H LOOP: ADD A, 00H jp z, LOOP service_routine: DI ld A, 55H …
1
vote
3 answers

Z80 Asm - Hex How to Create a String

I prefer to code on my calculator in hex. I know my opcodes and what not, but i'm not sure how to create a string "hello" in register HL. Cany you help? I have googled it, but it's hard to find an answer because most people use compilers that handle…
John B
  • 23
  • 3
1
vote
1 answer

How to read elements from a DEFB sequentially in Z80 Assembly language and then use the value retrieved at each iteration

I've been learning Z80 Assembly language, and I'm a bit stumped with this. The values in the DEFB represent musical pitches. The program creates a sequential loop, using the A register, starting at 0, and it should read the nth element of the DEFB,…
Davy C
  • 639
  • 5
  • 16
1
vote
1 answer

Z80 Assembly for ZX Spectrum how to use a variable as PRINT AT coordinates

I've been messing around with the ZX Spin emulator and Assembly language. I used to write BASIC games back in the 80s, and always wanted to learn machine code, but too stupid as a 12 year old kid. I've been putting this simple code together that…
Davy C
  • 639
  • 5
  • 16