Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
 Welcome to our latest new user hoist ! (Registered 2024-10-04) 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-01-15 09:51
Lobogris
Account closed

Registered: Oct 2010
Posts: 22
hi!
strings are not working with .import directive...

I am trying to do:

.var workpath="c:\kickass\Retroinvaders\"
.import source workpath+"include\macroslib.asm"
.import source workpath+"include\16bitcmds.asm"
.import source workpath+"include\graphics.asm"

and I have the following error:

Error: Unknown symbol 'workpath'

It will be cool if this little detail is corrected as a little improvement to kickass. Or maybe, I am doing something wrong? Thanks in advance!
2011-01-15 13:06
Slammer

Registered: Feb 2004
Posts: 416
Hi Lobogris,

It not an error. The import directive is executed in a preparse so functions, macros and pseudo commands are imported and ready to use anywhere in your sourcecode.
Try using the -libdir parameter instead. Something like:
java -jar KickAss.jar -libdir "c:\kickass\Retroinvaders\" source.asm

You can have as many libdir's as you like. Now, everytime you import stuff, the assembler will look in the libdirs if it cant find the file in the current dir. So now you just do:
.import source "include\macroslib.asm"
.import source "include\16bitcmds.asm"
.import source "include\graphics.asm"
2011-01-15 13:09
Lobogris
Account closed

Registered: Oct 2010
Posts: 22
Thats good. Many thanks! I have -libdir now added in kickass.cfg file

One last question, if I wanna add more paths to -libdir it will work separating it with ";"? or maybe ","?
for example:
-libdir "C:\kickass\Retroinvaders\;c:\mainlibs\"
2011-01-15 21:23
bepp

Registered: Jun 2010
Posts: 265
You can specify the -libdir parameter multiple times on the command line. See top of page 14 in the manual.
2011-01-16 06:38
Lobogris
Account closed

Registered: Oct 2010
Posts: 22
It was more a curiosity for future projects, so I looked quickly the manual (I have my head full of algorithms right now!) I need to print the manual because in pdf I miss some parts sometimes! sorry for that, and thanks bepp!
2011-03-18 18:49
TWW

Registered: Jul 2009
Posts: 543
Cheers


Is the a way to reliable determine the size of a immediate value (8/16/32 bit)?

I'm guessing that you can fetch the arg.getvalue+1 / +2 etc and check if they are zero but maybee there is a even more slick method?

-TWW
2011-03-19 10:35
Slammer

Registered: Feb 2004
Posts: 416
Im not sure exactly what you want, but you can write a bytesize function like this:

//Examples of use
.print "$12->"+byteSize($12)   
.print "$123->"+byteSize($123)       
.print "$123456->"+byteSize($123456)

// The function
.function byteSize(x) {
	.if (x==0) .return 0
	.return 1+byteSize(x>>8)			
}
2011-03-19 13:27
TWW

Registered: Jul 2009
Posts: 543
I was thinking (yeah I do that sometimes too) that I could construct "universal" pseudocommands for example:

:ADD x ; y ; z

and then get the pseudo to determine if it needs to utilize 8, 16, 24 or 'n' bits addition.

That is instead of making multiple pseudos like :ADD8 / :ADD16 f.ex.

Making a function like the one you made here returning the number of bytes in a passed argument looks to be a step in the right direction 8-)
2011-03-20 08:37
Slammer

Registered: Feb 2004
Posts: 416
That would be nice to have. I think there is a problem though. The destination will be a memory adress and we have to know if the data on that adress is 8 bit or 16 bit. If you want to do
:add #1 ; label
Then the value 1 can be contained in one byte (byteSize=1) but if 'label' is pointing to a 16 bit number you still have to make and adc to both the low and the high-byte in order to handle the carryflag when the lowbyte makes an overflow.
2011-03-21 02:49
TWW

Registered: Jul 2009
Posts: 543
I see your point.

However I have another issue:

.pseudocommand MEMFILL destination_address ; number_of_bytes ; value {


  .if (number_of_bytes.getValue()<=5) {

  "DO THE FIRST THING"

  }

  .if (number_of_bytes.getValue()>5 && number_of_bytes.getValue()<=256) {

  "DO THE SECOND THING"

  }

  .if (number_of_bytes.getValue()>256) {

  "DO THE THIRD THING"

  }

}


After i put in the doube boolean check on the second thing I get a message: "Made no progress and cant solve the program.. You should have gotten an error. Contact the author!"

If I change the 2nd entry to a single boolean check (i.e. more then 5 f.ex.) it works like a charm.

Any suggestions?
Previous - 1 | ... | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | ... | 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
Sentinel/Excess/TREX
Didi/Laxity
Fungus/Nostalgia
SplAtterpunk
Guests online: 61
Top Demos
1 Next Level  (9.7)
2 13:37  (9.7)
3 Coma Light 13  (9.7)
4 Edge of Disgrace  (9.6)
5 Mojo  (9.6)
6 Uncensored  (9.6)
7 Wonderland XIV  (9.6)
8 Comaland 100%  (9.6)
9 No Bounds  (9.6)
10 Unboxed  (9.5)
Top onefile Demos
1 Layers  (9.6)
2 Party Elk 2  (9.6)
3 Cubic Dream  (9.6)
4 Copper Booze  (9.6)
5 Rainbow Connection  (9.5)
6 It's More Fun to Com..  (9.5)
7 Morph  (9.5)
8 Dawnfall V1.1  (9.5)
9 Onscreen 5k  (9.5)
10 Daah, Those Acid Pil..  (9.5)
Top Groups
1 Booze Design  (9.3)
2 Oxyron  (9.3)
3 Performers  (9.3)
4 Nostalgia  (9.3)
5 Censor Design  (9.3)
Top Graphicians
1 Mirage  (9.7)
2 Archmage  (9.7)
3 Facet  (9.6)
4 Carrion  (9.6)
5 Pal  (9.6)

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