Jump to content
IGNORED

A worse programmers questions


Sid1968

Recommended Posts

3 hours ago, FarmerPotato said:

 

Where can you see BASIC treating integers this way?

 

In 99/4A console TI BASIC:

 

When I look in VDP (around >3700) at the stored statement CALL HCHAR(1,1,42,768) I see the numbers stored as strings in the program. 

The statement A=1234.3333 stores the number as a string in the program.

 

When I assign an integer to a variable see 8 bytes of stack written with the values


A = 1 gives 40 01 00 00 00 00 00 00 
A = 1.5 gives 40 01 32 00 00 00 00 00
A = 16 gives 40 10 00 00 00 00 00 00
A = 64 gives 40 40 00 00 00 00 00 00
A = 99 gives 40 63 00 00 00 00 00 00
A = 100 gives 41 01 00 00 00 00 00 00
A = 10000 gives 42 01 00 00 00 00 00 00
A  = -1 gives BF FF 00 00 00 00 00 00
A = -99 gives BF 9D 00 00 00 00 00 00

 

These are Radix 100 floating point values. It happens that small integers from -99 to 99 are easy to convert out of Radix 100 without any multiplication.

 

Why add integer types?

 

I agree that adding an integer type is a big deal, because of all the argument checking code in built-in functions.

 

Some gains to be had are:

  • avoiding costly CFI and CIF conversion routines,
  • avoiding costly string-to-number conversion,
  • fast numeric calculations where only integers are required, such as indexing through array indices, some equations in integer only.

It has been done before in 990 TI BASIC, so we can try it. 

 

In TI BASIC for the 990/4, the operating system and basic interpreter take up a little more than 32K, leaving 29K for the BASIC program.

It provides INT, REAL, and DECIMAL type declarations.

 

Integers are declared like so:


20 INTEGER A
30 A = 5

 

or for an array,


20 INTEGER A(10)


REAL variables consume 8 bytes of stack space, INTEGER 2.

Between REAL X(10) and REAL X(11) there is 8 bytes difference. For INTEGER it is 2 bytes.

 

Because it is a superset of 99/4A TI BASIC, you could type in any program and run it with good compatibility - all variables would default to REAL. It doesn't have HCHAR for one, and such subroutines would have to marshal their (integer desired) arguments by checking the input type. (If you wrote SUB HCHAR you could test the effect of changing parameter types from INTEGER to REAL.) Still, HCHAR could be written to work much faster if it didn't have to do any conversions from floating point to an integer VDP address.

 

I did one experiment - this is in sim990 on my fast PC, so times are only relative.


100 N=10000
110 REAL A
120 FOR I=1 TO N
130 A=A+1
140 NEXT I
150 PRINT A

time = 5 seconds

80 INTEGER N
90 INTEGER I
110 INTEGER A

time = <3 seconds

Not sure if that constant 1 should be treated somehow

 

Simple multiplication seems to go twice as fast:

 


100 N=10000
110 REAL A
120 A=1
130 FOR I=1 TO N
140 A=A*1.01
150 NEXT I
160 PRINT A

6 seconds

70 INTEGER B
80 INTEGER N
90 INTEGER I
110 INTEGER A
140 B=A*2

3 seconds

 

I hope this illustrates that there is a large gain to be had from a BASIC with integer types.

 

Your reasoning is plausible.

Would it be possible to add XBINTEGER and XBFLOAT in assemblercode to RXB or what do you think is the best way to implement these to RXB?

 

Would be interesting too what Rich thinks about that.

 

 

  • Like 1
Link to comment
Share on other sites

When you think about adding commands, check whether there are enough free token values. As for TI BASIC / Extended Basic I seem to remember there is still some space left, but in general you cannot just add arbitrarily many new commands.

 

(FYI, BASIC language elements are not stored as plain text in memory but as numeric values. OK, except for string values, but they also have a token "quoted string" or "unquoted string".)

  • Thanks 1
Link to comment
Share on other sites

As I see it, the main issue if trying to add integers to BASIC is that handling numeric arguments is done by each function itself. So everywhere you check that the argument is numeric, and treat it accordingly, you now have to check if it's a floating point or integer value, and treat them differently.

I still see the "value for money" factor to be too little for this project to be interesting. There are routes that are more beneficiary, if you simply want to speed up design and execution of your programs.

  • Thanks 1
Link to comment
Share on other sites

4 hours ago, mizapf said:

When you think about adding commands, check whether there are enough free token values. As for TI BASIC / Extended Basic I seem to remember there is still some space left, but in general you cannot just add arbitrarily many new commands.

 

(FYI, BASIC language elements are not stored as plain text in memory but as numeric values. OK, except for string values, but they also have a token "quoted string" or "unquoted string".)

There are available tokens. Where? Because I saw, in the source that kl99er posted, that the programmer of 99/4A TI BASIC commented out the keywords that were not being used from 990 TI BASIC. 

 

See "Console GROM Source Code 3-EDIT-HC 1982-08-25.pdf" here: https://atariage.com/forums/topic/295214-who-created-ti-99-basic-ti-or-ms/?do=findComment&comment=4339658


I also see functions that don't have tokens, so they are stored as strings in the program. So I understand it's possible to continue even when all the tokens are used up, it just takes more memory.

 

My first research is here:   

 

 

The following tokens had numbers reserved, but are commented out, in the 99/4A console TI BASIC source code. Many of them came back in Extended BASIC, or were already planned for it somehow. Some of them did not make the cut.

