Jump to content



2

basic compiler


83 replies to this topic

#76 unhuman OFFLINE  

unhuman

    Dragonstomper

  • 784 posts
  • Location:Vienna, VA

Posted Thu Sep 1, 2011 7:13 PM

Yeah, I encountered a bug in the compiler but I had a true TI-BASIC program (no multistatement, no logic in THEN). The problem I found was it didn't properly alter something in CALL KEY. If you stick to BASIC rules, I found nothing else...

Since I won't be doing any more BASIC programming - I won't be using the compiler anymore.

If I ever get free time again, I'll probably be checking out MLC or GCC (when we get libraries).... I can't use anything that's not released to Public Domain... So Kull's is out of the question, as intriguing as it sounds.

-H

#77 TEXAS_JOE OFFLINE  

TEXAS_JOE

    Chopper Commander

  • 179 posts
  • Currently working on Final Furlong

Posted Thu Sep 1, 2011 8:31 PM

View PostWillsy, on Thu Sep 1, 2011 1:36 PM, said:

Maybe its a bug in the compiler.

Try this as an experiment:

192 A=C(1):: IF A=31 THEN A=1:: C(1)=A

Repeat this for c(2) to c(5)

Let us know what happens.

I tried it, and it still locked as soon as the characters hit column 31. Another compiler that works with XB has been suggested, and this may be a way out. But in the long term, I think my syntax needs to be more Assembler friendly on the whole, I know nothing of Assembly, but I can imagine that it is maybe structured a little differently to XB and there's something I'm doing wrong.

TI Puck from Vorticon worked perfectly. I downloaded the TI Basic version and compiled it myself to check. The whole game runs no problem. I even added a "FOR DE=1 to 250::NEXT DE" just after the "CALL KEY" routine, to slow it down!

I just don't get it. It's baffling. Thankyou for you're feedback :)

#78 TEXAS_JOE OFFLINE  

TEXAS_JOE

    Chopper Commander

  • 179 posts
  • Currently working on Final Furlong

Posted Thu Sep 1, 2011 8:38 PM

View Postunhuman, on Thu Sep 1, 2011 7:13 PM, said:

Yeah, I encountered a bug in the compiler but I had a true TI-BASIC program (no multistatement, no logic in THEN). The problem I found was it didn't properly alter something in CALL KEY. If you stick to BASIC rules, I found nothing else...

Since I won't be doing any more BASIC programming - I won't be using the compiler anymore.

If I ever get free time again, I'll probably be checking out MLC or GCC (when we get libraries).... I can't use anything that's not released to Public Domain... So Kull's is out of the question, as intriguing as it sounds.

-H

It certainly doesnt like anything with any complexity to it. I've yet to write a program that will work, that actually has more than just sped up print statements. I'll get there in the end. :)

#79 TEXAS_JOE OFFLINE  

TEXAS_JOE

    Chopper Commander

  • 179 posts
  • Currently working on Final Furlong

Posted Fri Sep 2, 2011 12:34 AM

View PostOpry99er, on Tue Feb 22, 2011 9:54 PM, said:

Man, great news!!! :) Yep-- the first successful assembly experience is cool. :) Can't wait to play your game. Tursi came up with a way to put these assembly EA5 programs from Wilhelm's compiler into cart form. :)
That made my ears prick up ..... sounds interesting , putting EA5 into cart. Please point me in the right direction of Tursi's thread on this? :)

#80 sometimes99er ONLINE  

sometimes99er

    Stargunner

  • 1,918 posts
  • Location:Denmark

Posted Fri Sep 2, 2011 3:02 AM

View PostTEXAS_JOE, on Fri Sep 2, 2011 12:34 AM, said:

Please point me in the right direction of Tursi's thread on this? :)
http://www.harmlessl.../onesoft.cgi?96

:)

#81 Willsy OFFLINE  

Willsy

    Dragonstomper

  • 765 posts
  • Location:Uzbekistan (no, really!)

Posted Fri Sep 2, 2011 6:27 AM

HA! XB Compilers... Pussies! :P

Real men do it in FORTH :D

FORGET X
23 VALUE X
 1 VALUE C1
 4 VALUE C2
 8 VALUE C3
12 VALUE C4

35 CONSTANT FROG
36 CONSTANT CAR

: SETUP
  1 GMODE \ 32 COLUMN MODE
  17 4 DO I 15 1 COLOR LOOP \ SET COLORS
  HEX  DATA 4 1899 7E3C 3CBD FF5A  DECIMAL  FROG DCHAR
  HEX  DATA 4 66FF DBDB DBDB FF66  DECIMAL  CAR  DCHAR ;

: DRAW-FROG
  X 11 FROG 1 HCHAR ;
  
: MOVE-CARS
  12 C1 32 1 HCHAR  C1 1+ 32 MOD TO C1  12 C1 CAR 1 HCHAR
  14 C2 32 1 HCHAR  C2 1+ 32 MOD TO C2  14 C2 CAR 1 HCHAR
  16 C3 32 1 HCHAR  C3 1+ 32 MOD TO C3  16 C3 CAR 1 HCHAR
  18 C4 32 1 HCHAR  C4 1+ 32 MOD TO C4  18 C4 CAR 1 HCHAR ;
  
: MOVE-FROG
  KEY? 
  CASE
    69 OF 
      X 11 32 1 HCHAR
      -1 +TO X
    ENDOF
    88 OF
      X 11 32 1 HCHAR
      X 1+ DUP 24 = IF DROP 23 THEN TO X
    ENDOF
  ENDCASE ;
  
: FINISHED?
  X IF FALSE ELSE ." WELL DONE!" TRUE THEN ;
    
: DEAD?
  X 11 GCHAR
  CAR = IF
    ." YOU'RE DEAD!" TRUE 
  ELSE 
    FALSE
  THEN ;

: RUN
  SETUP  23 TO X
  BEGIN
    DRAW-FROG  
    MOVE-FROG  
    MOVE-CARS  
    DEAD?  FINISHED?  OR
  UNTIL CR ;


Don't be afraid to ask questions if you want to know how the code works!

Mark

#82 TEXAS_JOE OFFLINE  

TEXAS_JOE

    Chopper Commander

  • 179 posts
  • Currently working on Final Furlong

Posted Fri Sep 2, 2011 7:56 AM

View PostWillsy, on Fri Sep 2, 2011 6:27 AM, said:

HA! XB Compilers... Pussies! :P

Real men do it in FORTH :D

FORGET X
23 VALUE X
 1 VALUE C1
 4 VALUE C2
 8 VALUE C3
12 VALUE C4

35 CONSTANT FROG
36 CONSTANT CAR

: SETUP
  1 GMODE \ 32 COLUMN MODE
  17 4 DO I 15 1 COLOR LOOP \ SET COLORS
  HEX  DATA 4 1899 7E3C 3CBD FF5A  DECIMAL  FROG DCHAR
  HEX  DATA 4 66FF DBDB DBDB FF66  DECIMAL  CAR  DCHAR ;

: DRAW-FROG
  X 11 FROG 1 HCHAR ;
  
: MOVE-CARS
  12 C1 32 1 HCHAR  C1 1+ 32 MOD TO C1  12 C1 CAR 1 HCHAR
  14 C2 32 1 HCHAR  C2 1+ 32 MOD TO C2  14 C2 CAR 1 HCHAR
  16 C3 32 1 HCHAR  C3 1+ 32 MOD TO C3  16 C3 CAR 1 HCHAR
  18 C4 32 1 HCHAR  C4 1+ 32 MOD TO C4  18 C4 CAR 1 HCHAR ;
  
: MOVE-FROG
  KEY? 
  CASE
    69 OF 
      X 11 32 1 HCHAR
      -1 +TO X
    ENDOF
    88 OF
      X 11 32 1 HCHAR
      X 1+ DUP 24 = IF DROP 23 THEN TO X
    ENDOF
  ENDCASE ;
  
