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....
 
2010-11-07 19:35
Mace

Registered: May 2002
Posts: 1799
I downloaded today, just minutes before that post.

[edit]
While you're at it, I've got another question.

I have declared to pseudocommands, GoDebug and DebugRoutine.

// ========================================================
.var DebugOn = 0
.pseudocommand GoDebug {
                         jsr SUB_Debug
                         .var DebugOn = 1 }
.pseudocommand DebugRoutine {
                         // some routine to show debug info
                         }
/* code here */

     :GoDebug

/* more code */

/* at the end of all code */
SUB_Debug
     .if (DebugOn == 1) :DebugRoutine
// ========================================================

The idea is that if :GoDebug is called (and not commented out), the :DebugRoutine will be added to the code.
If :GoDebug isn't called, there will be no code following the SUB_Debug label.

This, however, doesn't work, because the if-statement doesn't see DebugOn as 1 even if :GoDebug is called.

What could be a solution for this problem?


How weird... it suddenly works, without changing anything, just by compiling it again?!
2010-11-07 22:28
Slammer

Registered: Feb 2004
Posts: 416
It doesnt work because you declare several DebugOn variables. When you write:
.var x=0
you declare the variable x. If you write
.var x=0
.var x=0 // This gives an error
You will get an error for redefining x since you cant have two variables with the same name. In you example you don't get an error because you are redefining the variable inside a scope:
.var x=0
{var x=1} // This declares another x variable inside a scope
So what you really want to do is to modify you existing variable not declare a new one. This is done with the eval command:
.var x=0
.eval x=1


Edit: Saw you fixed the problem. Still guess you should check the .var command..
2010-11-07 23:05
Slammer

Registered: Feb 2004
Posts: 416
Ok, fixed the problem with the .text issue. Since the problem only existed from this morning and until now, there will be no new release number.

I happend to change the java source format to UTF-8 thinking 'That doesn't make any difference for the final code' and then some speedtest on the new ftp site by timing the uploading - Well, it turns out it did matter. Sorry for the inconvinience.
2010-11-10 15:01
Pantaloon

Registered: Aug 2003
Posts: 124
Question:

is there any way i can transform a char from a string to a numeric ascii value ?

asNumber obviously doesn't work.

ie.

.macro mymacro(str)
{
  for (var i = 0; i < str.size(); i++)
  {
    .var asciivalue = ASCIIVALUE(str.charAt(i))
  }
}


2010-11-10 15:12
JackAsser

Registered: Jun 2002
Posts: 1997
Knowing that Kick-Ass internally uses ISO-8859-1 and that the scripts seems quite close to java perhaps something like this would work:

.var asciivalue = s.charAt(i)+0;

But I dunno ofcuorse... :)
2010-11-10 15:43
Cruzer

Registered: Dec 2001
Posts: 1048
JackAsser's solution almost works, except the 0 has to be prefixed:
.var asciivalue = 0 + s.charAt(i)
2010-11-10 15:46
Mace

Registered: May 2002
Posts: 1799
@ Pantaloon: RTFM, especially paragraph 4.7.

Your question is answered there in full detail and it's much easier than you think.
2010-11-10 17:44
Pantaloon

Registered: Aug 2003
Posts: 124
GREAT!
2010-11-16 21:13
Mace

Registered: May 2002
Posts: 1799
I'd like to do a LoadBinary and redistribute the bytes into the memory in another way than in the original file.
Byte 1 @ $x000
Byte 2 @ $x040
Byte 3 @ $x080
Byte 4 @ $x0c0
.
.
.
Byte 9 @ $x001
Byte 10@ $x041
.
.
.
Byte 17@ $x002 etc.

In other words: byte 1 + n*8 in order, byte 2 + n*8 etc.

My solution now is:
	.var theData = LoadBinary "data.prg"

	.for (var TelA=0; TelA<8; TelA++) {
		.pc = NewData + TelA*64
		.for (var TelB=0; TelB<64; TelB=TelB) {
			.byte theData.get(TelA + [TelB*8])
		}
	}

Is there a quicker way to do this?
Like, with some nifty scripty thingy?
2010-11-16 23:41
Cruzer

Registered: Dec 2001
Posts: 1048
Something like this?

.fill theData.size(), theData.get(mod(i,8)*$40 + floor(i/8))
Previous - 1 | ... | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | ... | 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
Thunder.Bird/HF/MYD!..
morphfrog
csabanw
Mibri/ATL^MSL^PRX
nucleus/TempesT
Krill/Plush
MCM/ONSLAUGHT
Guests online: 76
Top Demos
1 Next Level  (9.7)
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 Aliens in Wonderland  (9.6)
10 Wonderland XIV  (9.6)
Top onefile Demos
1 Layers  (9.6)
2 Cubic Dream  (9.6)
3 Party Elk 2  (9.6)
4 Copper Booze  (9.6)
5 Rainbow Connection  (9.5)
6 It's More Fun to Com..  (9.5)
7 Dawnfall V1.1  (9.5)
8 Birth of a Flower  (9.5)
9 Daah, Those Acid Pil..  (9.5)
10 Quadrants  (9.5)
Top Groups
1 Nostalgia  (9.4)
2 Oxyron  (9.3)
3 Booze Design  (9.3)
4 Censor Design  (9.3)
5 Offence  (9.3)
Top Musicians
1 Rob Hubbard  (9.7)
2 Stinsen  (9.7)
3 Jeroen Tel  (9.6)
4 Linus  (9.6)
5 MacMagix  (9.6)

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