::        82
!         83
SUBEXIT   A3
SUBEND    A4
REAL      A5
INTEGER   A6
SCRATCH   A7
ACCEPT    A8
IMAGE     A9
OR        BA
AND       BB
XOR       BC
NOT       BD
ALL       EC
USING     ED
BEEP      EE
ERASE     EF
AT        F0
VARIABLE  F2
TEMPORARY F3
RELATIVE  F4
INTERNAL  F5

I saw a gap of 16 tokens from DC to EB in the TI BASIC table, which I have guessed were formerly used for more of these 21 functions from 990 TI BASIC. I don't get why functions like ASC etc did not stay on as tokens!

 

ASC LEN NUMERIC POS RPT$ SPAN UPRC$ VAL CHR$ SEG$ STR$ DAT$ TIME$ RND FREESPACE INKEY INKEY$ EOF FTYPE ERR DUP


The token table is one piece of evidence strongly indicating that 99/4A TI BASIC at least had a spec derived from the 990 assembly language TI BASIC, though 99/4A BASIC was being written in GPL. Extended BASIC put many of the 990 keywords back in.  I haven't studied the Extended BASIC token table since I was a teenager though, when my brother and I played around with the 99er article about generating code from scratch in MERGE files. (see where this a lifelong love of the TI-99/4A?)

 

Somebody can help me understand if the gaps in the token table are still available.

 

In the near future I will disassemble the 990 TI BASIC interpreter to see what's under the hood. Maybe it uses this token table? I already found that it shares Radix 100, unlike 990 FORTRAN or other languages using IBM floating point. (By the way, there is a 990 p-System and UCSD Pascal.) To disassemble 990 TI BASIC without any CALL PEEK.. I'll have to write an assembly routine to add CALL PEEK into the language. (It will look ugly like CALL ".PEEK"(A, X)). From that dump I'll work it out using Ralph's xdt99 disassembler.

 

I don't think it is wise to use a name like XBINT, XBFLOAT, on the principle that TI BASIC's ancestor originally had keywords INTEGER, REAL, and DECIMAL. And they don't interfere with syntax. They are placed on a line by themselves, so syntax compatibility is not a problem. As you see in my FOR loop example, you just drop in a type declaration earlier in the program without modifying the code that uses it.

 

Finally, though, I am not able to work on any BASIC interpreter. I have too many commitments. This is mostly academic for me. It's a love of computing history, the sense of discovery, and the desire to right the hideous rumor that somehow Microsoft was our "BASIC Daddy". At some far future date I may work on Myarc Advanced Basic; I don't know, its unlikely. I'd much rather be programming in FORTH.

 

It might be fun to extend Dave Pitts' sim990 with a 9918A emulator. Then add all the 99/4A graphics CALLs in an assembly library.   Then run lots of 99/4A programs to see what is compatible or not.

 

 

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

23 hours ago, Sid1968 said:

 

How about adding two NEW datatypes XBINTEGER and XBFLOAT to RXB? Extended Basic is an extension of TI-Basic! Now old programs could use the old stuff, and new programs could use these two new datatypes ? This would result in NO compatibilityproblems with old Basicprograms.

I have a question, where would you put all of this stuff and you understand all the XB ROMs would have to be modified to do this, again where is that space?

  • Thanks 1
Link to comment
Share on other sites

5 hours ago, mizapf said:

When you think about adding commands, check whether there are enough free token values. As for TI BASIC / Extended Basic I seem to remember there is still some space left, but in general you cannot just add arbitrarily many new commands.

 

(FYI, BASIC language elements are not stored as plain text in memory but as numeric values. OK, except for string values, but they also have a token "quoted string" or "unquoted string".)

Good point but TI screwed the pooch, there is only 3 bytes left of space for new tokens in the XB ROMs.

Yes there is about 22 tokens you can add to XB but when I tried to add just one token, it constantly crashed till I found the problem was it was missing

that token in XB ROMs.

So I tried to get around it but always failed and I did ask for help many times.

History.....

  • Thanks 1
Link to comment
Share on other sites

54 minutes ago, FarmerPotato said:

There are available tokens. Where? Because I saw, in the source that kl99er posted, that the programmer of 99/4A TI BASIC commented out the keywords that were not being used from 990 TI BASIC. 

 

See "Console GROM Source Code 3-EDIT-HC 1982-08-25.pdf" here: https://atariage.com/forums/topic/295214-who-created-ti-99-basic-ti-or-ms/?do=findComment&comment=4339658


I also see functions that don't have tokens, so they are stored as strings in the program. So I understand it's possible to continue even when all the tokens are used up, it just takes more memory.

 

My first research is here:   

 

 

The following tokens had numbers reserved, but are commented out, in the 99/4A console TI BASIC source code. Many of them came back in Extended BASIC, or were already planned for it somehow. Some of them did not make the cut.


::        82
!         83
SUBEXIT   A3
SUBEND    A4
REAL      A5
INTEGER   A6
SCRATCH   A7
ACCEPT    A8
IMAGE     A9
OR        BA
AND       BB
XOR       BC
NOT       BD
ALL       EC
USING     ED
BEEP      EE
ERASE     EF
AT        F0
VARIABLE  F2
TEMPORARY F3
RELATIVE  F4
INTERNAL  F5

I saw a gap of 16 tokens from DC to EB in the TI BASIC table, which I have guessed were formerly used for more of these 21 functions from 990 TI BASIC. I don't get why functions like ASC etc did not stay on as tokens!

 


