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..
 
... 592 posts hidden. Click here to view all posts....
 
2012-12-07 11:31
ruk

Registered: Jan 2012
Posts: 43
I've been using cmdLineVars in order to inject global constants, e.g. "debug", and some macros / functions to support this:

.function isDebug() { 
    .return cmdLineVars.get("debug") != null && cmdLineVars.get("debug").asBoolean()
}

.pseudocommand debugD020 {
    .if (isDebug()){
        inc $d020
    }
}

.pseudocommand rebugD020 {
    .if(isDebug()){
        dec $d020
    }
}



Works like intended, and I can surround debug code with isDebug() or use debugD020 without worrying where the debug-symbol is defined.

But it is a little quirky having to declare ":debug=true" on the commandline. I would rather see something similar to Java's "final static" in addition to the cmdlineVars hash.

Also, vars, consts and friends should respect the namespace they are declared in.

@Cruzer:

What about

block: {
    label:
    .if (true) {
	 nop
    }
}

jmp block.label
2012-12-07 11:43
chatGPZ

Registered: Dec 2001
Posts: 11145
"Can I see the code contructs you are using? Is it labels or options you are setting up this way?"
both. i use conditional assembling with labels inside if/then a lot, and also headers with defines that are switched for different configurations. and i honestly dont feel like showing more code just to see another proposed super ugly workaround as a response =)
"So send me an example of 'ugly code' and preparsing will be taken into consideration."
if whats shown in this thread doesnt already convince you, then all hope is lost - forget it. maybe kickass is for tables and not for code =P
"vars, consts and friends should respect the namespace they are declared in."
yes. and it should be possible to explicitly export them into the parent namespace. thats how any other sane assembler does it anyways =P
2013-01-27 12:32
FATFrost
Account closed

Registered: Sep 2003
Posts: 211
hi, i have a problem running Kickass, in osx i get

Exception in thread "main" java.lang.NoClassDefFoundError: kickass/jar
Caused by: java.lang.ClassNotFoundException: kickass.jar
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247

Do i need to update or install anything?

Any help would be appreciated!! :)
2013-01-27 12:57
Cruzer

Registered: Dec 2001
Posts: 1048
FATFrost: Did you remember -jar? E.g. java -jar KickAss.jar
2013-01-27 15:58
FATFrost
Account closed

Registered: Sep 2003
Posts: 211
er...let me have look// :)

2013-01-27 16:01
FATFrost
Account closed

Registered: Sep 2003
Posts: 211
Yeahz!! got it working nice!! Thanks Cruzer!!
2013-02-12 16:39
TWW

Registered: Jul 2009
Posts: 541
So Mads, I've got one question:

Question: Before I go ahead and make too many pseudocommands, is there any plans for implementing the 65816 OPC set?
2013-02-12 19:27
Slammer

Registered: Feb 2004
Posts: 416
TWW: The short answer is no. I'm considering doing a hand made lexer/parser which allows people to insert their own instruction sets (from whatever processor you wish) while reusing the script language. This will take some time, so earliest release date (if any) will be about a year from now. So if I were you I would just go ahead with the pseudo-commands.
2013-02-17 08:52
TWW

Registered: Jul 2009
Posts: 541
Fair enough. You've done very well to suply the sceene with this tool never the less. And hey, it's not that long to christmas ;-)


I have a question regarding pseudo-cmds (again):


    .pseudocommand STZ val {
        .if (val.getType()==AT_ABSOLUTE) {
//            .if (val.getValue()<256) {
//                .byte $64, <val.getValue()  // Stupid ZP fix
//            } else {
                .byte $9c, <val.getValue(), >val.getValue()
//            }
        }
        .if (val.getType()==AT_ABSOLUTEX) {
            .byte $9e, <val.getValue(), >val.getValue()
        }
        .if (val.getType()==AT_ZEROPAGE) {  // The pseudo don't recognize ZP adressing...
            .byte $64, <val.getValue()
        }
    }



When I call the routine with a :STZ $00 the result produced is absolute and not ZP. AbsoluteX works fine though. Am I doing something wrong?
2013-02-17 10:19
Slammer

Registered: Feb 2004
Posts: 416
When getting an argument like $80, and yet not know in which command its used, you don't know what address mode going to be used. It could be absolute, relative or zeropage.
  jmp $80 // Absolute
  lda $80 // Zeropage
  bne $80 // Relative
So the most basic form, absolute, is passed around and its up to the commands to decide if a specialised form is going to be used instead.

You can see the addressmodes pseudocommands recieve in table 7.2 here:
http://www.theweb.dk/KickAssembler/webhelp/content/ch07s03.html

Previous - 1 | ... | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | ... | 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
psych
Digger/Elysium
Colt45RPM
iAN CooG/HVSC
Sentinel/Excess/TREX
t0m3000/HF^BOOM!^IBX
Broti/DT/KRN
Sulevi/Virtual Dreams
zscs
algorithm
kbs/Pht/Lxt
Mason/Unicess
Guests online: 111
Top Demos
1 Next Level  (9.8)
2 13:37  (9.7)
3 Mojo  (9.7)
4 Coma Light 13  (9.7)
5 Edge of Disgrace  (9.6)
6 Comaland 100%  (9.6)
7 Uncensored  (9.6)
8 No Bounds  (9.6)
9 Wonderland XIV  (9.6)
10 Bromance  (9.5)
Top onefile Demos
1 Layers  (9.7)
2 It's More Fun to Com..  (9.6)
3 Party Elk 2  (9.6)
4 Cubic Dream  (9.6)
5 Copper Booze  (9.6)
6 TRSAC, Gabber & Pebe..  (9.5)
7 Rainbow Connection  (9.5)
8 Dawnfall V1.1  (9.5)
9 Quadrants  (9.5)
10 Daah, Those Acid Pil..  (9.5)
Top Groups
1 Oxyron  (9.3)
2 Booze Design  (9.3)
3 Censor Design  (9.3)
4 Crest  (9.3)
5 Performers  (9.3)
Top Organizers
1 Burglar  (9.9)
2 Sixx  (9.8)
3 hedning  (9.7)
4 Irata  (9.7)
5 MWS  (9.6)

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