home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
RBBS in a Box Volume 1 #3.1
/
RBBSIABOX31.cdr
/
basw
/
bascom.txt
< prev
next >
Wrap
Text File
|
1984-07-29
|
2KB
|
84 lines
r ibm234.tst (xa1)
The following are test programs that accompany IBM BASIC COMPILER PROBLEMS
NUMBER 2, 3, & 4. Follow the instructions to see if the patches you have made
to your compiler at least fix these problems. (With your WP, just copy the
Basic code to another file, and compile & link. Only /O is necessary,
unless you're going to test BASRUN also, in which case, use no parameters).
PROBLEM #2:
The use of the INPUT # statement with quoted strings of length 1 may produce
random results.
10 OPEN "TSTPROG" FOR OUTPUT AS #1
20 FOR I=1 TO 10
30 WRITE #1,I,"A","BB","CCC","DDDD"
40 NEXT I
50 CLOSE
60 OPEN "TSTPROG" FOR INPUT AS #1
70 IF EOF(1) THEN END
80 INPUT #1,J,A$,B$,C$,D$
90 PRINT J;A$;B$;C$;D$
100 GOTO 70
This program should print:
1 ABBCCCDDDD
2 ABBCCCDDDD
3 ABBCCCDDDD
4 ABBCCCDDDD
5 ABBCCCDDDD
6 ABBCCCDDDD
7 ABBCCCDDDD
8 ABBCCCDDDD
9 ABBCCCDDDD
10 ABBCCCDDDD
PROBLEM #3:
3. When using arrays and making calculations such as:
T(J,L)=G(J)*E(L)+T(J+1,I)
the Compiler may give an Internal error or the calculation may be performed
incorrectly.
10 DEFINT D,F,N
20 DSD=0
30 FOR N=0 TO 7
40 FSEC=FSEC+1
50 NEXT
60 PRINT "The result is ";512*(1-DSD)*FSEC;" The result should be 4096"
70 END
PROBLEM #4:
MOD does not return the correct value under the following conditions:
1) Using a binary noncommutative operator such as IMP, MOD, or \ (integer
division backslash).
2) The left operand is simpiler than the right.
3) The result is required in BX register.
10 A=3: B=4: C=10
20 PRINT "C MOD (A + B) = ";C MOD (A + B)
7 is the incorrect answer.
-- Jim Gainsley [CIS: 70346,457] --
B=4: C=10
20 PRINT "C MOD (A + B) = ";C MOD (A + B)
7 is the incorrect answer.
-- Jim Gainsley