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..
 
... 590 posts hidden. Click here to view all posts....
 
2011-12-11 17:37
Slammer

Registered: Feb 2004
Posts: 416
Quote: Slammer,

I have a couple suggestions for features:

1. Allow the ability to access variables from user-defined structures by index.
That way we can pass in a List or HashTable containing UDS's to a function and apply an action based on the variable's index rather than the name, which could be different for each UDS.
Great for library building.

2. Call an external JAVA program, passing in Strings, Floats, Integers, Lists & HashTables with UDS's and return the same back into KickAssembler variables.
I could get the functionality by having my JAVA code generate KickAssembler script but this could get quite large for Collections.
Would be nice to have this inline.

Steve


1. Yep, I guess it's easily done. Im not sure i understand how to benefit from this in libraries. (Looking forward too see en example of use!)

2. Yep, can be done. Is in fact on the todo list, but it's will take a bit of work so i have postphoned it a bit. One of the reasons for restructuring the assemble mekanism so it could handle a flexible number of passes and to cache script results, was to be able to call external programs - Both with script parameters and assembled code (if you want to do crunching or encrypting etc.)
2011-12-12 00:05
Conjuror

Registered: Aug 2004
Posts: 168
Say I had a multi-field sorting routine this time for point{x,y} I could pass in a List of points.
Another time the names could be different or sort by even more fields.

I recently did a 2 field sort with a Hashtable and Lists. The Keys been the Y values which I called sort on, then called sort on Lists (Hashtable values).
That got me the result I wanted but I'd rather have a more generic solution.

But if suggestion #2 comes soon this will be irrelevant as I will just use full blown JAVA Collections and its interfaces (hmm still indexed fields would still be useful there saves
calling invoke on named methods).

And great to hear that it is on your list. That will make any other 'missing' functionality just go away. Cant wait!
2011-12-12 22:00
Slammer

Registered: Feb 2004
Posts: 416
I don't think #2 will come that soon. Im pretty busy at the moment so there is not much time for coding for fun. However #1 is a small task. I guess it will be in the next release.
2011-12-12 23:03
Pantaloon

Registered: Aug 2003
Posts: 124
coding is always fun :)
2011-12-13 12:15
Conjuror

Registered: Aug 2004
Posts: 168
Thanks Slammer that will help heaps.

So tempted to work the other way around and make JAVA spit out Kick Assembler script and ASM, but then I live in JAVA world all day.

Quote:
coding is always fun :)
Says the game programmer. Well coding is always fun, programming not always.
2011-12-29 09:14
Style

Registered: Jun 2004
Posts: 498
Ive asked this once before, and found some workaround at the time that Ive forgotten, but I lost my kickass libs and had to revert to ca65 again - and now, once again, Im converting to kickass ;)

So... the question once again - if I have a macro, how do I tell if the parameters were passed or not? ie, can I implement nonmandatory parameters?

thanks
2011-12-29 21:27
Slammer

Registered: Feb 2004
Posts: 416
Hi Style

Normal macros have to have the right number of arguments.

Pseudocommands can have empty parameters
2011-12-30 03:18
Style

Registered: Jun 2004
Posts: 498
any chance you can overload macros? :)

2011-12-30 17:02
Slammer

Registered: Feb 2004
Posts: 416
No, not at the moment.

Supplying too few parameters for a macros (like you can on pseudocommands) and setting the parameter to null when left out is possible. I left it out to avoid too much confusion when users supply to few arguments by mistake (Clearer errror messages vs flexibility) - If flexibility is in great demand, i'll open up that feature.

Since its a weakly typed script language something like the following is kind of against that nature of the language:

.macro myMacro(NumberValue x) {
  //do something
}

.macro myMacro(String x) {
  //do something else
}


If people miss this(?), it can be made possible by a type() function on objects:

.macro myMacro(x) {
  if (x.type()==NUMBERVALUE) :myMacro_value()
  else (x.type()==STRING) :myMacro_string()
  else .error("Unkown Type")

 

.macro myMacro_value(x) {
  //do something 
}

.macro myMacro_string(x) {
  //do something else
}



Btw. Can you give an example of where you will use this feature.
2011-12-31 04:40
Style

Registered: Jun 2004
Posts: 498
yeh, on ca65 I had a macro, next_irq, which accepted conditional parameters of the address and raster position. If you didnt provide them, it merely dec $d019 (ie, there is only 1 IRQ)....

small point I know, but like I said Im trying to convert sources over the kickass.
Previous - 1 | ... | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | ... | 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
Nordischsound/Hokuto..
Jetboy/Elysium
Alakran_64
Scooby/G★P/Light
machete
Brataccas/HF
Guests online: 150
Top Demos
1 Next Level  (9.8)
2 Mojo  (9.7)
3 Coma Light 13  (9.7)
4 Edge of Disgrace  (9.6)
5 Comaland 100%  (9.6)
6 No Bounds  (9.6)
7 Uncensored  (9.6)
8 Wonderland XIV  (9.6)
9 Bromance  (9.6)
10 Memento Mori  (9.6)
Top onefile Demos
1 It's More Fun to Com..  (9.7)
2 Party Elk 2  (9.7)
3 Cubic Dream  (9.6)
4 Copper Booze  (9.5)
5 Rainbow Connection  (9.5)
6 TRSAC, Gabber & Pebe..  (9.5)
7 Onscreen 5k  (9.5)
8 Wafer Demo  (9.5)
9 Dawnfall V1.1  (9.5)
10 Quadrants  (9.5)
Top Groups
1 Oxyron  (9.3)
2 Nostalgia  (9.3)
3 Booze Design  (9.3)
4 Censor Design  (9.3)
5 Crest  (9.3)
Top Crackers
1 Mr. Z  (9.9)
2 S!R  (9.9)
3 Antitrack  (9.8)
4 Mr Zero Page  (9.8)
5 OTD  (9.8)

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