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
 
... 80 posts hidden. Click here to view all posts....
 
2016-06-20 20:56
JackAsser

Registered: Jun 2002
Posts: 2014
Quote: hehe, that kinda defeats the whole new syntax thing though =)

Yeah, indeed.

Suggestion:
; 8-bit argument
sta arg
lda arg:#$00

; 16-bit argument
lda #<$c020
sta <addr
lda #>$c020
sta >addr
...
bit addr:$0000
2016-06-20 21:05
chatGPZ

Registered: Dec 2001
Posts: 11386
args. operators that change their meaning depending on what labels come after them? /o\
2016-06-20 21:05
Oswald

Registered: Apr 2002
Posts: 5094
very neat suggestions. but sta >addr would conflict with normal usage of ><
2016-06-20 21:06
Oswald

Registered: Apr 2002
Posts: 5094
how about sta addr> and sta addr<
2016-06-20 21:20
Krill

Registered: Apr 2002
Posts: 2980
To be honest, this looks like syntactical sachharin to me, creating more problems than it solves. A 6502 op-code is always one byte, its first argument byte always one byte later, and the second two. I see no problem with the classical way of doing it, e.g.
store: sta $1234
[...]
stx store + 1; set lo-byte of argument address
sty store + 2; set hi-byte of argument address
To make it a bit fancier (and cleaner, depending on taste), use macros, so you can do
store: sta $1234
[...]
stx SELFMODLO(store); set lo-byte of argument address
sty SELFMODHI(store); set hi-byte of argument address
2016-06-20 22:05
Slammer

Registered: Feb 2004
Posts: 416
I don't mind writing +1 at the end of the label reference, if we should do that better it must only be one char since +1 is only two.

I see alot of possibilities in this:

- It makes a label point to the argument, so you can easier switch between 'normal label before byte directive' and 'selfmodifying code'.

- You don't have to reuse a loop label as an argument label, you can do:
loop: lda.a memPos:$0000
- When a label is inside a library routine it might be good that the caller don't know what the implmentations is behind it:
myRoutine: {
	lda color	
	sta $d020
	rts
color: byte 0
}
or
myRoutine: {
	lda color:#$00	
	sta $d020
	rts
}
- Visually, It might make it easier to find your loop labels as there are fewer labels on the left of the screen. (Again it might make it harder to find you argument labels since they don't start at column 0)

- It makes it clearer what the purpose of the label is.

- Users don't have to use the syntax, so it don't cripple anybodys codingstyle - you can always use good old +2 if you want to.

- It works nicely without +1 for all one byte arguments

I think its a matter of style, and it have to be tried in practise to figure out if its good or not and taste is individual. You never improve your style if you don't try something new.

Krill: Indeed it is syntactic sugar, since you could do the same by combining a mnemonic an a user defined label.
2016-06-20 22:29
Skate

Registered: Jul 2003
Posts: 494
Slammer, I liked that syntax. I'd definitely use it.
2016-06-21 06:08
Bitbreaker

Registered: Oct 2002
Posts: 508
These are the coder's problems when we wait for the graphics to be done.
2016-06-21 06:13
ChristopherJam

Registered: Aug 2004
Posts: 1409
I like that syntax a lot.

Happy to be using +1 to get to the high byte; I already do that for zero page pointers anyway, this way I'd not be using +0/+1 for zp, +1/+2 for SMC.

It removes the overloading where sometimes +1 means SMC and sometimes it means high byte.

(oh, and a belated +1 for JackAsser's comment that newbies should be using stack rather than SMC anyway. Optionally only save what you're going to trash too - applies as much to AXY as it does to $01)
2016-06-21 07:44
Slammer

Registered: Feb 2004
Posts: 416
An argument label could generate 3 labels:
lda.a memPos:$1000 // Generates: memPos, memPosLo, memPosHi
This enforces a special naming convention, which I don't like (It should be up to the user).
We could also make fields on labels. So you could do:
sta memPos.lo
stx memPos.hi
...
lda.a memPos:$1000
That would remove the need for +1. There are alot of possibilities :-)
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
Metal Maniac/Dual Crew
McGurk/Coma
csabanw
Xiny6581/Dees Produc..
Dan
Morpheus/IPC+C64.COM
E$G/HF ⭐ 7
El Jefe/Slackers^sidD
algorithm
MWR/Visdom
Guests online: 122
Top Demos
1 Next Level  (9.7)
2 13:37  (9.7)
3 Mojo  (9.7)
4 Coma Light 13  (9.6)
5 Edge of Disgrace  (9.6)
6 What Is The Matrix 2  (9.6)
7 The Demo Coder  (9.6)
8 Uncensored  (9.6)
9 Comaland 100%  (9.6)
10 Wonderland XIV  (9.6)
Top onefile Demos
1 Layers  (9.6)
2 No Listen  (9.6)
3 Cubic Dream  (9.6)
4 Party Elk 2  (9.6)
5 Copper Booze  (9.6)
6 Dawnfall V1.1  (9.5)
7 Rainbow Connection  (9.5)
8 Onscreen 5k  (9.5)
9 Morph  (9.5)
10 Libertongo  (9.5)
Top Groups
1 Performers  (9.3)
2 Booze Design  (9.3)
3 Oxyron  (9.3)
4 Triad  (9.3)
5 Censor Design  (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.055 sec.