home *** CD-ROM | disk | FTP | other *** search
/ RBBS in a Box Volume 1 #3.1 / RBBSIABOX31.cdr / basw / bascom.txt < prev    next >
Text File  |  1984-07-29  |  2KB  |  84 lines

  1. r ibm234.tst (xa1)
  2.  
  3. The following are test programs that accompany IBM BASIC COMPILER PROBLEMS
  4. NUMBER 2, 3, & 4.  Follow the instructions to see if the patches you have made 
  5. to your compiler at least fix these problems.  (With your WP, just copy the
  6. Basic code to another file, and compile & link. Only /O is necessary,
  7. unless you're going to test BASRUN also, in which case, use no parameters). 
  8.  
  9.  
  10. PROBLEM #2:
  11.  
  12. The use of the INPUT # statement with quoted strings of length 1 may produce 
  13. random results.
  14.  
  15.  
  16. 10 OPEN "TSTPROG" FOR OUTPUT AS #1
  17. 20 FOR I=1 TO 10
  18. 30 WRITE #1,I,"A","BB","CCC","DDDD"
  19. 40 NEXT I
  20. 50 CLOSE
  21. 60 OPEN "TSTPROG" FOR INPUT AS #1
  22. 70 IF EOF(1) THEN END
  23. 80 INPUT #1,J,A$,B$,C$,D$
  24. 90 PRINT J;A$;B$;C$;D$
  25. 100 GOTO 70
  26.  
  27. This program should print:
  28.  
  29. 1 ABBCCCDDDD
  30. 2 ABBCCCDDDD
  31. 3 ABBCCCDDDD
  32. 4 ABBCCCDDDD
  33. 5 ABBCCCDDDD
  34. 6 ABBCCCDDDD
  35. 7 ABBCCCDDDD
  36. 8 ABBCCCDDDD
  37. 9 ABBCCCDDDD
  38. 10 ABBCCCDDDD
  39.  
  40.  
  41.  
  42. PROBLEM #3:
  43.  
  44. 3.  When using arrays and making calculations such as:
  45.  
  46.      T(J,L)=G(J)*E(L)+T(J+1,I)
  47.  
  48. the Compiler may give an Internal error or the calculation may be performed 
  49. incorrectly.
  50.  
  51.  
  52. 10 DEFINT D,F,N
  53. 20 DSD=0
  54. 30 FOR N=0 TO 7
  55. 40 FSEC=FSEC+1
  56. 50 NEXT
  57. 60  PRINT "The result is ";512*(1-DSD)*FSEC;"  The result should be 4096"
  58. 70 END
  59.  
  60.  
  61. PROBLEM #4:
  62.  
  63. MOD does not return the correct value under the following conditions:
  64. 1) Using a binary noncommutative operator such as IMP, MOD, or \ (integer
  65.    division backslash).
  66. 2) The left operand is simpiler than the right.
  67. 3) The result is required in BX register.
  68.  
  69. 10 A=3: B=4: C=10
  70. 20 PRINT "C MOD (A + B) = ";C MOD (A + B)
  71.  
  72. 7 is the incorrect answer.
  73.  
  74.  
  75. -- Jim Gainsley [CIS: 70346,457] --
  76.  
  77. B=4: C=10
  78. 20 PRINT "C MOD (A + B) = ";C MOD (A + B)
  79.  
  80. 7 is the incorrect answer.
  81.  
  82.  
  83. -- Jim Gainsley
  84.