| |
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.. |
|
... 590 posts hidden. Click here to view all posts.... |
| |
TWW
Registered: Jul 2009 Posts: 541 |
Quote: Quoting TWW@ Krill: No it doesen't (which you surely know) but I really didn’t want to get into any this assembler vs. that assembler and exactly what I was trying to avoid in this thread. I am not thrilled about the syntax of some other assemblers however I try to keep it to myself. I'd keep my mouth shut if it was only about choosing the quirks of one assembler over the quirks of the other. :)
Alas, it isn't - if you cannot avoid other assemblers being involved.
Consider a 3rd party library - let's say, a loader. =)
The most basic and portable way to include it is via some sort of .incbin to statically link its binary.
The problem is that the symbols definition file with the relevant call and zeropage variable addresses and some other constants (included via some sort of .include) needs to be understood by your assembler - if you want to have clean code, at least.
It doesn't get simpler than "install = $1000" and "load = $2000" etc. (which is understood by pretty much each and every other 6502 assembler) then "jsr install" etc., and yet... need to "convert" that stuff in the include file to work with KA. Bit annoying.
Agreed, definately a pain, but doable (and regarding say, a loader, already done - check your pm) :D |
| |
Krill
Registered: Apr 2002 Posts: 2839 |
Quoting TWWAgreed, definately a pain, but doable (and regarding say, a loader, already done - check your pm) :D Not quite the solution i was hoping for, tbh. :) |
| |
Stone
Registered: Oct 2006 Posts: 168 |
@TWW: I was pompous, sure, but not sarcastic. There was no malice. |
| |
PAL
Registered: Mar 2009 Posts: 269 |
Strange how fast things just turn and get twisted or weird.
In our scene all people are on different skill levels and production methods (Novice. Advanced Beginner. Competent. Proficient. Expert.) Some are great at everything, while some others can not figure out things that seem simple or "stupid" yet create super great effects and parts... I think one should reflect a tad about the fact that we are all on different levels and also social skills... I think I have learned a lesson in the last one ;-)
@TWW - Looking forward to me and you get together after the summer and try to create something nice like we spoke of at X and in chats - We will have lots of fun with that! PAL |
| |
Martin Piper
Registered: Nov 2007 Posts: 634 |
Since I modified Acme to add python scripting support and exhaustive forward label resolution (it retries passes until all labels are defined consistent values) I prefer that assembler. :) |
| |
Frantic
Registered: Mar 2003 Posts: 1627 |
Quote: Since I modified Acme to add python scripting support and exhaustive forward label resolution (it retries passes until all labels are defined consistent values) I prefer that assembler. :)
Where is that version of ACME available, if anywhere? |
| |
Martin Piper
Registered: Nov 2007 Posts: 634 |
Quote: Where is that version of ACME available, if anywhere?
Win binaries: https://github.com/martinpiper/ACME/tree/master/Release
Tests:
https://github.com/martinpiper/ACME/blob/master/features/CheckF..
https://github.com/martinpiper/ACME/blob/master/features/CheckP..
https://github.com/martinpiper/ACME/blob/master/TestPython.a#L17
Source in same repo. |
| |
Frostbyte
Registered: Aug 2003 Posts: 166 |
I have a small problem, and I don't know if Kick Assembler has a way to provide the solution.
What I think I'd need is dynamic labels - that is, labels that are created and named dynamically at compile time.
In my macro, i'm generating code based on some input data, and I'd need labels within that code (in positions and numbers I don't know of yet at the time of generating the code). Then I'm generating another code block that would refer to those generated labels.
E.g. first bit of macro creates code with label1, label2, label3 etc.
Second bit of macro creates code that updates the values at the aforementioned labels.
As far as I can see this is not possible, at least with the usual labels that seem to be always hard-coded? Any other ideas how to do something like this? |
| |
trident
Registered: May 2002 Posts: 74 |
Quote: I have a small problem, and I don't know if Kick Assembler has a way to provide the solution.
What I think I'd need is dynamic labels - that is, labels that are created and named dynamically at compile time.
In my macro, i'm generating code based on some input data, and I'd need labels within that code (in positions and numbers I don't know of yet at the time of generating the code). Then I'm generating another code block that would refer to those generated labels.
E.g. first bit of macro creates code with label1, label2, label3 etc.
Second bit of macro creates code that updates the values at the aforementioned labels.
As far as I can see this is not possible, at least with the usual labels that seem to be always hard-coded? Any other ideas how to do something like this?
Instead of using a bunch of labels, you can create a list to keep track of the addresses, and then use that list to reach them. Like this:
.var ldas = List()
.macro the_macro_that_creates_the_code() {
.eval ldas.add(* + 1)
lda #0
sta $d020
}
Then, further down in the code:
.macro the_macro_that_refers_to_the_created_code() {
.for (var i = 0; i < ldas.size(); i++) {
lda colors + i,x
sta ldas.get(i)
}
} |
| |
Frostbyte
Registered: Aug 2003 Posts: 166 |
Quote: Instead of using a bunch of labels, you can create a list to keep track of the addresses, and then use that list to reach them. Like this:
.var ldas = List()
.macro the_macro_that_creates_the_code() {
.eval ldas.add(* + 1)
lda #0
sta $d020
}
Then, further down in the code:
.macro the_macro_that_refers_to_the_created_code() {
.for (var i = 0; i < ldas.size(); i++) {
lda colors + i,x
sta ldas.get(i)
}
}
Ahhh of course, brilliant! Thank you! I haven't tried it yet, but I can already see it solves my problem. :) |
Previous - 1 | ... | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 - Next |