Giter VIP home page Giter VIP logo

Comments (5)

ISSOtm avatar ISSOtm commented on July 19, 2024

The brackets are part of the instruction's syntax, so no prior knowledge is assumed: they're explained by the instruction's description.

from rgbds-www.

brainard52 avatar brainard52 commented on July 19, 2024

I'll use LD [HL], r8 as an example.

"Store value in register r8 into byte pointed to by register HL."

This says that HL holds an address. It implies that the brackets de-reference the address, but this is never explicitly explained anywhere. This leaves ambiguity and room for confusion for somebody who is expected to read this but doesn't have prior knowledge of the specifics of the syntax presented.

from rgbds-www.

ISSOtm avatar ISSOtm commented on July 19, 2024

I think this is a problem of the document's intent. I believe gbz80(7) is intended as an instruction quick reference, i.e. it's intended for programmers already seasoned to RGBASM's syntax, but needing a quick refresher on what a given instruction does.

This issue seems to imply the document should instead be a learning resource; I disagree with that, as there is actually nothing fully explaining RGBASM's syntax, even rgbasm(5) omits some basic concepts.
They are only meant as manual pages, not outright tutorials; and while there is definitely a lack of those, I don't think RGBDS' online docs are a good fit for that.

from rgbds-www.

Rangi42 avatar Rangi42 commented on July 19, 2024

It doesn't imply that brackets dereference the address: it outright states that for this particular instruction, LD [HL], r8 "store[s] value in register r8 into byte pointed to by register HL".

It's true that every instruction follows that syntax pattern of using brackets to indicate a dereference, but it didn't have to be that way: they could have arbitrarily required LD A, *BC and LD A, DEREF DE for those particular opcodes.

I agree that things like "brackets indicate a dereference" belong in a separate tutorial, along with further detail like explaining what a dereference is, explaining the Game Boy memory map, analogies to pointers in C, etc.

from rgbds-www.

ISSOtm avatar ISSOtm commented on July 19, 2024

Closing, then.

from rgbds-www.

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.