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 > Kick Assembler Thread 2
2009-07-21 17:20
Slammer

Registered: Feb 2004
Posts: 416
Kick Assembler Thread 2

The previous thread took a little long to load, so this is a new fresh one..
 
... 592 posts hidden. Click here to view all posts....
 
2011-10-02 14:32
tlr

Registered: Sep 2003
Posts: 1737
Quoting Slammer
Tlr: Like in java, you can't reach a variable declared inside an if (or for). If you want to access it outside the scope of the if, then declare it outside of the scope and set it inside.

Will give predeclaration a go.

What's causing the confusion is that there is no preprocessor style if.
Other assemblers usually treat both if's and macros in a preprocessor sense, often even using multiple passes to resolve conflicts.

This of course causes some other problems (like oscillations) which you solve in kick assembler with much stricter parsing rules.

I'll see if I can figure out a way to adapt my coding style to this difference.
2011-10-05 03:37
TWW

Registered: Jul 2009
Posts: 542
Feature Request:

Maybee this is a posibility already but here goes:

Allow Suffixes to Pseudocommands according to some fixed syntax.

Ex:

A multiply routine can be called with either:

:MUL_S <- for Signed Mul (suffix being the "_S")

or

:MUL_U for Unsigned (Suffix is "_U").

This is just an example and so is the syntax but it would allow you to put both these routines inside one file instead of two (there would ofcourse have to be some way to use these suffixes inside the pseudo to make descicions).


Another thing:

Did the ".IfDefined" feature requested by someone before see the day of light?


Cheers!
2011-10-05 15:42
Cruzer

Registered: Dec 2001
Posts: 1048
TWW: Why not use a parameter for that?
2011-10-05 17:04
TWW

Registered: Jul 2009
Posts: 542
That's what I'm currently doing so yes, this is a luxory feature request 8-D
2011-10-05 17:09
tlr

Registered: Sep 2003
Posts: 1737
I thought I'd post a few things I've run in to lately. If the suggestions are too crazy, feel free to disregard them. :)

1:
I tried just now to write a file format header using kick assembler and discovered that there is no pseudo op to output ascii. (.text converts lower case to screen codes.)
	.ascii	"Header Ident!"
	.byte	0
That would be useful!


2:
Consider this:
	.pc = $1000
start:
	lda	#<msg
	ldy	#>msg
	jmp	$ab1e
	
msg:
	.text	"LEN $"+toHexString(end-start)
	.byte	0
end:
In this example toHexString() will generate lowercase, which is fine. However how do I convert it automatically to upper case? A custom to_upper(str) will fail because the string isn't fully resolved in the first pass.


3, A suggestion:
It would be useful to be able to generate UC-mode/LC-mode screen codes/petscii in some structured way.
   .text_u "HELLO WORLD!"
   .text_l "Hello World!"
   .scr_u "HELLO WORLD!"
   .scr_l "Hello World!"
A function wrapper could be a substitute, but see 2 above.


4, another suggestion:
It would be useful to be able to mix bytes and strings.
   .text "STRING",0
   .byte TOKEN_SYS,"2061",0,0,0
I guess some of this could be emulated with macros, but I usually prefer the short form.
2011-10-05 17:37
TWW

Registered: Jul 2009
Posts: 542
tlr: Good suggests!


Cruzer: Just to add: I find it a bit akward to use numerical parameters to pass on to a pseudo which should dictate what way it should operate.

i.e:

:MUL "S" ; #$04 ; #$10 ; $1000

would work fine but since I can't pass strings and you need to remeber that 1 = signed and 2 = unsigned etc. it doesen't look and feel that tidy to me anymore.

So: just allow a suffix to be passed OR allow passing of strings and it's all Rock and Roll Rulletobakk after that.
2011-10-05 18:20
Slammer

Registered: Feb 2004
Posts: 416
You can allready use _ in commandnames. Why don't you use two extra lines to define the two pseudo commands:
.pseudocommand MUL_S a ; b ; tar { :MUL 1 ; a ; b ; tar}
.pseudocommand MUL_U a ; b ; tar { :MUL -1 ; a ; b ; tar}
.pseudocommand MUL sign ; a ; b ; tar {

/* CODE..  
Use .if (sign==1) {...} etc. 
*/

}
2011-10-05 18:30
Slammer

Registered: Feb 2004
Posts: 416
Thanks for the suggestions.. I have had several whishes for uppercase/lowercase selection so that will be put high on the list.
2011-10-05 19:11
tlr

Registered: Sep 2003
Posts: 1737
Quote: Thanks for the suggestions.. I have had several whishes for uppercase/lowercase selection so that will be put high on the list.

Great!

In case it wasn't clear enough:
in 3 I am suggesting that .text_u generates petscii suitable for printing with the uppercase charset, and .text_l generates the same suitable for printing with the lowercase charset.
.scr_u and .scr_l does the same but with screen code output.

In 1 I mean plain ASCII, or perhaps ISO-8859-1.

In 2 either some kind of conversion function, or better yet, solve the resolution problem in some way.
2011-10-05 19:55
TWW

Registered: Jul 2009
Posts: 542


Halleluja! Ask slammer and he has a way!!!

Beers on me if we ever meet!


About the ".ifdefined" thing, any news about this?
Previous - 1 | ... | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | ... | 61 - 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
Black/Angels
Didi/Laxity
JCH/Vibrants
Asphodel
Mr. SID
Kickback
csabanw
Jammer
Guests online: 73
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.7)
6 Uncensored  (9.6)
7 Comaland 100%  (9.6)
8 No Bounds  (9.6)
9 Aliens in Wonderland  (9.6)
10 Wonderland XIV  (9.6)
Top onefile Demos
1 Layers  (9.6)
2 Cubic Dream  (9.6)
3 Party Elk 2  (9.6)
4 Copper Booze  (9.6)
5 Rainbow Connection  (9.5)
6 It's More Fun to Com..  (9.5)
7 Dawnfall V1.1  (9.5)
8 Birth of a Flower  (9.5)
9 Morph  (9.5)
10 Quadrants  (9.5)
Top Groups
1 Nostalgia  (9.4)
2 Oxyron  (9.3)
3 Booze Design  (9.3)
4 Censor Design  (9.3)
5 Offence  (9.3)
Top Diskmag Editors
1 Magic  (9.4)
2 Jazzcat  (9.4)
3 hedning  (9.2)
4 Elwix  (9.1)
5 Remix  (9.1)

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