Sphinx C--

This is a discussion on Sphinx C-- within the A Brief History of Cprogramming.com forums, part of the Community Boards category; http://download.com.com/3000-2212-86...ml?legacy=cnet This is a good mix of C and x86 Assembly, helps make small TSR(Terminate and Stay Resident)'s and highly ...

  1. #1
    Registered User
    Join Date
    Nov 2001
    Posts
    70

    Sphinx C--

    http://download.com.com/3000-2212-86...ml?legacy=cnet
    This is a good mix of C and x86 Assembly, helps make small TSR(Terminate and Stay Resident)'s and highly optomized programs, pretty good, C experience along with ASM experience helps A LOT!

    Bye!

  2. #2
    Registered User
    Join Date
    Nov 2001
    Posts
    70
    Somthing I wrote in C--, it echos HEX digits only, beeps if its not hex all lower-case becomes capital(uppercase) backspace works and on ENTER (Dec char 13) it closes, simple..

    HexEcho.C--
    Code:
    ?include "WRITE.H--"
    ?include "KEYCODES.H--"
    ?include "DOS.H--"
    main()
    {
    do{
    	BIOSEREADKEY();
    	IF ( AL == 65 )
    	 WRITE(AL);
    	else IF ( AL == 66 )
    	 WRITE(AL);
    	else IF ( AL == 67 )
    	 WRITE(AL);
    	else IF ( AL == 68 )
    	 WRITE(AL); 
    	else IF ( AL == 69 )
    	 WRITE(AL); 
    	else IF ( AL == 70 )
    	 WRITE(AL); 
    	else IF ( AL == 48 )
    	 WRITE(AL); 
    	else IF ( AL == 49 )
    	 WRITE(AL); 
    	else IF ( AL == 50 )
    	 WRITE(AL); 
    	else IF ( AL == 51 )
    	 WRITE(AL); 
    	else IF ( AL == 52 )
    	 WRITE(AL); 
    	else IF ( AL == 53 )
    	 WRITE(AL); 
    	else IF ( AL == 54 )
    	 WRITE(AL); 
    	else IF ( AL == 55 )
    	 WRITE(AL); 
    	else IF ( AL == 56 )
    	 WRITE(AL); 
    	else IF ( AL == 57 )
    	 WRITE(AL); 
    	else IF ( AL == 13 )
    	 ABORT();
    	else IF ( AL == 8 )
    	{
    	 WRITE(AL);
    	 WRITE(32);
    	 WRITE(8);
    	}
    	else IF ( AL == 97 )
    	 WRITE(65);
    	else IF ( AL == 98 )
    	 WRITE(66);
    	else IF ( AL == 99 )
    	 WRITE(67);
    	else IF ( AL == 100 )
    	 WRITE(68);
    	else IF ( AL == 101 )
    	 WRITE(69);
    	else IF ( AL == 102 )
    	 WRITE(70);
    	ELSE
    	 BEEP();
       }while ( AL <> 13 );  
    }
    "...since anyone who is anyone knows C..." -Peter Cellik

  3. #3
    PC Fixer-Upper Waldo2k2's Avatar
    Join Date
    May 2002
    Posts
    2,001
    MY GOD!

    What is wrong with you??
    Switch! For the love of God use a switch statement!
    LOL

    Interesting language.
    PHP and XML
    Let's talk about SAX

  4. #4
    Registered User
    Join Date
    Nov 2001
    Posts
    70
    No switch in C-- :-/ Otherwise I would have!
    "...since anyone who is anyone knows C..." -Peter Cellik

  5. #5
    PC Fixer-Upper Waldo2k2's Avatar
    Join Date
    May 2002
    Posts
    2,001
    oh wow, they really are going for that low level feel huh? yikes...i think that was a bad decision, i wouldn't use a programming language that didn't have a switch statement...they really should consider adding that.
    PHP and XML
    Let's talk about SAX

  6. #6
    Registered User
    Join Date
    Nov 2001
    Posts
    70
    the language isnt under dev anymore, hasnt been for years, its not finished but it still works..
    "...since anyone who is anyone knows C..." -Peter Cellik

  7. #7
    Registered User
    Join Date
    Nov 2001
    Posts
    70
    Any ideas why AL is 0 everytime? the function DOSGETTIME is supposed to return 0 for sunday 1 for monday ect, it says 0 everytime SOooo it becomes Sunday, No idea why.
    Code:
    ? include "write.h--"
    ? include "dos.h--"
    main()
    {
    @ DOSGETDATE(); 
     WRITESTR ("Today is ");
     IF( AL == 0 )
      WRITESTR("Sunday");
     else IF( AL == 1 )
      WRITESTR("Monday");
     else IF( AL == 2 )
      WRITESTR("Tuesday");
     else IF( AL == 3 )
      WRITESTR("Wednesday");
     else IF( AL == 4 )
      WRITESTR("Thursday");
     else IF( AL == 5 )
      WRITESTR("Friday");
     else IF( AL == 6 ) 
      WRITESTR("Saturday");
     WRITESTR(", ");
     IF( DH == 1 )
      WRITESTR("January"); 
     else IF( DH == 2 )
      WRITESTR("February");
     else IF( DH == 3 )
      WRITESTR("March");
     else IF( DH == 4 )
      WRITESTR("April");
     else IF( DH == 5 )
      WRITESTR("May");
     else IF( DH == 6 )
      WRITESTR("June");
     else IF( DH == 7 )
      WRITESTR("July");
     else IF( DH == 8 )
      WRITESTR("August");
     else IF( DH == 9 )
      WRITESTR("September");
     else IF( DH == 10 )
      WRITESTR("October");
     else IF( DH == 11 )
      WRITESTR("November");
     else IF( DH == 12 )
      WRITESTR("December");
     WRITESTR(" ");
     WRITEINT( DL );
    }
    "...since anyone who is anyone knows C..." -Peter Cellik

  8. #8
    PC Fixer-Upper Waldo2k2's Avatar
    Join Date
    May 2002
    Posts
    2,001
    the prob f-ed up the algorithm, like you said it's not finished...prob not even tested all the way
    PHP and XML
    Let's talk about SAX

  9. #9
    Registered User
    Join Date
    Nov 2001
    Posts
    70
    Before, when it was oly days that showed (which is the part thats being messed up now) it worked completely then I added months ect and it shows sunday, and if anything its the interupt that f---ed up, the librarys are jsut functions (like you didnt know that :-P) its finished enough that it works, I know its not a compiler issue.
    "...since anyone who is anyone knows C..." -Peter Cellik

  10. #10
    Registered User
    Join Date
    Nov 2001
    Posts
    70
    I fixed the code! as I thought, it was my mistake not C--!
    Code:
    ? include "write.h--"
    ? include "dos.h--"
    main()
    {
     WRITESTR ("Today is ");
    @ DOSGETDATE(); 
     IF( AL == 0 )
      WRITESTR("Sunday");
     else IF( AL == 1 )
      WRITESTR("Monday");
     else IF( AL == 2 )
      WRITESTR("Tuesday");
     else IF( AL == 3 )
      WRITESTR("Wednesday");
     else IF( AL == 4 )
      WRITESTR("Thursday");
     else IF( AL == 5 )
      WRITESTR("Friday");
     else IF( AL == 6 ) 
      WRITESTR("Saturday");
     WRITESTR(", ");
     IF( DH == 1 )
      WRITESTR("January"); 
     else IF( DH == 2 )
      WRITESTR("February");
     else IF( DH == 3 )
      WRITESTR("March");
     else IF( DH == 4 )
      WRITESTR("April");
     else IF( DH == 5 )
      WRITESTR("May");
     else IF( DH == 6 )
      WRITESTR("June");
     else IF( DH == 7 )
      WRITESTR("July");
     else IF( DH == 8 )
      WRITESTR("August");
     else IF( DH == 9 )
      WRITESTR("September");
     else IF( DH == 10 )
      WRITESTR("October");
     else IF( DH == 11 )
      WRITESTR("November");
     else IF( DH == 12 )
      WRITESTR("December");
     WRITESTR(" ");
     WRITEINT( DL );
    }
    "...since anyone who is anyone knows C..." -Peter Cellik

  11. #11
    |<o>| <--cyclopse LouDu's Avatar
    Join Date
    Mar 2003
    Posts
    137
    *looks at first line*

    *Unplugs computer*

    *huddles and looks at the screen scared*

    Languages <> C++, HTML

    /*The Ledgend of Ludlow Coming to a PC Near
    You intro Cinenmatic Needed email me of
    Reply to one of my threads if you can make
    one, thats decent. */

  12. #12
    Registered User
    Join Date
    Mar 2003
    Posts
    73
    Jeeze, isn't it annoying having to use all those if statements? lol. I couldn't imagine programming like that.

    When you say it's not finished, how far along was it?

  13. #13
    Registered User
    Join Date
    Nov 2001
    Posts
    70
    its not buggy at all from what I can tell, the external libraries arnt finished, some of the functions are in the "internal" libraries so i think they are included into all of your programs which may add some over head, not sure considering how small the exe's are.. you cant compile to exe's only com's and obj's, although you cant compile to a dll, the obj's are ms compatable so its pretty much just as good, and you cant call dll's... theres another distro (it was open sourced when the author stopped deving) it lets you compile to dll exe ect.. gui apps, everything.. its more than jsut finished by now, I dont use it tho.. I will but never got around to downloading it.. :-)
    "...since anyone who is anyone knows C..." -Peter Cellik

  14. #14
    Registered User
    Join Date
    Mar 2003
    Posts
    73
    I see... So it is possible to work with?

    I tried to download it but it said that the page doesn't exist anymore.

Popular pages Recent additions subscribe to a feed

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21