ASC LEN NUMERIC POS RPT$ SPAN UPRC$ VAL CHR$ SEG$ STR$ DAT$ TIME$ RND FREESPACE INKEY INKEY$ EOF FTYPE ERR DUP


The token table is one piece of evidence strongly indicating that 99/4A TI BASIC at least had a spec derived from the 990 assembly language TI BASIC, though 99/4A BASIC was being written in GPL. Extended BASIC put many of the 990 keywords back in.  I haven't studied the Extended BASIC token table since I was a teenager though, when my brother and I played around with the 99er article about generating code from scratch in MERGE files. (see where this a lifelong love of the TI-99/4A?)

 

Somebody can help me understand if the gaps in the token table are still available.

 

In the near future I will disassemble the 990 TI BASIC interpreter to see what's under the hood. Maybe it uses this token table? I already found that it shares Radix 100, unlike 990 FORTRAN or other languages using IBM floating point. (By the way, there is a 990 p-System and UCSD Pascal.) To disassemble 990 TI BASIC without any CALL PEEK.. I'll have to write an assembly routine to add CALL PEEK into the language. (It will look ugly like CALL ".PEEK"(A, X)). From that dump I'll work it out using Ralph's xdt99 disassembler.

 

I don't think it is wise to use a name like XBINT, XBFLOAT, on the principle that TI BASIC's ancestor originally had keywords INTEGER, REAL, and DECIMAL. And they don't interfere with syntax. They are placed on a line by themselves, so syntax compatibility is not a problem. As you see in my FOR loop example, you just drop in a type declaration earlier in the program without modifying the code that uses it.

 

Finally, though, I am not able to work on any BASIC interpreter. I have too many commitments. This is mostly academic for me. It's a love of computing history, the sense of discovery, and the desire to right the hideous rumor that somehow Microsoft was our "BASIC Daddy". At some far future date I may work on Myarc Advanced Basic; I don't know, its unlikely. I'd much rather be programming in FORTH.

 

It might be fun to extend Dave Pitts' sim990 with a 9918A emulator. Then add all the 99/4A graphics CALLs in an assembly library.   Then run lots of 99/4A programs to see what is compatible or not.

 

 

Ok here is the TOKEN TABLE from listing in RXB GROM6:

[2152]                      AORG >0B00
[2153]               ***********************************************************
[2154]               *                BASIC KEYWORD TABLE
[2155]               *      THE TOKEN IS ITS LEFT BINDING POWER
[2156]               ***********************************************************
[2157] CB00 CB,14,CB KEYTAB DATA CHAR1,CHAR2,CHAR3,CHAR4,CHAR5
       CB03 35,CB,4E
       CB06 CB,EF,CC
       CB09 59
[2158] CB0A CC,A8,CC        DATA CHAR6,CHAR7,CHAR8,CHAR9,CHARA
       CB0D F6,CD,2F
       CB10 CD,5D,CD
       CB13 68
[2159] CB14 21       CHAR1  TEXT '!'
[2160] CB15 83              BYTE TREMZ             *  !
[2161] CB16 23              TEXT '#'
[2162] CB17 FD              BYTE NUMBEZ            *  #
[2163] CB18 26              TEXT '&'
[2164] CB19 B8              BYTE CONCZ             *  &
[2165] CB1A 28              TEXT '('
[2166] CB1B B7              BYTE LPARZ             *  (
[2167] CB1C 29              TEXT ')'
[2168] CB1D B6              BYTE RPARZ             *  )
[2169] CB1E 2A              TEXT '*'
[2170] CB1F C3              BYTE MULTZ             *  *
[2171] CB20 2B              TEXT '+'
[2172] CB21 C1              BYTE PLUSZ             *  +
[2173] CB22 2C              TEXT ','
[2174] CB23 B3              BYTE COMMAZ            *  ,
[2175] CB24 2D              TEXT '-'
[2176] CB25 C2              BYTE MINUSZ            *  -
[2177] CB26 2F              TEXT '/'
[2178] CB27 C4              BYTE DIVIZ             *  /
[2179] CB28 3A              TEXT ':'
[2180] CB29 B5              BYTE COLONZ            *  :
[2181] CB2A 3B              TEXT ';'
[2182] CB2B B4              BYTE SEMICZ            *  ;
[2183] CB2C 3C              TEXT '<'
[2184] CB2D BF              BYTE LESSZ             *  <
[2185] CB2E 3D              TEXT '='
[2186] CB2F BE              BYTE EQUALZ            *  =
[2187] CB30 3E              TEXT '>'
[2188] CB31 C0              BYTE GREATZ            *  >
[2189] CB32 5E              TEXT '^'
[2190] CB33 C5              BYTE CIRCUZ            *  ^
[2191] CB34 FF              BYTE >FF
[2192] CB35 3A,3A    CHAR2  TEXT '::'
[2193] CB37 82              BYTE SSEPZ             *  ::
[2194] CB38 41,54           TEXT 'AT'
[2195] CB3A F0              BYTE ATZ               *  AT

