Enjoying your C128 content 👍 I've mostly been using mine in C64 mode. While I understand the intent to demonstrate the compiler, I think it would be overall easier to just write the RLE routine in assembly language from scratch🙂
In this specific case FE is not a number that‘s within the valid range. But yes, your suggestion is one way to do it. In general there‘s multiple ways to do this - also more efficient ones. Totally valid question, thanks for that
It depends on the nature of the data. You could just do FE FE. And not allow FE repeats. Or you could swap respeat and literal. So you can have FE repeats. So you could do FE 09 05 to repeat 9 five times. Or FE FE FE FE to repeat FE FE times. If it's text then the high bit won't be set so you could set the high bit for the literal and follow it with the repeat, instead of having a reserved byte Have a read about lz compression also, despite being patent encumbered in the 80s it is very straight forward. That just basically adds a pointer back to the already decompressed stream. So you could do this "So you c[back 4: repeat 2]ld d[back 12: repeat 2]this"
With so many restrictions, this micro compiler doesn't really bring any advantages to just writing the code in assembler, for example in Turbo Macro Pro and targeting the C=128. It's basically in the same class as the cc65 C compiler, which does not have the basic float and double data types, and therefore cannot do floating point arithmetic, and doesn't come with libc, which pretty much defeats the purpose of writing software for the C=64 in C, or compiling existing body of C software for the C=64. These pieces of software are the antithesis to core UNIX software design principles.
From today's perspective that's completely right. Back then, the micro compiler was a type-in program. It basically came for free (well, the price of the magazine), which was one of the main benefits, I guess. All the restrictions only make it useful for targeting very specific tasks, not for writing full programs. Any probably only for people who aren't familiar with assembly language.
By the by, "variable" in English is pronounced the same way as in German, the only difference being that the "a" in "va" is short, not long. Pronounced "Weriable".
@@the8bittheory ...and I appreciate how much you go into detail, and also that you've decided to do a series of videos on the C=128, because it's not a well documented, well understood system, and there should be more (modern) software for it to exploit its full capabilities in comparison to the C=64.
aAARGHHHHHHHHHH! I know I am being a horrible pedant here, but "assembler" is a program that assembles assembly language. Please call the code itself "assembly language" or "6502" or "assembly".
As an explanation why I used the term „assembler“ incorrectly here: in german (my native language) the term is actually also used to describe the language. So, I didn‘t think that this could be different in english. Thanks a lot for making me aware! Highly appreciated!
Not for this task, but I'm familiar with it. The reason I stick with Basic in these videos is that I want to show how easy the VDC-chip is to work with. Of course, all the concepts are applicable to Assembler and C just as well. Thanks for your comment :-)
I'm still learning about Basic and older computers in general. Fast compilers are definitely fascinating and very very welcome.
Yes they are. That concept was fascinating to me at first sight :-)
Great video!
Thank you!
Enjoying your C128 content 👍 I've mostly been using mine in C64 mode. While I understand the intent to demonstrate the compiler, I think it would be overall easier to just write the RLE routine in assembly language from scratch🙂
Pure assembly language is definitely superior.
Thanks for the good feedback!
Just out of curiosity, what happens when RLE needs to encode FE byte? I guess it does something like this: FE 01 FE, 3 bytes instead of 1?
In this specific case FE is not a number that‘s within the valid range. But yes, your suggestion is one way to do it. In general there‘s multiple ways to do this - also more efficient ones.
Totally valid question, thanks for that
It depends on the nature of the data.
You could just do FE FE. And not allow FE repeats.
Or you could swap respeat and literal. So you can have FE repeats.
So you could do FE 09 05 to repeat 9 five times.
Or FE FE FE FE to repeat FE FE times.
If it's text then the high bit won't be set so you could set the high bit for the literal and follow it with the repeat, instead of having a reserved byte
Have a read about lz compression also, despite being patent encumbered in the 80s it is very straight forward.
That just basically adds a pointer back to the already decompressed stream.
So you could do this
"So you c[back 4: repeat 2]ld d[back 12: repeat 2]this"
With so many restrictions, this micro compiler doesn't really bring any advantages to just writing the code in assembler, for example in Turbo Macro Pro and targeting the C=128. It's basically in the same class as the cc65 C compiler, which does not have the basic float and double data types, and therefore cannot do floating point arithmetic, and doesn't come with libc, which pretty much defeats the purpose of writing software for the C=64 in C, or compiling existing body of C software for the C=64. These pieces of software are the antithesis to core UNIX software design principles.
From today's perspective that's completely right.
Back then, the micro compiler was a type-in program. It basically came for free (well, the price of the magazine), which was one of the main benefits, I guess.
All the restrictions only make it useful for targeting very specific tasks, not for writing full programs. Any probably only for people who aren't familiar with assembly language.
By the by, "variable" in English is pronounced the same way as in German, the only difference being that the "a" in "va" is short, not long. Pronounced "Weriable".
I'll keep that in mind, thanks! Highly appreciate your feedback :-)
@@the8bittheory ...and I appreciate how much you go into detail, and also that you've decided to do a series of videos on the C=128, because it's not a well documented, well understood system, and there should be more (modern) software for it to exploit its full capabilities in comparison to the C=64.
aAARGHHHHHHHHHH! I know I am being a horrible pedant here, but "assembler" is a program that assembles assembly language. Please call the code itself "assembly language" or "6502" or "assembly".
I‘ll try :-)
As an explanation why I used the term „assembler“ incorrectly here: in german (my native language) the term is actually also used to describe the language. So, I didn‘t think that this could be different in english. Thanks a lot for making me aware! Highly appreciated!
Did you try cc65?
Not for this task, but I'm familiar with it.
The reason I stick with Basic in these videos is that I want to show how easy the VDC-chip is to work with. Of course, all the concepts are applicable to Assembler and C just as well.
Thanks for your comment :-)
@@the8bittheory Yes I understand. Might be an interesting video… 😂