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: 1989
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: 11118
args. operators that change their meaning depending on what labels come after them? /o\
2016-06-20 21:05
Oswald

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

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

Registered: Apr 2002
Posts: 2845
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: 490
Slammer, I liked that syntax. I'd definitely use it.
2016-06-21 06:08
Bitbreaker

Registered: Oct 2002
Posts: 500
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: 1378
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
bugjam
Mike
Bob/Censor Design
Alakran_64
Martinland
Matt
Scorpion/Contex / Ar..
Mibri/ATL^MSL^PRX
juN3bula/N3U
Viti/Hokuto Force
Linus/MSL
Guests online: 80
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 Wafer Demo  (9.5)
8 Dawnfall V1.1  (9.5)
9 Quadrants  (9.5)
10 Daah, Those Acid Pil..  (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 Logo Graphicians
1 Sander  (10)
2 Facet  (9.7)
3 Mermaid  (9.4)
4 Pal  (9.4)
5 Shine  (9.3)

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