Author Topic: Small-C - confused  (Read 9547 times)

0 Members and 1 Guest are viewing this topic.

Offline Blagus

  • LV2 Member (Next: 40)
  • **
  • Posts: 29
  • Rating: +1/-0
    • View Profile
Small-C - confused
« on: November 19, 2011, 01:52:07 pm »
Can someone help me with Small-C compiler for TI-83 Plus?
I downloaded 8xccb5 compiler and I don't understand a thing there, and there are no tutorials about Small-C on TI-83.
Since I'm already learning C on PC (in school), I'd like to do the same, at least for small fun, on my calc, before moving on to ASM.
So can anyone help me with making at least "Hello World" program? When I try to compile code, it gives me hello.bin, hello.lst and hello.opt
Hello.opt contains ASM code, which is then compiled in hello.bin, so I'm guessing it should be ready, but what to do with that hello.bin? I can't send it to calc.

Thanks

Offline Scipi

  • Omni Kitten Meow~ =^ω^=
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1547
  • Rating: +192/-3
  • Meow :3
    • View Profile
    • ScipiSoftware
Re: Small-C - confused
« Reply #1 on: November 19, 2011, 02:02:55 pm »
Wait, woah, woah. You're saying there's C for the calc? Can you supply a link, I definitely want to check this out. XD

It might be the formatting for a file that's readable by the calc.

