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 > Converting ACME code to Kick Assembler
2016-06-19 03:24
Pixman
Account closed

Registered: Dec 2001
Posts: 42
Converting ACME code to Kick Assembler

In this code there are some confusing lines (since there are no proper ACME manuals):
http://codebase64.org/doku.php?id=base:double_irq
lda #$00 ;Reload A,X,and Y
reseta1 = *-1 ;registers
ldx #$00
resetx1 = *-1
ldy #$00
resety1 = *-1



Someone on #c-64 told me = is for the current Program Counter.

But there is no equivalent to this in Kick Assembler.

Solve it with branches?

I seriously have no idea how to fix this problem.

Any suggestions?
Tnx,
Pix
2016-06-19 05:20
Endurion

Registered: Mar 2007
Posts: 72
= sets a label's value. * = current program Counter

so reseta1 is set to the current program Counter - 1

I can't believe Kick Ass wouldn't have something similar, that's a quite essential Feature.
2016-06-19 06:25
Oswald

Registered: Apr 2002
Posts: 5022
ya. reseta is the addy of #$00 in lda #$00.

and * works.

http://www.theweb.dk/KickAssembler/webhelp/content/ch03s05.html
2016-06-19 07:17
Angel of Death

Registered: Apr 2008
Posts: 210
Ehmm... This has nothing to do with ACME itself. This is one of the oldest tricks there are used since the very first assemblers were around.
And the manual provided with ACME is fine and readable, so...
Are you sure you are ready for kickassembler yet? ;)
2016-06-19 08:05
chatGPZ

Registered: Dec 2001
Posts: 11130
thats what you get for having the attention span of a fruit fly
2016-06-19 11:08
Slammer

Registered: Feb 2004
Posts: 416
The syntax is not that different.
- Use // instead of ; for comments
- Use : at the end of labels.
- Use .label x=*+1 when you want to define a user defined label
- In older Kick Ass versions use .pc=$1000 instead of *=$1000

You could use the converter by Noice. Copy-paste your example into this form and get a converted output: http://tasmtokickass.insoft.se

The output is KickAss3.x but will also work in 4.x, and will work fine for your purpose.

Feel free to join https://www.facebook.com/groups/RetroAssembler/
A lot of the same people who hang around on CSDb is also is on RetroAssembler, but the discussion is a bit more friendly.
2016-06-19 16:46
ChristopherJam

Registered: Aug 2004
Posts: 1380
Interesting coding style. Personally I tend to express that pattern like this, albeit with the disadvantage of having to add the +1s if I move to SMC from (eg) zero page vars.
         sta reseta1+1 ;Preserve A,X and Y
         stx resetx1+1 ;registers
         sty resety1+1 ;via self modifying code
...
reseta1
         lda #$00      ;Reload A,X,and Y
resetx1                ;registers
         ldx #$00
resety1
         ldy #$00
2016-06-19 17:37
Oswald

Registered: Apr 2002
Posts: 5022
Quote: Interesting coding style. Personally I tend to express that pattern like this, albeit with the disadvantage of having to add the +1s if I move to SMC from (eg) zero page vars.
         sta reseta1+1 ;Preserve A,X and Y
         stx resetx1+1 ;registers
         sty resety1+1 ;via self modifying code
...
reseta1
         lda #$00      ;Reload A,X,and Y
resetx1                ;registers
         ldx #$00
resety1
         ldy #$00


I do the same. I think its more readable. just I put the labels infront of the instructions. moving from zp changes a lot in the other case aswell. its a small issue.

sta reseta1+1 ;Preserve A,X and Y
stx resetx1+1 ;registers
sty resety1+1 ;via self modifying code
...

reseta1 lda #$00 ;Reload A,X,and Y registers
resetx1 ldx #$00
resety1 ldy #$00
2016-06-19 19:17
Frantic

Registered: Mar 2003
Posts: 1627
In my case I tend to do similar to the original example, except putting it before the instruction rather than after:

myvariable = *+1
lda #$ff

Having that *+1 stuff at the line before an instruction immediately tells me that this is about self modifying code rather than being a program flow label (e.g. a label that you branch/jump to). Not saying that this is "the best way to do it". Just explicating why I do it the way I do.

...and, doing it this way, I don't have to put "+1" and stuff after the labels when accessing it. This means that if I change a variable from being stored in a "data segment" (so to speak) to being stored in (selfmodifying) code instead, I don't have to change all variable references to "sta myvariable+1" but I can just keep on using "sta myvariable".
2016-06-19 20:51
Oswald

Registered: Apr 2002
Posts: 5022
"...and, doing it this way, I don't have to put "+1" and stuff after the labels when accessing it."

when you put +1 after the labels its an implied sign that your code deals with self modify there. otherwise its just a label there and there's no way to tell if its a var or smc.

also you get even more clutter in the way of clean code when you want to selfmod 16bit abs value.

but its a matter of taste.
2016-06-19 21:03
Pixman
Account closed

Registered: Dec 2001
Posts: 42
Thanks for your help, Oswald.
But *-1 doesn't work. I found a solution, though:

.pc = *-1

Compiles!
€dit: Assembles, sorry
Yay!
 
... 80 posts hidden. Click here to view all posts....
 
Previous - 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 - 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
Dr. Doom/RAD
acrouzet/G★P
Guests online: 139
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 Memento Mori  (9.6)
10 Bromance  (9.5)
Top onefile Demos
1 It's More Fun to Com..  (9.7)
2 Party Elk 2  (9.7)
3 Cubic Dream  (9.6)
4 Copper Booze  (9.5)
5 TRSAC, Gabber & Pebe..  (9.5)
6 Rainbow Connection  (9.5)
7 Dawnfall V1.1  (9.5)
8 Quadrants  (9.5)
9 Daah, Those Acid Pil..  (9.5)
10 Birth of a Flower  (9.5)
Top Groups
1 Nostalgia  (9.3)
2 Oxyron  (9.3)
3 Booze Design  (9.3)
4 Censor Design  (9.3)
5 Crest  (9.3)
Top NTSC-Fixers
1 Pudwerx  (10)
2 Booze  (9.7)
3 Stormbringer  (9.7)
4 Fungus  (9.6)
5 Grim Reaper  (9.3)

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