'write a string to STDOUT 'by Dave Navarro, Jr. DosOut "Hello World!" SUB DosOut( Text$ ) PUBLIC LOCAL Segm%, Offs%, Slen% Segm% = STRSEG( Text$ ) ' put segment of string in Segm Offs% = STRPTR( Text$ ) ' put offset of string in Offs Slen% = LEN( Text$ ) ' put length of string in Slen ! push DS ; save DS for PowerBASIC ! mov CX, Slen% ; Length of string in CX ! mov DS, Segm% ; Segment of string in DS ! mov DX, Offs% ; Offset of string in DX ! mov AH, &H40 ; DOS write to file ! mov BX, 1 ; file handle 1 is CONS ! int &H21 ; call DOS ! pop DS ; restore DS for PowerBASIC END SUB