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: 434
Kick Assembler Thread 2

The previous thread took a little long to load, so this is a new fresh one..
 
... 618 posts hidden. Click here to view all posts....
 
2025-05-09 10:15
TWW

Registered: Jul 2009
Posts: 549
Great thanks. Extended mnemonics and regs sounds like a great idea.

Sounds like there may be some update in the future, so I'd like to use the oportunity to report a couple of findings in case they are not known already;

When dealing with 32 bit numbers which is passed as immediate to a pseudocommand, values >= #$80000000 will have it's lobyte set to #$ff if you don't do the opc #arg.getValue()&$ff trick. 16 and 24 works fine though, it's once it turns negative and the bypass is easy once you've figgured it out. Not sure if this is anyting to 'fix' though as going Unsigned perhaps messes up (a lot of) other stuff.

Inside a pseudo, I had to use "arg.getType() == -5" instead of "arg.getType() == AT_IZEROPAGEX" (seems to not be defined). Perhaps the argument type constant was not typed correctly in the manual (page 32). Could be this was fixed already as it was an old observation.

Anyway, cheers!
2025-05-10 17:54
Slammer

Registered: Feb 2004
Posts: 434
Quote: Great thanks. Extended mnemonics and regs sounds like a great idea.

Sounds like there may be some update in the future, so I'd like to use the oportunity to report a couple of findings in case they are not known already;

When dealing with 32 bit numbers which is passed as immediate to a pseudocommand, values >= #$80000000 will have it's lobyte set to #$ff if you don't do the opc #arg.getValue()&$ff trick. 16 and 24 works fine though, it's once it turns negative and the bypass is easy once you've figgured it out. Not sure if this is anyting to 'fix' though as going Unsigned perhaps messes up (a lot of) other stuff.

Inside a pseudo, I had to use "arg.getType() == -5" instead of "arg.getType() == AT_IZEROPAGEX" (seems to not be defined). Perhaps the argument type constant was not typed correctly in the manual (page 32). Could be this was fixed already as it was an old observation.

Anyway, cheers!


The 32-bit issue was an easy fix. (The number-values in Kick-Assemeber are doubles, which have enough precision - but in the process it went through an 32bit int (which is signed) and then we had the problem.). It will be fixed in the next release. Didn't expect the use of 32bit values :-)

AT_IZEROPAGEX is defined but it is 5 not -5. The the minus modes are the 'unresolved' modes and -5 is 'unresolved indirect x'. Since we could get a processor where you could do:
  lda ($1234,x)
but not
  lda ($12,x)
which then had to be
  lda ($0012,x)

KickAss first resolved the address mode when it has the mnemonic and know the available opcodes. I have a todo on exposing the unresolved constants, but using -5 as you do, will work.

Regarding a release, I can't promise anything soon, but if you are in pressing need then pm me and I will see if I can build a jar for you.
2025-05-10 21:50
cobbpg

Registered: Jan 2022
Posts: 42
Speaking of numbers, I ran into the issue of double precision because I was trying to use 64-bit values. It was not even a very esoteric use case: I was deduplicating characters based on their contents, so I needed to use their bit patterns as keys to a hashmap. Had to convert them into hex strings to get around the issue. It would have been nicer to be able to just use 64-bit integers directly. Of course this is partly a me problem, as I generally prefer using Kick Assembler to write quick preprocessing scripts instead of Python, but it's just nice to be able to use one language within a project for as many things as possible.

In a bit similar vein, another thing that came up recently was the desire to implement segment modifiers as functions inside the scripting language instead of having to make a Java plugin. This would make it easy to spit out assembled structures in particular custom formats without having to implement and/or invoke external tools (e.g. cartconv).

Also, it would be nice to be able to convert numbers into characters, not just the other way around, so one could extract strings from files. As far as I can tell, the only way to approximate this functionality is to define a string listing the ASCII characters in order and use charAt(), like I did in the Kye music pattern parser logic.

And a little thing that sometimes bugs me is that when using the –vicesymbols option the resulting file is completely unordered. From time to time I wish the lines were ordered by address, and all addresses were padded to 4 hex digits, because then it would allow me to quickly check the generated memory layout just by eyeballing this file.
2025-05-12 09:30
Slammer

Registered: Feb 2004
Posts: 434
If there is a need for it, the ViceSymbolfile could be sorted, but originally it is not intended for readning. You can get an overview af the memory by defining you segments in cronological order and naming you memoryblocks. Then you can get output like this:

	Memory Map
	----------
	ZP-segment:
	  *$0010-$0037 zpBorderColorPtrs
	  *$0038-$0039 borderColorProtoThread indexs
	  *$003a-$003c Generate sprites
	  *$003d-$003d Pause
	  *$003e-$0045 Scroll controller
	  *$0046-$004e General Purpose


	Debug-segment:
	  $0801-$080c Basic
	  $080e-$080d Basic End
	  $0810-$0893 Part Starter

	Music-segment:
	  $1000-$245f Dirty_Vaiana.sid

	Align100-segment:
	  $2500-$29ff Charset

	MainProgram-segment:
	  $2a00-$2ac6 BorderColorProtoThread
	  $2ac7-$2afd UnpackSprite
	  $2afe-$2b08 Pause
	  $2b09-$2eb5 FillBuffer Job
	  $2eb6-$3262 Irq

	  ....

When you are setting the segment you have the option of adding a mememoryblock name and then the above comes natural.

	.segment Align100 "Charset" 
	charset: .fill ... 


