BZC

Code:
   rst 28h
   .dw $4972
   ld b,(result)
   dec a
   jr nz,Skip1
   inc b
Skip1:
   dec a
   jr nz,Skip2
   dec b
Skip2:
   ld (result),b
Result:
   .db 0
KermMartian wrote:
At that point wouldn't it just be better to learn ASM? Smile (Just playing devil's advocate here).


Z80 C USING SDCC FTW!!!
My code takes 18 bytes. How many bytes for yours compiled, Something?
OH I had to compile it. Which code should I compile, upper or lower?
Do both! Then we can compare all three.
Be right back...
Razz You don't actually have to post that, you know. Smile
Yeah. Anyways I think the lower code actually was illegal because it wouldn't compile, but the one that did compile took 100 bytes. BIG DIFFERENCE.
See? That's horribly unoptimized compared with my 18 bytes. Smile
[not sarcastic]And I bet it's much slower Wink[/not sarcastic]
something1990 wrote:
Yeah. Anyways I think the lower code actually was illegal because it wouldn't compile, but the one that did compile took 100 bytes. BIG DIFFERENCE.


Yes, the lower code is illegal, because BZC doesn't support the Boolean data type right now. Something for a future release, though...

Obviously, Kerm's little ASM program is quite a bit more efficient in terms of both speed and size; most of the BASIC ASM program is spent on the conditional processing. But, that's the trade-off between a compiled and an assembled language...the compiled language is easier to use, but generally results in larger and slower programs.
We will have to make an actual program to see that (referring to speed). I am trying to make functions to integrate BZC with Mirage routines and regular romcalls. Any ideas on which program wouldn't be too hard? Maybe a countdown?
something1990 wrote:
We will have to make an actual program to see that (referring to speed). I am trying to make functions to integrate BZC with Mirage routines and regular romcalls. Any ideas on which program wouldn't be too hard? Maybe a countdown?


A countdown program is a piece of cake with BASIC ASM; just use a FOR loop like so:

Code:
#include <asmlib.h>

INT counter

START
FOR counter = 1000 to 0 BACK
PRINTF 0 0 counter
NEXT
END


I haven't actually tried compiling this, but I believe it should work.
I think I shall be annoying. Smile

Code:
     ld hl,1000
Loopit:
     xor a
     ld (pencol),a
     ld (penrow),a
     push hl
     bcall(_disphl)
     pop hl
     dec hl
     ld a,h
     or l
     jr nz,Loopit
     ret
WTF! IT CAN POST!!! Anyways should we test the speed right now??

Also, I think I may have figured out enough BZC/Mirage integration to remake JDodge19 in BZC. Just maybe it may work. It could be done by this Saturday.
something1990 wrote:
Also, I think I may have figured out enough BZC/Mirage integration to remake JDodge19 in BZC. Just maybe it may work. It could be done by this Saturday.
You're still calling it JDodge19? I thought you changed the name after you completely remade it.

So, it looks like the compiler can't produce code as good as just making the program in ASM. I would expect that. If it were somehow able to produce better, than I would be amazed Laughing . Kerm, I wouldn't be too hard on it yet. I think it has some potential and here's why.

First, I think most of us can agree that TIBASIC is usually the first language learned by programmers in the TI scene. Some have prior experience, but for the vast majority this is their first venture. After programming in this for a while, many want to go to the next level, which, unfortunately for the z80 line, is pure assembly. Now this poses a problem normally. We expect new programmers to go from practically the easiest language in the world, to just about the hardest. Obviously, the gap is pretty wide. Here's where I think BZC could fit in. If BASIC programmers could learn the BZC syntax, which it doesn't look like that's all that much of a stretch, then they could gain more experience in a second language. Also, they could begin to experiment with small assembly instructions while still being able to use the basic commands. This would allow a much more gradual developement. Now, I'm not going to beat around the bush; BZC probably isn't going to be all that great of a stand-alone language. I mean it shouldn't be. TIBASIC was written by a company, and ASM is, well, ASM. But, BZC would offer a perfect means for a transition between BASIC and ASM. I love that feature of being able to insert ASM code. That is why I think that this is a great, and needed project. Eventually, those BZC programmers will move on to asm because BZC will not produce the quality code that they will need. Also, there may not be as much flexibility.

In conclusion, we need a "middle" language in the z80 line. I see no reason why BZC can't fill this greatly important gap.
others like SquirrelBox have tried, but SquirrelBox is broken and most of the rest are just macro languages....
Oh, I completely agree with you Chipmaster, there's definitely a void that needs filling. Hopefully this shall be the language, and if not, something else Cemetech develops (cough SDCC cough) will help. Smile
something1990 wrote:
Also, I think I may have figured out enough BZC/Mirage integration to remake JDodge19 in BZC. Just maybe it may work. It could be done by this Saturday.


So you've found a way to integrate the MirageOS heading into a BZC program?
It sounds like it. If you think about it, it shouldn't be overly challenging; jus tcopy/paste the header, and add dynamic fields where necessary.
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
BZC
» Goto page Previous  1, 2, 3, 4, 5 ... 10, 11, 12  Next
» View previous topic :: View next topic  
Page 4 of 12
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement