[Coco] Programming in BASIC YouTube series URBANE Version

Stephen H. Fischer SFischer1 at Mindspring.com
Sat Apr 30 00:51:22 EDT 2016


"AA" is the conversion of the first variable, "AB" is the conversion of the second and so on. New programs, not existing DECB programs.

None of the two original first characters of a variable have any effect on the two character name assigned. FLEX Basic Preprocessor does NOT have a way that you can look at what is generated!!! The first version of URBANE was written using FLEX's Basic. I switched to the CoCo when it could generate a run able version of itself.

There was NO intent to try and keep the bad things in DECB. I am at the opposite extreme from the one liners. I write code that is human friendly and let the program produce code that DECB will run, no blanks, the shortest variable names and other things that speed up the program.

It was very rare for me to look at the DECB code generated, usually it was in a case where I had typed a error the DECB interpreter caught. Yes rare, it is not intended that you look at the DECB code generated. See FLEX's Basic. If the cross reference file had been converted as intended you could go to the line in the URBANE source directly to find your error.

When I got my first paid programming job I quickly realized that only perfect code could be generated by me if I wanted to keep my job.

The only way you could determine where the PPU was executing your code was to look for a cell in the core dump that was zero. Then you could look for what subroutines were called and try and figure out your error.

 http://livingcomputermuseum.tumblr.com/post/91924982154/cdc-restoration-update

URBANE is DECB without the bad programming practices. There are some new restrictions applied.

Only programmers that can generate perfect DECB need apply. It is intended for medium to large programs. Look at the URBANE source, it is a large program.

As I said, the name "URBANE" was chosen to nail the idea that it is not a modern language.

Earl Casper may generate a DECB replacement that you like better, it will need overlays for the first disk version, a large ROM if he gets that far. We have had sufficient time to improve on DECB, nothing has been done.

He was unhappy with the speed. (I used an emulator and just did something else while it was running.) He somehow fed URBANE's source into a "C" compiler on Windows. What! YES. He then dropped some of what I had added for good programming practices. His latest version was very stripped down. Now he is starting on a different path.

URBANE is very close to the pseudo code language I wrote in. With the colored listing I can read what I did ten (10) years later. The line labels and variable names plus no numbers make it possible. Where are the bug reports? Again, the bad DECB things have been designed out.

It was completed "CONSTANT UBN~VERSION$      = "1.060202 RC0". (February 2, 2006.)

SHF

----- Original Message ----- 
From: "Arthur Flexser" <flexser at fiu.edu>
To: "CoCoList for Color Computer Enthusiasts" <coco at maltedmedia.com>
Sent: Friday, April 29, 2016 8:44 PM
Subject: Re: [Coco] Programming in BASIC YouTube series URBANE Version


