Category : BASIC Source Code
Archive   : QB2TB.ZIP
Filename : QB-TO-TB.BAS
'³ QB-TO-TB: written by Richard Guion & Norm Scroggins, ³
'³ Borland International Technical Support ³
'³ A simple procedure that demonstrates the assembly language interface ³
'³ with Turbo Basic. It uses the assembly code in the file called ³
'³ QB-TO-TB.ASM to find the last non-blank character in a string. ³
'³ The main purpose of it is to demonstrate how to access the length ³
'³ byte of the string from the stack and also return an integer from ³
'³ the assembly program to the Basic program. ³
'³ ³
'³ The QB-TO-TB.ASM file might also be of interest to users who are ³
'³ converting their MicroSoft QuickBasic assembly routines to Turbo ³
'³ Basic. We have included the original assembly code used by ³
'³ QuickBasic so that these users can compare the differences and see ³
'³ the alterations that have to be made. ³
'³ ³
'³ Take the QB-TO-TB.ASM file and use the Macro Assembler prepare it ³
'³ with these steps: ³
'³ 1. MASM QB-TO-TB 'should be 0 errors ³
'³ 2. LINK QB-TO-TB 'a stack warning appears, just ignore it ³
'³ 3. EXE2BIN QB-TO-TB 'afterwards, the .BIN file is on the disk ³
'³ ³
'³ Then, run this sample program to get the correct result ³
'ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
SUB GetBlank INLINE '( Position%, AnyStr$ )
' Position% is uninitialized when called,
' but contains the position of the last non-blank
' character in AnyStr$.
' AnyStr$ can contain any string that you have
' assigned something to.
$INLINE "QB-TO-TB.BIN" 'load the file prepared with the Macro Assembler
END SUB 'end GetBlank
CLS
AnyStr$ = "01234567890123456789 " 'the last non-blank character is 20
CALL GetBlank ( Position%, AnyStr$ ) 'call the assembly routine
PRINT Position% 'print the position of the last non-blank character
Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!
This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.
But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/