99/4 GPL-ASSEMBLER (Pass 3) correct                                   PAGE 0039 
EQUATES ALCS-359
[2196] CB3B 47,4F           TEXT 'GO'
[2197] CB3D 85              BYTE GOZ               *  GO * RXB MOTION
[2198] CB3E 49,46           TEXT 'IF'
[2199] CB40 84              BYTE IFZ               *  IF
[2200] CB41 4F,4E           TEXT 'ON'
[2201] CB43 9B              BYTE ONZ               *  ON * ONKEY
[2202] CB44 4F,52           TEXT 'OR'
[2203] CB46 BA              BYTE ORZ               *  OR
[2204] CB47 50,49           TEXT 'PI'
[2205] CB49 DD              BYTE PIZ               *  PI
[2206] CB4A 54,4F           TEXT 'TO'
[2207] CB4C B1              BYTE TOZ               *  TO
[2208] CB4D FF              BYTE >FF
[2209] CB4E 41,42,53 CHAR3  TEXT 'ABS'
[2210] CB51 CB              BYTE ABSZ              *  ABS
[2211] CB52 41,4C,4C        TEXT 'ALL'
[2212] CB55 EC              BYTE ALLZ              *  ALL
[2213] CB56 41,4E,44        TEXT 'AND'
[2214] CB59 BB              BYTE ANDZ              *  AND
[2215] CB5A 41,53,43        TEXT 'ASC'
[2216] CB5D DC              BYTE ASCZ              *  ASC
[2217] CB5E 41,54,4E        TEXT 'ATN'
[2218] CB61 CC              BYTE ATNZ              *  ATN
[2219] CB62 42,59,45        TEXT 'BYE'
[2220] CB65 03              BYTE >03               *  BYE
[2221] CB66 43,4F,4E        TEXT 'CON'
[2222] CB69 01              BYTE >01               *  CONtinue
[2223] CB6A 43,4F,53        TEXT 'COS'
[2224] CB6D CD              BYTE COSZ              *  COS
[2225] CB6E 44,45,46        TEXT 'DEF'
[2226] CB71 89              BYTE DEFZ              *  DEF
[2227]               * GKXB added token
[2228] CB72 44,45,4C        TEXT 'DEL'
[2229] CB75 09              BYTE >09               *  DEL
[2230] CB76 44,49,4D        TEXT 'DIM'
[2231] CB79 8A              BYTE DIMZ              *  DIM
[2232] CB7A 45,4E,44        TEXT 'END'
[2233] CB7D 8B              BYTE ENDZ              *  END
[2234] CB7E 45,4F,46        TEXT 'EOF'
[2235] CB81 CA              BYTE EOFZ              *  EOF
[2236] CB82 45,58,50        TEXT 'EXP'
[2237] CB85 CE              BYTE EXPZZ             *  EXP
[2238] CB86 46,4F,52        TEXT 'FOR'
[2239] CB89 8C              BYTE FORZ              *  FOR
[2240] CB8A 49,4E,54        TEXT 'INT'
[2241] CB8D CF              BYTE INTZ              *  INT
[2242] CB8E 4C,45,4E        TEXT 'LEN'
[2243] CB91 D5              BYTE LENZ              *  LEN
[2244] CB92 4C,45,54        TEXT 'LET'
[2245] CB95 8D              BYTE LETZ              *  LET
[2246] CB96 4C,4F,47        TEXT 'LOG'
[2247] CB99 D0              BYTE LOGZ              *  LOG
[2248] CB9A 4D,41,58        TEXT 'MAX'
[2249] CB9D DF              BYTE MAXZ              *  MAX
[2250] CB9E 4D,49,4E        TEXT 'MIN'
[2251] CBA1 E0              BYTE MINZ              *  MIN
[2252] CBA2 4E,45,57        TEXT 'NEW'
[2253] CBA5 00              BYTE >00               *  NEW * RXB CALL NEW
[2254] CBA6 4E,4F,54        TEXT 'NOT'
[2255] CBA9 BD              BYTE NOTZ              *  NOT
[2256] CBAA 4E,55,4D        TEXT 'NUM'
[2257] CBAD 04              BYTE >04               *  NUMber
[2258] CBAE 4F,4C,44        TEXT 'OLD'
[2259] CBB1 05              BYTE >05               *  OLD

99/4 GPL-ASSEMBLER (Pass 3) correct                                   PAGE 0040 
EQUATES ALCS-359
[2260] CBB2 50,4F,53        TEXT 'POS'
[2261] CBB5 D9              BYTE POSZ              *  POS
[2262] CBB6 52,45,43        TEXT 'REC'
[2263] CBB9 DE              BYTE RECZ              *  REC
[2264] CBBA 52,45,4D        TEXT 'REM'
[2265] CBBD 9A              BYTE REMZ              *  REMark
[2266] CBBE 52,45,53        TEXT 'RES'
[2267] CBC1 06              BYTE >06               *  RESequence
[2268] CBC2 52,4E,44        TEXT 'RND'
[2269] CBC5 D7              BYTE RNDZ              *  RND
[2270]               * RXB PATCH CODE
[2271] CBC6 52,41,4E        TEXT 'RAN'            
[2272] CBC9 E2              BYTE RANZ              *  RAN * RXB RND
[2273] CBCA 52,55,4E        TEXT 'RUN'
[2274] CBCD A9              BYTE RUNZ              *  RUN 
[2275] CBCE 53,47,4E        TEXT 'SGN'
[2276] CBD1 D1              BYTE SGNZZ             *  SGN
[2277] CBD2 53,49,4E        TEXT 'SIN'
[2278] CBD5 D2              BYTE SINZ              *  SIN
[2279] CBD6 53,51,52        TEXT 'SQR'
[2280] CBD9 D3              BYTE SQRZ              *  SQR
[2281] CBDA 53,55,42        TEXT 'SUB'
[2282] CBDD A1              BYTE SUBZ              *  SUB
[2283] CBDE 54,41,42        TEXT 'TAB'
[2284] CBE1 FC              BYTE TABZ              *  TAB
[2285] CBE2 54,41,4E        TEXT 'TAN'
[2286] CBE5 D4              BYTE TANZ              *  TAN
[2287] CBE6 56,41,4C        TEXT 'VAL'
[2288] CBE9 DA              BYTE VALZ              *  VAL
[2289] CBEA 58,4F,52        TEXT 'XOR'
[2290] CBED BC              BYTE XORZ              *  XOR
[2291] CBEE FF              BYTE >FF
[2292] CBEF 42,41,53 CHAR4  TEXT 'BASE'
       CBF2 45
