Open WATCOM Programmer's Guide

Total Page:16

File Type:pdf, Size:1020Kb

Open WATCOM Programmer's Guide this document downloaded from... Use of this document the wings of subject to the terms and conditions as flight in an age stated on the website. of adventure for more downloads visit our other sites Positive Infinity and vulcanhammer.net chet-aero.com Watcom FORTRAN 77 Programmer's Guide Version 1.8 Notice of Copyright Copyright 2002-2008 the Open Watcom Contributors. Portions Copyright 1984-2002 Sybase, Inc. and its subsidiaries. All rights reserved. Any part of this publication may be reproduced, transmitted, or translated in any form or by any means, electronic, mechanical, manual, optical, or otherwise, without the prior written permission of anyone. For more information please visit http://www.openwatcom.org/ Portions of this manual are reprinted with permission from Tenberry Software, Inc. ii Preface The Watcom FORTRAN 77 Programmer's Guide includes the following major components: · DOS Programming Guide · The DOS/4GW DOS Extender · Windows 3.x Programming Guide · Windows NT Programming Guide · OS/2 Programming Guide · Novell NLM Programming Guide · Mixed Language Programming · Common Problems Acknowledgements This book was produced with the Watcom GML electronic publishing system, a software tool developed by WATCOM. In this system, writers use an ASCII text editor to create source files containing text annotated with tags. These tags label the structural elements of the document, such as chapters, sections, paragraphs, and lists. The Watcom GML software, which runs on a variety of operating systems, interprets the tags to format the text into a form such as you see here. Writers can produce output for a variety of printers, including laser printers, using separately specified layout directives for such things as font selection, column width and height, number of columns, etc. The result is type-set quality copy containing integrated text and graphics. Many users have provided valuable feedback on earlier versions of the Watcom FORTRAN 77 compilers and related tools. Their comments were greatly appreciated. If you find problems in the documentation or have some good suggestions, we would like to hear from you. July, 1997. Trademarks Used in this Manual DOS/4G and DOS/16M are trademarks of Tenberry Software, Inc. OS/2 is a trademark of International Business Machines Corp. IBM Developer's Toolkit, Presentation Manager, and OS/2 are trademarks of International Business Machines Corp. IBM is a registered trademark of International Business Machines Corp. Intel and Pentium are registered trademarks of Intel Corp. Microsoft, Windows and Windows 95 are registered trademarks of Microsoft Corp. Windows NT is a trademark of Microsoft Corp. NetWare, NetWare 386, and Novell are registered trademarks of Novell, Inc. iii Phar Lap, 286|DOS-Extender and 386|DOS-Extender are trademarks of Phar Lap Software, Inc. UNIX is a registered trademark of The Open Group. WATCOM is a trademark of Sybase, Inc. and its subsidiaries. iv Table of Contents 1 Watcom FORTRAN 77 Application Development .......................................................................... 1 DOS Programming Guide ............................................................................................................................... 3 2 Creating 16-bit DOS Applications ................................................................................................... 5 2.1 The Sample Application ..................................................................................................... 5 2.2 Building and Running the Sample DOS Application ........................................................ 5 2.3 Debugging the Sample DOS Application .......................................................................... 6 3 Creating 32-bit Phar Lap 386|DOS-Extender Applications ............................................................. 9 3.1 The Sample Application ..................................................................................................... 9 3.2 Building and Running the Sample 386|DOS-Extender Application .................................. 10 3.3 Debugging the Sample 386|DOS-Extender Application .................................................... 10 4 Creating 32-bit DOS/4GW Applications .......................................................................................... 13 4.1 The Sample Application ..................................................................................................... 13 4.2 Building and Running the Sample DOS/4GW Application ............................................... 13 4.3 Debugging the Sample DOS/4GW Application ................................................................ 14 5 32-bit Extended DOS Application Development ............................................................................. 17 5.1 Introduction ........................................................................................................................ 17 5.2 How can I write directly to video memory using a DOS extender? .................................. 17 5.3 How do I issue interrupts in a DOS/4GW application? ..................................................... 18 5.4 How do I get information about free memory in the 32-bit environment? ........................ 19 The DOS/4GW DOS Extender ....................................................................................................................... 21 6 The Tenberry Software DOS/4GW DOS Extender .......................................................................... 23 7 Linear Executables ........................................................................................................................... 25 7.1 The Linear Executable Format ........................................................................................... 25 7.1.1 The Stub Program ................................................................................................ 25 7.2 Memory Use ....................................................................................................................... 26 8 Configuring DOS/4GW .................................................................................................................... 29 8.1 The DOS4G Environment Variable ................................................................................... 29 8.2 Changing the Switch Mode Setting ................................................................................... 30 8.3 Fine Control of Memory Usage ......................................................................................... 31 8.3.1 Specifying a Range of Extended Memory ........................................................... 31 8.3.2 Using Extra Memory ........................................................................................... 32 8.4 Setting Runtime Options .................................................................................................... 33 8.5 Controlling Address Line 20 .............................................................................................. 34 9 VMM ................................................................................................................................................ 35 9.1 VMM Default Parameters .................................................................................................. 35 9.2 Changing the Defaults ........................................................................................................ 36 9.2.1 The .VMC File ..................................................................................................... 36 10 Interrupt 21H Functions ................................................................................................................. 37 10.1 Functions 25H and 35H: Interrupt Handling in Protected Mode ..................................... 40 v Table of Contents 10.1.1 32-Bit Gates ....................................................................................................... 40 10.1.2 Chaining 16-bit and 32-bit Handlers ................................................................. 41 10.1.3 Getting the Address of the Interrupt Handler .................................................... 41 11 Interrupt 31H DPMI Functions ...................................................................................................... 43 11.1 Using Interrupt 31H Function Calls ................................................................................. 43 11.2 Int31H Function Calls ...................................................................................................... 44 11.2.1 Local Descriptor Table (LDT) Management Services ...................................... 44 11.2.2 DOS Memory Management Services ................................................................ 49 11.2.3 Interrupt Services ............................................................................................... 51 11.2.4 Translation Services .......................................................................................... 53 11.2.5 DPMI Version .................................................................................................... 60 11.2.6 Memory Management Services ......................................................................... 61 11.2.7 Page Locking Services ....................................................................................... 62 11.2.8 Demand Paging Performance Tuning Services ................................................. 63 11.2.9 Physical Address Mapping
Recommended publications
  • Screenshot Showcase 1
    Volume 125 June, 2017 VirtualBox: Going Retro On PCLinuxOS Inkscape Tutorial: Creating Tiled Clones, Part Three An Un-feh-gettable Image Viewer Game Zone: Sunless Sea PCLinuxOS Family Member Spotlight: arjaybe GOG's Gems: Star Trek 25th Anniversary Tip Top Tips: HDMI Sound On Encrypt VirtualBox Virtual Machines PCLinuxOS Recipe Corner PCLinuxOS Magazine And more inside ... Page 1 In This Issue... 3 From The Chief Editor's Desk... Disclaimer 4 Screenshot Showcase 1. All the contents of The PCLinuxOS Magazine are only for general information and/or use. Such contents do not constitute advice 5 An Un-feh-gettable Image Viewer and should not be relied upon in making (or refraining from making) any decision. Any specific advice or replies to queries in any part of the magazine is/are the person opinion of such 8 Screenshot Showcase experts/consultants/persons and are not subscribed to by The PCLinuxOS Magazine. 9 Inkscape Tutorial: Create Tiled Clones, Part Three 2. The information in The PCLinuxOS Magazine is provided on an "AS IS" basis, and all warranties, expressed or implied of any kind, regarding any matter pertaining to any information, advice 11 ms_meme's Nook: Root By Our Side or replies are disclaimed and excluded. 3. The PCLinuxOS Magazine and its associates shall not be liable, 12 PCLinuxOS Recipe Corner: Skillet Chicken With Orzo & Olives at any time, for damages (including, but not limited to, without limitation, damages of any kind) arising in contract, rot or otherwise, from the use of or inability to use the magazine, or any 13 VirtualBox: Going Retro On PCLinuxOS of its contents, or from any action taken (or refrained from being taken) as a result of using the magazine or any such contents or for any failure of performance, error, omission, interruption, 30 Screenshot Showcase deletion, defect, delay in operation or transmission, computer virus, communications line failure, theft or destruction or unauthorized access to, alteration of, or use of information 31 Tip Top Tips: HDMI Sound On contained on the magazine.
    [Show full text]
  • Powershell Core Ja Sitä Edeltävät Komentorivi- Pohjaiset Hallintatyökalut
    Ismail Belmostefa PowerShell Core ja sitä edeltävät komentorivi- pohjaiset hallintatyökalut Metropolia Ammattikorkeakoulu Insinööri (AMK) Tietotekniikan koulutusohjelma Insinöörityö 12.12.2016 Tiivistelmä Tekijä Ismail Belmostefa Otsikko PowerShell Core ja sitä edeltävät komentorivipohjaiset hallin- tatyökalut Sivumäärä 38 sivua + 2 liitettä Aika 12.12.2016 Tutkinto Insinööri (AMK) Koulutusohjelma Tietotekniikka Suuntautumisvaihtoehto Ohjelmistotekniikka Ohjaaja Kari Sundberg Ohjaajat Yliopettaja Markku Nuutinen Insinöörityön aiheena oli PowerShell Core ja sitä edeltävät komentorivipohjaiset hallinta- työkalut. Tavoite oli ymmärtää näiden asennusympäristö, alla käytetyt teknologiat ja niihin liittyvä terminologia. Tutkimustyö syntyi harjoittelutyön muistiinpanojen lopputuloksena sekä tutkimalla alan kirjallisuutta ja verkkomateriaalia. Insinöörityössä selvitettiin PowerShell Coren ja sitä edeltävien komentorivipohjaisten hal- lintatyökalujen alla käytetyt teknologiat, terminologia, käyttökohteet ja motivaatio niiden syntyyn. Koska komentorivipohjaiset hallintatyökalut on rakennettu asennusympäristön tar- joamien palveluiden päälle, palveluiden toiminnan hahmottaminen edesauttaa komentori- vin käyttöä ja soveltamista. Tutkimustyötä on hyödynnetty tietokoneen ylläpidossa, ohjel- moinnissa ja peruskäytössä. Tutkimustyö osoitti asennusympäristön kokonaiskuvan hallit- semisen tärkeyden komentorivipohjaisten työkalujen käytössä. Avainsanat DDE, OLE, COM, .NET, CMD.EXE, COMMAND.COM, WSH, MOM, PowerShell Abstract Author Ismail Belmostefa Title
    [Show full text]
  • DOS Technical Reference
    -------- - ---- Personal Computer - ---- - --- ------ - . - Programming Family DOS Technical Reference 6138536 Preliminary First Edition (February 1985) The following paragraph does not apply to the United Kingdom or any country where such provisions are inconsistent ~ith local law: INTERNATIONAL BUSINESS MACHINES CORPORATION PROVIDES TIllS PUBLICATION "AS IS" wrrnom WARRANTY OF ANY KIND, EmlER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 1HE IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Some states do not allow disclaimer of express or implied warranties in certain transactions, therefore, this statement may not apply to you. lbis publication could include technical inaccuracies or typographical errors. Changes are periodically made to the information herein; these changes will be incorporated in new editions of the publication. IBM may make improvements and!or changes in the product(s) and/or the program(s) described in this pUblication at any time. It is possible that this publication may contain reference to, or information about, IBM products (machines and programs), programming, or services that are not announced in your country. Such references or information must not be construed to mean that IBM intends to announce such IBM products, programming, or services in your country. Products are not stocked at the address below. Requests for copies of this publication and for technical information about IBM Personal Computer products should be made to your authorized IBM Personal Computer dealer, IBM Product Center, or your IBM Marketing Representative. The following paragraph applies only to the United States and Puerto Rico: A Reader's Comment Form is provided at the back of this publication. If the form has been removed.
    [Show full text]
  • Thank You for Purchasing the Elder Scrolls: Arena. Dedicated Rpgers
    The Elder Scrolls ARENA hank you for purchasing The Elder Scrolls: Arena. Dedicated RPGers have invested an incredible amount of effort into creating this detailed simulation. If you enjoy the game, please pass the word! There is no better advertising than a satisfied customer. TYou can also purchase the second chapter of The Elder Scrolls, entitled Daggerfall, in Fall 1996. TES: Daggerfall will feature the same open-endedness and breadth as Arena, but will feature increased NPC (Non-Player-Character) interaction, a faster, more sophisticated 3-D engine, and a more extensive storyline. With all the planned enhancements, Daggerfall will give you even more of an opportunity to role-play your character as you choose. We are very excited about Daggerfall and what it will mean to the role-playing community. On our part, we promise to keep bringing you the best in computer simulation software and welcome any suggestions you may have for how we can serve you better. Journey well, and peace be with you. —The Bethesda Team Installing the Game Place the CD into your computer’s CD-ROM drive. Type the drive letter followed by a colon (Ex: D: for most CD-ROM drives) and hit <ENTER>. Next type INSTALL and hit <ENTER>. If you are installing Arena from floppy disks, select ‘Install Game’ and follow the prompts. Because you are installing from the CDROM, 5 megabytes of data will be copied to your hard drive when you select ‘Exit’. The next step is to configure your game (see below). Configuring Arena to your System To configure any Sound FX and Music drivers once Arena has successfully installed (if you wish to play the game with sound and/or music), choose the ‘Configure Game’ option.
    [Show full text]
  • XICE Lnstallationguide for Motorola 68000, 68HCOOO, 68ECOOO and 68302 Development Systems for DOS and UNIX Hosts
    1mmm Applied Microsystems Corporation XICE lnstallationGuide for Motorola 68000, 68HCOOO, 68ECOOO and 68302 Development Systems for DOS and UNIX Hosts May 1993 PIN 922-17140-03 Copyright© 1993 Applied Microsystems Corporation All rights reserved. \' '\'9~t\B<\', nnt:iubmv ~'9\nt . ,:~ s no gnilis' IBM XT and IBM AT are trademarks of IBM Corporation Microsoft and MS-DOS™ are trademarks of Microsoft Corporation. Microtec is a registered trademarks of Microtec Research, Inc. SP ARC, SPARCstation, Sun, Sun-3, Sun-4, NFS, and PC-NFS are trademarks o Microsystems, Inc. UNIX is a registered trademark of AT&T. VALIDATE is a registered tradmark of Applied Microsystems Corporation I Contents Chapter 1 Introduction Organization of the documentation................................... 1-2 Overview of the toolchain................................................... 1-4 XICE ............................................................................. 1-4 XRAY............................................................................ 1-4 C Cross Compiler......................................................... 1-4 C++ Compiler............................................................... 1-4 Chapter2 Installing on a Sun Workstation Step 1: Check minimum requirements ................ ............. 2-2 Requirements for Sun 4 (SPARC) workstations........ 2-2 Step 2: Set up the directory structure............................... 2-3 · Step 3: Copy the software from the tape........................... 2-4 Step 4: Define individual user's setup..............................
    [Show full text]
  • IT Acronyms.Docx
    List of computing and IT abbreviations /.—Slashdot 1GL—First-Generation Programming Language 1NF—First Normal Form 10B2—10BASE-2 10B5—10BASE-5 10B-F—10BASE-F 10B-FB—10BASE-FB 10B-FL—10BASE-FL 10B-FP—10BASE-FP 10B-T—10BASE-T 100B-FX—100BASE-FX 100B-T—100BASE-T 100B-TX—100BASE-TX 100BVG—100BASE-VG 286—Intel 80286 processor 2B1Q—2 Binary 1 Quaternary 2GL—Second-Generation Programming Language 2NF—Second Normal Form 3GL—Third-Generation Programming Language 3NF—Third Normal Form 386—Intel 80386 processor 1 486—Intel 80486 processor 4B5BLF—4 Byte 5 Byte Local Fiber 4GL—Fourth-Generation Programming Language 4NF—Fourth Normal Form 5GL—Fifth-Generation Programming Language 5NF—Fifth Normal Form 6NF—Sixth Normal Form 8B10BLF—8 Byte 10 Byte Local Fiber A AAT—Average Access Time AA—Anti-Aliasing AAA—Authentication Authorization, Accounting AABB—Axis Aligned Bounding Box AAC—Advanced Audio Coding AAL—ATM Adaptation Layer AALC—ATM Adaptation Layer Connection AARP—AppleTalk Address Resolution Protocol ABCL—Actor-Based Concurrent Language ABI—Application Binary Interface ABM—Asynchronous Balanced Mode ABR—Area Border Router ABR—Auto Baud-Rate detection ABR—Available Bitrate 2 ABR—Average Bitrate AC—Acoustic Coupler AC—Alternating Current ACD—Automatic Call Distributor ACE—Advanced Computing Environment ACF NCP—Advanced Communications Function—Network Control Program ACID—Atomicity Consistency Isolation Durability ACK—ACKnowledgement ACK—Amsterdam Compiler Kit ACL—Access Control List ACL—Active Current
    [Show full text]
  • DOS Virtualized in the Linux Kernel
    DOS Virtualized in the Linux Kernel Robert T. Johnson, III Abstract Due to the heavy dominance of Microsoft Windows® in the desktop market, some members of the software industry believe that new operating systems must be able to run Windows® applications to compete in the marketplace. However, running applications not native to the operating system generally causes their performance to degrade significantly. When the application and the operating system were written to run on the same machine architecture, all of the instructions in the application can still be directly executed under the new operating system. Some will only need to be interpreted differently to provide the required functionality. This paper investigates the feasibility and potential to speed up the performance of such applications by including the support needed to run them directly in the kernel. In order to avoid the impact to the kernel when these applications are not running, the needed support was built as a loadable kernel module. 1 Introduction New operating systems face significant challenges in gaining consumer acceptance in the desktop marketplace. One of the first realizations that must be made is that the majority of this market consists of non-technical users who are unlikely to either understand or have the desire to understand various technical details about why the new operating system is “better” than a competitor’s. This means that such details are extremely unlikely to sway a large amount of users towards the operating system by themselves. The incentive for a consumer to continue using their existing operating system or only upgrade to one that is backwards compatible is also very strong due to the importance of application software.
    [Show full text]
  • Computing :: Operatingsystems :: DOS Beyond 640K 2Nd
    DOS® Beyond 640K 2nd Edition DOS® Beyond 640K 2nd Edition James S. Forney Windcrest®/McGraw-Hill SECOND EDITION FIRST PRINTING © 1992 by James S. Forney. First Edition © 1989 by James S. Forney. Published by Windcrest Books, an imprint of TAB Books. TAB Books is a division of McGraw-Hill, Inc. The name "Windcrest" is a registered trademark of TAB Books. Printed in the United States of America. All rights reserved. The publisher takes no responsibility for the use of any of the materials or methods described in this book, nor for the products thereof. Library of Congress Cataloging-in-Publication Data Forney, James. DOS beyond 640K / by James S. Forney. - 2nd ed. p. cm. Rev. ed. of: MS-DOS beyond 640K. Includes index. ISBN 0-8306-9717-9 ISBN 0-8306-3744-3 (pbk.) 1. Operating systems (Computers) 2. MS-DOS (Computer file) 3. PC -DOS (Computer file) 4. Random access memory. I. Forney, James. MS-DOS beyond 640K. II. Title. QA76.76.063F644 1991 0058.4'3--dc20 91-24629 CIP TAB Books offers software for sale. For information and a catalog, please contact TAB Software Department, Blue Ridge Summit, PA 17294-0850. Acquisitions Editor: Stephen Moore Production: Katherine G. Brown Book Design: Jaclyn J. Boone Cover: Sandra Blair Design, Harrisburg, PA WTl To Sheila Contents Preface Xlll Acknowledgments xv Introduction xvii Chapter 1. The unexpanded system 1 Physical limits of the system 2 The physical machine 5 Life beyond 640K 7 The operating system 10 Evolution: a two-way street 12 What else is in there? 13 Out of hiding 13 Chapter 2.
    [Show full text]
  • Automated Testing of Firmware Installation and Update Scenarios for Peripheral Devices
    DEGREE PROJECT IN COMPUTER SCIENCE AND ENGINEERING, SECOND CYCLE, 30 CREDITS STOCKHOLM, SWEDEN 2019 Automated testing of firmware installation and update scenarios for peripheral devices DAG REUTERSKIÖLD KTH ROYAL INSTITUTE OF TECHNOLOGY SCHOOL OF ELECTRICAL ENGINEERING AND COMPUTER SCIENCE Automated testing of firmware installation and update scenarios for peripheral devices DAG REUTERSKIÖLD Master in Computer Science Date: August 12, 2019 Supervisor: Hamid Faragardi Examiner: Elena Troubitsyna School of Electrical Engineering and Computer Science Host company: Tobii AB Swedish title: Automatisering av enhetsinstallation, uppdatering och testning med hjälp av virtuella maskiner iii Abstract This research presents an approach to transition from manual to automated testing of hardware specific firmware. The manual approach for firmware test- ing can be repetitive and time consuming. A significant proportion of the time is spent on cleaning and re-installing operating systems so that old firmware does not interfere with the newer firmware that is being tested. The approach in this research utilizes virtual machines and presents an automation framework. One component of the automation framework is an application to imitate con- nected peripheral devices to bypass hardware dependencies of firmware in- stallers. The framework also consists of automation and pipeline scripts with the objective to execute firmware installers and detect errors and abnormalities in the installation and updating processes. The framework can run on locally hosted virtual machines, but is most applicable using cloud hosted virtual ma- chines, where it is part of a continuous integration that builds, downloads, installs, updates and tests new firmware versions, in a completely automated manner. The framework is evaluated by measuring and comparing execution times with manually conducted installation and updating tests, and the result shows that the framework complete tests much faster than the manual approach.
    [Show full text]
  • COMPILING FUNCTIONAL PROGRAMMING CONSTRUCTS to a LOGIC ENGINE by Harvey Abramson and Peter Ludemann Technical Report 86-24 November 1986
    COMPILING FUNCTIONAL PROGRAMMING CONSTRUCTS TO A LOGIC ENGINE by Harvey Abramson and Peter Ludemann Technical Report 86-24 November 1986 Compiling Functional Programming Constructs to a Logic Engine Harvey Abramson t and Peter Ltidemann:I: Department of Computer Science University of British Columbia Vancouver, B.C., Canada V6T 1W5 Copyright © 1986 Abstract In this paper we consider how various constructs used in functional programming can be efficiently translated to code for a Prolog engine (designed by Ltidemann) similar in spirit but not identical to the Warren machine. It turns out that this Prolog engine which contains a delay mechanism designed to permit co­ routining and sound implementation of negation is sufficient to handle all common functional programming constructs; indeed, such a machine has about the same efficiency as a machine designed specifically for a functional programming language. This machine has been fully implemented. t Present address: Department of Computer Science, Bristol University, Bristol, England . f Present address: IBM Canada Ltd., 1 Park Centre, 895 Don Mills Road, North York, Ontario, Canada M3C 1W3 The proposals for combining the two paradigms Compiling Functional Programming have been roughly classified in [BoGi86] as being Constructs to a Logic Engine either functional plus logic or logic plus functional. Harvey Abramson t and Peter Ltidemanni In the former approach, invertibility, nondeterminism Department of Computer Science and unification are added to some higher order functional language; in the latter approach, first-order University of British Columbia functions are added to a first-order logic with an Vancouver, B.C., Canada V6T lWS equality theory. We do not take any position as to Copyright© 1986 which approach is best, but since a logic machine already deals with unification, nondeterminism and invertibility, we have taken, from an implementation Abstract viewpoint, the logic plus functional approach.
    [Show full text]
  • Parameter Passing, Generics, Exceptions
    Lecture 9: Parameter Passing, Generics and Polymorphism, Exceptions COMP 524 Programming Language Concepts Stephen Olivier February 12, 2008 Based on notes by A. Block, N. Fisher, F. Hernandez-Campos, and D. Stotts The University of North Carolina at Chapel Hill Parameter Passing •Pass-by-value: Input parameter •Pass-by-result: Output parameter •Pass-by-value-result: Input/output parameter •Pass-by-reference: Input/output parameter, no copy •Pass-by-name: Effectively textual substitution The University of North Carolina at Chapel Hill 2 Pass-by-value int m=8, i=5; foo(m); print m; # print 8 proc foo(int b){ b = b+5; } The University of North Carolina at Chapel Hill 3 Pass-by-reference int m=8; foo(m); print m; # print 13 proc foo(int b){ b = b+5; } The University of North Carolina at Chapel Hill 4 Pass-by-value-result int m=8; foo(m); print m; # print 13 proc foo(int b){ b = b+5; } The University of North Carolina at Chapel Hill 5 Pass-by-name •Arguments passed by name are re-evaluated in the caller’s referencing environment every time they are used. •They are implemented using a hidden-subroutine, known as a thunk. •This is a costly parameter passing mechanism. •Think of it as an in-line substitution (subroutine code put in-line at point of call, with parameters substituted). •Or, actual parameters substituted textually in the subroutine body for the formulas. The University of North Carolina at Chapel Hill 6 Pass-by-name array A[1..100] of int; array A[1..100] of int; int i=5; int i=5; foo(A[i], i); foo(A[i]); print A[i]; #print A[6]=7
    [Show full text]
  • Appendix A: Compiler Porting Tools
    Appendix A: Compiler Porting Tools Vector Pascal is an open-source project. It aims to create a productive and efficient program development environment for SIMD programming. In order to validate the concepts it has been developed initially for the Intel family of processors running Linux and Microsoft Windows. However, it has been intended from the outset that the technology should be portable to other families of CPUs. This Appendix addresses some of the issues involved in porting the compiler to new systems. A.1 Dependencies The Vector Pascal compiler tool-set can be divided along two axes as shown in Figure A.l. 1. Tools can be divided into (a) those provided as part of the release and (b) those provided as part of the operating environment. (a) These are mainly written in Java, the exceptions being a small run-time library in C, a Pascal System unit and several machine descriptions. (b) These are all available as standard under Linux, and Windows versions are freely downloadable from the web. 2. Tools can further be divided into (a) those required for program prepara­ tion and documentation, (b) those for code translation tools and (c) those for code generator preparation. (a) The program preparation tools are the VIPER IDE described in Chapter 16, along with the standard IM_EX document preparation system, DVI viewers and the TTH tool to prepare web-enabled versions of Vector Pascal program descriptions. (b) The program translation tools are: i. The i l c g . p a s c a l Java package which contains the Pascal compiler itself and classes to support Pascal-type declarations.
    [Show full text]