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....
 
2013-02-12 16:39
TWW

Registered: Jul 2009
Posts: 541
So Mads, I've got one question:

Question: Before I go ahead and make too many pseudocommands, is there any plans for implementing the 65816 OPC set?
2013-02-12 19:27
Slammer

Registered: Feb 2004
Posts: 416
TWW: The short answer is no. I'm considering doing a hand made lexer/parser which allows people to insert their own instruction sets (from whatever processor you wish) while reusing the script language. This will take some time, so earliest release date (if any) will be about a year from now. So if I were you I would just go ahead with the pseudo-commands.
2013-02-17 08:52
TWW

Registered: Jul 2009
Posts: 541
Fair enough. You've done very well to suply the sceene with this tool never the less. And hey, it's not that long to christmas ;-)


I have a question regarding pseudo-cmds (again):


    .pseudocommand STZ val {
        .if (val.getType()==AT_ABSOLUTE) {
//            .if (val.getValue()<256) {
//                .byte $64, <val.getValue()  // Stupid ZP fix
//            } else {
                .byte $9c, <val.getValue(), >val.getValue()
//            }
        }
        .if (val.getType()==AT_ABSOLUTEX) {
            .byte $9e, <val.getValue(), >val.getValue()
        }
        .if (val.getType()==AT_ZEROPAGE) {  // The pseudo don't recognize ZP adressing...
            .byte $64, <val.getValue()
        }
    }



When I call the routine with a :STZ $00 the result produced is absolute and not ZP. AbsoluteX works fine though. Am I doing something wrong?
2013-02-17 10:19
Slammer

Registered: Feb 2004
Posts: 416
When getting an argument like $80, and yet not know in which command its used, you don't know what address mode going to be used. It could be absolute, relative or zeropage.
  jmp $80 // Absolute
  lda $80 // Zeropage
  bne $80 // Relative
So the most basic form, absolute, is passed around and its up to the commands to decide if a specialised form is going to be used instead.

You can see the addressmodes pseudocommands recieve in table 7.2 here:
http://www.theweb.dk/KickAssembler/webhelp/content/ch07s03.html

2013-02-17 16:02
TWW

Registered: Jul 2009
Posts: 541
So my "Stupid ZP fix" wasn't so stupid after all then 8-D


Not really important but any plans on including mnemonic extensions (ref. Table 3.4. in the manual) for psuedos?
2013-02-17 17:55
Slammer

Registered: Feb 2004
Posts: 416
Never thought of that. If there is a need then I'll put it in the todo list.
2013-02-17 19:23
Cruzer

Registered: Dec 2001
Posts: 1048
Good idea, TWW! I vote for putting it on the TODO list.
2013-02-17 23:13
TWW

Registered: Jul 2009
Posts: 541
Aaannd... If you're really feeling like boored, include some more adressing modes in the extensions;


Program Counter Relative Long
BRL $1234

Stack Relative
LDA 15,S

Stack Relative Indirect Indexed Y
LDA (9,S),Y

Block Move
MVP 0,0

Absolute Long
LDA $123456

Absolute Long Indexed X
LDA $123456,X

Absolute Indexed Indirect
JMP ($1234,X)

Absolute Indirect Long
JMP [$1234]

Direct Page Indirect
LDA ($12)

Direct Page Indirect Long
LDA [$12]

Direct Page Indirect Long Indexed Y
LDA [$77],Y


Anyways, just a suggestion (And a boon for those of us who wishes to play more with the 65C816).
2013-03-18 08:57
Carlos
Account closed

Registered: Mar 2009
Posts: 15
Maybe this is a bit silly question but i'm starting with KickAss (and with asm in general...)

I have made a small macro library (change vic bank, change vic mode and things like that...) i have, for instance, a macro like:

.macro setBackground(color)
{
lda #color
sta $d021
}

nothing fancy, works ok if i use it.

Now i want use it from my mainloop to change the background color when i move the joystick up:

.var color = 0

read_joy:
lda $dc00
lsr
bcc joy_up
jmp read_joy

joy_up:
.eval color++
:setBackground(color)
jmp read_joy

i tought that the .var directive was the answer to my problem but seems that's only evaluated while assembling not during execution (so this code only works once).

Any idea how to set some kind of 'variable' in my main loop and use it as a parameter to a macro?
2013-03-18 09:16
Cruzer

Registered: Dec 2001
Posts: 1048
Yes, variables and other fancy stuff is only evaluated during assembly. Nothing but the machine code is compiled to the executable, so it's not like a normal programming language where you can do color++ in "realtime". In your case you need a memory location to hold your color value, and a machine code way of incrementing it:
read_joy:
	lda $dc00
	lsr
	bcc joy_up
	jmp read_joy

joy_up:
	inc color
	lda color
	sta $d021
	jmp read_joy

color:	.byte 0
Previous - 1 | ... | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | ... | 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
Mike
Nicron
zscs
A3/AFL
Knight Rider/TREX
Hobbit/Fairlight
oziphantom
ThunderBlade/BLiSS
Slaxx/Q/HF/MYD!
Guests online: 111
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 No Bounds  (9.6)
7 Comaland 100%  (9.6)
8 Aliens in Wonderland  (9.6)
9 Uncensored  (9.6)
10 Wonderland XIV  (9.6)
Top onefile Demos
1 Happy Birthday Dr.J  (9.7)
2 Layers  (9.6)
3 It's More Fun to Com..  (9.6)
4 Cubic Dream  (9.6)
5 Party Elk 2  (9.6)
6 Copper Booze  (9.6)
7 TRSAC, Gabber & Pebe..  (9.5)
8 Rainbow Connection  (9.5)
9 Dawnfall V1.1  (9.5)
10 Daah, Those Acid Pil..  (9.5)
Top Groups
1 Nostalgia  (9.4)
2 Oxyron  (9.3)
3 Booze Design  (9.3)
4 Censor Design  (9.3)
5 SHAPE  (9.3)
Top Crackers
1 Mr. Z  (9.9)
2 Antitrack  (9.8)
3 OTD  (9.8)
4 S!R  (9.7)
5 Fungus  (9.7)

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