[2293] CBF3 F1              BYTE BASEZ             *  BASE
[2294] CBF4 42,45,45        TEXT 'BEEP'
       CBF7 50
[2295] CBF8 EE              BYTE BEEPZ             *  BEEP
[2296] CBF9 43,41,4C        TEXT 'CALL'
       CBFC 4C
[2297] CBFD 9D              BYTE CALLZ             *  CALL
[2298] CBFE 43,48,52        TEXT 'CHR$'
       CC01 24
[2299] CC02 D6              BYTE CHRZZ             *  CHR$
[2300]               * GKXB added token
[2301] CC03 43,4F,50        TEXT 'COPY'
       CC06 59
[2302] CC07 0A              BYTE >0A               *  COPY
[2303] CC08 44,41,54        TEXT 'DATA'
       CC0B 41
[2304] CC0C 93              BYTE DATAZ             *  DATA
[2305] CC0D 45,4C,53        TEXT 'ELSE'
       CC10 45
[2306] CC11 81              BYTE ELSEZ             *  ELSE
[2307] CC12 47,4F,54        TEXT 'GOTO'
       CC15 4F
[2308] CC16 86              BYTE GOTOZ             *  GOTO * RXB ONKEY
[2309] CC17 4C,49,53        TEXT 'LIST'
       CC1A 54
[2310] CC1B 02              BYTE >02               *  LIST
[2311]               * GKXB added token
[2312] CC1C 4D,4F,56        TEXT 'MOVE'
       CC1F 45
[2313] CC20 0B              BYTE >0B               *  MOVE

99/4 GPL-ASSEMBLER (Pass 3) correct                                   PAGE 0041 
EQUATES ALCS-359
[2314] CC21 4E,45,58        TEXT 'NEXT'
       CC24 54
[2315] CC25 96              BYTE NEXTZ             *  NEXT
[2316] CC26 4F,50,45        TEXT 'OPEN'
       CC29 4E
[2317] CC2A 9F              BYTE OPENZ             *  OPEN
[2318] CC2B 52,45,41        TEXT 'READ'
       CC2E 44
[2319] CC2F 97              BYTE READZ             *  READ
[2320] CC30 52,50,54        TEXT 'RPT$'
       CC33 24
[2321] CC34 E1              BYTE RPTZZ             *  RPT$
[2322] CC35 53,41,56        TEXT 'SAVE'
       CC38 45
[2323] CC39 07              BYTE >07               *  SAVE * RXB SAVE IV254
[2324] CC3A 53,45,47        TEXT 'SEG$'
       CC3D 24
[2325] CC3E D8              BYTE SEGZZ             *  SEG$
[2326] CC3F 53,49,5A        TEXT 'SIZE'
       CC42 45
[2327] CC43 EB              BYTE SIZEZ             *  SIZE * RXB CALL SIZE
[2328] CC44 53,54,45        TEXT 'STEP'
       CC47 50
[2329] CC48 B2              BYTE STEPZ             *  STEP
[2330] CC49 53,54,4F        TEXT 'STOP'
       CC4C 50
[2331] CC4D 98              BYTE STOPZ             *  STOP * RXB MOTION
[2332] CC4E 53,54,52        TEXT 'STR$'
       CC51 24
[2333] CC52 DB              BYTE STRZZ             *  STR$
[2334] CC53 54,48,45        TEXT 'THEN'
       CC56 4E
[2335] CC57 B0              BYTE THENZ             *  THEN
[2336] CC58 FF              BYTE >FF
[2337] CC59 42,52,45 CHAR5  TEXT 'BREAK'
       CC5C 41,4B
[2338] CC5E 8E              BYTE BREAKZ            *  BREAK
[2339] CC5F 43,4C,4F        TEXT 'CLOSE'
       CC62 53,45
[2340] CC64 A0              BYTE CLOSEZ            *  CLOSE
[2341] CC65 44,49,47        TEXT 'DIGIT'
       CC68 49,54
[2342] CC6A E9              BYTE DIGITZ            *  DIGIT
[2343] CC6B 45,52,41        TEXT 'ERASE'
       CC6E 53,45
[2344] CC70 EF              BYTE ERASEZ            *  ERASE
[2345] CC71 45,52,52        TEXT 'ERROR'
       CC74 4F,52
[2346] CC76 A5              BYTE ERRORZ            *  ERROR
[2347] CC77 46,49,58        TEXT 'FIXED'
       CC7A 45,44
[2348] CC7C FA              BYTE FIXEDZ            *  FIXED
[2349] CC7D 47,4F,53        TEXT 'GOSUB'
       CC80 55,42
[2350] CC82 87              BYTE GOSUBZ            *  GOSUB
[2351] CC83 49,4D,41        TEXT 'IMAGE'
       CC86 47,45
[2352] CC88 A3              BYTE IMAGEZ            *  IMAGE
[2353] CC89 49,4E,50        TEXT 'INPUT'
       CC8C 55,54
