$CPU 8086 ' program works on any CPU $OPTIMIZE SIZE ' make smallest possible executable '$COMPILE UNIT ' compile to a unit (PBU) $DEBUG MAP OFF ' turn off map file generation $DEBUG PBDEBUG OFF ' don't include pbdebug support in our executable $LIB COM OFF ' turn off PowerBASIC's communications library. $LIB CGA OFF ' turn off PowerBASIC's CGA graphics library. $LIB EGA OFF ' turn off PowerBASIC's EGA graphics library. $LIB VGA OFF ' turn off PowerBASIC's VGA graphics library. $LIB HERC OFF ' turn off PowerBASIC's hercules graphics library. $LIB LPT OFF ' turn off PowerBASIC's printer support library. $LIB IPRINT OFF ' turn off PowerBASIC's interpreted print library. $LIB FULLFLOAT OFF ' turn off PowerBASIC's floating point support. $ERROR BOUNDS OFF ' turn off bounds checking $ERROR NUMERIC OFF ' turn off numeric checking $ERROR OVERFLOW OFF ' turn off overflow checking $ERROR STACK OFF ' turn off stack checking $DIM ARRAY ' force arrays to be pre-dimensioned before they can ' be used $DYNAMIC ' all arrays will be dynamic by default DEFINT A-Z ' default all variables to integers for maximum ' speed and minimum size %FLAGS = 0 %AX = 1 %BX = 2 %CX = 3 %DX = 4 %SI = 5 %DI = 6 %BP = 7 %DS = 8 %ES = 9 SHARED Target$ cls for i=1 to 19 color i,0 print "Hello" next for i=1 to 5 call FadeOut call FadeIn next end SUB FadeOut() PUBLIC IF LEN( Target$ ) = 0 THEN Target$ = STRING$( 765, 0 ) REG %AX, &H1017 REG %BX, 0 REG %CX, 255 REG %ES, STRSEG( Target$ ) REG %DX, STRPTR( Target$ ) CALL INTERRUPT &H10 END IF FOR J% = 1 TO 32 CALL FadeDAC( -4 ) NEXT J% END SUB SUB FadeIn() PUBLIC IF LEN( Target$ ) = 0 THEN EXIT SUB END IF FOR J% = 1 TO 32 CALL FadeDAC( 4 ) NEXT J% END SUB SUB FadeDAC( Inc% ) PRIVATE LOCAL Buff$, N%, K% Buff$ = STRING$( 765, 0 ) REG %AX, &H1017 REG %BX, 0 REG %CX, 255 REG %ES, STRSEG( Buff$ ) REG %DX, STRPTR( Buff$ ) CALL INTERRUPT &H10 FOR J% = 1 TO LEN( Buff$ ) N% = ASC( MID$( Buff$, J%, 1 )) + Inc% IF N% < 0 THEN N% = 0 K% = ASC( MID$( Target$, J%, 1 )) IF N% > K% THEN N% = K% MID$( Buff$, J%, 1 ) = CHR$( N% ) NEXT J% REG %AX, &H1012 REG %BX, 0 REG %CX, 255 REG %ES, STRSEG( Buff$ ) REG %DX, STRPTR( Buff$ ) CALL INTERRUPT &H10 END SUB