BeebASM Namespace

handy tools that can assist in the development of new software
Post Reply
User avatar
fizgog
Posts: 618
Joined: Thu Jun 17, 2021 3:18 pm
Location: Nottinghamshire
Contact:

BeebASM Namespace

Post by fizgog »

Can BeebASM do namespacing i.e

Code: Select all

namespace Player
{
    .Update
    {
        ; code here
    }

    .Draw
    {
        ; code here
    }
}
and access the functions like Player.Update and Player.Draw, rather than naming the function like PlayerUpdate and PlayerDraw

If it can't, then are there any plans to add this sometime in the future?
Pitfall, Gridrunner, Matrix: Gridrunner 2, LaserZone, AcornViewer, AcornPad
User avatar
tricky
Posts: 7694
Joined: Tue Jun 21, 2011 9:25 am
Contact:

Re: BeebASM Namespace

Post by tricky »

I think that my mod to export scores like that as labels for the debugger went in, but I don't think it was added as actual label support. I had to make up some extra labels when you have things like nested scope out consecutive scope without a label between.
There are probably many gotchas unless you introduce a new naming convention to link the label specifically to the scope.
User avatar
fizgog
Posts: 618
Joined: Thu Jun 17, 2021 3:18 pm
Location: Nottinghamshire
Contact:

Re: BeebASM Namespace

Post by fizgog »

Thanks for the info, would be a nice feature to have though
Pitfall, Gridrunner, Matrix: Gridrunner 2, LaserZone, AcornViewer, AcornPad
User avatar
tricky
Posts: 7694
Joined: Tue Jun 21, 2011 9:25 am
Contact:

Re: BeebASM Namespace

Post by tricky »

I also use it to gather execution counts/cycles for profiling, so I agree it does make sense, it is just that sometimes it is an anonymous scope!

Code: Select all

.fn
{
	ldx #10 { .lp : sta addr0,x : dex : bpl lp }
	ldx #18 { .lp : sta addr1,x : dex : bpl lp }
}
The inner {} don't have their own label, so I make some up based on the number and nesting of {} at that point, so these would be ._0_0 and ._0_1
Post Reply

Return to “development tools”