RSS Amplifier

Recent Questions - Retrocomputing Stack Exchange · Jan 7, 2021

How can a Z80 assembly program find out the address stored in the SP register?

0
Sign in to vote or save

This page did not load. You can still read it on the original site — the toolbar below keeps your place in the directory.

I'm wondering how to write a program in Z80 assembler that discovers the value stored in the SP register. From what I've seen, the only instructions that touch the SP register are: LD SP, HL/IX/IY EX (SP), HL/IX/IY PUSH / POP However, none of them seem to load the address stored in the SP register anywhere. Is there a way to do it?

I'm wondering how to write a program in Z80 assembler that discovers the value stored in the SP register.

From what I've seen, the only instructions that touch the SP register are:

  • LD SP, HL/IX/IY
  • EX (SP), HL/IX/IY
  • PUSH / POP

However, none of them seem to load the address stored in the SP register anywhere. Is there a way to do it?

Read on retrocomputing.stackexchange.com

Comments

Nothing yet. Say the first thing.

    Sign in to join the conversation.