Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
You are not logged in - nap
CSDb User Forums


Forums > C64 Coding > Wanted: Source codes (for badass)
2020-10-17 08:22
Sasq

Registered: Apr 2004
Posts: 155
Wanted: Source codes (for badass)

In order to improve my assembler it would be great to try it on existing projects.

So if you have sources for demos/intros/games that you don't mind sharing it would be kind if you could send them my way, and I'll try to get them working in bass.

They need to be buildable the normal way (Kickass, Acme or whatever) so I can compare the output binaries...

(this also means that if your type of demos requires special tools there is a greater chance I will include such functionality in bass).

-- sasq64@gmail.com
 
... 70 posts hidden. Click here to view all posts....
 
2020-11-15 20:05
Krill

Registered: Apr 2002
Posts: 2855
Quoting soci
"+" is for numerical sum only because calculations may be performed with strings. For example 1 - 'a' + 'z' is 26 (if letters are encoded in a sequence). Therefore concatenation must have a different operator.
I thought single quotes would denote chars (which allow arithmetics) and double quotes strings. This would neatly allow + for string concatenation, as it does in C++ and other languages.
2020-11-15 20:58
tlr

Registered: Sep 2003
Posts: 1728
Quoting Krill
I thought single quotes would denote chars (which allow arithmetics) and double quotes strings. This would neatly allow + for string concatenation, as it does in C++ and other languages.

Me too, although "c" is quite common in this context as well. It starts to get a bit tricky once you add multiple data types.

Btw, another use for parent is to break out of relocated origin addresses. For instance finding out the "parent" pc of a relocated part of the code. This may be done in more than one level.
Maybe not be entierly related though as .logical/.here or .rorg/.rend and friends needn't be scopes per se. It could be entierly orthogonal but I'm not sure what to call it except "parent".
2020-11-15 22:20
soci

Registered: Sep 2003
Posts: 474
Label of a block is always at its start. However it does not have to be used as an entry point. Usually for such special functions I write something like below:
					    *=$1000

.1000	20 06 10	jsr $1006	    jsr stuff

=$1006					stuff = (+).entry
.1003					+   .proc
.1003	9d 00 04	sta $0400,x	lp  sta $400,x
.1006					entry
.1006	e8		inx		    inx
.1007	d0 fa		bne $1003	    bne lp
.1009	60		rts		    rts
					   .pend

An anonymous symbol was used as it's only used in the expression above to get the entry point.

Named parent scope access is exactly what it sounds:
b1   .block
label1
b2a    .block
label2
       .bend
b2b    .block
c1       .block
         jsr b1.label1
         jmp b1.b2a.label2
         jmp b2a.label2
         .bend
       .bend
     .bend

After all labels of parent scopes are visible for children.

It's not like I had much choice as the C64 TASM uses double quotes for both literals and strings. Therefore there's no special casing for character literals. Single quotes can be used for easy enclosing of text containing double quotes.
.1000	a9 93		lda #$93	lda #"{clr}"
.1002	20 d2 ff	jsr $ffd2	jsr $ffd2

					.al
.1005	a9 49 44	lda #$4449	lda #"id"
.1008	8d 00 04	sta $0400	sta $400

Yes it may take a while to remember the concatenation operator but it's not impossible to get used to it.

As for "parent" PC I usually just put a label in front:
						      *=$1000

.1000						label .logical $800
>1000	0800	00 10				      .word label
						      .here

Such a label is more useful for the installer code than the relocated one. As a .logical/.here block is just a relocation and so there's no label scoping.

But I see the point. If an assembler insists to scope every block then tough luck.
2020-11-16 12:15
tlr

Registered: Sep 2003
Posts: 1728
Quoting soci
Label of a block is always at its start. However it does not have to be used as an entry point. Usually for such special functions I write something like below:
					    *=$1000

.1000	20 06 10	jsr $1006	    jsr stuff

=$1006					stuff = (+).entry
.1003					+   .proc
.1003	9d 00 04	sta $0400,x	lp  sta $400,x
.1006					entry
.1006	e8		inx		    inx
.1007	d0 fa		bne $1003	    bne lp
.1009	60		rts		    rts
					   .pend

