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
0
votes
1 answer

gbz80 Sleep Cycle How To

I just can't figure out how to code a simple sleep/delay cycle in gbz80 "assembly" I must confess that my gbz80 knowledge virtually none, but I was thinking something like: ld bc,XXX call WaitCyclEx WaitCyclEx: ld bc,(&FF05) dec bc …
0
votes
1 answer

Rapid screen drawing in Z80 Assembler + BASIC on emulator

Following the instruction of Chapter 10 of First Steps in Z80 Assembly Language by Darryl Sloan: Firstly, we fill the screen with a BASIC program of random colored "hello" messages. The assembler code, as I understand it, is then able to copy that…
Ghoul Fool
  • 6,249
  • 10
  • 67
  • 125
0
votes
1 answer

Assembly's numeric variable modifies the previous one

While learning Z80 assembly I've go a strange behavior that after declaring 2 numeric variables the value of the first one gets a totally different value. Example: org 32768 ld bc,(score1) call 6683 ret score1 defb 15 score2 defb…
Alexey
  • 2,582
  • 3
  • 13
  • 31
0
votes
1 answer

i make a program in z80 PIO using conditional , but the result is different

Program to make output port B = FFH, if and only if input port A = 01H (another input then output is 00) Here my code: LD A, 4FH OUT (82H), A LD A, 0FH OUT (83H), A LOOP: IN A,(80H) CP 01H …
0
votes
1 answer

i am making z80 pio program , but i find some error with the code for JRNZ

if data input PORT A=08H then data output PORT B=0FH, and if the data input PORT A = 80H then data output PORT B = F0H , other than these the output PORT B = 00H Here is my code LD A, 4FH OUT (82H), A LD A, 0FH OUT…
0
votes
0 answers

fasmg: cannot execute binary file: Exec format error

I am trying to convert my ez80 program to .8xp for my ti 83 premium ce with fasmg and the ez80-lib but i got the following error when trying to compile : INCLUDE="include;include/fasmg-ez80" fasmg DragonLairTI.asm DragonLairTI.8xp /bin/sh:…
user14524761
0
votes
1 answer

Extracting LSB and MSB on Z80 Assembly

Lets say i have a data (15H) on memory 0040. My question is, how an I extract that most significant and least significant bit for further usage? I have lookup on the Z80 User manual and found nothing. Any help will be appreciated
Fahmi Jabbar
  • 329
  • 4
  • 12
0
votes
2 answers

How to shift the contents of a memory location left 1 bit to another memory using z80 assembly language

Example , left shifting 1 bit from location 1900H and store in location 1901H , and empty bit positions are filled with zero
谢RenS
  • 21
  • 2
0
votes
2 answers

Multiply 2 data 8-bit in z80 simulator assembly, there is an error "invalid argument of the instruction", what should i do?

LD BC,(1900H) LD B,8 LD DE,(1901H) LD D,0 LD HL,0 SRL C JR NC,NOADD ADD HL,DE SLA E RL D DEC B JP NZ,MULT LD (1902H),HL HALT .END Error messages: invalid argument of the instruction.…
谢RenS
  • 21
  • 2
0
votes
1 answer

When using z80 asm is there a difference between (HL) and (BC/DE)?

In the process of attempting to write assembly for my TI-84 PlusCE I came across an odd "bug". Consider the following code: #include "includes\ti84pce.inc" s_mem_start = saveSScreen .assume ADL=1 .org userMem-2 .db tExtTok,tAsm84CeCmp …
user197974
  • 229
  • 2
  • 6
0
votes
0 answers

Why can't I load byte A0h into z80 register?

Is there some upper limit on how big a byte I can load into a z80 register? Loading 9Fh works ok. Attempting to load A0h results in an assembler error message. I'm using the z80asm assembler on linux. $ cat load-test.asm ld a, 9Fh ;ok …
twisted
  • 742
  • 2
  • 11
  • 19
0
votes
2 answers

Z80 assembly push and pop a value

How I can use a value that has been stored into a register after N lines of code? For example I want to use the value that has been stored into bc later in INIT. I tried with push and pop but after the cp 2 instruction the program won't jump to…
gameloverr
  • 53
  • 1
  • 8
0
votes
0 answers

When should i draw the screen

I have a program that draws a section of ram to the screen and a program that manipulates the section of ram Would it be a better idea to either Draw the screen after the program is done manipulating data then draw the data. Create an interrupt to…
Nathaniel Smith
  • 106
  • 1
  • 9
0
votes
1 answer

TASM - unrecognized argument

I'm trying to write a small z80 program for a ti-84+ and TASM doesn't recognize my arguments for the OUT instruction. This should be the syntax for the OUT instruction, but TASM doesn't seem to recognize it. OUT ($10) , $05 Expected Result: no…
0
votes
1 answer

Understanding opcodes in Z80 emulator

I'm currently working with an Z80 processor emulator, as a beginner I found an example with values assigned to the memory in order to show "Hello World!". 1. 0x21, 0x0C, 0X00,// ld hl, 0008 2. 0x06, 0x0F, // ld b,0f 3. 0x7e, // ld a,(hl) 4. 0x23, //…
mraz
  • 195
  • 10