SRCKIT.DOC 46 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678
  1. Core Library and startup files Documentation version 3.10
  2. ============================== ==========================
  3. Introduction
  4. ------------
  5. Why a read-me file?
  6. There are two major reasons why printed documentation was
  7. not produced for the TopSpeed SourceKits:
  8. * Internal revision. Only the public interface of the
  9. run-time libraries can remain fixed. TopSpeed's policy
  10. of continual improvement means that the actual
  11. implementation of products may be changed between
  12. minor releases.
  13. * User feedback. This documentation will be augmented in
  14. response to user requests for information where
  15. possible.
  16. What is the core library?
  17. -------------------------
  18. The standard library for a TopSpeed language comprises
  19. two major components, the language specific part and the
  20. language independent core.
  21. The core provides startup and termination code, plus
  22. integrated I/O, memory management, text windowing,
  23. graphics, and other services. This arrangement reduces
  24. redundancy and ensures that the major system features are
  25. compatible between languages.
  26. Core library naming
  27. In normal use, the correct core library is linked automatically
  28. by the project system. However, if manual selection is required,
  29. the following naming convention must be used:
  30. %O%%M%%C%COM.LIB
  31. Where the macros %O%, %M% and %C% are expanded as follows:
  32. %O% Operating system:
  33. R Real mode (MSDOS).
  34. W Windows.
  35. P Protected mode (OS2).
  36. %M% Memory model:
  37. S Small model.
  38. C Compact model.
  39. M Medium model.
  40. L Large model.
  41. X XLarge model.
  42. T Mthread model.
  43. O Overlay model (MSDOS only).
  44. D Dynalink model.
  45. %C% Calling convention:
  46. _ JPI.
  47. F Stack frame.
  48. For example, the large model, MSDOS, JPI calling
  49. convention core library is named:
  50. RL_COM.LIB
  51. The core library Interface
  52. ---------------------------
  53. For reasons of compatibility, the core library interface
  54. remains fixed between major releases. However, you should
  55. avoid using functions, procedures and data objects
  56. declared in the core library interface for future
  57. portability.
  58. The core library Implementation
  59. -------------------------------
  60. Why assembler?
  61. Assembly language code is not straightforward to maintain
  62. or easy to understand. In a traditional implementation,
  63. some of the routines could have been implemented in a
  64. high level language. However, TopSpeed's approach has the
  65. following advantages:
  66. * Efficiency. Many of the library functions, such as
  67. string handling, are highly optimized, giving a
  68. significant improvement in performance over other
  69. products.
  70. * Multi language environment. To allow the user to
  71. remake and customize the run-time libraries, the
  72. complete language implementation must either be
  73. written in the host language or assembly language.
  74. * Low level requirements. While 'tricks' can often be
  75. employed to implement low-level features, assembly
  76. language is often the most elegant and efficient way
  77. to implement operating system and machine specific
  78. code.
  79. Conditional compilation
  80. -----------------------
  81. The assembly language files produce code for all TopSpeed
  82. memory models, operating systems and calling conventions.
  83. This is achieved by conditional compilation.
  84. The following boolean flags are used to reflect the
  85. various possibilities:
  86. NearPtr When true, data pointers are 16 bit. When
  87. false, data pointers are 32 bit.
  88. Small and Medium models use NearPtr = true.
  89. All other models use NearPtr = false.
  90. NearCall When true, calls and return are near, and
  91. procedure variables are 16 bit. When false,
  92. calls and return are far, and procedure
  93. variables are 32 bit.
  94. Small and Compact models use NearCall = true.
  95. All other models use NearCall = false.
  96. SameDS When true, DS is not assumed to be fixed, i.e.
  97. pointing to DGROUP, the default data segment.
  98. XLarge, Mthread, Overlay and Dynalink models
  99. use SameDS = false. All other models use
  100. NearCall = true.
  101. RegParam When using the jpi calling convention, passing
  102. parameters in registers, RegParam is true.
  103. When using the standard stack frame calling
  104. convention, RegParam is false.
  105. MThread In memory models that support multi-thread
  106. operation, MThread is true.
  107. Mthread, overlay and dynalink models support
  108. multiple threads. Code to support this mode of
  109. operation is include in these models.
  110. _OS2 When true OS2 specific code is generated. When
  111. false MSDOS and some Windows code is generated
  112. _WINDOWS When true, Windows specific code is generated.
  113. _DLLOVL When true, code required for the TopSpeed
  114. overlay manager is generated. This required
  115. for Overlay model and the Dynalink model under
  116. MSDOS.
  117. _DLL When true, code specific to DLLs is generated.
  118. ProtMode When true, protected mode features are enabled
  119. for either OS2 or Windows.
  120. _WINDLL When true, code specific to Windows DLLs is
  121. generated.startup files five main EXE file
  122. startup files are used by TopSpeed:
  123. initexe.a
  124. initnew.a
  125. initpm.a
  126. initwin.a
  127. initmwin.a
  128. Plus two DLL initialization files:
  129. initdll.a
  130. initwdll.a
  131. The selection of the correct startup code
  132. removes the need for more library variants and
  133. allows greater flexibility of run-time
  134. segmentation.
  135. Each file performs two main functions:
  136. * Declaration of segmentation.
  137. * The segment and group declarations at the top the file
  138. determine the ordering and groups recognized by the
  139. linker. If a new segment class needs to be added, it
  140. must be declared in the first section of the startup
  141. file.
  142. · The db definitions at the bottom of the file determine
  143. the ordering of segments within DGROUP. These must not
  144. be changed.
  145. · Initial startup code. Information stored in registers
  146. at program startup is saved, and a call is made to low
  147. level initialization code to insert any initialization
  148. blocks in to a list which will be processed later.
  149. Initialization may either be created by hand to
  150. initialize assembly language modules, or by the C++
  151. compiler to construct static objects. See Advanced
  152. Programmer's guide.
  153. initexe.a
  154. This is the default startup file for an OS2 or DOS exe
  155. file.
  156. The __initx record has the following structure:
  157. far ptr: Address of program entry sequence.
  158. word: Size of near heap.
  159. word: Size of stack.
  160. byte: Stack location. Non-zero in dgroup.
  161. In the code section, the stack size and location are
  162. saved, the near heap, if present, is located, and the
  163. program entry point determined.
  164. Finally the initialization blocks associated with the
  165. program are added to the list, and a far jump made into
  166. the library startup code.
  167. initnew.a
  168. This startup is identical to initexe apart from its
  169. segment ordering. It is used by Modula-2 and Pascal
  170. programs in XLarge models to reduce DOS exe file size.
  171. Since static data is not required to be initialized to
  172. zero, it may be placed at the end of the file.
  173. initpm.a
  174. This startup is identical to initexe apart from its stack
  175. location. It is used by Presentation manager programs
  176. which require a stack segment fixed in DGROUP.
  177. initwin.a
  178. This startup file provides both initial startup code for
  179. C and C++ Windows programs, and a dummy main procedure
  180. that calls the program entry point WinMain.
  181. initmwin.a
  182. This startup file provides both initial startup code for
  183. Modula-2 and Pascal Windows programs, and a dummy
  184. procedure that calls the program entry point WinMain.
  185. initdll.a
  186. This file adds any initialization blocks associated with
  187. the DLL to the list associated with the process. The file
  188. is used for both DOS and OS2 DLLs.
  189. initwdll.a
  190. The file is used for Windows DLLs. It adds any
  191. initialization blocks associated with the DLL to the
  192. list, and calls the DLLs startup sequence.
  193. Floating point files
  194. --------------------
  195. Support files
  196. Three floating point support files are used by TopSpeed:
  197. noemul.a
  198. nofloat.a
  199. r_emul.a
  200. p_emul.a
  201. winfloat.a
  202. These files resolve calls to helper functions and perform
  203. the floating point initialization.
  204. nofloat This is used when no floating point is
  205. required by the program.
  206. noemul This is used when no emulation is required in
  207. program that used floating point.
  208. r_emul This is used by MSDOS programs that require
  209. floating point emulation.
  210. p_emul This is used by OS2 programs that require
  211. floating point emulation.
  212. winfloat This is used by Windows programs that require
  213. floating point emulation.
  214. Emulation strategies
  215. Under MSDOS, the standard Microsoft software interrupts
  216. are used to invoke the emulator. If a chip is present at
  217. run-time, interrupt instructions are back patched to
  218. floating point instructions.
  219. Under OS2, the emulator is invoked via the invalid op-
  220. code exception.
  221. Under Windows, special OS fixups are used. These are
  222. fixed up by the Windows loader to either interrupts or
  223. floating point instructions depending on the run-time
  224. environment. Not that Windows emulator is used instead of
  225. the TopSpeed emulator in Windows programs
  226. Emulator data
  227. In order to achieve re-entrancy, the TopSpeed emulator
  228. uses a data area at the bottom of each thread's stack
  229. segment. In all memory models, This area is reserved.
  230. MKLIB.PI
  231. --------
  232. Overview
  233. MKLIB.PI is included by the project file mklib.pr. It
  234. defines all the TopSpeed libraries, and the commands
  235. necessary to make them. The macro setting s necessary to
  236. make a specific group of libraries are described in the
  237. relevant language library reference. The core library is
  238. re-made automatically when any language library is re-
  239. made.
  240. Library structure
  241. Core library comprises following files:
  242. coremain.a Library startup and termination code.
  243. coresig.a Exception and error handling.
  244. coremath.a Floating point math and conversions.
  245. 3rdparty.a Helper functions for third party code.
  246. corefile.a File I/O data definitions.
  247. corertl.a Helper functions and compiler run-time
  248. support.
  249. coreio.a Low level input and output functions.
  250. corepmd.a Low level post mortem dump support.
  251. corewind.a Low level text window functions.
  252. coremem.a Memory management.
  253. coreemul.a Operating system independent floating
  254. point emulation code.
  255. coreproc.a Low level multi thread functions.
  256. coregrap.a Low level, hardware dependent, graphics
  257. functions. MSDOS only.
  258. The system header file is included by each file:
  259. corelib.inc System constant definitions.
  260. Interface files
  261. ---------------
  262. Interface files for each language are provided. They used
  263. internally by the high level library modules and should
  264. not be used by the user unless directed by the Language
  265. documentation.
  266. Replacing or redefining modules
  267. -------------------------------
  268. Certain of the core library modules may be replaced by
  269. user defined ones. For example, CoreMem could be replaced
  270. by an another memory manager, as long as the interface
  271. required by the high level language library and startup
  272. code is preserved.
  273. More precise details are provided in the documentation
  274. for the individual module.
  275. The core library EXP file
  276. -------------------------
  277. The MSDOS and OS2 DLL versions of the core library have
  278. corresponding EXP files, declaring the exported
  279. identifiers:
  280. RD_COM.EXP Real mode.
  281. PD_COM.EXP Protected mode.
  282. If a public definition is added or removed from a core
  283. module, EXP must be altered to reflect the change, if the
  284. DLL version is to be made.
  285. Similarly, a cut-down version of the core library DLL may
  286. be made by commenting out any unused identifiers. Smart
  287. linking will take care of removing the unwanted code from
  288. the DLL when it is remade.
  289. Windows DLL core library
  290. ------------------------
  291. The DLL versions of the windows libraries are not DLLs
  292. themselves; they link statically with a user created DLL.
  293. Versions exists in all supported models, and have the
  294. name COMD instead of COM.
  295. The library initialization is called from the initwdll
  296. file.
  297. Core Library modules
  298. --------------------
  299. corelib.inc
  300. The constants defined in this file may not be changed unless
  301. specifically documented as such.
  302. The model and calling convention constants are defined:
  303. NearCall
  304. SameDS
  305. NearPtr
  306. MThread
  307. RegParam
  308. Two constants that determine the pointer sizes in Modula-
  309. 2 and Pascal initialization records are defined:
  310. near_init_code = NearCall
  311. near_init_data = SameDS
  312. The constant StackChecks is defined to be non-zero. This
  313. enables stack checking in certain functions that use
  314. large local variables. A small reduction in program size
  315. may achieved at the cost of safety by setting this
  316. variable to 0.
  317. All process spawning functions and the C function write
  318. perform a stack check by default.
  319. Three constants are defined to specify the offset of
  320. parameters on a standard BP stack frame.
  321. frame Default for current memory model.
  322. lframe Far call.
  323. sframe Near Call
  324. Three constants are defined to specify the offset of parameters
  325. on an optimized BX stack frame. e.g.
  326. mov bx, sp
  327. mov ax, ss:[bx][var]
  328. bxframe Default for current memory model.
  329. lbxframe Far call.
  330. sbxframe Near Call
  331. Code and data pointer sizes are defined for the model
  332. default, plus near and far variants.
  333. CodePtrSize
  334. FarCodePtrSize
  335. NearCodePtrSize
  336. DataPtrSize
  337. FarDataPtrSize
  338. NearDataPtrSize
  339. The FILE structure is defined for near and far data
  340. pointer models. This is used directly by C stdio input
  341. and output functions, and as a global stream descriptor
  342. by all languages.
  343. A subset of the error codes defined in errno.h are
  344. defined for use by the assembler parts of the library.
  345. ENOENT
  346. ENOPATH
  347. EACCESS
  348. EBADF
  349. E2BIG
  350. ENOMEM
  351. ENOSPC
  352. EINVAL
  353. EDOM
  354. ERANGE
  355. Similarly a subset of the I/O flags are defined. These
  356. are documented by comments.
  357. The next section is a subset of the OS2 API type
  358. definitions required by the assembler library.
  359. THREADTABLESIZE is the size of the thread information
  360. record. An array of these records is maintained by the
  361. library for internal static data. The constant MAXTHREAD
  362. is of interest because this controls the maximum number
  363. of threads supported. See Advanced Programmer's Guide.
  364. The following constants are constants private to the
  365. implementation. Of interest are STACK_GUARD, which is
  366. used to terminate the BP chain in overlay and DOS DLL
  367. models, plus the error codes generated by the overlay
  368. loader, LOADER_ERROR_*.
  369. coremain.a
  370. ----------
  371. Overview
  372. Coremain contains functions, variables and procedures for
  373. program startup and termination.
  374. Variables
  375. __argbuf Command line buffer
  376. __hugeshift Huge pointer shift value.
  377. __osmajor major OS version number
  378. __osminor minor OS version number
  379. __osmode flag, true if protected mode
  380. Functions
  381. Pointers passed to at/onexit are pushed onto the stack and
  382. called LIFO on program termination:
  383. __exit_stk at/onexit function stack.
  384. __exit_ptr atexit stack pointer
  385. __exit_top atexit stack top
  386. __exit_list_done atexit stack flag. True if executed.
  387. The low level C library and C++ static object
  388. initialization code is called from a record entry. The
  389. records, gathered from the main program and any DLLs
  390. used, are stored as a linked list of arrays. These are
  391. traversed once for each priority level, and any code of
  392. that priority is called. The called code calls InitLoop
  393. to process the next record.
  394. At the end of this process the main module is called.
  395. When that returns or the program terminated, the code
  396. sections execute any termination code and return,
  397. ensuring that destructors are called in reverse order.
  398. InitCalled Running total of low-level initialization
  399. procedures called.
  400. @InitGrandTotal Total of low-level initialization
  401. procedures to be called.
  402. @InitCurrent Current record being processed.
  403. @InitRecPointer Pointer to current record.
  404. @InitPointer Pointer to current control record.
  405. @InitPriority Current priority being processed.
  406. If the process is ended by a call to HALT or exit, the
  407. stack context is restored to ensure that the termination
  408. chain is executed.
  409. @StackContextBP BP value
  410. @StackContextSS SS value
  411. @StackContextSP SP value
  412. Variables used in program termination.
  413. @ExitCode program termination code.
  414. __exit_io procedure variable for io termination.
  415. __exit_file procedure variable for file handling
  416. termination.
  417. __exit_tmp procedure variable for temporary file
  418. clean up.
  419. __exit_proc procedure variable for process module
  420. termination
  421. __exitbreak procedure variable for deinstalling break
  422. handler.
  423. __exitsig procedure variable for deinstalling signal
  424. handlers.
  425. __exitgraph procedure variable for graph module
  426. termination.
  427. Modula-2 and Pascal use a chain of procedures for their
  428. termination code, as used by Lib.Terminate.
  429. __Term2 exit label for Terminate chain
  430. standard@haltChain pointer to beginning of chain.
  431. Two procedure variables are used to install real number
  432. conversion in printf and scanf. This is used to prevent
  433. these functions dragging floating point unnecessarily
  434. __real_in procedure variable for formatted input of
  435. real numbers
  436. __real_out procedure variable for formatted output of
  437. real numbers
  438. General variables
  439. __CmdLine command line storage used by
  440. windows DLL.
  441. __farstack flag, true if stack in far
  442. segment.
  443. __sp_temp used for restoring SP.
  444. __ss_temp used for restoring SS
  445. DOSHUGESHIFT Huge shift constant
  446. _x_initx pointer to startup vector.
  447. _x_bss_end end of BSS segment
  448. _x_bss_start start of BSS segment.
  449. __sigsetup flag, true if signal handling
  450. setup.
  451. __psp Program segment prefix.
  452. __env Environment segment.
  453. __heap_base base of far heap.
  454. __env_init flag, true if environment
  455. initialized.
  456. __arg_init flag, true command processed.
  457. STKHQQ stack length.
  458. __stklen stack length.
  459. __SSisDS flag, true if SS in dgroup
  460. __far_ss far stack segment
  461. __x_near_stack_start start of near stack
  462. __heap_size heap size, used by windows
  463. DLLs.
  464. _x_main points to main module
  465. __stk_base base of stack.
  466. __nmemsetup flag, true if near heap setup.
  467. __fmodmemsetup flag, true if Modula-2 far heap
  468. setup.
  469. __fmemsetup flag, true if near heap setup.
  470. __res_mem procedure variable for restoring
  471. heap after spawn.
  472. __fix_mem procedure variable for fixing far
  473. heap before spawn.
  474. __shr_mem procedure variable for shrinking
  475. far heap before spawn.
  476. __argv array of pointers to command line
  477. arguments.
  478. __env_var array of pointers to environment
  479. strings
  480. __osversion OS version
  481. Procedures and routines
  482. Public interface library procedures are not normally
  483. mentioned here since they are documented fully in the
  484. appropriate language library reference.
  485. _exit
  486. This the C and C++ exit function. It is also called
  487. indirectly by Modula-2 and Pascal.
  488. __InitLoop
  489. This procedure is called by C and C++ initialization
  490. code. It chains all the initialization and termination
  491. code.
  492. __InitLink
  493. This procedure is called from process and DLL startup to
  494. add an array of initialization records to the list.
  495. __InitSetup
  496. Preprocesses list of initialization record arrays .
  497. __cleanup
  498. Calls termination procedure variables.
  499. __setenv
  500. Initializes program environment variable table.
  501. exit_handler, __set_exit_handler
  502. Install an exit handler for OS2. This will be called if
  503. the program terminates will a segment overrun for
  504. example.
  505. __main_args2
  506. calls _main with 2 arguments.
  507. __main_args3
  508. calls _main with 3 arguments
  509. __libmain_args
  510. Calls windows DLL libmain function.
  511. __set_machine_id
  512. sets machine id information.
  513. __env_copy
  514. copies environment strings to local buffer.
  515. __init0, __init2, __init3
  516. vectors for calling main module.
  517. __initWDLL
  518. entry point for Windows DLL.
  519. __getheapbase
  520. returns base of far heap.
  521. do_initargc
  522. Initialization code to process command line arguments.
  523. __setargv
  524. Initializes command line variables.
  525. __real_pdef, __real_sdef
  526. Default procedure that is called if an attempt is made to
  527. format an integer floating point number by either printf
  528. or scanf.
  529. __exit
  530. Low level, operating system specific termination
  531. procedure. It all ends here.
  532. __startup
  533. The library entry point.
  534. $Stage2
  535. The second initialization stage, called after low level
  536. and C++ initialization.
  537. __call_main
  538. calls _main
  539. __fp_1
  540. Tells library that floating point is present.
  541. __fp_0
  542. Tells library that floating point is absent.
  543. Replacing module
  544. In normal circumstances this module may not be replaced.
  545. Embedded systems
  546. embedded systems programmers are unlikely to be using the
  547. low level library initialization. In this case the
  548. program main module will be called directly from
  549. initesys, so coremain becomes redundant. However, some
  550. functions or variables may be referenced. It is safe to
  551. include coremain, as no OS or machine specific code will
  552. be dragged in as long as __startup is not used.
  553. Initialization
  554. The initialization code contained in this module concerns
  555. command line arguments and environment strings. The
  556. procedures __setargv and __setenv mentioned above perform
  557. the actual initialization.
  558. coresig.a
  559. ---------
  560. Overview
  561. Coresig provides error, signal and exception handling.
  562. variables
  563. __sigTrans
  564. Table for translating signal numbers
  565. __raiseTrans
  566. Table for translating signal numbers
  567. CoreSig@CnsHandler
  568. procedure variable for handling run-time errors such as
  569. nil pointer dereference etc.
  570. __sigTable
  571. signal vector table
  572. __vec0,__vec2,__vec4,__vec16,__vec23,__vec24
  573. Storage for interrupt vectors to be restored on program
  574. termination.
  575. @RecursiveExit
  576. Flag, set true at first call to terminate process. A
  577. subsequent fatal error will cause immediate termination.
  578. _errno
  579. The C global error variable.
  580. @InProgramFlag
  581. Flag, when true process not executing in operating system
  582. (MSDOS).
  583. @StopProgramFlag
  584. Flag, when true signals that process has received a
  585. terminate signal. (MSDOS)
  586. @MachineId
  587. Indicates if machine is an AT.
  588. __pmd_stub
  589. procedure variable for invoking post mortem dump.
  590. Procedures and functions
  591. Public interface library procedures are not normally
  592. mentioned here since they are documented fully in the
  593. appropriate language library reference.
  594. __seterrno
  595. Used to set error variable _errno.
  596. __errno__
  597. called in multi-thread models to access _errno.
  598. __ioerr
  599. Used to set dos error variable.
  600. @ReloadCache
  601. Dummy procedure in far segment to force cache flushing on
  602. some machines.
  603. __sysmsg
  604. System error message output procedure.
  605. __FatalErrorPos
  606. Returns current IP:CS
  607. __FatalError
  608. Invokes program termination and creates ERRORINF.$$$
  609. file. If post mortem dump is included the debug file will
  610. also be produced.
  611. @DosInterrupt
  612. Executes DOS Int21H. Checks for re-entering DOS.
  613. __SigInit
  614. Initializes signal handling system
  615. do_initsig
  616. Initialization block for signal system. Calls __SigInit.
  617. __do_exitsig
  618. Clean up for signal handling.
  619. __initsig
  620. Minimal signal handling initialization called if main
  621. signal system not used.
  622. __sigDefault
  623. Default procedure for handling signal. Terminates
  624. program.
  625. __sig23
  626. Handler for int23.
  627. __sigFp_AT, __sig_Fp
  628. Handler for floating point exceptions.
  629. Initialization
  630. The initialization code contained in this module relates
  631. to the signal handling mechanism. The actual
  632. initialization is done by __SigInit.
  633. Replacing module
  634. It is not really practicable to replace this module if it
  635. features are required. The signal and exception handling
  636. are complex and highly implementation specific.
  637. Embedded systems
  638. This module may be omitted, since the startup code in
  639. initesys will not use the signal handling mechanisms.
  640. However, using run-time checks or floating point will
  641. require the use of coresig.
  642. coremath.a
  643. ----------
  644. Coremath implements the assembler floating point math
  645. library. The file is in two sections, one for stack frame
  646. and one for JPI calling conventions.
  647. 3rdparty.a
  648. ----------
  649. This module implements compiler support functions called
  650. by code generated by other vendors products.
  651. corefile.a
  652. ----------
  653. Corefile contains the data definitions for the file I/O
  654. descriptor arrays.
  655. OPEN_MAX Sets maximum number of open files.
  656. __open_max Variable used by high level languages to
  657. get file maximum.
  658. __iob C FILE array.
  659. __openfd C file handle descriptor array.
  660. _BufInf Modula-2 buffered file descriptor array.
  661. __tmpfiles Temporary file name array.
  662. __tmpfptrs Temporary file FILE structure array.
  663. corertl.a
  664. ---------
  665. corertl contains compiler helper functions, run-time
  666. error handlers and Modula-2/Pascal module initialization
  667. code.
  668. All helper functions have far, near and IO privilege
  669. versions. The names used below omit the prefixes F, N and
  670. I.
  671. All the helper functions use a stack based calling
  672. convention, and return values in dx:ax.
  673. $UnsMol
  674. Multiplies two unsigned long integers with modulus
  675. wraparound on overflow.
  676. $SgnMol
  677. Multiplies two signed long integers with modulus
  678. wraparound on overflow.
  679. $SgnDiv
  680. Divides two signed long integers.
  681. $UnsDiv
  682. Divides two unsigned long integers.
  683. $UnsRem
  684. Calculates the remainder of two unsigned long integers.
  685. $SgnRem
  686. Calculates remainder of two signed long integers.
  687. $UnsMul
  688. Multiplies two unsigned long integers.
  689. $SgnMul
  690. Multiplies two signed long integers.
  691. $SgnMod
  692. Calculates modulus of two signed long integers.
  693. $LngShl
  694. Shifts left signed long integer.
  695. $LngShr
  696. Shifts right signed long integer.
  697. $ULngShr
  698. Shifts right unsigned long integer.
  699. $PushByt
  700. Pushes bytes onto stack.
  701. $PopByt
  702. Pops bytes from stack.
  703. $SetOr
  704. Computes bitwise OR of two sets.
  705. $SetDif
  706. Computes bitwise difference of two sets.
  707. $SetXor
  708. Computes bitwise XOR of two sets.
  709. $SetAnd
  710. Computes bitwise AND of two sets.
  711. $DupByt
  712. Copies bytes.
  713. $EquByte
  714. Compares two blocks of bytes. Returns result in flags and
  715. non-zero in AX if equal.
  716. $NotEquByte
  717. Compares two blocks of bytes. Returns result in flags and
  718. non-zero in AX if not equal.
  719. $HugeSub
  720. Subtracts two huge pointers.
  721. $LngRol
  722. Rotates left a signed long integer.
  723. $StkChk
  724. Performs stack check. Called on entry to procedure.
  725. $CnsStk
  726. Called if stack overflow occurs. Invokes error handling
  727. mechanism.
  728. $CnsPtr
  729. Called if nil pointer dereference occurs. Invokes error
  730. handling mechanism.
  731. $CnsIdx
  732. Called if array index error occurs. Invokes error handling
  733. mechanism.
  734. $CnsOvr
  735. Called if overflow occurs. Invokes error handling
  736. mechanism.
  737. $CnsRng
  738. Called if range error occurs. Invokes error handling
  739. mechanism.
  740. $CnsRet
  741. Called if illegal return occurs. Invokes error handling
  742. mechanism.
  743. $CnsCase
  744. Called if case error occurs. Invokes error handling
  745. mechanism.
  746. $CnsDiv
  747. Called if divide by zero occurs. Invokes error handling
  748. mechanism.
  749. $CnsPVC
  750. Called if pure virtual function called. Invokes error
  751. handling mechanism.
  752. __initm
  753. Calls modula2/Pascal initialization, followed by the main
  754. module. If this module returns then _exit is called.
  755. $initm
  756. Calls each of the module initialization routines. The
  757. bottom of the stack segment is used for working space. A
  758. stack of 16k gives enough storage for about 1000 modules
  759. which should be ample. There are logically three arrays,
  760. a fixed size hash table, an array of graph nodes, and an
  761. array of lists used for sorting. The latter two are of
  762. dynamic size and are interleaved, and allocated together.
  763. Once the order has been determined, the addresses are
  764. pushed onto the stack, and a return instruction is
  765. executed.
  766. Embedded systems
  767. This module must be included, unless no compiler
  768. generated calls exist in your code..
  769. coreio.a
  770. --------
  771. Coreio provides low level file and console I/O
  772. facilities, plus a DOS timer delay function.
  773. Variables
  774. __fmode
  775. default file open mode.
  776. __fmask
  777. default permission mask.
  778. __ungotchar
  779. character put back by ungetch.
  780. __DelayFactor, __Iter, __Count
  781. calibration information for timer delay.
  782. __upperHex
  783. Hex format case.
  784. __zero_code, __scanwaiting
  785. variables for handling extended key codes.
  786. __kbdhandle
  787. OS2 keyboard handle.
  788. __i_putch
  789. putch function vector.
  790. __i_cgets
  791. cgets function vector.
  792. __p_init
  793. console initialization flag.
  794. __doserrno dos error variable.
  795. Procedures and functions
  796. Public interface library procedures are not normally
  797. mentioned here since they are documented fully in the
  798. appropriate language library reference.
  799. __d_putch
  800. Default putch function. The graph, JPI window and
  801. clipping window modules install their own versions of
  802. putch.
  803. __d_cgets
  804. Default cgets function. The graph, JPI window and
  805. clipping window modules install their own versions of
  806. cgets.
  807. __iosetup
  808. Flag, true if file I/O initialized.
  809. do_initio
  810. Initialization block for file I/O.
  811. do_initTimer
  812. Initialization block for delay timer.
  813. __pascreate, __pasopen
  814. Internal file open functions for pascal library.
  815. __exists
  816. low level function to check for a file's existence.
  817. Initialization
  818. The timer and file I/O systems are initialized in coreio.
  819. Embedded systems
  820. Unless I/O is actually used, the module is not required.
  821. The very low level I/O functions such as __read, __write
  822. etc require no initialization.
  823. corepmd.a
  824. ---------
  825. Corepmd contains the initialization and low level code
  826. for the post mortem dump facility. It is not used unless
  827. PMD is enabled.
  828. corewind.a
  829. ----------
  830. CoreWind provides initialization and low level functions
  831. for the JPI window module.
  832. __initwin_vector vector used for DLL initialization.
  833. __fullscreen The default window handle.
  834. __uselist List of windows to be used.
  835. __windowstack Stack of active windows.
  836. __cursorstack Cursor stack.
  837. __multip Flag, true if multi-thread process.
  838. __winsetup Flag, true if window module
  839. initialized.
  840. __cursorlines Number of raster lines in the cursor.
  841. __ScrnAddr Address of screen memory.
  842. __ActPag Active display page.
  843. __IsColor Flag, true if color display.
  844. __IsSnow Flag, true if CGA snow checking
  845. enabled.
  846. __ScreenSel OS2 display memory selector.
  847. __Config, __BufInf, __Status
  848. OS2 screen configuration.
  849. All the procedures in this module are called from the
  850. high level wdinow modules.
  851. __bufferwrite
  852. Writes character directly to window buffer.
  853. __getscreendepth
  854. Returns depth in rows of screen.
  855. __palxlat
  856. Translate palette colors.
  857. __buffertoscreen
  858. Updates screen from window buffer.
  859. __screentobuffer
  860. Updates window buffer from screen.
  861. __setvideopage
  862. Selects active display page.
  863. __activepage
  864. Returns active display page.
  865. __initscreentype
  866. Determines display mode and parameters.
  867. do_initconio
  868. Initialization block for window module. __initwin does
  869. the actual initialization.
  870. __set_initwin_vector
  871. Initializes vector for DLL.
  872. Embedded systems
  873. The window module uses BIOS calls and code segment variables,
  874. so it not suitable for embedded systems programming.
  875. coremem.a
  876. ---------
  877. Coremem implements the run-time memory management of both
  878. near and far heaps. Note that in Modula-2 only programs
  879. all the far heap is allocated to the Storage module, and
  880. sub-allocated.
  881. Near heap structure
  882. -------------------
  883. The near heap is a single contiguous block of memory
  884. located in DGROUP. Free blocks form a linked list. The
  885. list is terminated by a nil value.
  886. The header structure is as follows:
  887. Block size word
  888. offset of next free block word
  889. When a block is allocated and removed from the free list,
  890. only the block size part of the header is preserved, a
  891. pointer to the second word of the header is returned.
  892. DOS far heap structure
  893. ----------------------
  894. The far heap is a single contiguous block of memory
  895. located above the stack segment. Free blocks form a
  896. linked list. The list is terminated by a nil segment
  897. value.
  898. The header structure is as follows:
  899. Block size word
  900. segment of next free block word
  901. When a block is allocated and removed from the free list,
  902. only the block size part of the header is preserved, a
  903. pointer to the second word of the header is returned.
  904. All blocks are paragraph aligned. The heap expands
  905. upwards into free memory. If the heap contracts, surplus
  906. memory is returned to DOS.
  907. OS2 far heap structure
  908. ----------------------
  909. The OS2 far heap is a linked list of short heaps. Each
  910. heap has a header of the following structure:
  911. selector of previous heap word
  912. selector of next heap word
  913. offset of first free block word
  914. Heap status word
  915. The first block begins after the header at offset 8. The
  916. heap status word can have two values:
  917. 1 Heap allocated and active.
  918. 0 Heap free and unused.
  919. If a request is made to allocate a huge block or one
  920. greater than 64K - 8, a segment is allocate from the
  921. Operating system.
  922. When a heap becomes full, a new segment is allocated and
  923. added to the list. When a heap becomes empty, it is
  924. returned to the operating system. However, in xlarge,
  925. mthread and dynalink models, the heap segment is shrunk
  926. to its header size and marked as free. This means that
  927. any selectors referring to dynamic memory still on the
  928. stack may still be popped safely. When a new heap segment
  929. is required, the first free heaps will be re-used.
  930. __memtype OS2 segment allocation attribute
  931. __fheapstart segment value of bottom of far heap
  932. __fheaptop segment value of top of far heap
  933. __firstfree segment of first free block in far heap
  934. __fheapsem process control semaphore
  935. __nheapstart offset of beginning of near heap
  936. __nfirstfree offset of first free *block in near heap
  937. __nheaptop offset of end of near heap
  938. __firstheap first heap of OS2 far heaps
  939. Procedures and functions
  940. Public interface library procedures are not normally
  941. mentioned here since they are documented fully in the
  942. appropriate language library reference.
  943. __nheap_merge
  944. Merges two near heap blocks if they are adjacent.
  945. do_initfmem
  946. Initializatin block for far heap.
  947. do_initnmem
  948. Initializatin block for near heap.
  949. __shrink_mem
  950. Shrinks far heap to minimum size and returns rest of
  951. memory to DOS. Used when spawning a process.
  952. __heap_align
  953. Normalizes block request to far heap allocation function.
  954. Two bytes are added for header overhead, and the size is
  955. then rounded up to the nearest paragraph.
  956. __heap_free
  957. Returns any surplus memory to DOS if far heap contracts.
  958. __heap_merge
  959. Merges two far heap blocks if they are adjacent.
  960. __get_heapstate, _set_heapstate
  961. In overlay or dynalink model under DOS, the far heap is
  962. managed by the overlay manager. Any library functions
  963. that access the heap must call __get_heapstate to get the
  964. current state of the heap before access it, and call
  965. set_heapstate to update the overlay manager.
  966. __newheap
  967. Creates new OS2 far heap.
  968. __newheapr
  969. Creates or reinitializes an OS2 far heap in xlarge,
  970. mthread or dynalink model.
  971. __osalloc
  972. Allocates memory from OS2.
  973. __osfree
  974. Disposes of an empty OS2 far heap.
  975. __osfreer
  976. Disposes of an empty OS2 far heap. If in xlarge, mthread
  977. or dynalink model, the heap is shrunk to its header size
  978. and not freed. This is to ensure that any selector values
  979. subsequently popped from the stack are still valid.
  980. Initialization
  981. The far and near heaps are initialized in this module.
  982. coreemul.a
  983. ----------
  984. Coreemul implements the floating point emulator. If
  985. floating point is used and emulation is required, either
  986. R_EMUL (DOS), or P_EMUL (OS2), will be linked, causing
  987. the emulator to be initialized. Note that Windows3
  988. programs use the windows emulator.
  989. coreproc.a
  990. ----------
  991. Coreproc implements low level thread handling functions
  992. as well as the Modula-2 system procedures NEWPROCESS etc.
  993. __threadTable Table of thread control structures.
  994. __threadTotal Total number of active threads.
  995. __cp currently active task + ready queue
  996. __dq queue of delayed tasks
  997. __wq queue of tasks that have reached their
  998. delay time but haven't been placed on
  999. the ready queue.
  1000. __SchedProc Pointer to scheduler.
  1001. __Started Flag, true if scheduler started.
  1002. __Continue Procedure variable used by closedown
  1003. procedure.
  1004. __Stop Signal to stop scheduler.
  1005. __LockNestMonster Lock count.
  1006. __SchedTime Time value for scheduler.
  1007. __NextThread Next thread number to be started.
  1008. __proc_init Flag, true if process module
  1009. initialized.
  1010. __initmt_vector Vector used to initialize DLL.
  1011. __ProcIds Process Id array.
  1012. __LockSem OS2 Lock procedure semaphore.
  1013. __LockCount OS2 lock count.
  1014. __LockedThread Number of locked thread.
  1015. @CurrentProcess Current DOS thread.
  1016. __core_lock procedure variable for language
  1017. independent lock.
  1018. __core_unlock procedure variable for language
  1019. independent unlock.
  1020. __core_delay procedure variable for language
  1021. independent delay.
  1022. Major functions
  1023. Public interface library procedures are not normally
  1024. mentioned here since they are documented fully in the
  1025. appropriate language library reference.
  1026. __set_initmt_vector
  1027. Instigates DLL initialization.
  1028. _new_priority
  1029. Compiler generated call to change priority.
  1030. CoreProc$initprocess, SYSTEM$initprocess
  1031. Basic low level initialization for SYSTEM.
  1032. do_initproc
  1033. Initialization block for process module.
  1034. Initialization
  1035. The initialization block for the process module is
  1036. contained in coreproc, but the actual code is implemented
  1037. in a high level language.
  1038. coregrap.a
  1039. ----------
  1040. Coregraph implements the hardware specific and
  1041. performance critical areas of the JPI graph module.
  1042. Variables
  1043. __active_page Active display page.
  1044. __bkcolor Background color.
  1045. __clip_br Bottom right corner of clip region.
  1046. __clip_tl TopLeft corner of clip region.
  1047. __current_graph Current position of graphics cursor.
  1048. __current_mask pointer to current fill mask.
  1049. __current_text Current position of text cursor.
  1050. __current_video Current video configuration.
  1051. __cursor_lock Cursor lock count.
  1052. __cursor_state Current cursor state.
  1053. __depth Depth in pixels of screen.
  1054. __display_state Current display mode.
  1055. __EGA_table EGA color translation table.
  1056. __EGA64K Flag, true if 64K EGA card present.
  1057. __EGAPlaneShift EGA plane shift value.
  1058. __EGAScreen Address of EGA screen.
  1059. __EGAStartPlane Starting EGA plane.
  1060. __EGAtranslate Flag, true if translation of EGA
  1061. color value required.
  1062. __fgcolor Current foreground color.
  1063. __fill_mask Current fill mask.
  1064. __current_linestyle Current line style.
  1065. __fstart Start of fill when filling pie.
  1066. __g_charout procedure variable for outputting
  1067. character to screen.
  1068. __g_strin procedure variable for reading
  1069. string from keyboard.
  1070. __get procedure variable for getting bit
  1071. image of screen.
  1072. __hline procedure variable for drawing
  1073. horizontal line.
  1074. __hscan procedure variable for scanning a
  1075. line of pixels. Used by floodfill.
  1076. __initgraph_vector vector for initialization of DLL.
  1077. __lastmode Previous display mode.
  1078. __line procedure variable for drawing line.
  1079. __mode_changed Flag, true if program has changed
  1080. display mode.
  1081. __origin Origin of viewport.
  1082. __page_size Size of graphics display page.
  1083. __plot procedure variable for setting
  1084. pixel.
  1085. __point procedure variable for getting pixel
  1086. value.
  1087. __put procedure variable for copying bit
  1088. image to screen.
  1089. __scr_attr Text mode character attribute.
  1090. __text_br Bottom right corner of text window.
  1091. __text_tl Top left corner of text window.
  1092. __txcolor Current text color.
  1093. __visual_page Current visual display page.
  1094. __width Screen width.
  1095. __wrap_state State of text wrap.
  1096. Procedures and functions.
  1097. All the following routines a called from the high level
  1098. cgraph.c and graph.mod modules.
  1099. $OutWord
  1100. Word output to port. This is done in single bytes for
  1101. portability. However, coregraph may be recompiled with
  1102. FastIO true, which causes output by an out dx
  1103. instruction.
  1104. __CGA320Get
  1105. Captures bit image of CGA 320*200 graphics screen.
  1106. __CGA320HLine
  1107. Draws horizontal line in CGA 320*200 graphics mode.
  1108. __CGA640HLine
  1109. Draws horizontal line in CGA 640*200 graphics mode.
  1110. __CGA320leftscan
  1111. Scans pixel line to the left in CGA 320*200 graphics
  1112. mode. Used by floodfill.
  1113. __CGA320Line
  1114. Draws line in CGA 320*200 graphics mode.
  1115. __CGA320Put
  1116. Copies bit image to CGA 320*200 graphics screen.
  1117. __CGA320rightscan
  1118. Scans pixel line to the right in CGA 320*200 graphics
  1119. mode. Used by floodfill.
  1120. __CGA640Get
  1121. Captures bit image of CGA 640*200 graphics screen.
  1122. __CGA640leftscan
  1123. Scans pixel line to the left in CGA 640*200 graphics
  1124. mode. Used by floodfill.
  1125. __CGA640Line
  1126. Draws line in CGA 640*200 graphics mode.
  1127. __CGA640Put
  1128. Copies bit image to CGA 640*200 graphics screen.
  1129. __CGA640rightscan
  1130. Scans pixel line to the right in CGA 640*200 graphics
  1131. mode. Used by floodfill.
  1132. __change_screen_background
  1133. Updates graphics screen background.
  1134. __clear_Herc
  1135. Clears hercules graphics screen.
  1136. __EGA2HLine
  1137. Draws horizontal line in EGA 2 color graphics mode.
  1138. __EGA2Line
  1139. Draws line in EGA 2 color graphics mode.
  1140. __EGA2Plot
  1141. Sets pixel in EGA 2 color graphics mode.
  1142. __EGA2Point
  1143. Gets pixel in EGA 2 color graphics mode.
  1144. __EGAGet
  1145. Captures bit image of EGA native mode graphics screen.
  1146. __EGAHLine
  1147. Draws horizontal line in native EGA graphics mode.
  1148. __EGAleftscan
  1149. Scans pixel line to the left in EGA graphics mode. Used
  1150. by floodfill.
  1151. __EGALine
  1152. Draws line in native EGA graphics mode.
  1153. __EGAPlot
  1154. Sets pixel in native EGA graphics mode.
  1155. __EGAPoint
  1156. Gets pixel in native EGA graphics mode.
  1157. __EGAPut
  1158. Copies bit image to EGA graphics screen.
  1159. __EGArexlat, __EGAxlat
  1160. Translation procedures used for 64K EGA.
  1161. __EGArightscan
  1162. Scans pixel line to the right in EGA graphics mode. Used
  1163. by floodfill.
  1164. __gcur
  1165. Draws graphics cursor.
  1166. __getmemory
  1167. Returns display adapter memory size.
  1168. __hclip
  1169. Clips horizontal line.
  1170. __HercGet
  1171. Captures bit image of hercules mode graphics screen.
  1172. __HercHLine
  1173. Draws horizontal line in hercules graphics mode.
  1174. __HercLine
  1175. Draws line in hercules graphics mode.
  1176. __HercPut
  1177. Copies bit image to hercules graphics screen.
  1178. __lclip
  1179. Clips line.
  1180. __pixeladdr320x200
  1181. Calculates pixel address and shift count in CGA 320*200
  1182. graphics mode.
  1183. __pixeladdr640x200
  1184. Calculates pixel address and shift count in CGA 640*200
  1185. graphics mode.
  1186. __pixeladdrEGA
  1187. Calculates pixel address and shift count in native EGA
  1188. graphics mode.
  1189. __pixeladdrEGA2
  1190. Calculates pixel address and shift count in EGA 2 color
  1191. graphics mode.
  1192. __pixeladdrHerc
  1193. Calculates pixel address and shift count in hercules
  1194. graphics mode.
  1195. __resetEGA
  1196. Resets EGA/VGA adapter.
  1197. __restore_mode
  1198. Cleanup function top restore display mode on termination.
  1199. __setbiosmode
  1200. Sets display mode using BIOS call.
  1201. __txt_out
  1202. Outputs text to screen.
  1203. __VGAGet
  1204. Captures bit image of VGA 256 color graphics screen.
  1205. __VGAHLine
  1206. Draws horizontal line in VGA 256 color graphics mode.
  1207. __VGALine
  1208. Draws line in VGA 256 color graphics mode.
  1209. __VGAleftscan
  1210. Scans pixel line to the left in VGA 256 color graphics
  1211. mode. Used by floodfill.
  1212. __VGAPoint
  1213. Gets pixel in VGA 256 color graphics mode.
  1214. __VGAPut
  1215. Copies bit image to VGA 256 graphics screen.
  1216. __VGArightscan
  1217. Scans pixel line to the right in VGA 256 color graphics
  1218. mode. Used by floodfill.
  1219. do_initgraph
  1220. Initialization block for graphics module.
  1221. Initialization
  1222. The initialization block for graphics is contained in
  1223. this module, but the actual initialization code is in a
  1224. high level language.
  1225.