Code Monkey home page Code Monkey logo

Comments (4)

ped7g avatar ped7g commented on May 25, 2024

The ex bc,hl could be also push hl : ld l,c : ld h,b : pop bc which is 1 byte longer but -11T faster and in case you have single spare register you can write it as 6x ld to have 24T total instead of 29T (or yours 40T).

I feel a bit dubious about these, but I guess most of the fake instruction already are dubious, so that's not a good counter argument. I'm more like surprised you are even missing these, that was unexpected for me. :) (how comes, did you run into the need of this in some real project?)

But I guess there's little harm to add them, probably in the faster-but-longer variant doing ld where possible? If anyone else has opinion/idea about these, please share, so it's not just me vs OP.

from sjasmplus.

sromeroi avatar sromeroi commented on May 25, 2024

Thanks for you quick response.

I just came across those combinations while reading/watching Z80 ASM tutorials, and found out that they were not available among the existing Fake Instructions.

I agree about your -11T+1b combination, it's a better tradeof to save 11 t-states for a single byte. Thanks!

from sjasmplus.

ped7g avatar ped7g commented on May 25, 2024

So I have been pondering about this for a while, also discussed it with other users and contributors, and these ex feels not "attractive enough" for us to add them, we can't recall any good use cases from our experience of writing ZX SW, usually when you long for ex bc,hl the answer is to write the code in different way to not need it.

The tricky part is that ex de,hl is only one byte and only 4T (as it's technically just flipping single bit inside CPU, not doing much work, so for anyone not familiar with Z80 ISA having ex bc,hl on hand would look similarly cheap, while it's lot more costly in the form of fake instruction. And it's using also stack which is another "not attractive" feature.

If you would go through current list of fake instructions, you could easily find few more questionable, which could be rejected by similar reasoning, so please understand this is rather subjective ruling, but I don't see a way how to make this process more objective. I hope you will understand it as it is. I'm definitely glad you did raise this, could be still helpful info for people who would look for it.

In the end, it's reasonable easy to add your own macro if you really need instruction like this, but I would be surprised if you would need this often, we were discussing it among people who delivered tens+ ZX projects over decades and nobody was able to recall good use case.

from sjasmplus.

sromeroi avatar sromeroi commented on May 25, 2024

Thanks anyway for considering my request.

from sjasmplus.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.