13.07.2015 Views

Turbo Basic

Turbo Basic

Turbo Basic

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Passing Parameters to INLINE ProceduresParameters are pushed on the stack as 32-bit pointers to the data items (except forfull arrays). Parameters are pushed on the stack in order from left to right.Passing Numeric VariablesFor numeric variables (integer, floating point), you get a 32-bit pointer to the data.(See Appendix A, "Numeric Considerations," for the numeric formats.)Passing StringsFor string parameters (other than full string arrays), you get a 32-bit pointer to the4-byte string descriptor. The first 2 bytes contain the length of the string. The next2 bytes contain the offset of the string data in the string segment.Note: You must ignore the upper bit on the string length bytes, since it isreserved and may be set. You must AND off this bit before using the length, but thevalue in memory must never be altered.Note: You can modify bytes in the string but you can't modify the string's length.To get the string segment pointer, use the first word of the default data segment(word at DS:O). The format of a string descriptor follows:Bytes 0,1:Length of string (upper bit is reserved)2,3: Offset of data within the string segmentPassing ArraysFor array parameters, the array descriptor (60 bytes long) is pushed on the stack.The format of an array descriptor follows:Bytes 0,1:Segment address of the array data. The first element always starts atoffset O. For dynamic arrays, it contains zero until the array is dimensioned.2: Type of the array elementso = integer2 = long integer4 = single-precision floating-point6 = double-precision floating-point8 = reserved10 = string3: Number of subscripts398 <strong>Turbo</strong> <strong>Basic</strong> Owner's Handbook

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!