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....
 
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...
2015-03-23 16:18
Pantaloon

Registered: Aug 2003
Posts: 124
To my knowledge the labels are limited to it's scope.

One way of doing the thing you want could be this.

.label DEBUG_MODE=1

.var MODIFY_PTR = 0

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

.if (DEBUG_MODE==1) // debug mode
{
inc MODIFY_PTR+1
}
rts
2015-03-24 11:01
Oswald

Registered: Apr 2002
Posts: 5017
seems overcomplicated.. how about:

lda #debug_mode
sta $d020

or:

if debug_mode
inc $d020
else
sta $d020

etc.
2015-03-24 16:39
chatGPZ

Registered: Dec 2001
Posts: 11101
Quote:
Are there any better way of doing similiar conditional assembly such like this?

use an assembler that properly supports scoping.
2015-03-24 16:49
Pantaloon

Registered: Aug 2003
Posts: 124
i was waiting for that comment from Groepaz :)
2015-03-24 17:32
Slammer

Registered: Feb 2004
Posts: 416
I guess Groepaz is the kind of person who goes down to the store to buy a tool so he can cook an egg. The clerk sells him a frying pan and the next day he comes back complaining that the pan is a terrible pot and that he can't get the egg hard-boild!

Groepaz: I think you mean an assembler that does not support scoping, not an assembler that supports scoping properly.
2015-03-24 18:24
chatGPZ

Registered: Dec 2001
Posts: 11101
i mean exactly what i said. and no, "not the right tool for the job" does not apply here at all. hardly any other assembler is broken like this.
2015-03-24 18:39
soci

Registered: Sep 2003
Posts: 473
Works as designed, it seems.
2015-03-24 18:56
chatGPZ

Registered: Dec 2001
Posts: 11101
i am not doubting that at all :)
Previous - 1 | ... | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | ... | 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
Mike
Hagar/The Supply Team
Mibri/ATL^MSL^PRX
St0rmfr0nt/Quantum
Guests online: 80
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 The Ghost  (9.6)
10 Bromance  (9.6)
Top onefile Demos
1 It's More Fun to Com..  (9.8)
2 Party Elk 2  (9.7)
3 Cubic Dream  (9.6)
4 Copper Booze  (9.5)
5 Rainbow Connection  (9.5)
6 Wafer Demo  (9.5)
7 TRSAC, Gabber & Pebe..  (9.5)
8 Onscreen 5k  (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 Graphicians
1 Sulevi  (10)
2 Mirage  (9.8)
3 Lobo  (9.7)
4 Mikael  (9.7)
5 Archmage  (9.7)

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