| |
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.... |
| |
Cruzer
Registered: Dec 2001 Posts: 1048 |
TWW: Why not use a parameter for that? |
| |
TWW
Registered: Jul 2009 Posts: 543 |
That's what I'm currently doing so yes, this is a luxory feature request 8-D |
| |
tlr
Registered: Sep 2003 Posts: 1762 |
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: 543 |
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: 1762 |
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: 543 |
Halleluja! Ask slammer and he has a way!!!
Beers on me if we ever meet!
About the ".ifdefined" thing, any news about this? |
| |
Slammer
Registered: Feb 2004 Posts: 416 |
No .ifdefined yet. What are you going to use it for? |
| |
TWW
Registered: Jul 2009 Posts: 543 |
F.ex:
I want a spudocommand/routine to behave in three different ways:
#1 - Set a global constant (ex: .const SafeMode = 1) which the automatically preserves all registers within pseudocommands.
#2 - Call up a pseudo with a SafeMode setting which then might overrrule the global setting to allow individual routines behave differently if I so choose.
#3 - If none of them are defined, force a default mode
So basically I want to check if a Constant or a Variable is defined from before.
However I am sure, by your question, you already got a(nother) method to do this^^ |
Previous - 1 | ... | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | ... | 61 - Next |