[2354] CC8E 92              BYTE INPUTZ            *  INPUT
[2355] CC8F 4D,45,52        TEXT 'MERGE'
       CC92 47,45
[2356] CC94 08              BYTE >08               *  MERGE

99/4 GPL-ASSEMBLER (Pass 3) correct                                   PAGE 0042 
EQUATES ALCS-359
[2357] CC95 50,52,49        TEXT 'PRINT'
       CC98 4E,54
[2358] CC9A 9C              BYTE PRINTZ            *  PRINT
[2359] CC9B 54,52,41        TEXT 'TRACE'
       CC9E 43,45
[2360] CCA0 90              BYTE TRACEZ            *  TRACE
[2361] CCA1 55,53,49        TEXT 'USING'
       CCA4 4E,47
[2362] CCA6 ED              BYTE USINGZ            *  USING
[2363] CCA7 FF              BYTE >FF
[2364] CCA8 41,43,43 CHAR6  TEXT 'ACCEPT'
       CCAB 45,50,54
[2365] CCAE A4              BYTE ACCEPZ            *  ACCEPT
[2366] CCAF 41,50,50        TEXT 'APPEND'
       CCB2 45,4E,44
[2367] CCB5 F9              BYTE APPENZ            *  APPEND
[2368] CCB6 44,45,4C        TEXT 'DELETE'
       CCB9 45,54,45
[2369] CCBC 99              BYTE DELETZ            *  DELETE
[2370] CCBD 4C,49,4E        TEXT 'LINPUT'
       CCC0 50,55,54
[2371] CCC3 AA              BYTE LINPUZ            *  LINPUT
[2372] CCC4 4E,55,4D        TEXT 'NUMBER'
       CCC7 42,45,52
[2373] CCCA 04              BYTE >04               *  NUMBER
[2374] CCCB 4F,50,54        TEXT 'OPTION'
       CCCE 49,4F,4E
[2375] CCD1 9E              BYTE OPTIOZ            *  OPTION
[2376] CCD2 4F,55,54        TEXT 'OUTPUT'
       CCD5 50,55,54
[2377] CCD8 F7              BYTE OUTPUZ            *  OUTPUT
[2378] CCD9 52,45,54        TEXT 'RETURN'
       CCDC 55,52,4E
[2379] CCDF 88              BYTE RETURZ            *  RETURN
[2380] CCE0 53,55,42        TEXT 'SUBEND'
       CCE3 45,4E,44
[2381] CCE6 A8              BYTE SUBNDZ            *  SUBEND
[2382] CCE7 55,41,4C        TEXT 'UALPHA'
       CCEA 50,48,41
[2383] CCED EA              BYTE UALPHZ            *  UALPHA
[2384] CCEE 55,50,44        TEXT 'UPDATE'
       CCF1 41,54,45
[2385] CCF4 F8              BYTE UPDATZ            *  UPDATE
[2386] CCF5 FF              BYTE >FF
[2387] CCF6 44,49,53 CHAR7  TEXT 'DISPLAY'
       CCF9 50,4C,41
       CCFC 59
[2388] CCFD A2              BYTE DISPLZ            *  DISPLAY
[2389] CCFE 4E,55,4D        TEXT 'NUMERIC'
       CD01 45,52,49
       CD04 43
[2390] CD05 E8              BYTE NUMERZ            *  NUMERIC
[2391] CD06 52,45,53        TEXT 'RESTORE'
       CD09 54,4F,52
       CD0C 45
[2392] CD0D 94              BYTE RESTOZ            *  RESTORE
[2393] CD0E 53,55,42        TEXT 'SUBEXIT'
       CD11 45,58,49
       CD14 54
[2394] CD15 A7              BYTE SUBXTZ            *  SUBEXIT
[2395] CD16 55,4E,42        TEXT 'UNBREAK'
       CD19 52,45,41
       CD1C 4B
[2396] CD1D 8F              BYTE UNBREZ            *  UNBREAK

99/4 GPL-ASSEMBLER (Pass 3) correct                                   PAGE 0043 
EQUATES ALCS-359
[2397] CD1E 55,4E,54        TEXT 'UNTRACE'
       CD21 52,41,43
       CD24 45
[2398] CD25 91              BYTE UNTRAZ            *  UNTRACE
[2399] CD26 57,41,52        TEXT 'WARNING'
       CD29 4E,49,4E
       CD2C 47
[2400] CD2D A6              BYTE WARNZ             *  WARNING
[2401] CD2E FF              BYTE >FF
[2402] CD2F 43,4F,4E CHAR8  TEXT 'CONTINUE'
       CD32 54,49,4E
       CD35 55,45
[2403] CD37 01              BYTE >01               *  CONTINUE
[2404] CD38 49,4E,54        TEXT 'INTERNAL'
       CD3B 45,52,4E
       CD3E 41,4C
[2405] CD40 F5              BYTE INTERZ            *  INTERNAL
[2406] CD41 52,45,4C        TEXT 'RELATIVE'
       CD44 41,54,49
       CD47 56,45
[2407] CD49 F4              BYTE RELATZ            *  RELATIVE
[2408] CD4A 56,41,4C        TEXT 'VALIDATE'
       CD4D 49,44,41
       CD50 54,45
[2409] CD52 FE              BYTE VALIDZ            *  VALIDATE
[2410] CD53 56,41,52        TEXT 'VARIABLE'
       CD56 49,41,42
       CD59 4C,45