> Thanks for the clarification.
> 
> It isn't entirely clear to me under what circumstances a new two-character
> name starting with "AA" would be assigned.  Any time you detect a not
> previously-used variable name in the source?  Any time a not
> previously-used variable name is found that exceeds 2 characters in length?
> 
> I would think a good system would be to retain the first two characters
> (converted to uppercase if necessary) as the new variable name when
> possible, and only assign a new variable name starting with "AA" when doing
> so would result in variable name duplication.  This would tend to make the
> converted output somewhat more intelligible, which would be a minor plus.
> If the original version is FOR I = 1 TO N, it would be a little weird to
> convert it to FOR AA = 1 TO AB, in my opinion, instead of just leaving it
> unchanged.
> 
> Art
> 
> On Fri, Apr 29, 2016 at 9:06 PM, Stephen H. Fischer <
> SFischer1 at mindspring.com> wrote:
> 
>> I suggest that this post be read with the colorized "ubn_in.htm" in
>> another window. I am not sure if using a monospaced font helps this.
>>
>> ----- Original Message -----
>> From: "Arthur Flexser" <flexser at fiu.edu>
>> To: "CoCoList for Color Computer Enthusiasts" <coco at maltedmedia.com>
>> Sent: Friday, April 29, 2016 5:09 PM
>> Subject: Re: [Coco] Programming in BASIC YouTube series URBANE Version
>>
>>
>> >I notice two changes from standard Basic in this:  no line numbers in most
>> > lines, and where line numbers are used, they appear between underscores.
>>
>> '''             CHARACTERS IN COLUMN ONE
>> '               "A-Za-z", "_", "0-9"   =    LINE LABLE
>> '               "#"                    =    Urbane COMMAND
>> '               " "                    =    NO LINE LABLE
>> '               "'"                    =    COMMENT
>> '               any other character    =    COMMENT
>>
>> >where line numbers are used, they appear between underscores.
>>
>> That is just my convention when converting an existing DECB program. I
>> never wrote a conversion program but thought about one. the old line
>> numbers might still work, I wondered even if an existing DECB program would
>> work. But my idea was to get the noise out first.
>>
>> Look at the source for URBANE, it also is the language definition. I said
>> some more words on: http://www.tandycoco.com/coco-forum/basic-ly-speaking
>>
>> > This is typed in (to a word processor?) by the user and saved as a data
>> > file and then Urbane reads that data file and converts it, outputting the
>> > conversion results to an Ascii file that standard Basic can load in?
>>
>> YES!
>>
>> I used Windows "CONTEX" programming editor with syntax coloring to write
>> the program and I think Jeff's "PORT" utility to copy from a Windows file
>> to a DECB disk. URBANE is a CoCo  2 program that will run on a CoCo 3 and
>> yes handle CoCo 3 programs even if run on a CoCo 2. The input and output
>> file names are fixed as well as the other files written. I used Jeff's CoCo
>> 2 emulator after the switch from FLEX's basic was completed. The only way
>> URBANE was possible was because version 1.0 was purchased by me when I got
>> FLEX. I did not realize what I had purchased until I was stumped by the
>> four string sorts to all four running on the same screen at the same time
>> conversion. It just popped into my head after four days. How valiable are
>> libraries of DECB subroutines?
>>
>> As the complete source is right there before your eyes, it can be changed
>> and if someone found a bug they could fix it and never tell me about it.
>> The only bug reported was really in the emulator used. That was discussed
>> right here.
>>
>> > This example seems not to contain any long variable names.  How are such
>> > long names converted to standard Basic variable names?  That is, what
>> > method do you use to avoid the problem simple truncation would have in
>> > cases where several long names start with the same beginning characters?
>>
>> The entire variable name is checked to see if it is a new one, several
>> times I made a typo and had to examine the cross reference raw file to find
>> the exact name I had used before. Some two character variables are not used.
>>
>> '               Illegal Two Character Variable Table    NOTE: "PI" is a
>> variable that is NOT replaced
>>                 DATA AS,BF,FN,IF,ON,OR,PI,TO,"\"
>>
>> > Allowing lowercase in variable names would be nice, if that is not
>> already
>> > a feature.
>>
>> The lowercase letters are converted to upper case  because DECB does not
>> allow them. New two character names are assigned starting with "AA".
>>
>> GET_VLSTRING    VLSTRING$ = IN_LINE_CH$
>> NEXT_VLSTRING_CH GOSUB GET_IN_LINE_CHAR
>>                 IF IN_LINE_CH  <  NUM_0   THEN RETURN
>>                 IF IN_LINE_CH  >= ASC_A_U AND IN_LINE_CH  <= ASC_Z_U GOTO
>> VLSTRING_ADD_UPPER_ALPHA
>>                 IF IN_LINE_CH  >= ASC_a_L AND IN_LINE_CH  <= ASC_z_L GOTO
>> VLSTRING_ADD_LOWER_ALPHA
>>                 IF IN_LINE_CH  >= ASC_0   AND IN_LINE_CH  <= ASC_9   GOTO
>> VLSTRING_ADD_NUMBER
>>                 IF IN_LINE_CH   = ASC_UNDERSCORE                     GOTO
>> VLSTRING_ADD_SPECIAL
>>                 IF IN_LINE_CH   = ASC_TILDE                          GOTO
>> VLSTRING_ADD_SPECIAL
>>                 IF IN_LINE_CH   = ASC_DOLLAR                         GOTO
>> VLSTRING_ADD_DOLLAR
>> '               REM Character Found that cannot be in Variable or line
>> Label
>>                 RETURN
>>
>> VLSTRING_ADD_LOWER_ALPHA IN_LINE_CH   = IN_LINE_CH  - ( ASC_a_L - ASC_A_U )
>>                 IN_LINE_CH$ = CHR$(IN_LINE_CH)
>> VLSTRING_ADD_UPPER_ALPHA  REM
>> VLSTRING_ADD_NUMBER       REM
>> VLSTRING_ADD_SPECIAL      REM
>> VLSTRING_ADD_DOLLAR       REM
>>                 VLSTRING$ = VLSTRING$ + IN_LINE_CH$
>> '               If an "ASC_DOLLAR" is found, declare label or variable end
>> found
>>                 IF IN_LINE_CH  =  ASC_DOLLAR THEN LAST_CH = IN_LINE_CH :
>> GOSUB GET_IN_LINE_CHAR : RETURN
>>                 GOTO NEXT_VLSTRING_CH
>>
>> > Art
>> >
>> > On Fri, Apr 29, 2016 at 3:03 PM, Stephen H. Fischer <
>> > SFischer1 at mindspring.com> wrote:
>> >
>> >> Agreed, but I cannot download files.
>> >>
>> >> Someone else would need to do it.
>> >>
>> >> But then the resulting post could not be sent to the mailing list as it
>> >> would be too large.
>> >>
>> >> That's why zip files were invented.
>> >>
>> >> The dim witted (SOME only) that refuse to use facebook and
>> >> tandycoco.com/coco-forum are locking themselves out of much that is
>> good.
>> >>
>> >> I will see if a post of the converted Selection Sort does not break the
>> >> mailing list limit.
>> >>
>> >> SHF
>> >>
>> >> ---------------------------------------------
>> >> '********************
>> >> '*                  *
>> >> '*  SELECTION SORT  *
>> >> '*                  *
>> >> '********************
>> >> '
>> >>
>> >> _1100_ ' GENERATE RANDOM DATA
>> >> '      PMODE 4
>> >> '      SCREEN 1,0
>> >> '      DIM NO( 126 )
>> >> '      PCLS 0
>> >>
>> >>        FOR I = 1 TO N
>> >>        NO( I ) = INT( RND( 190 ) )
>> >>        HLINE ( I * D, 190 ) - ( I * D, 190 -NO( I )), PSET
>> >>        NEXT
>> >>        HCOLOR 3,2: FOR I = 0 TO 80 STEP 16 : HPRINT(I,0)," SELECTION
>> >> SORT.": NEXT I : HCOLOR 1,2
>> >>        FOR J = N TO 1 STEP -1
>> >>        LS = -1: SI = -1
>> >>        FOR I=1 TO J:IF NO( I ) > LS THEN LS = NO( I ): SI =I: NEXT I
>> ELSE
>> >> NEXT I
>> >>        GOSUB _1290_
>> >>        TM = NO( J ) : NO( J ) = NO( SI ): NO( SI ) = TM
>> >>        GOSUB _1320_
>> >>        NEXT J
>> >>        RETURN
>> >>
>> >> '      LINE DISPLAY SUBROUTINES
>> >>
>> >> _1290_ HLINE ( J * D, 190 ) - ( J * D, 0 ),PRESET
>> >>        HLINE ( ( SI ) * D, 190 ) - (  ( SI ) * D, 0 ), PRESET
>> >>        RETURN
>> >> _1320_ HLINE ( J * D, 190 ) - ( J * D, 190 - NO( J ) ), PSET
>> >>        HLINE ( ( SI ) * D, 190 ) - ( ( SI ) * D, 190 - NO( SI ) ), PSET
>> >>        RETURN
>>
>>
>> --
>> Coco mailing list
>> Coco at maltedmedia.com
>> https://pairlist5.pair.net/mailman/listinfo/coco
>>
> 
> -- 
> Coco mailing list
> Coco at maltedmedia.com
> https://pairlist5.pair.net/mailman/listinfo/coco
>


More information about the Coco mailing list