An anonymous symbol was used as it's only used in the expression above to get the entry point.

That's quite good. I wasn't sure if the constant assignment itself would trigger generation of the .proc contents.

Quoting soci
Named parent scope access is exactly what it sounds:
b1   .block
label1
b2a    .block
label2
       .bend
b2b    .block
c1       .block
         jsr b1.label1
         jmp b1.b2a.label2
         jmp b2a.label2
         .bend
       .bend
     .bend

After all labels of parent scopes are visible for children.

So scope lookup works the same as symbol lookup in 64tass? I.e search all scopes towards the global scope until it matches?
This isn't an entierly obvious behaviour to me, but perhaps it makes sense.

Being able to put stuff in the global scope is useful for implementing stateful behaviour of macros perhaps. The "start" macro could push stuff to a global stack and the "end" macro could pop it back, effectively implementing scope like behaviour.
Using your search method there is automatically a way to address the global scope, assuming it has a unique name and was already defined. But would it be reasonable to be able to _define_ stuff outside the local scope?

Quoting soci
As for "parent" PC I usually just put a label in front:
						      *=$1000

.1000						label .logical $800
>1000	0800	00 10				      .word label
						      .here

Such a label is more useful for the installer code than the relocated one. As a .logical/.here block is just a relocation and so there's no label scoping.

As an example in the freezer of superfluid I generate a depacking stub by copying it into place and then updating a couple of key variables at that location. The stub itself contains parts that are relocated so I have stacked relocations going on. Currently this is assembled in stages and there are separate calculations to find out the address of the various modification points.

Quoting soci
But I see the point. If an assembler insists to scope every block then tough luck.

I personally avoid an explicit scope for relocated origin too. Again in superfluid I even enter and exit the relocated scope within macros ENTER_ULTIMAX and EXIT_ULTIMAX which moves execution from $8000 space to $e000 space and vice versa. This would be impossible if this relocation was a scope.

I guess the struggle is to define (in a comprehendable way) at what stage different things get translated.
2020-11-22 17:55
Krill

Registered: Apr 2002
Posts: 2855
Fresh 64tass syntax code to test against: Transwarp V0.64 =)
Previous - 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 - Next
RefreshSubscribe to this thread:

You need to be logged in to post in the forum.

Search the forum:
Search   for   in  
All times are CET.
Search CSDb
Advanced
Users Online
Higgie/Kraze/Slackers
Broti/DT/KRN
TheRyk/MYD!
sachy
BYB/Hokuto Force
csabanw
Guests online: 91
Top Demos
1 Next Level  (9.7)
2 13:37  (9.7)
3 Mojo  (9.7)
4 Coma Light 13  (9.7)
5 Edge of Disgrace  (9.6)
6 No Bounds  (9.6)
7 Aliens in Wonderland  (9.6)
8 Comaland 100%  (9.6)
9 Uncensored  (9.6)
10 Wonderland XIV  (9.6)
Top onefile Demos
1 Happy Birthday Dr.J  (9.7)
2 Layers  (9.6)
3 It's More Fun to Com..  (9.6)
4 Cubic Dream  (9.6)
5 Party Elk 2  (9.6)
6 Copper Booze  (9.6)
7 TRSAC, Gabber & Pebe..  (9.5)
8 Rainbow Connection  (9.5)
9 Dawnfall V1.1  (9.5)
10 Daah, Those Acid Pil..  (9.5)
Top Groups
1 Nostalgia  (9.4)
2 Oxyron  (9.3)
3 Booze Design  (9.3)
4 Censor Design  (9.3)
5 SHAPE  (9.3)
Top Swappers
1 Derbyshire Ram  (10)
2 Jerry  (9.8)
3 Violator  (9.8)
4 Acidchild  (9.7)
5 Starlight  (9.6)

Home - Disclaimer
Copyright © No Name 2001-2024
Page generated in: 0.04 sec.