| |
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.... |
| |
tlr
Registered: Sep 2003 Posts: 1737 |
Quoting SlammerTlr: Like in java, you can't reach a variable declared inside an if (or for). If you want to access it outside the scope of the if, then declare it outside of the scope and set it inside.
Will give predeclaration a go.
What's causing the confusion is that there is no preprocessor style if.
Other assemblers usually treat both if's and macros in a preprocessor sense, often even using multiple passes to resolve conflicts.
This of course causes some other problems (like oscillations) which you solve in kick assembler with much stricter parsing rules.
I'll see if I can figure out a way to adapt my coding style to this difference.
|
| |
TWW
Registered: Jul 2009 Posts: 542 |
Feature Request:
Maybee this is a posibility already but here goes:
Allow Suffixes to Pseudocommands according to some fixed syntax.
Ex:
A multiply routine can be called with either:
:MUL_S <- for Signed Mul (suffix being the "_S")
or
:MUL_U for Unsigned (Suffix is "_U").
This is just an example and so is the syntax but it would allow you to put both these routines inside one file instead of two (there would ofcourse have to be some way to use these suffixes inside the pseudo to make descicions).
Another thing:
Did the ".IfDefined" feature requested by someone before see the day of light?
Cheers! |
| |
Cruzer
Registered: Dec 2001 Posts: 1048 |
TWW: Why not use a parameter for that? |
| |
TWW
Registered: Jul 2009 Posts: 542 |
That's what I'm currently doing so yes, this is a luxory feature request 8-D |
| |
tlr
Registered: Sep 2003 Posts: 1737 |
I thought I'd post a few things I've run in to lately. If the suggestions are too crazy, feel free to disregard them. :)
1:
I tried just now to write a file format header using kick assembler and discovered that there is no pseudo op to output ascii. (.text converts lower case to screen codes.)
.ascii "Header Ident!"
.byte 0 That would be useful!
2:
Consider this:
.pc = $1000
start:
lda #<msg
ldy #>msg
jmp $ab1e
msg:
.text "LEN $"+toHexString(end-start)
.byte 0
end: In this example toHexString() will generate lowercase, which is fine. However how do I convert it automatically to upper case? A custom to_upper(str) will fail because the string isn't fully resolved in the first pass.
3, A suggestion:
It would be useful to be able to generate UC-mode/LC-mode screen codes/petscii in some structured way.
.text_u "HELLO WORLD!"
.text_l "Hello World!"
.scr_u "HELLO WORLD!"
.scr_l "Hello World!" A function wrapper could be a substitute, but see 2 above.
4, another suggestion:
It would be useful to be able to mix bytes and strings.
.text "STRING",0
.byte TOKEN_SYS,"2061",0,0,0 I guess some of this could be emulated with macros, but I usually prefer the short form. |
| |
TWW
Registered: Jul 2009 Posts: 542 |
tlr: Good suggests!
Cruzer: Just to add: I find it a bit akward to use numerical parameters to pass on to a pseudo which should dictate what way it should operate.
i.e:
:MUL "S" ; #$04 ; #$10 ; $1000
would work fine but since I can't pass strings and you need to remeber that 1 = signed and 2 = unsigned etc. it doesen't look and feel that tidy to me anymore.
So: just allow a suffix to be passed OR allow passing of strings and it's all Rock and Roll Rulletobakk after that. |
| |
Slammer
Registered: Feb 2004 Posts: 416 |
You can allready use _ in commandnames. Why don't you use two extra lines to define the two pseudo commands:.pseudocommand MUL_S a ; b ; tar { :MUL 1 ; a ; b ; tar}
.pseudocommand MUL_U a ; b ; tar { :MUL -1 ; a ; b ; tar}
.pseudocommand MUL sign ; a ; b ; tar {
/* CODE..
Use .if (sign==1) {...} etc.
*/
} |
| |
Slammer
Registered: Feb 2004 Posts: 416 |
Thanks for the suggestions.. I have had several whishes for uppercase/lowercase selection so that will be put high on the list. |
| |
tlr
Registered: Sep 2003 Posts: 1737 |
Quote: Thanks for the suggestions.. I have had several whishes for uppercase/lowercase selection so that will be put high on the list.
Great!
In case it wasn't clear enough:
in 3 I am suggesting that .text_u generates petscii suitable for printing with the uppercase charset, and .text_l generates the same suitable for printing with the lowercase charset.
.scr_u and .scr_l does the same but with screen code output.
In 1 I mean plain ASCII, or perhaps ISO-8859-1.
In 2 either some kind of conversion function, or better yet, solve the resolution problem in some way.
|
| |
TWW
Registered: Jul 2009 Posts: 542 |
![](http://rubmint.com/wp-content/plugins/wp-o-matic/cache/51473_funny-pictures-cat-praises-lols.jpg)
Halleluja! Ask slammer and he has a way!!!
Beers on me if we ever meet!
About the ".ifdefined" thing, any news about this? |
Previous - 1 | ... | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | ... | 61 - Next |