[2411] CD5B F3              BYTE VARIAZ            *  VARIABLE
[2412] CD5C FF              BYTE >FF
[2413] CD5D 52,41,4E CHAR9  TEXT 'RANDOMIZE'
       CD60 44,4F,4D
       CD63 49,5A,45
[2414] CD66 95              BYTE RANDOZ            *  RANDOMIZE
[2415] CD67 FF              BYTE >FF
[2416] CD68 53,45,51 CHARA  TEXT 'SEQUENTIAL'
       CD6B 55,45,4E
       CD6E 54,49,41
       CD71 4C
[2417] CD72 F6              BYTE SEQUEZ            *  SEQUENTIAL
[2418] CD73 FF              BYTE >FF
[2419]               ***********************************************************
[2420]               * RXB PATCH CODE FILLER BYTE ******************************
[2421] CD74 00,00,00        BYTE >00,>00,>00

The TOKEN in RXB are exactly the same as normal XB, but I did use many for other functions in RXB

for example CALL NEW or CALL BYE or CALL ONKEY(string,key-unit,return-variable,status-variable) GOTO line-number

 

So yes DECIMAL and INTEGER are defined but not in the main TOKEN tables, just for ACCEPT AT, thus would need to be added to XB ROMs.

  • Thanks 1
Link to comment
Share on other sites

59 minutes ago, RXB said:

Ok here is the TOKEN TABLE from listing in RXB GROM6:

The TOKEN in RXB are exactly the same as normal XB, but I did use many for other functions in RXB

for example CALL NEW or CALL BYE or CALL ONKEY(string,key-unit,return-variable,status-variable) GOTO line-number

 

So yes DECIMAL and INTEGER are defined but not in the main TOKEN tables, just for ACCEPT AT, thus would need to be added to XB ROMs.

 

Thanks. It's very interesting. I will compare it to XB, console TI BASIC, and 990 TI BASIC.

Here's a sorted, look-up table of RXB tokens, reformatted from Rich's listing above. For those who are interested.

 

tables.txt

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

35 minutes ago, FarmerPotato said:

 

Thanks. It's very interesting. I will compare it to XB, console TI BASIC, and 990 TI BASIC.

Here's a sorted, look-up table of RXB tokens, reformatted from Rich's listing above. For those who are interested.

 

tables.txt 2.76 kB · 3 downloads

Good, go on and dont give up! ?

 

  • Like 1
Link to comment
Share on other sites

Hmmm I was wrong then, I swear I saw something where if a value is an integer it just uses the first couple bytes so it doesn't have to parse the entire thing into the GPL/ROM mathematics routines for every single operation.

 

And yes, adding a new variable type is a pain because every single function and call has to be re-written to handle all variants.

 

In fact, nearly every CALL function works with floating point. As shown here:

 

100 CALL CLEAR
110 C=10
120 G=42
130 FOR R=1 TO 24
140 CALL VCHAR(R,C,G)
150 C=C+0.15
160 G=G+0.4
170 NEXT R
180 GOTO 180

There's no quick easy add of a new variable type to the existing Extended BASIC. And RXB's goal was to maintain backwards compatibility with XB, which means not straying too far in certain directions.

 

You can craft your own BASIC and do anything you want with it, you could write up all the math routines and even use IEEE 754 or bfloat16 instead of Radix 100 for floating point if you want to. You could use the SAMS system with an abstraction layer so you effectively have megabytes of memory available.

 

The point is, it's a new platform and language, you can't load an existing XB program into it and expect it to work flawlessly. You'd have to write new programs explicitly for it.

  • Thanks 2
Link to comment
Share on other sites

10 minutes ago, adamantyr said:

Hmmm I was wrong then, I swear I saw something where if a value is an integer it just uses the first couple bytes so it doesn't have to parse the entire thing into the GPL/ROM mathematics routines for every single operation.

 

The only weirdness I am aware of in radix-100 math on the TI-99/4A is how zero and negative numbers are handled:

  • If the first word (2 bytes) is 0000h, the entire radix-100 number is treated as zero, regardless of the values in the remaining 3 words. That is, 0000h 6363h 0035h 1234h is considered to have the same value as 0000h 0000h 0000h 0000h.
  • Negative radix-100 numbers have only the first word negated. Any calculations deal with this contingency before performing the actual calculation, which is done with the absolute values of the numbers. The sign of the result is adjusted to accommodate the signs of the calculation arguments.

...lee

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

Ahem ... before you start wondering about my claim

10 hours ago, mizapf said:

As for TI BASIC / Extended Basic I seem to remember there is still some space left

this was just a guess. I did not really check this with my notes. I just wanted to make aware that there is some technical constraint concerning the addition of new commands. ?

 

Back in the past, I sometimes actually asked myself why we had no integer variables in TI BASIC (knowing them from other computers). Considering the elaborate CALL concept and other TI BASIC elements, I think there could have been some purpose behind. The floating point numbers imply the least "surprises" in terms of valid ranges, and obviously TI had in mind to produce a kind of waterproof (or foolproof if you like) BASIC by taking out anything that could lead to surprises. Also, as we recently had, the Radix 100 format is much better suited to represent human-readable fractions.

 

(Well, in contrast, the POKEs of the C64 always had something mysterious, as if a wrong one could unleash something sinister from another dimension. But it was also fun to POKE around in memory and watch the C64 interpreter landing flat on its face. :-D )

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

On 9/28/2019 at 8:39 AM, RXB said:

 

This would force a Compiled version to not slow down the programs, thus defeating the entire reason for Basic in the first place.