If you want more info on the output you can use the bytedump - file and see the content of the segments:

	******************************** Segment: Debug ********************************

	[Part Starter]
	0810: a9 00     - start:  lda #0
	0812: 8d 20 d0  -         sta $d020
	0815: 8d 21 d0  -         sta $d021
	0818: a9 00     -         lda #0
	081a: 20 00 10  -         jsr $1000
	081d: 78        -         sei


So is an ordered vice-symbolfile still usefull?? I'm asking because I know there is many ways of working with Kick Assembler and you seems like an advanced user that probaly know most of the above?
2025-05-12 09:50
Slammer

Registered: Feb 2004
Posts: 434
Numbers->Chars - I will take a look at this.

64-bit integers not gonna happend anytime soon. I guess it would require more strict typing so the user have to be aware if he is working with an long or a double and I see a new problem comming up when you want bigger chars :-) But you found the right solution. Another way of getting big keys is putting several numbervalues in a container, could be a Vector.

Segment modifyers in KickAss script is also a wish of mine. Just havn't had time.
2025-05-12 09:52
WVL

Registered: Mar 2002
Posts: 923
Can you put a list in a Hashtable? then you could put a char in an 8 value long list and do it that way.

So something like :

.var emptyChar = List.add(0,0,0,0,0,0,0,0)
.var charHashTable = Hashtable()
.eval charHashTable.put(0, emptyChar)

I also have a png -> charset decoder somewhere, but it didn't occur to me I could use a hasthable to check for duplicates.
2025-05-12 09:58
Oswald

Registered: Apr 2002
Posts: 5118
"I generally prefer using Kick Assembler to write quick preprocessing scripts instead of Python"

best would be if one would write programs in a programming languages not in assembler scripts, then you wouldnt miss features like the ones you are missing.
2025-05-12 09:59
Oswald

Registered: Apr 2002
Posts: 5118
Quote: Can you put a list in a Hashtable? then you could put a char in an 8 value long list and do it that way.

So something like :

.var emptyChar = List.add(0,0,0,0,0,0,0,0)
.var charHashTable = Hashtable()
.eval charHashTable.put(0, emptyChar)

I also have a png -> charset decoder somewhere, but it didn't occur to me I could use a hasthable to check for duplicates.


yes, again a programming language, python fex. can perfectly do it for you.
2025-05-12 10:30
Slammer

Registered: Feb 2004
Posts: 434
Quote: yes, again a programming language, python fex. can perfectly do it for you.

Your argmumentation doesn't make any sence and seems more like harrashment to me. No matter what language you choose there will be pros and cons. If you choose Python, you will miss type safety, and speed. If you choose C++, you need to compile and add extra complexity. All choices are good but for different reasons - it's a matter of taste.
2025-05-12 13:00
cobbpg

Registered: Jan 2022
Posts: 42
Quoting Slammer
So is an ordered vice-symbolfile still usefull?? I'm asking because I know there is many ways of working with Kick Assembler and you seems like an advanced user that probaly know most of the above?

Yes, I'm quite aware of all these features, and I do take advantage of them already. :) However, sometimes I find myself wanting to get a list of all labels in address order to inspect how individual variables are laid out in the final build, and fixing the order in the symbol file would help with that without the need to introduce any other feature.

Quoting Slammer
Segment modifyers in KickAss script is also a wish of mine. Just havn't had time.

Actually, if I could provide a start index and a length to the .segmentout directive as opposed to being forced to output the whole contents of the segments mentioned, that would already be helpful.

Quoting Oswald
best would be if one would write programs in a programming languages not in assembler scripts, then you wouldnt miss features like the ones you are missing.

Not necessarily. There's value in keeping your asset pipeline as simple as possible, which implies using as few different tools as possible. Sure, there's a trade-off, since the KickAss scripting language is obviously limited compared to a full-fledged PL, but it's still powerful enough to be able to express a lot of useful transformations. It's definitely helpful to be able to produce binaries without an external build system and other dependencies, just by running the assembler, so I'm more than happy to stretch it as far as it makes sense.
Previous - 1 | ... | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 - 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
CA$H/TRiAD
ccr/TNSP
Didi/Laxity
Guests online: 91
Top Demos
1 Next Level  (9.7)
2 13:37  (9.7)
3 Codeboys & Endians  (9.7)
4 Coma Light 13  (9.6)
5 Mojo  (9.6)
6 Signal Carnival  (9.6)
7 Edge of Disgrace  (9.6)
8 In Surgery  (9.6)
9 Comaland 100%  (9.6)
10 Uncensored  (9.6)
Top onefile Demos
1 Keine Termine und le..  (9.9)
2 Nine  (9.8)
3 Layers  (9.6)
4 Cubic Dream  (9.6)
5 Party Elk 2  (9.6)
6 Copper Booze  (9.5)
7 Charflasher  (9.5)
8 Onscreen 5k  (9.5)
9 Libertongo  (9.5)
10 Dawnfall V1.1  (9.5)
Top Groups
1 Booze Design  (9.3)
2 Oxyron  (9.3)
3 Performers  (9.3)
4 Censor Design  (9.2)
5 Artline Designs  (9.2)
Top Crackers
1 Mr. Z  (9.9)
2 Antitrack  (9.8)
3 OTD  (9.8)
4 Fungus  (9.8)
5 S!R  (9.8)

Home - Disclaimer
Copyright © No Name 2001-2025
Page generated in: 0.09 sec.