Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
 Welcome to our latest new user maak ! (Registered 2024-04-18) 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....
 
2012-04-17 22:00
Killsquad
Account closed

Registered: Jun 2005
Posts: 17
To get the numeric value of the params use max.getValue(), min.getValue() and freq.getValue().
2012-04-17 22:15
Killsquad
Account closed

Registered: Jun 2005
Posts: 17
Would it be possible for enums to continue from the next number after an explicit value?
Example:
.enum { var1 = $10, var2, var3 }
should give var2=$11, var3=$12

As it is now var1=$10, var2=$00 and var3=$01

Thanks for the massive effort by the way. Excellent assembler!
2012-04-18 11:11
Cruzer

Registered: Dec 2001
Posts: 1048
Mace: Seems more like a job for a macro. Then you don't have to use getValue()
2012-04-18 18:27
Mace

Registered: May 2002
Posts: 1799
Thanks Killsquad.
@Cruzer: yeah, probably... was just foolin' around 'n stuff ;-)
2012-04-18 18:39
Slammer

Registered: Feb 2004
Posts: 416
Mace: What Killsquad and Cruzer said. Pseudocommands is macros that takes assembler instruction arguments. So you can write :myCmd #$20 or :myCmd $20 and the command will know that the first one is an immediate argument and the second one is an absolute argument although they both have the value $20.

Killsquad: Thanks! Good Point. I actually considered that solution when I made the enum directive and it could just as well have been that solution. However, I'm rather sensitive to things that destroys backwards compatibility so I'm not planning on changing it.
2012-04-30 08:12
ruk

Registered: Jan 2012
Posts: 43
Hi,

This does not compile:
.var hashtable = Hashtable()
.const booleanOption = hashtable.containsKey("booleanOption") && hashtable.get("booleanOption")


The error is "Error: Can't get a boolean representation from a value of type Null", so I guess there is some issues with lazy evaluation?

As a workaround I have defined the following function:

.function getValue(hashtable, key, defaultValue) {

        .if (hashtable.containsKey(key))
                .return hashtable.get(key)
         else
                .return defaultValue
}


So that I can do e.g.

 .const underTest = getValue(cmdLineVars, "testing", false)


2012-04-30 10:09
Cruzer

Registered: Dec 2001
Posts: 1048
@Ruk:

You're trying to make a boolean and (&&) of false (the result of containsKey) and null (the result of get), which doesn't make sense.

Your function seems to do the job, but you could also do it like this:
.const booleanOption = hashtable.containsKey("booleanOption") ? hashtable.get("booleanOption") : false

2012-04-30 13:37
ruk

Registered: Jan 2012
Posts: 43
Sure, np, but I've gotten used to lazy evaluations in boolean expressions.

Thing is, if containsKey() == false the '&&'-operator shouldn't evaluate the term to the right since the whole expression is bound to be false.

It just struck me as odd that Kickass complained.
2012-04-30 18:25
Cruzer

Registered: Dec 2001
Posts: 1048
Ah, so that's what you meant. Wasn't familiar with the term lazy evaluation. Guess KickAss doesn't use it, but I guess it would be smart from a performance viewpoint.
2012-04-30 20:27
tlr

Registered: Sep 2003
Posts: 1702
It's also commonly known as "short circuiting" operators. It is well defined for many C-like languages. I would guess it applies to Java as well.
Previous - 1 | ... | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | ... | 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
kbs/Pht/Lxt
Higgie/Kraze/Onslaught
Mixer
pcollins/Quantum
Guests online: 84
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.9)
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 Diskmag Editors
1 Jazzcat  (9.4)
2 Magic  (9.4)
3 hedning  (9.2)
4 Newscopy  (9.1)
5 Elwix  (9.1)

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