This is what also happened to all Compiled Basic versions, as if you compiled Basic, just might as well just jump to C or Pascal or Assembly. 

I believe ALL of the Kemeny & Kurtz 1960's versions of BASIC at Dartmouth were compiled. The interpreted versions of BASIC became popular (late 70s) out of necessity, with the limited capabilities of early personal computers. The point of BASIC was to get non-computer savvy folks to use computers and write code. Specifically, BASIC was created on large computers to get non-technical students and staff at Dartmouth to use the new time share system. 

 

BASIC has been compiled from day one. 

  • Like 2
  • Thanks 1
Link to comment
Share on other sites

11 hours ago, Airshack said:

I believe ALL of the Kemeny & Kurtz 1960's versions of BASIC at Dartmouth were compiled. The interpreted versions of BASIC became popular (late 70s) out of necessity, with the limited capabilities of early personal computers. The point of BASIC was to get non-computer savvy folks to use computers and write code. Specifically, BASIC was created on large computers to get non-technical students and staff at Dartmouth to use the new time share system. 

 

BASIC has been compiled from day one. 

According to Wikipedia Dartmouth Basic was "interactive" and started in 1964.

https://en.wikipedia.org/wiki/Dartmouth_BASIC

Sounds like an interpreter was there.

 

Sidebar:

I have a memory of sitting in front of a bank of teletype terminals at the University of Western Ontario, in 1969, using a time shared BASIC.

I had no idea what platform it was.  (Google indicates that it was probably an HP product)

LOL.

It was cool but very noisy with 10 terminals clacking away.

 

  • Thanks 1
Link to comment
Share on other sites

46 minutes ago, TheBF said:

According to Wikipedia Dartmouth Basic was "interactive" and started in 1964.

https://en.wikipedia.org/wiki/Dartmouth_BASIC

Sounds like an interpreter was there.

 

Sidebar:

I have a memory of sitting in front of a bank of teletype terminals at the University of Western Ontario, in 1969, using a time shared BASIC.

I had no idea what platform it was.  (Google indicates that it was probably an HP product)

LOL.

It was cool but very noisy with 10 terminals clacking away.

 

True. The interpreter was there as well. Does not exclude the compiler.

  • Thanks 1
Link to comment
Share on other sites

1 hour ago, TheBF said:

 

Sidebar:

I have a memory of sitting in front of a bank of teletype terminals at the University of Western Ontario, in 1969, using a time shared BASIC.

I had no idea what platform it was.  (Google indicates that it was probably an HP product)

LOL.

It was cool but very noisy with 10 terminals clacking away.

 

That’s a great memory to have! That clacking sound was on terminals, not keypunch machines? If so that’s quite advanced for 1969. What a time with Apollo 11 and all...

 

Dartmouth’s system was a GE-225 with GE DATANET-30. Equipment they purchased at a 60% discount from GE’s Phoenix Arizona office. 

 

Of course they put the BASIC Time-Share system together so users wouldn’t have to compile-link-load-execute manually. 

 

BASIC did in fact start out as a compiled language. Kemeny (with Bill Zani) wrote the first single-pass BASIC compiler on punch cards in the summer of 1963. 

 

Later, BASIC was ported to other computers with less memory and processing power, simplified, and interpreted versions appeared.

 

Ref: Back to BASIC, Kennedy and Kurtz

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

1 hour ago, TheBF said:

According to Wikipedia Dartmouth Basic was "interactive" and started in 1964.

https://en.wikipedia.org/wiki/Dartmouth_BASIC

Sounds like an interpreter was there.

 

. In contrast to the Dartmouth compilers, most other BASICs were written as interpreters. This allowed them to run in the limited main memory of early microcomputers.“

 

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

13 hours ago, Airshack said:

I believe ALL of the Kemeny & Kurtz 1960's versions of BASIC at Dartmouth were compiled. The interpreted versions of BASIC became popular (late 70s) out of necessity, with the limited capabilities of early personal computers. The point of BASIC was to get non-computer savvy folks to use computers and write code. Specifically, BASIC was created on large computers to get non-technical students and staff at Dartmouth to use the new time share system. 

 

BASIC has been compiled from day one. 

Ok I started with my first computer in 1975 a K-43 Teletype machine with 32 bytes of memory, I later expanded to 96 bytes.

The reason Basic was compiled was there was not enough memory for a interpeture to exist.

An interpeture requires all the code for conversions and a editor too, so basically a Compiler built in on the fly and editor in one unit.

 

This is why Basic was originally compiled. Interpetures had not been INVENTED YET!

Edited by RXB
  • Thanks 1
Link to comment
Share on other sites

https://www.q7basic.org/History of BASIC.pdf

 

A Basic VM was made by Gordon Eubanks (founder of Symantec) in 1970. 

 

Gates and Allen wrote an interpreter for Altair BASIC in 1975. 

 

Kemeny and Kurtz did not like this at the time, because an interpreter gave up speed to save memory.  But later acknowledged how an interactive interpreter had made Basic spread.  

 

 

 

  • Thanks 2
Link to comment
Share on other sites

7 hours ago, Sid1968 said:

Thx. Do you remember for what you used the K-43 in everyday life?

I worked for several churches and wrote programs to do checking and money records in Machine Language, it did not have Assembly yet.

I never was trained just sat down and read manuals and found examples to create programs for use.

I also spent a weekend upside down under computer soldering magnetic loops adding bits to memory from 32 bits to 96 bits.

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...