OS2_M2.DOC 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494
  1. Protected-mode TopSpeed Modula-2 Release notes version 3.10
  2. ================================ ==========================
  3. This document contains information on the following:
  4. 1. DIFFERENCES FROM TOPSPEED VERSION 2.00
  5. 2. GENERAL INFORMATION
  6. 3. ERRATA
  7. 4. OBJECT-ORIENTED GRAPHICS INTERFACE
  8. 5. TOPSPEED EXTENSIONS
  9. ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
  10. 1. DIFFERENCES FROM TOPSPEED VERSION 2.00
  11. ==========================================
  12. Major improvements and alterations to the TopSpeed Modula-2
  13. compiler and code generator since the previous version include
  14. the following:
  15. þ More memory models are available, including an automatic code
  16. and data overlaying model.
  17. þ TopSpeed Modula-2 now supports Microsoft Windows version 3.
  18. þ Support for third-party libraries has been improved,
  19. particularly in the area of floating-point code generation
  20. (via the standard_float pragma). A large model stack-frame
  21. library is now supplied with TopSpeed Modula-2, which is
  22. likely to be of use when linking to third party libraries
  23. compiled for use with other vendors' C compilers.
  24. þ TopSpeed Modula-2's object-oriented features have been
  25. enhanced, to support multiple inheritance and linking to C++
  26. classes. The syntax of class declarations have been changed;
  27. the supplied utility program NEWCLASS may be used to translate
  28. object-oriented source code designed for the previous release
  29. of TopSpeed Modula-2.
  30. 2. GENERAL INFORMATION
  31. =======================
  32. The following Graph Module procedures are not supported under
  33. OS/2:
  34. Arc ClearScreen Cube DisplayCursor
  35. FloodFill GetBkColor GetFillMask GetImage
  36. GetLineStyle GetTextColor GetTextPosition GetVideoConfig
  37. ImageSize InitHerc InitGraph OutText
  38. Pie PutImage Rectangle RemapPalette
  39. RemapAllPalette SelectPalette SetActivePage SetBkColor
  40. SetClipRgn SetFillMask SetLineStyle SetTextColor
  41. SetTextPosition SetTextWindow SetVideoMode SetVisualPage
  42. Stackfill Wrapon
  43. 3. ERRATA
  44. ==========
  45. Reference manual p 17:
  46. The FIXREAL Real type should have the following numeric range:
  47. -2^63 to 2^63 -1
  48. Reference manual p 18 paragraph 1:
  49. This paragraph should read as follows:
  50. Modula-2 has one predefined enumeration type defining
  51. truth values:
  52. TYPE
  53. BOOLEAN = (FALSE, TRUE);
  54. Reference manual p 43:
  55. A type transfer function is considered well-behaved if the sizes
  56. of the transfer type and the value type are the same, or if a
  57. proper VAL conversion is performed. If the value type size is more
  58. than the transfer type size then the remaining last bytes of the
  59. value are ignored. If it is shorter, the last bytes of the resulting
  60. value are undefined.
  61. Reference manual p 72:
  62. Line 18 of Example 1 should read as follows:
  63. RETURN(c1 IS classTwo)
  64. Reference manual p 109:
  65. The default value of separators should read as follows:
  66. Str.CHARSET {
  67. CHR(9),
  68. CHR(10),
  69. CHR(13),
  70. CHR(26),
  71. CHR(32),
  72. }
  73. Reference manual p 126:
  74. The values returned by the GetDrive procedure are
  75. 1 for Drive A, 2 for Drive B, etc.
  76. Reference manual p 136 line 29:
  77. This line should read:
  78. Name : PathTail;
  79. Reference manual p 137:
  80. The example should read as follows:
  81. (*
  82. This example also illustrates the use
  83. of ReadNextEntry
  84. *)
  85. IMPORT FIO, IO;
  86. VAR
  87. Ent : FIO.DirEntry;
  88. FOUND : BOOLEAN;
  89. BEGIN
  90. ...
  91. Found := FIO.ReadFirstEntry( "C:\COM\*.EXE",
  92. FIO.FileAttr{FIO.system,FIO.hidden},
  93. Ent);
  94. WHILE Found DO
  95. IO.WrStr(Ent.Name);
  96. IO.WrLn;
  97. Found := FIO.ReadNextEntry(Ent);
  98. END;
  99. ...
  100. Reference manual p 139:
  101. The drive values for the SetDrive procedure are
  102. 1 for Drive A, 2 for Drive B, etc.
  103. Reference manual p 155:
  104. The syntax for the FindNewPath and FindPath procedures should
  105. read as follows:
  106. PROCEDURE FindNewPath(
  107. name : ARRAY OF CHAR;
  108. VAR fullname : ARRAY OF CHAR) : BOOLEAN;
  109. PROCEDURE FindPath(
  110. name : ARRAY OF CHAR;
  111. VAR fullname : ARRAY OF CHAR) : BOOLEAN;
  112. The description of these procedures omits the following information:
  113. FindNewPath always returns TRUE.
  114. FindPath returns TRUE if the requested file was found.
  115. Reference manual p 157:
  116. The description of the Open procedure should read as follows:
  117. ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
  118. Open Open file for reading using redirection
  119. ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
  120. PROCEDURE Open( name : ARRAY OF CHAR ) : File;
  121. The Open procedure is used to open a file for reading. In
  122. this way it is identical to the OpenRead procedure in the
  123. FIO module. This version of Open, however, uses the
  124. redirection file to determine the full path string of the
  125. file. The FIO version of OpenRead only looks in the current
  126. directory.
  127. Reference manual p 157:
  128. The OpenRW procedure is not documented in the manual. The syntax
  129. and description are as follows:
  130. ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
  131. OpenRW Open file using redirection
  132. ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
  133. PROCEDURE OpenRW( name : ARRAY OF CHAR ) : File;
  134. The OpenRW procedure is used to open a file for processing.
  135. In this way it is identical to the Open procedure in the FIO
  136. module. This version of Open, however, uses the redirection
  137. file to determine the full path string of the file. The FIO
  138. version of Open only looks in the current directory.
  139. Reference manual p171:
  140. The third paragraph should read as follows:
  141. Thus to draw a rectangle in Red, on a CGA adapter:
  142. x:= Graph.SetVideoMode(MRES4COLOR);
  143. y:= Graph.SelectPalette(0);
  144. (* Palette 0 *)
  145. Graph.Rectangle(10,10,100,2,FALSE);
  146. (* The color is 2 (Red) *)
  147. Reference manual, page 173:
  148. The description of Arc should be replaced by the following:
  149. PROCEDURE Arc( x0, y0, a0, b0, x1, y1, x2, y2 : CARDINAL;
  150. Color : CARDINAL );
  151. Draws an arc in the color number specified by the Color
  152. parameter. The arc drawn is a fragment of an ellipse. The
  153. arc is specified using the parameters (x0,y0), a0, b0,
  154. (x1,y1) and (x2,y2) in the following manner:
  155. (x0,y0) Specifies the center of the ellipse that
  156. contains the arc.
  157. a0 Specifies the length of the semi-major axis
  158. of the ellipse that contains the arc.
  159. b0 Specifies the length of the semi-minor axis
  160. of the ellipse that contains the arc.
  161. (x1,y1) Specifies the co-ordinates for the starting
  162. point of the arc
  163. (x2,y2) Specifies the co-ordinates for the ending
  164. point of the arc
  165. The arc is drawn from (x1,y1) counterclockwise to (x2,y2).
  166. Reference manual, page 177:
  167. The description of Ellipse should be replaced by the following:
  168. PROCEDURE Ellipse( x0, y0 : CARDINAL; a0, b0 : CARDINAL;
  169. Color : CARDINAL; Fill : BOOLEAN );
  170. Draws an ellipse in the color number specified by the Color
  171. parameter. The ellipse is specified using the parameters
  172. (x0,y0), a0 and b0 in the following manner:
  173. (x0,y0) Specifies the center of the ellipse.
  174. a0 Specifies the length of the semi-major axis of
  175. the ellipse.
  176. b0 Specifies the length of the semi-minor axis.
  177. Color Specifies the color number used to draw the
  178. ellipse
  179. Fill If TRUE the ellipse is filled with the current
  180. fill mask (see Graph.SetFillMask).
  181. Reference manual, page 185:
  182. The description of Pie should be replaced by the following:
  183. PROCEDURE Pie( x0, y0, a0, b0, x1, y1, x2, y2 : CARDINAL;
  184. Color : CARDINAL; Fill : BOOLEAN );
  185. This procedure draws a pie slice. The parameters have the
  186. following meaning:
  187. Draws an arc in the color number specified by the Color
  188. parameter. The arc drawn is a fragment of an ellipse. The
  189. arc is specified using the parameters (x0,y0), a0, b0,
  190. (x1,y1) and (x2,y2) in the following manner:
  191. (x1,y1) Specifies the center of the ellipse that
  192. contains pie slice.
  193. a0 Specifies the length of the semi-major axis of
  194. the ellipse that contains the pie slice.
  195. b0 Specifies the length of the semi-minor axis of
  196. the ellipse that contains the pie slice.
  197. (x1,y1) Specifies the co-ordinates for the starting
  198. point of the pie slice (curved) edge.
  199. (x2,y2) Specifies the co-ordinates for the ending
  200. point of the pie slice (curved) edge.
  201. The pie slice arc is drawn from (x1,y1)
  202. counterclockwise to (x2,y2).
  203. Color Specifies the color number used to draw the
  204. slice.
  205. Fill If TRUE the pie slice is filled, otherwise
  206. only the outline is drawn.
  207. Reference manual p 199:
  208. The SetVideoMode procedure returns FALSE if the mode selected
  209. is not supported by the hardware.
  210. Reference manual p 220:
  211. The example should read as follows:
  212. For example:
  213. IMPORT Lib, IO;
  214. ...
  215. VAR
  216. CPU : Lib.CpuRec;
  217. ...
  218. Lib.CpuId(CPU);
  219. IF (CPU.cpu <> Lib.cpu_80386)
  220. OR (CPU.fpu <> Lib.fpu_80387) THEN
  221. IO.WrStr(
  222. "Won't run without a 80386 & 80387");
  223. HALT;
  224. END;
  225. ...
  226. Reference manual p 229:
  227. The declarations of the SetDate and SetTime Procedures should
  228. read as follows:
  229. PROCEDURE SetDate(
  230. VAR Year, Month,
  231. Day : CARDINAL) : BOOLEAN;
  232. PROCEDURE SetTime(
  233. Hrs, Mins,
  234. Secs, Hsecs : CARDINAL) : BOOLEAN;
  235. The return value indicates whether the date or time specified
  236. was valid.
  237. Reference manual, page 257:
  238. PROCEDURE ATan2 should read:
  239. ATan2 returns the arc tangent of ( Y / X ) and the result is
  240. in the range -ã to ã.
  241. Reference manual p 261 line 24:
  242. This line should read as follows:
  243. These are in graphics coordinates irrespective of the mouse
  244. state.
  245. Reference manual p 261 line 30:
  246. This line should read as follows:
  247. These are in graphics coordinates irrespective of the mouse
  248. state.
  249. Reference manual p 275 lines 11 and 15:
  250. The value in both cases should be 1 and not 0.
  251. Reference manual p 286:
  252. The spelling of the NearAllocate and FarAllocate procedures
  253. is incorrect and should read as spelt in this sentence.
  254. Reference manual p 288:
  255. The spelling of the NearDeallocate and FarDeallocate procedures
  256. is incorrect and should read as spelt in this sentence.
  257. Reference manual, page 312:
  258. Str.Match matches insensitive to the case of the characters.
  259. Thus the second example returns TRUE.
  260. 4. OBJECT-ORIENTED GRAPHICS INTERFACE
  261. ======================================
  262. Within the multi-language example programs is an object
  263. orientated interface to the M2 graphics module.
  264. 5. TOPSPEED EXTENSIONS
  265. =======================
  266. The following is a list of TopSpeed extensions to Modula-2 as
  267. described in Niklaus Wirth's Programming in Modula-2, 3rd
  268. edition.
  269. Address constructor A := [S:O PT]
  270. Based pointers SP : POINTER S TO T
  271. Structured constants SC = A(C1,C2)
  272. Concatenation of string constants S = 'ST'+'RING'+CHR(13)
  273. Type conversion of numeric types I := INTEGER(CARD)
  274. Standard types BYTE, SHORTINT, SHORTCARD, LONGCARD,
  275. LONGWORD, SHORTADDR
  276. Standard constant NULLPROC
  277. Object extensions, with CLASS, IS, VIRTUAL and SELF keywords.
  278. Alias notation A ::= P
  279. Compiler pragmas (*# ... *)
  280. Conditional compilation (*% ... *)
  281. Compiler directives (old style) (*$ ... *)
  282. SIZE and some other SYSTEM functions do not
  283. have to be imported from SYSTEM
  284. Function procedures may return any data type
  285. Shift operators >> and <<
  286. GOTO/LABEL GOTO fail
  287. SIZE may be applied to any expression or designated variable.
  288. Identifiers imported in a definition module do not have to
  289. be re-imported in the corresponding implementation module.
  290. A module may refer to its own objects using qualified
  291. reference.
  292. Keyword INLINE allows specification of a procedure body
  293. in a definition file.
  294. Binary procedures can be defined to be a constant agregate.
  295. VSIZE can find the size of a record (or object) type or
  296. variable upto and including the specified field.
  297. FieldOfs returns the offset of a field relative to the
  298. start of a record (or object) variable or type.
  299. A New function FieldOfs can be used to get the offsets of record
  300. fields of record and objects, it works on variables and types.
  301. Function procedure results may be dereferenced,
  302. indexed or fields selected.
  303. Procedures may be declared using a FORWARD declaration.
  304. Procedure may be declared externally in another module
  305. PROCEDURE P; IN file;
  306. Multiple-models mean that ADDRESSes and POINTERS can be 16 or
  307. 32 bits. FarADDRESS, NearADDRESS, FarADR and NearADR can
  308. be used to specify these explicitly.
  309. Procedure variables may be compared for equality.
  310. Pragmas may specify various calling conventions/parameter
  311. passing techniques.
  312. Record fields may be packed by using a pragma.
  313.