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....
 
2014-12-18 22:52
Lead

Registered: Dec 2004
Posts: 20
Yes I'm afraid so aswell, hope Slammer sees, support for variable names would be awesome for those that want to keep an organized eye on the memory map.

I was afraid the way I subscribe was not beeing understood by people as there was little reply. I will try to explain a bit more accurate so people know what I mean for sure ;)

Here's some coding, this is not a function I created to use in production but more as a test :

.macro getFile(fileName, loadAdr) {
.pc = loadAdr "Image"
.var picture = LoadPicture(fileName, List().add($444444, $6c6c6c,$959595,$000000))
.fill $800, picture.getMulticolorByte(i>>7,i&$7f)
}

use with :getFile("image.png", $2000)

This will correctly load a file to memory at $2000 and will show up in memorymap like this when you have more images :

Memory Map
----------
$0801-$080c Basic
$0900-$0910 Main Code
$2000-$27ff Image
$2800-$2fff Image
$3000-$37ff Image


That's where I want to keep my namings in order ;)
2014-12-19 06:45
Slammer

Registered: Feb 2004
Posts: 416
Hi, I do check this thread, so any questions asked will be answered eventually. Also, I wanna stay a bit in the background to give other users room for stating their views and experiences.

In the case of the PC directive, you are right, the .pc directive only takes a string, not an expression. I don't think it will be a big deal to change so I'll see what I can do.
2014-12-19 10:13
Lead

Registered: Dec 2004
Posts: 20
Hi Slammer thanks for confirming, I understand and think you do the right thing with staying a bit in the background so others can share their thoughs aswell.

In this case though it seems that there are very little people the came across this iussue or had anything to say about it (other than Ruk). You're right on the fact that eventually stuff gets answered in this thread... I've been reading this one all the way. there's some good stuff hidden below ;)
2014-12-19 17:30
Slammer

Registered: Feb 2004
Posts: 416
Lead: Its always cool to know how other people does things, and with discussions in the KickAss-facebook group and by mail together with doing a bit of demo stuff and some other projects its hard to get time to code new features for Kick Assembler. That why i really want to encourage people to help answering questions.

Btw. The official 'Kick Assembler Wish List' is in the facebook group. Feel free to drop by and enter your wishes.
2014-12-20 12:50
Lead

Registered: Dec 2004
Posts: 20
I just got on the MickAss facebook and saw there is no need for me to add it to the feature request list as it allready is there :

- Auto naming of memory blocks after variables, so you can write: .pc = coolRoutine, and it shows up as coolRoutine in the memory map, instead of "unnamed".

At least, I assume this is the same as I requested. I'll keep an eye on that page and hope this will be implemented in a future update :)
If I come up with other idea's you;ll see them either here or there...
2015-01-04 15:20
Slammer

Registered: Feb 2004
Posts: 416
I gave it a look and found out that both the name and virtual parameters are optional which makes it impossible if we shall maintain backwards compatibility since the parser can see the difference between a string and a indentifer, but not between an expression and an identifer.

Technical talk, i know.. However the wish stays on the wish list. I might revice the .pc syntax in a later version.
2015-01-04 20:34
Mace

Registered: May 2002
Posts: 1799
What about a .name directive with a more elaborate syntax, in addition to what is already possible?
.pc = $2000
.name fileNameOfMacro + " at " + * // result: myMacro.asm at $2000
2015-01-13 11:04
Fresh

Registered: Jan 2005
Posts: 101
Hi slammer,
first of all thanks for a great tool.
I have a little problem with "arrays of labels". This kind of problem is partially solvable (pantaloon already pointed out a working solution in this thread) but it can't be used in every contexts.
The sample code:
.var	test=List()

.for(var i=0;i<10;i++)
  .for(var j=0;j<random()*20;j++)
    {
     .eval test.add(*)
     .byte i
    }

main:
	lda test.get(0)
	rts


This works fine but using a List to store the addresses brings some problem if I need to swap code and data:
.var	test=List()

main:
	lda test.get(0)
	rts

.for(var i=0;i<10;i++)
  .for(var j=0;j<random()*20;j++)
    {
     .eval test.add(*)
     .byte i
    }

This clearly doesn't work because I'm trying to get values from a List which is still empty.
So, based on my example, what to do if the code needs to be located *before* the data? Maybe defining a List of ".label" which may be evaluated after some passes?
2015-01-13 16:46
Slammer

Registered: Feb 2004
Posts: 416
Good question. I can tell you that I had the same problem as late as december where i had some cyclic references in the code, meaning no matter which code you place first you will always get an error. Currently, I got no solution ready yet, but I am thinking about some approches.

If you need a solution now, you might try to have two versions of you code. A virtual (.pc = $1000 virtual), and a non virtual (.pc = $1000), and place them in this order:
1. Virtual version of code, that calculates the label array 
2. Dependant code that uses the label array 
3. Real (nonvirtual) version of code 

If you place the code inside a macro with the label list as argument you only have to define it once. I havn't tried that approch yet though.
2015-03-23 13:43
Agemixer

Registered: Dec 2002
Posts: 38
Hi,

I'm still new to kickassembler and found this thread - in need to continue with the question about conditional assembly.. But it's not exactly the same. I needed something like this to remove some debug code from the final product (simplified example):

.label DEBUG_MODE=1

.if (DEBUG_MODE==1) // debug mode
{
lda #$00
sta $d020
MODIFY_THIS:
lda #$00
sta $d020
}
lda #$00 // normal or debug mode
sta $d020

.if (DEBUG_MODE==1) // debug mode
{
inc MODIFY_THIS+1
}
rts

..which gives "Error: Unknown symbol 'MODIFY_THIS'"

So i needed to pull all labels like MODIFY_THIS out of .if, to get it compiled:


.if (DEBUG_MODE==1) // debug mode
{
lda #$00
sta $d020
}
MODIFY_THIS:
.if (DEBUG_MODE==1) // debug mode
{
lda #$00
sta $d020
}
lda #$00 // normal or debug mode
sta $d020
.if (DEBUG_MODE==1) // debug mode
{
inc MODIFY_THIS+1
}
rts


Are there any better way of doing similiar conditional assembly such like this? I don't even know which order kickass parses the asmfile, but this is just strange. Is that the same scope issue in question? I got a plenty of SMC labels like Something=*-1 so my code looks like ANYTHING else but CLEAN because of this :)

How you would create that kind of label touching code? I spent just several hours just because of this...
Previous - 1 | ... | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | ... | 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
Apollyon/ALD
kbs/Pht/Lxt
Scooby/G★P/Light
Arcane/Glance
Guests online: 111
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 The Ghost  (9.6)
9 Wonderland XIV  (9.6)
10 Bromance  (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 NTSC-Fixers
1 Pudwerx  (10)
2 Booze  (9.7)
3 Stormbringer  (9.7)
4 Fungus  (9.6)
5 Grim Reaper  (9.3)

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