: FINISHED?
  X IF FALSE ELSE ." WELL DONE!" TRUE THEN ;
    
: DEAD?
  X 11 GCHAR
  CAR = IF
    ." YOU'RE DEAD!" TRUE 
  ELSE 
    FALSE
  THEN ;

: RUN
  SETUP  23 TO X
  BEGIN
    DRAW-FROG  
    MOVE-FROG  
    MOVE-CARS  
    DEAD?  FINISHED?  OR
  UNTIL CR ;


Don't be afraid to ask questions if you want to know how the code works!

Mark
Willsy you truly are a legend! :cool:
Forth!!!!!!! Well, this is actually swinging me away from Assembler compilers ..... All I need is this sort of thing, you know,
Forth source, and you took my game and did this. Man , May The Forth by with you!

How would you slow down the game ... what is the Forth equivelant to "For A=1 to 50::next A" ? :)

#83 Willsy OFFLINE  

Willsy

    Dragonstomper

  • 765 posts
  • Location:Uzbekistan (no, really!)

Posted Fri Sep 2, 2011 8:40 AM

View PostTEXAS_JOE, on Fri Sep 2, 2011 7:56 AM, said:

How would you slow down the game ... what is the Forth equivelant to "For A=1 to 50::next A" ? :)

50 FOR NEXT

But probably better to put it into it's own routine. A value of about 500 seems about right...

: DELAY 500 FOR NEXT ;

I also switched MOVE-FROG and DRAW-FROG around. Much better movement now... I didn't notice before as it was all a bit too fast...!

Mark :D

23 VALUE X
 1 VALUE C1
 4 VALUE C2
 8 VALUE C3
12 VALUE C4

35 CONSTANT FROG
36 CONSTANT CAR

: SETUP
  1 GMODE \ 32 COLUMN MODE
  17 4 DO I 15 1 COLOR LOOP \ SET COLORS
  HEX  DATA 4 1899 7E3C 3CBD FF5A  DECIMAL  FROG DCHAR
  HEX  DATA 4 66FF DBDB DBDB FF66  DECIMAL  CAR  DCHAR ;

: DRAW-FROG
  X 11 FROG 1 HCHAR ;
  
: MOVE-CARS
  12 C1 32 1 HCHAR  C1 1+ 32 MOD TO C1  12 C1 CAR 1 HCHAR
  14 C2 32 1 HCHAR  C2 1+ 32 MOD TO C2  14 C2 CAR 1 HCHAR
  16 C3 32 1 HCHAR  C3 1+ 32 MOD TO C3  16 C3 CAR 1 HCHAR
  18 C4 32 1 HCHAR  C4 1+ 32 MOD TO C4  18 C4 CAR 1 HCHAR ;
  
: MOVE-FROG
  KEY? 
  CASE
    69 OF 
      X 11 32 1 HCHAR
      -1 +TO X
    ENDOF
    88 OF
      X 11 32 1 HCHAR
      X 1+ DUP 24 = IF DROP 23 THEN TO X
    ENDOF
  ENDCASE ;
  
: FINISHED?
  X IF FALSE ELSE ." WELL DONE!" TRUE THEN ;
    
: DEAD?
  X 11 GCHAR
  CAR = IF
    ." YOU'RE DEAD!" TRUE 
  ELSE 
    FALSE
  THEN ;
  
: DELAY
  500 FOR NEXT ;

: RUN
  SETUP  23 TO X
  BEGIN
    MOVE-FROG  
    DRAW-FROG  
    MOVE-CARS  
    DELAY
    DEAD?  FINISHED?  OR
  UNTIL CR ;


#84 TEXAS_JOE OFFLINE  

TEXAS_JOE

    Chopper Commander

  • 179 posts
  • Currently working on Final Furlong

Posted Fri Sep 2, 2011 11:35 AM

Nice one , Willsy. Cheers for the feedback & help! Can't wait for the TurboForth manual .... many advantages to be gained by this language.... bit fed up of Basic now, it's not really responsive enough :cool:




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users