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 > Question about Kickassembler 5.2 compilation process
2018-12-28 17:43
Antu Manthureie
Account closed

Registered: Oct 2007
Posts: 4
Question about Kickassembler 5.2 compilation process

Hi, I recently discovered Kickassembler 5.2 and I'm using it in a project for a c64 videogame.
I have used extensively macros and structs and so far I have come down little to the assembler level: the project seems almost written in pseudo-C without pointers :).
I created several .asm files, each corresponding to a functional module (Actor.asm to define the NPCs behaviour an state, Game.asm to organize the game loop etc.) and I created a main.asm file to launch the game.
As long as I try to build individual .asm files I have no problems, but when I run the build on main.asm which is the entry point for the code flow, the compiler hangs on the first flex pass and does not go on.
I wanted to know if anyone in the community has ever encountered a similar problem and I wonder if this is not due to some difficulty of the compiler to find some missing reference to move on to the next steps.
I have no way of carrying out control .print in phase 1, is this true?

Thanks for the help, have a nice day!
2018-12-28 19:09
Antu Manthureie
Account closed

Registered: Oct 2007
Posts: 4
After a session of manual code trace, I've discovered that if I use while like this in the main game loop:

.macro Game_runLoop(this){
	.var inputData = InputData()
	.while(Game_mustGoOn(this)){ 
		:Game_processInput(inputData)
		:Game_update(this, inputData)
		:Game_prepareScene(this)
		:Game_prepareActiveElements(this)
		:Graphics_render()
	}	
}
.function Game_mustGoOn(this){
	.return this.player.state.stateID != "S_PLAYER_DEAD";
}


the compiler hangs on flex pass 1.
2018-12-28 21:11
Frantic

Registered: Mar 2003
Posts: 1627
Not sure, but it seems like you're confusing runtime and compile time code. The while loop that waits for player dead or not sounds like something that should be executed at runtime, but the macro code is obviously executed at compile time.
2018-12-28 22:18
Antu Manthureie
Account closed

Registered: Oct 2007
Posts: 4
Quote:
but it seems like you're confusing runtime and compile time code


Oops ... I think I totally misunderstood the fact that .macro means a real macro, which is expanded at compile time! :( Thank you so much Frantic for pointing it out to me, I have not written code for a long time and I need some practice.
2018-12-28 23:31
Cruzer

Registered: Dec 2001
Posts: 1048
A lot of n00bs make this error at first. "Wow, this looks just like a high level language. Guess I don't need to write asm code anymore."

But in reality, you need to learn asm coding first, and then you can use some of the high level functionality to help you with some of the repetitive tasks.

If you're looking for a high level language that can compile to machine code that runs with a decent speed there is the KickC project by Rex/CML. Disclaimer: Still in beta, and I haven't even tried it yet.
2018-12-29 11:02
Antu Manthureie
Account closed

Registered: Oct 2007
Posts: 4
Thank you Cruzer, anyway
I think I will insist with assembler code.
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
Nordischsound/Hokuto..
teloni0
QuasaR/CENTRiC
psych
macx
Frostbyte/Artline De..
Guests online: 138
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.8)
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 Swappers
1 Derbyshire Ram  (10)
2 Jerry  (9.8)
3 Violator  (9.8)
4 Acidchild  (9.7)
5 Starlight  (9.6)

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