10 REM A Program that shows the difference between Microsoft BASIC and Full on the AND operation
15 REM AND operation on Microsoft BASIC is a bitwise operation on integers.
20 REM On Microsoft BASIC, A(j)>b shall be tested even if j=0 in the line 2000.
30 REM Try on JIS mode and Microsoft BASIC compatible mode.
100 REM Insertion sort
110 DATA 58,19,40,28,79,45,38,16,30,52
120 OPTION BASE 0
130 DIM a(10)
140 FOR k=0 TO 9
150    READ a(k)
160 NEXT k
170 FOR i=1 TO 9 
180    LET b=a(i)
190    LET j=i-1
200    DO WHILE j>=0 AND a(j)>b
210       LET a(j+1)=a(j)
220       LET j=j-1
230    LOOP
240    LET a(j+1)=b
250    FOR k=0 TO 9
260       PRINT a(k);
270    NEXT k
280    PRINT
290 NEXT i
300 END
     
