|
Post by cbmguy on Sept 17, 2015 20:23:26 GMT
Does anyone have any experience with kickAssembler? I cannot seem to figure out character strings. It seems that any lowercase characters are automatically translated to screencodes and uppercase characters are translated to petscii. I'm programming for the VDC which can use both lower and upper case sets at the same time.
The issue is this: using the following,
jsr primm .text "F1 Help F2 View" .byte 0
results with: f1 h f2 v
and sometimes some funky screen attributes (blinking, rvs, etc) occurs, too because of the way the text strings are being compiled. Besides coding each character in a .byte list, I have no idea how to change this problem.
I was asked to use the C= & SHIFT key to change character sets. Am I missing something? Is there a way to use char strings easily?
cheers, c
|
|
|
Post by hydrophilic on Sept 18, 2015 5:05:45 GMT
God bless you cbmguy, I found the documentation for KickAssembler amazing... but it failed me in so many ways that I eventually went schizo (I reverted to old/true assemblers on the one hand, but developed my own custom assembler on the other hand!). Err, sorry, that is not very helpful! I *thought* I read in the documentation how to change character sets (I assume this is this root cause of your problem), but upon review of the documentation, I do not see how this is possible (changing character sets). Maybe we missed something? So, yeah, I had to abandon KickAssmbler myself, but maybe there is a way to do this? If so, I too would like to know how!
|
|
|
Post by cbmguy on Sept 18, 2015 14:09:08 GMT
Thanks for the reply. Any two cents is better than none. I love this assembler for the scoping one can do of their source code. It excels at everything, but that fundamental and (IMHO) very basic function. Unfortunately, this is breaking it for me, big time. It's making using the custom characters next to impossible on the VDC. I've asked for a .pet directive to force all char's and strings into petscii code regardless of whether the 7 bit is set or not. I'm still hoping to be told I'm doing it wrong and there's a way to make this compile properly. Cheers!
|
|
|
Post by VDC 8x2 on Sept 21, 2015 14:41:29 GMT
God bless you cbmguy, I found the documentation for KickAssembler amazing... but it failed me in so many ways that I eventually went schizo (I reverted to old/true assemblers on the one hand, but developed my own custom assembler on the other hand!). I have been dabbling in kick-assembler too. I am very curious about your custom assembler. What is it like?
|
|
|
Post by hydrophilic on Sept 22, 2015 12:41:39 GMT
My assembler? Well one author like to use an analogy with vehicles: some are like sports cars, they get you there fast but you need to be very careful; some are like a family sedan, they get you there reliably and safely but aren't good off-road; my assembler is like a tank, it will roll over any obstacle in its path, if you want (but isn't very fast).
Considering the speed of modern computers, and the size of CBM files I like to assemble (usually the BIN is 10K or less), speed is not an issue at all. I wrote it in VB because it was too big for me to try in C.
Anyway, it lets you use most any assembler format you like. You can change the strictness of input, rename psudo-ops, rename (err re-symbol) operators, change operator precedence, blah blah blah. I haven't worked on it in awhile, but have over 20 pages of documentation, as I recall. I stopped when I had a problem with variable exporting and segment writing.
I could finish it, just haven't had the time/motivation ... I just really like the way it will do things that make most assemblers cry like a baby. For example, many allow you to use conditional assembly, but as far as I can tell, all others will stop if the condition isn't defined yet (forward reference). My favorite example is probably this:
LDA #0 ;force .Z flag .if (target - (* + 2) +128) and -256 BNE + JMP target .else BEQ target .endif + RTS .fill 80 target RTS
If it isn't obvious, this is just a "smart" branch... if the distance to target (target - [current_address+2]) is not a signed 8-bit number, then use JMP, else use BEQ. So here it should assemble as BEQ, but if you changed the fill command to emit 200 bytes for example (instead of 80) then it would assemble as BNE / JMP because 'target' would be out of range of BEQ. I've tried many many assemblers, and my "tank" is the only one that works.
Note that some people will claim it is not possible... and some assemblers make up special opcodes to do just that (with names like GEQ, GNE, GCC, GCS, etc.) which shows it can be done. It just always annoyed me that the authors kept that power to themselves (secret internal code) and never let you, the programmer, have that power... will now you can!
Plus it also annoyed me how different assemblers would have different names for psudo-ops or, operator precedence, allowed number formats, name formats, etc. You can change any of that stuff, but be careful not to make it logically inconsistent! I guess it is really a meta-language assembler of sorts. Right now I only have it parse 6502 code, but it is setup to allow other similar processors, like Z80 or 65816. Also, each processor can have its own syntax, so you are not forced to use some general purpose syntax for everything (I hate that).... but you could tell it to act like that if you want...
Maybe biggest problem isn't it doesn't have a name... I was thinking myBitch but that might be too offensive.
cbmguy, sorry still didn't answer your question! Based on your description, it seems like maybe it is using SCREEN codes (so called POKE codes) instead of ASCII or PETSCII? I looked through the documentation I have for kickAssembler, and it doesn't say what encoding it uses or how to change it. Grrr...
I guess you could write a psudo-op that just a FOR loop over the input string (parameter) and then output a .BYTE for each character, doing any necessary conversion. Kind of messy just to use different character sets, but it should work.
|
|
|
Post by VDC 8x2 on Sept 22, 2015 16:35:15 GMT
Maybe biggest problem isn't it doesn't have a name... I was thinking myBitch but that might be too offensive. Call it: Tank assembler. lol
|
|
|
Post by cbmguy on Sept 22, 2015 16:49:12 GMT
Maybe biggest problem isn't it doesn't have a name... I was thinking myBitch but that might be too offensive. lol good one! lol And yes, the lowercase char strings are compiled into screen codes while the uppercase are compiled into normal chr$ values. It's not very useful. I've converted the modules to 64TASS 1.51, but the .proc/.endp directive won't provide internal labels to be printed to a text file. The source code is modular and sometimes modules seem to be skipped when compiled, as if it is over looking the .include directive. It seems that each cross assembler is broken in some way or another. I've decided to take a break and build a server that will sync the source code so I can work on it at work and from home without too much hassle.
|
|
|
Post by hydrophilic on Sept 24, 2015 4:14:00 GMT
Thanks for the info, cbmguy! It just so happens that uppercase PETSCII screen-codes are the same as default (unshifted) CHR$ codes in ASCII. For example, PETSCII screen-code 01 = "a" while PETSCII screen-code 65 = "A" (which also is ASCII/CHR$ code of "A" [in uppercase/graphic set]).
The screen-codes are not compatible with CIOUT/BSOUT/PRIMM... because the alternate (PETSCII/ASCII) are some of the most common KERNAL routines (also used by BASIC), I am really surprised that kickAssembler doesn't use them by default (or at least give you a way to use them). Below is an example PSEUDO-COMMAND that will convert a string into PETSCII (upper+lower case) for use with BSOUT/PRIMM, etc. I haven't tested it, but hopefully it will help... It would need some modification for ASCII (uppercase+graphics) Oh yeah, it also has an example use with PRIMM... the classic "Hello World!" .pseudocommand petscii mystring { .for (var i=0; i<mystring.len(); i++) { .var c=mystring.CharAt(i) .if c < 32 { .byte c+64 // lower-case (64~95) } else { .if c < 64 { .byte c // numbers, punctuation (32~63) } else { .byte c+32 //upper-case (96~127) } } } }
jsr $ff7d // PRIMM :petscii "Hello World!" .byte 0 rts
I hope that helps! (Although setting up a server to consolidate local/remote access sounds like you already know this...)r
@vdc, thanks, "tank" does sound like an appropriate "politically correct" name, but I will always think of her as my bitch
|
|