Imma Cat! =^_^= :3 (It's an emoticon now!)
Spoiler For Things I find interesting:
Spoiler For AI Programming:
Spoiler For Shameless advertising:

Spoiler For OldSig:





Spoiler For IMPORTANT NEWS!:
Late last night, Quebec was invaded by a group calling themselves, "Omnimaga". Not much is known about these mysterious people except that they all carried calculators of some kind and they all seemed to converge on one house in particular. Experts estimate that the combined power of their fabled calculators is greater than all the worlds super computers put together. The group seems to be holding out in the home of a certain DJ_O, who the Omnimagians claim to be their founder. Such power has put the world at a standstill with everyone waiting to see what the Omnimagians will do...

Wait... This just in, the Omnimagians have sent the UN a list of demands that must be met or else the world will be "submitted to the wrath of Netham45's Lobster Army". Such demands include >9001 crates of peanuts, sacrificial blue lobsters, and a wide assortment of cherry flavored items. With such computing power stored in the hands of such people, we can only hope these demands are met.

In the wake of these events, we can only ask, Why? Why do these people make these demands, what caused them to gather, and what are their future plans...

Offline Blagus

  • LV2 Member (Next: 40)
  • **
  • Posts: 29
  • Rating: +1/-0
    • View Profile
Re: Small-C - confused
« Reply #2 on: November 19, 2011, 02:15:12 pm »
Right here: http://www.ticalc.org/archives/files/fileinfo/91/9187.html

Update on progress: I found utility that converts bin to 8xp, but when I execute Asm(prgmHELLO it gives me ERR:INVALID
so I guess I made some mistake in code, but I don't know what.
That's why I'm asking for help here.

Offline Scipi

  • Omni Kitten Meow~ =^ω^=
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1547
  • Rating: +192/-3
  • Meow :3
    • View Profile
    • ScipiSoftware
Re: Small-C - confused
« Reply #3 on: November 19, 2011, 02:16:05 pm »
Can you post your code? If it's the same syntax as C then I could probably help. :D

Imma Cat! =^_^= :3 (It's an emoticon now!)
Spoiler For Things I find interesting:
Spoiler For AI Programming:
Spoiler For Shameless advertising:

Spoiler For OldSig:





Spoiler For IMPORTANT NEWS!:
Late last night, Quebec was invaded by a group calling themselves, "Omnimaga". Not much is known about these mysterious people except that they all carried calculators of some kind and they all seemed to converge on one house in particular. Experts estimate that the combined power of their fabled calculators is greater than all the worlds super computers put together. The group seems to be holding out in the home of a certain DJ_O, who the Omnimagians claim to be their founder. Such power has put the world at a standstill with everyone waiting to see what the Omnimagians will do...

Wait... This just in, the Omnimagians have sent the UN a list of demands that must be met or else the world will be "submitted to the wrath of Netham45's Lobster Army". Such demands include >9001 crates of peanuts, sacrificial blue lobsters, and a wide assortment of cherry flavored items. With such computing power stored in the hands of such people, we can only hope these demands are met.

In the wake of these events, we can only ask, Why? Why do these people make these demands, what caused them to gather, and what are their future plans...

Offline Blagus

  • LV2 Member (Next: 40)
  • **
  • Posts: 29
  • Rating: +1/-0
    • View Profile
Re: Small-C - confused
« Reply #4 on: November 19, 2011, 02:28:10 pm »
Sure, here it is:
Keep in mind that include files were a wild guess since there's no std*.h files.
hello.z80:
Code: [Select]
#include "ti.h"
#include "ti83.h"
main()
{
printf("Hello World!nl");
printf("HELLO WORLD!");
printf("1234567890");
}
int main() was causing compile error.
« Last Edit: November 19, 2011, 02:28:39 pm by Blagus »

Offline ralphdspam

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 841
  • Rating: +38/-1
  • My name is actually Matt.
    • View Profile
Re: Small-C - confused
« Reply #5 on: November 19, 2011, 02:29:55 pm »
Right here: http://www.ticalc.org/archives/files/fileinfo/91/9187.html

Update on progress: I found utility that converts bin to 8xp, but when I execute Asm(prgmHELLO it gives me ERR:INVALID
so I guess I made some mistake in code, but I don't know what.
That's why I'm asking for help here.

It looks like it only works for the TI-83 (not plus).  Sadly, those two are not compatible.
ld a, 0
ld a, a

Offline Scipi

  • Omni Kitten Meow~ =^ω^=
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1547
  • Rating: +192/-3
  • Meow :3
    • View Profile
    • ScipiSoftware
Re: Small-C - confused
« Reply #6 on: November 19, 2011, 02:32:06 pm »
Instead of printf(str), use puts(str)

From the readme:

Quote
Function:     puts(str)
Parameters:   char *str - string to display to screen.
Returns:      Nothing
Include File: TI.H
Description:  Displays the string 'str' at current cursor location and moves
              cursor to the end of the string

Imma Cat! =^_^= :3 (It's an emoticon now!)
Spoiler For Things I find interesting:
Spoiler For AI Programming:
Spoiler For Shameless advertising:

Spoiler For OldSig:





Spoiler For IMPORTANT NEWS!:
Late last night, Quebec was invaded by a group calling themselves, "Omnimaga". Not much is known about these mysterious people except that they all carried calculators of some kind and they all seemed to converge on one house in particular. Experts estimate that the combined power of their fabled calculators is greater than all the worlds super computers put together. The group seems to be holding out in the home of a certain DJ_O, who the Omnimagians claim to be their founder. Such power has put the world at a standstill with everyone waiting to see what the Omnimagians will do...

Wait... This just in, the Omnimagians have sent the UN a list of demands that must be met or else the world will be "submitted to the wrath of Netham45's Lobster Army". Such demands include >9001 crates of peanuts, sacrificial blue lobsters, and a wide assortment of cherry flavored items. With such computing power stored in the hands of such people, we can only hope these demands are met.

In the wake of these events, we can only ask, Why? Why do these people make these demands, what caused them to gather, and what are their future plans...

Offline Blagus

  • LV2 Member (Next: 40)
  • **
  • Posts: 29
  • Rating: +1/-0
    • View Profile
Re: Small-C - confused
« Reply #7 on: November 19, 2011, 02:47:43 pm »
@ralph: I'm afraid you're right. I've minimized the code and still error.
Then I found the actual TI-83 Plus compiler, but it's made primarily for MacOS with badly compiled Windows executables.
I took ti83p.h from there and put it in 8x... compiler and still ERR:INVALID.

Still, it would be really nice if it could be modified somehow for TI-83 Plus.

Offline Scipi

  • Omni Kitten Meow~ =^ω^=
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1547
  • Rating: +192/-3
  • Meow :3
    • View Profile
    • ScipiSoftware
Re: Small-C - confused
« Reply #8 on: November 19, 2011, 02:57:22 pm »
I wonder if there's a converter to change 83 ASM to 83+ ASM.

Also, did you change printf to puts?

Imma Cat! =^_^= :3 (It's an emoticon now!)
Spoiler For Things I find interesting:
Spoiler For AI Programming:
Spoiler For Shameless advertising:

Spoiler For OldSig:





Spoiler For IMPORTANT NEWS!:
Late last night, Quebec was invaded by a group calling themselves, "Omnimaga". Not much is known about these mysterious people except that they all carried calculators of some kind and they all seemed to converge on one house in particular. Experts estimate that the combined power of their fabled calculators is greater than all the worlds super computers put together. The group seems to be holding out in the home of a certain DJ_O, who the Omnimagians claim to be their founder. Such power has put the world at a standstill with everyone waiting to see what the Omnimagians will do...

Wait... This just in, the Omnimagians have sent the UN a list of demands that must be met or else the world will be "submitted to the wrath of Netham45's Lobster Army". Such demands include >9001 crates of peanuts, sacrificial blue lobsters, and a wide assortment of cherry flavored items. With such computing power stored in the hands of such people, we can only hope these demands are met.

In the wake of these events, we can only ask, Why? Why do these people make these demands, what caused them to gather, and what are their future plans...

Offline Blagus

  • LV2 Member (Next: 40)
  • **
  • Posts: 29
  • Rating: +1/-0
    • View Profile
Re: Small-C - confused
« Reply #9 on: November 19, 2011, 03:02:06 pm »
Yes, I changed to puts and with minimizing code, I came to stage with no errors and successful assembly, and only error being fail to convert bin to "83p" since there's no app for that in the folder. So I do it manually (convert to 8xp).

And here's the TI-83+ C compiler, but for Mac: http://www.ticalc.org/archives/files/fileinfo/381/38118.html

Edit: I found Windows version! But I'm having some annoying problems with setting up path as readme says to do.
« Last Edit: November 19, 2011, 03:23:53 pm by Blagus »

Offline Scipi

  • Omni Kitten Meow~ =^ω^=
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1547
  • Rating: +192/-3
  • Meow :3
    • View Profile
    • ScipiSoftware
Re: Small-C - confused
« Reply #10 on: November 19, 2011, 03:35:21 pm »
Can you supply a link to that one? I have a post around here that explains the path.

I'll try to find it.

Imma Cat! =^_^= :3 (It's an emoticon now!)
Spoiler For Things I find interesting:
Spoiler For AI Programming:
Spoiler For Shameless advertising:

Spoiler For OldSig:





Spoiler For IMPORTANT NEWS!:
Late last night, Quebec was invaded by a group calling themselves, "Omnimaga". Not much is known about these mysterious people except that they all carried calculators of some kind and they all seemed to converge on one house in particular. Experts estimate that the combined power of their fabled calculators is greater than all the worlds super computers put together. The group seems to be holding out in the home of a certain DJ_O, who the Omnimagians claim to be their founder. Such power has put the world at a standstill with everyone waiting to see what the Omnimagians will do...

Wait... This just in, the Omnimagians have sent the UN a list of demands that must be met or else the world will be "submitted to the wrath of Netham45's Lobster Army". Such demands include >9001 crates of peanuts, sacrificial blue lobsters, and a wide assortment of cherry flavored items. With such computing power stored in the hands of such people, we can only hope these demands are met.

In the wake of these events, we can only ask, Why? Why do these people make these demands, what caused them to gather, and what are their future plans...

Offline FinaleTI

  • Believe in the pony that believes in you!
  • CoT Emeritus
  • LV10 31337 u53r (Next: 2000)
  • *
  • Posts: 1830
  • Rating: +121/-2
  • Believe in the pony that believes in you!
    • View Profile
    • dmuckerman.tumblr.com
Re: Small-C - confused
« Reply #11 on: November 19, 2011, 03:43:53 pm »
I think it's here. The readme says stuff about the PATH and the author is the same.
http://www.ticalc.org/archives/files/fileinfo/380/38061.html


Spoiler For Projects:

My projects haven't been worked on in a while, so they're all on hiatus for the time being. I do hope to eventually return to them in some form or another...

Spoiler For Pokemon TI:
Axe port of Pokemon Red/Blue to the 83+/84+ family. On hold.

Spoiler For Nostalgia:
My big personal project, an original RPG about dimensional travel and a few heroes tasked with saving the world.
Coding-wise, on hold, but I am re-working the story.

Spoiler For Finale's Super Insane Tunnel Pack of Doom:
I will be combining Blur and Collision Course into a single gamepack. On hold.

Spoiler For Nostalgia Origins: Sky's Story:
Prequel to Nostalgia. On hold, especially while the story is re-worked.

Offline Blagus

  • LV2 Member (Next: 40)
  • **
  • Posts: 29
  • Rating: +1/-0
    • View Profile
Re: Small-C - confused
« Reply #12 on: November 19, 2011, 03:46:23 pm »
Yes, I did it finally, and I get to this stage:
Code: [Select]
c:\tisdcc>tisdcc ti83p_asm hello.c
tisdcc
tisdcc: sdcc -mz80 --no-std-crt0 --code-loc 0x9DA3 --data-loc 0x9872 -L c:\tisdcc\lib -I c:\tisdcc\include -DTI83P -Wlc:\tisdcc\startup\ti83p_asm.o ti83p.lib hello.c
?ASlink-Error-<cannot open> : "c:\tisdcc\startup\ti83p_asm.rel"
Error in sdcc

hello.c:
Code: [Select]
#include "ti83p.h"
main()
{
PutS("Hello World!");
return 0;
}
« Last Edit: November 19, 2011, 03:46:55 pm by Blagus »

Offline Scipi

  • Omni Kitten Meow~ =^ω^=
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1547
  • Rating: +192/-3
  • Meow :3
    • View Profile
    • ScipiSoftware
Re: Small-C - confused
« Reply #13 on: November 19, 2011, 03:49:11 pm »
I think you need. TI.H If included. Or it might be a different instruction perhaps?

Imma Cat! =^_^= :3 (It's an emoticon now!)
Spoiler For Things I find interesting:
Spoiler For AI Programming:
Spoiler For Shameless advertising:

Spoiler For OldSig:





Spoiler For IMPORTANT NEWS!:
Late last night, Quebec was invaded by a group calling themselves, "Omnimaga". Not much is known about these mysterious people except that they all carried calculators of some kind and they all seemed to converge on one house in particular. Experts estimate that the combined power of their fabled calculators is greater than all the worlds super computers put together. The group seems to be holding out in the home of a certain DJ_O, who the Omnimagians claim to be their founder. Such power has put the world at a standstill with everyone waiting to see what the Omnimagians will do...

Wait... This just in, the Omnimagians have sent the UN a list of demands that must be met or else the world will be "submitted to the wrath of Netham45's Lobster Army". Such demands include >9001 crates of peanuts, sacrificial blue lobsters, and a wide assortment of cherry flavored items. With such computing power stored in the hands of such people, we can only hope these demands are met.

In the wake of these events, we can only ask, Why? Why do these people make these demands, what caused them to gather, and what are their future plans...

Offline Blagus

  • LV2 Member (Next: 40)
  • **
  • Posts: 29
  • Rating: +1/-0
    • View Profile
Re: Small-C - confused
« Reply #14 on: November 19, 2011, 04:09:10 pm »
No, there's no TI.H at all in 83+ version of compiler.
But this one is different than 83 version I started with, and gives me different asm code.
Either C to ASM part is too buggy or I'm doing something wrong. This time I get no errors, but no other output either. Only sdcc command line.
Guess I'm too tired to set it up now... I'll try tomorrow, but maybe someone else wants to have fun with setting up too :)