Git Product home page Git Product logo

Comments (3)

Rangi42 avatar Rangi42 commented on June 20, 2024

Something that might work is, using the "distance til next label" heuristic as the default, but allowing the user to end it early.

An ENDSCOPE keyword, or ENDSCOPE <arg> for local labels, would return the current label scope to being nothing. (This is fine; you can continue declaring space/outputting data without a top-level label.)

For example:

AddNTimes::
; Add bc * a to hl.
	and a
	ret z
.loop
	add hl, bc
	dec a
	jr nz, .loop
	ENDSCOPE .loop
	ret
ENDSCOPE

	nop ; unused

TheNextFunction:
	ret

assert SIZEOF(AddNTimes) == 7
assert SIZEOF(AddNTimes.loop) == 4
assert SIZEOF(TheNextFunction) == 1
wFoo:: ds 3
ENDSCOPE wFoo
    ds 4 ; unused
wBar:: dw

assert SIZEOF(wFoo) == 3
assert SIZEOF(wBar) == 2

from rgbds.

ISSOtm avatar ISSOtm commented on June 20, 2024

I am firmly opposed to a ENDSCOPE keyword as cluttering metadata.

As for "size of X" semantics, what is the size of any of these?

MACRO far_ptr
    DW ; Address.
    DB ; Bank.
ENDM

PlayerActor:
wActor0:
.y  DB
.x  DB
.gfx
    far_ptr

I'd argue that there are too many possible interpretations, and that the default behaviour would have to be too complex, that this should not be integrated into RGBASM at all.

from rgbds.

Rangi42 avatar Rangi42 commented on June 20, 2024

...You're right. I could imagine more keyword functionality to control a label's "size", but it would end up being less convenient than LabelEnd - Label.

from rgbds.

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.