NASM — the Netwide Assembler

Total Page:16

File Type:pdf, Size:1020Kb

NASM — the Netwide Assembler NASM — The Netwide Assembler version 2.12.02 © 1996−2016 The NASM Development Team — All Rights Reserved This document is redistributable under the license given in the file "LICENSE" distributed in the NASM archive. Contents Chapter 1: Introduction . .16 1.1 What Is NASM? . .16 1.1.1 Why Yet Another Assembler?. .16 1.1.2 License Conditions . .16 1.2 Contact Information . .17 1.3 Installation. .17 1.3.1 Installing NASM under MS−DOS or Windows . .17 1.3.2 Installing NASM under Unix . .18 Chapter 2: Running NASM . .19 2.1 NASM Command−Line Syntax . .19 2.1.1 The −o Option: Specifying the Output File Name . .19 2.1.2 The −f Option: Specifying the Output File Format . .20 2.1.3 The −l Option: Generating a Listing File . .20 2.1.4 The −M Option: Generate Makefile Dependencies . .20 2.1.5 The −MG Option: Generate Makefile Dependencies . .20 2.1.6 The −MF Option: Set Makefile Dependency File . .20 2.1.7 The −MD Option: Assemble and Generate Dependencies. .21 2.1.8 The −MT Option: Dependency Target Name. .21 2.1.9 The −MQ Option: Dependency Target Name (Quoted) . .21 2.1.10 The −MP Option: Emit phony targets. .21 2.1.11 The −F Option: Selecting a Debug Information Format . .21 2.1.12 The −g Option: Enabling Debug Information. .21 2.1.13 The −X Option: Selecting an Error Reporting Format. .21 2.1.14 The −Z Option: Send Errors to a File. .22 2.1.15 The −s Option: Send Errors to stdout ............................22 2.1.16 The −i Option: Include File Search Directories . .22 2.1.17 The −p Option: Pre−Include a File. .23 2.1.18 The −d Option: Pre−Define a Macro. .23 2.1.19 The −u Option: Undefine a Macro . .23 3 2.1.20 The −E Option: Preprocess Only. .23 2.1.21 The −a Option: Don’t Preprocess At All . .24 2.1.22 The −O Option: Specifying Multipass Optimization . .24 2.1.23 The −t Option: Enable TASM Compatibility Mode . .24 2.1.24 The −w and −W Options: Enable or Disable Assembly Warnings . .24 2.1.25 The −v Option: Display Version Info . .26 2.1.26 The −y Option: Display Available Debug Info Formats . .26 2.1.27 The −−prefix and −−postfix Options. .26 2.1.28 The NASMENV Environment Variable . .26 2.2 Quick Start for MASM Users . .26 2.2.1 NASM Is Case−Sensitive . .26 2.2.2 NASM Requires Square Brackets For Memory References . .27 2.2.3 NASM Doesn’t Store Variable Types . .27 2.2.4 NASM Doesn’t ASSUME ....................................27 2.2.5 NASM Doesn’t Support Memory Models . .28 2.2.6 Floating−Point Differences . .28 2.2.7 Other Differences . .28 Chapter 3: The NASM Language . .29 3.1 Layout of a NASM Source Line . .29 3.2 Pseudo−Instructions . .30 3.2.1 DB and Friends: Declaring Initialized Data . .30 3.2.2 RESB and Friends: Declaring Uninitialized Data . .30 3.2.3 INCBIN: Including External Binary Files . .31 3.2.4 EQU: Defining Constants . .31 3.2.5 TIMES: Repeating Instructions or Data . .31 3.3 Effective Addresses . .32 3.4 Constants . .33 3.4.1 Numeric Constants . .33 3.4.2 Character Strings . .34 3.4.3 Character Constants. .35 3.4.4 String Constants . .35 3.4.5 Unicode Strings. .35 3.4.6 Floating−Point Constants . .35 4 3.4.7 Packed BCD Constants . .37 3.5 Expressions . .37 3.5.1 |: Bitwise OR Operator. .37 3.5.2 ^: Bitwise XOR Operator . .37 3.5.3 &: Bitwise AND Operator . .37 3.5.4 << and >>: Bit Shift Operators . .37 3.5.5 + and −: Addition and Subtraction Operators . .37 3.5.6 *, /, //, % and %%: Multiplication and Division. .38 3.5.7 Unary Operators . .38 3.6 SEG and WRT ............................................38 3.7 STRICT: Inhibiting Optimization . .39 3.8 Critical Expressions . .39 3.9 Local Labels. .39 Chapter 4: The NASM Preprocessor . .41 4.1 Single−Line Macros . .41 4.1.1 The Normal Way: %define ..................................41 4.1.2 Resolving %define: %xdefine ...............................42 4.1.3 Macro Indirection: %[...] ..................................43 4.1.4 Concatenating Single Line Macro Tokens: %+..........................43 4.1.5 The Macro Name Itself: %? and %?? ..............................44 4.1.6 Undefining Single−Line Macros: %undef ...........................44 4.1.7 Preprocessor Variables: %assign ...............................44 4.1.8 Defining Strings: %defstr ..................................45 4.1.9 Defining Tokens: %deftok ..................................45 4.2 String Manipulation in Macros . .45 4.2.1 Concatenating Strings: %strcat ................................45 4.2.2 String Length: %strlen ....................................46 4.2.3 Extracting Substrings: %substr ................................46 4.3 Multi−Line Macros: %macro ....................................46 4.3.1 Overloading Multi−Line Macros . .47 4.3.2 Macro−Local Labels . .48 4.3.3 Greedy Macro Parameters. .48 4.3.4 Macro Parameters Range . .49 5 4.3.5 Default Macro Parameters . .50 4.3.6 %0: Macro Parameter Counter. .51 4.3.7 %00: Label Preceeding Macro . .51 4.3.8 %rotate: Rotating Macro Parameters . .51 4.3.9 Concatenating Macro Parameters . .52 4.3.10 Condition Codes as Macro Parameters . .53 4.3.11 Disabling Listing Expansion . .53 4.3.12 Undefining Multi−Line Macros: %unmacro..........................53 4.4 Conditional Assembly . .54 4.4.1 %ifdef: Testing Single−Line Macro Existence. .54 4.4.2 %ifmacro: Testing Multi−Line Macro Existence . .55 4.4.3 %ifctx: Testing the Context Stack. .55 4.4.4 %if: Testing Arbitrary Numeric Expressions . .55 4.4.5 %ifidn and %ifidni: Testing Exact Text Identity . .56 4.4.6 %ifid, %ifnum, %ifstr: Testing Token Types . ..
Recommended publications
  • Beyond MOV ADD XOR – the Unusual and Unexpected
    Beyond MOV ADD XOR the unusual and unexpected in x86 Mateusz "j00ru" Jurczyk, Gynvael Coldwind CONFidence 2013, Kraków Who • Mateusz Jurczyk o Information Security Engineer @ Google o http://j00ru.vexillium.org/ o @j00ru • Gynvael Coldwind o Information Security Engineer @ Google o http://gynvael.coldwind.pl/ o @gynvael Agenda • Getting you up to speed with new x86 research. • Highlighting interesting facts and tricks. • Both x86 and x86-64 discussed. Security relevance • Local vulnerabilities in CPU ↔ OS integration. • Subtle CPU-specific information disclosure. • Exploit mitigations on CPU level. • Loosely related considerations and quirks. x86 - introduction not required • Intel first ships 8086 in 1978 o 16-bit extension of the 8-bit 8085. • Only 80386 and later are used today. o first shipped in 1985 o fully 32-bit architecture o designed with security in mind . code and i/o privilege levels . memory protection . segmentation x86 - produced by... Intel, AMD, VIA - yeah, we all know these. • Chips and Technologies - left market after failed 386 compatible chip failed to boot the Windows operating system. • NEC - sold early Intel architecture compatibles such as NEC V20 and NEC V30; product line transitioned to NEC internal architecture http://www.cpu-collection.de/ x86 - other manufacturers Eastern Bloc KM1810BM86 (USSR) http://www.cpu-collection.de/ x86 - other manufacturers Transmeta, Rise Technology, IDT, National Semiconductor, Cyrix, NexGen, Chips and Technologies, IBM, UMC, DM&P Electronics, ZF Micro, Zet IA-32, RDC Semiconductors, Nvidia, ALi, SiS, GlobalFoundries, TSMC, Fujitsu, SGS-Thomson, Texas Instruments, ... (via Wikipedia) At first, a simple architecture... At first, a simple architecture... x86 bursted with new functions • No eXecute bit (W^X, DEP) o completely redefined exploit development, together with ASLR • Supervisor Mode Execution Prevention • RDRAND instruction o cryptographically secure prng • Related: TPM, VT-d, IOMMU Overall..
    [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]
  • NASM — the Netwide Assembler Version 2.09.04
    NASM — The Netwide Assembler version 2.09.04 -~~..~:#;L .-:#;L,.- .~:#:;.T -~~.~:;. .~:;. E8+U *T +U' *T# .97 *L E8+' *;T' *;, D97 `*L .97 '*L "T;E+:, D9 *L *L H7 I# T7 I# "*:. H7 I# I# U: :8 *#+ , :8 T, 79 U: :8 :8 ,#B. .IE, "T;E* .IE, J *+;#:T*" ,#B. .IE, .IE, © 1996−2010 The NASM Development Team — All Rights Reserved This document is redistributable under the license given in the file "LICENSE" distributed in the NASM archive. Contents Chapter 1: Introduction . .15 1.1 What Is NASM? . .15 1.1.1 Why Yet Another Assembler?. .15 1.1.2 License Conditions . .15 1.2 Contact Information . .16 1.3 Installation. .16 1.3.1 Installing NASM under MS−DOS or Windows . .16 1.3.2 Installing NASM under Unix . .17 Chapter 2: Running NASM . .18 2.1 NASM Command−Line Syntax . .18 2.1.1 The −o Option: Specifying the Output File Name . .18 2.1.2 The −f Option: Specifying the Output File Format . .19 2.1.3 The −l Option: Generating a Listing File . .19 2.1.4 The −M Option: Generate Makefile Dependencies . .19 2.1.5 The −MG Option: Generate Makefile Dependencies . .19 2.1.6 The −MF Option: Set Makefile Dependency File . .19 2.1.7 The −MD Option: Assemble and Generate Dependencies. .19 2.1.8 The −MT Option: Dependency Target Name. .20 2.1.9 The −MQ Option: Dependency Target Name (Quoted) . .20 2.1.10 The −MP Option: Emit phony targets. .20 2.1.11 The −F Option: Selecting a Debug Information Format .
    [Show full text]
  • User's Manual
    User’s Manual P/N 064673-004 ® JANUS 2.4 GHz Installation Utility (4MB) Intermec Technologies Corporation 6001 36th Avenue West P.O. Box 4280 Everett, WA 98203-9280 U.S. service and technical support: 1-800-755-5505 U.S. media supplies ordering information: 1-800-227-9947 Canadian service and technical support: 1-800-688-7043 Canadian media supplies ordering information: 1-800-268-6936 Outside U.S. and Canada: Contact your local Intermec service supplier. The information contained herein is proprietary and is provided solely for the purpose of allowing customers to operate and/or service Intermec manufactured equipment and is not to be released, reproduced, or used for any other purpose without written permission of Intermec. Information and specifications in this manual are subject to change without notice. 1998 by Intermec Technologies Corporation All Rights Reserved The word Intermec, the Intermec logo, JANUS, IRL, TRAKKER, Antares, Duratherm, Precision Print, PrintSet, Virtual Wedge, and CrossBar are either trademarks or registered trademarks of Intermec Corporation. Throughout this manual, trademarked names may be used. Rather than put a trademark () symbol in every occurrence of a trademarked name, we state that we are using the names only in an editorial fashion, and to the benefit of the trademark owner, with no intention of infringement. Manual Change Record This page records the changes to this manual, which was originally released as version 001. Version Date Description of Change 002 12/96 New information was added for the JG2050 and for UDP Plus terminal emulation. 003 9/97 New information was added to describe using the installation utility on a JG2010.
    [Show full text]
  • On Improving Cybersecurity Through Memory Isolation Using Systems Management Mode
    On Improving Cybersecurity Through Memory Isolation Using Systems Management Mode A thesis submitted for the degree of Doctor of Philosophy James Andrew Sutherland School of Design and Informatics University of Abertay Dundee August 2018 i Abstract This thesis describes research into security mechanisms for protecting sensitive areas of memory from tampering or intrusion using the facilities of Systems Man- agement Mode. The essence and challenge of modern computer security is to isolate or contain data and applications in a variety of ways, while still allowing sharing where desir- able. If Alice and Bob share a computer, Alice should not be able to access Bob’s passwords or other data; Alice’s web browser should not be able to be tricked into sending email, and viewing a social networking web page in that browser should not allow that page to interact with her online banking service. The aim of this work is to explore techniques for such isolation and how they can be used usefully on standard PCs. This work focuses on the creation of a small dedicated area to perform cryp- tographic operations, isolated from the rest of the system. This is a sufficiently useful facility that many modern devices such as smartphones incorporate dedic- ated hardware for this purpose, but other approaches have advantages which are discussed. As a case study, this research included the creation of a secure web server whose encryption key is protected using this approach such that even an intruder with full Administrator level access cannot extract the key. A proof of concept backdoor which captures and exfiltrates encryption keys using a modified processor wasalso demonstrated.
    [Show full text]
  • NASM — the Netwide Assembler
    NASM — The Netwide Assembler version 2.10.09 © 1996−2012 The NASM Development Team — All Rights Reserved This document is redistributable under the license given in the file "LICENSE" distributed in the NASM archive. Contents Chapter 1: Introduction . .16 1.1 What Is NASM? . .16 1.1.1 Why Yet Another Assembler?. .16 1.1.2 License Conditions . .16 1.2 Contact Information . .17 1.3 Installation. .17 1.3.1 Installing NASM under MS−DOS or Windows . .17 1.3.2 Installing NASM under Unix . .18 Chapter 2: Running NASM . .19 2.1 NASM Command−Line Syntax . .19 2.1.1 The −o Option: Specifying the Output File Name . .19 2.1.2 The −f Option: Specifying the Output File Format . .20 2.1.3 The −l Option: Generating a Listing File . .20 2.1.4 The −M Option: Generate Makefile Dependencies . .20 2.1.5 The −MG Option: Generate Makefile Dependencies . .20 2.1.6 The −MF Option: Set Makefile Dependency File . .20 2.1.7 The −MD Option: Assemble and Generate Dependencies. .21 2.1.8 The −MT Option: Dependency Target Name. .21 2.1.9 The −MQ Option: Dependency Target Name (Quoted) . .21 2.1.10 The −MP Option: Emit phony targets. .21 2.1.11 The −F Option: Selecting a Debug Information Format . .21 2.1.12 The −g Option: Enabling Debug Information. .21 2.1.13 The −X Option: Selecting an Error Reporting Format. .21 2.1.14 The −Z Option: Send Errors to a File. .22 2.1.15 The −s Option: Send Errors to stdout ............................22 2.1.16 The −i Option: Include File Search Directories .
    [Show full text]
  • The Netwide Assembler
    NASM – The Netwide Assembler version 2.15.05rc1 © 1996-2020 The NASM Development Team — All Rights Reserved This document is redistributable under the license given in the section "License". Contents Chapter 1: Introduction . 17 1.1 What Is NASM?. 17 1.1.1 License . 17 Chapter 2: Running NASM . 19 2.1 NASM Command-Line Syntax . 19 2.1.1 The -o Option: Specifying the Output File Name . 19 2.1.2 The -f Option: Specifying the Output File Format . 20 2.1.3 The -l Option: Generating a Listing File . 20 2.1.4 The -L Option: Additional or Modified Listing Info . 20 2.1.5 The -M Option: Generate Makefile Dependencies . 21 2.1.6 The -MG Option: Generate Makefile Dependencies . 21 2.1.7 The -MF Option: Set Makefile Dependency File . 21 2.1.8 The -MD Option: Assemble and Generate Dependencies . 21 2.1.9 The -MT Option: Dependency Target Name . 21 2.1.10 The -MQ Option: Dependency Target Name (Quoted) . 21 2.1.11 The -MP Option: Emit phony targets . 21 2.1.12 The -MW Option: Watcom Make quoting style . 21 2.1.13 The -F Option: Selecting a Debug Information Format . 22 2.1.14 The -g Option: Enabling Debug Information. 22 2.1.15 The -X Option: Selecting an Error Reporting Format . 22 2.1.16 The -Z Option: Send Errors to a File . 22 2.1.17 The -s Option: Send Errors to stdout ...........................22 2.1.18 The -i Option: Include File Search Directories . 23 2.1.19 The -p Option: Pre-Include a File .
    [Show full text]
  • Writing OS/2 Warp Device Drivers in C Third Edition 2
    1 Tuesday, May 06, 1997 Writing OS/2 Warp Device Drivers in C Third Edition 2 Disclaimer This book and software are provided -as is.' The implied warranties of merchantability and fitness for a particular purpose are expressly disclaimed. This book and software may contain programs that are furnished as examples. These examples have not been thoroughly tested under all conditions. Therefore, the reliability, serviceability, or function of any program or program code herein is not guaranteed. The information presented in this book was valid at the time it was written and was conveyed as accurately as possible by the author. However, some information may be incorrect or may have changed prior to publication. The author makes no claims that the material contained in this book is entirely correct, and assumes no liability for use of the material contained herein. 3 Trademarks and Copyrights IBM, AT, OS/2, Personal System/2, PS/2, and Micro Channel are registered trademarks of the International Business Machines Corporation. C/2, XT, and Presentation Manager are trademarks of International Business Machines Corporation. Intel is a registered trademark of the Intel Corporation. Lotus 1-2-3 is a registered trademark of Lotus Development Corporation. MS-DOS, CodeView and Microsoft are registered trademarks of Microsoft Corporation. Microsoft and Microsoft Windows are registered trademarks of Microsoft Corporation. UNIX is a registered trademark of AT&T Bell Laboratories. Copyright 1993 by Van Nostrand Reinhold Library of Congress Catalog Card Number 93-2264 ISBN 0-442-01729-4 All rights reserved. No part of this work covered by the copyright hereon may be reproduced or used in any form or by any means-graphic, electronic, or mechanical, including photocopying, recording, taping, or information storage and retrieval systems-without written permission of the publisher.
    [Show full text]
  • EXTENDING DOS a Programmers's Guide to Protected-Mode DOS Second Edition
    EXTENDING DOS A Programmers's Guide to Protected-Mode DOS Second Edition Edited by Ray Duncan Ray Duncan Charles Petzold Andrew Schulman M. Steven Baker Ross P. Nelson Stephen R. Davis Robert Moote Addison-Wesley Publishing Company, Inc. Reading, Massachusetts Menlo Park, California New York Don Mills, Ontario Wokingham, England Amsterdam Bonn Sydney Singapore Tokyo Madrid San Juan Paris Seoul Milan Mexico City Taipei Chapter 1—Programming the IBM PC j By Ross P. Nelson DOS Lives -i The Quest for RAM 2 The IBM PC Architecture 5 A New Family Member 7 Solving Real Problems IQ Using Protected Mode 25 DOS Extenders 23 Intel's 32-bit Microprocessors 24 Operating Environments 3Q What About OS/2? 31 Choosing Your Market 32 Chapter 2—Expanded Memory and the EMS 35 By Ray Duncan Components of Expanded Memory 37 Obtaining Access to Expanded Memory 40 Using Expanded Memory 44 EMS Pitfalls for Drivers and TSRs 49 EMS Emulators 52 EMS Example Program 54 Chapter 3—Extended Memory and the XMS 75 By Ray Duncan Reaching Extended Memory in Real Mode 78 The ROM BIOS Extended Memory Functions 79 Primitive Extended Memory Management 85 The eXtended Memory Specification (XMS) EXTENDING DOS, Second Edition Programming Example: The XMSDISK.SYS Driver 96 XMS Example Program 97 LOADALL: The Back Door to Extended Memory 116 Chapter 4—16-bit Protected-Mode DOS Extenders 121 By Andrew Schulman 123 Isn't the 286 Outdated? 124 DOS: The Outer Limits Protected-Mode MS-DOS ^7 No More Overlays BigMalloc Protected-Mode C++ Creating the Illusion 143 INT 21h Isn't Enough 146 The RUN286 Loader 150 Compatibility 153 Debugging with CVP and TDW under DOS 159 Isn't There Any Work Involved? 162 Bugs! 164 Real-Mode Practices 173 Limits to Transparency 188 New Features 191 Benefits and Limitations 295 Chapter 5—32-bit Protected-Mode DOS Extenders By M.
    [Show full text]
  • Protected Mode Registers As Universal Registers, Avoiding Any Interrupts, Employing the Wait-State for Other Than Its Intended Purpose, and So On
    PROTE CTE D he air-to-surface battle of 1991 demonstrated once again that among postmodern strategies of appearance, none is as effective as the simulation that there really is software. Until the proof to the contrary on the field of combat—where computers unambiguously revealed themselves as hardware for the destruction of Iraqi hardware (as durable goods are still called in everyday English)—advertising brochures and media conferences spread the fairytale of a development of software that would become increas- ingly more innocuous and user-friendly, more spiritual and intelli- gent, until one day in the not so distant future it would effectively lead to German idealism—that is, it would become human. And that is why software, the billion-dollar enterprise out of one of the cheapest elements on Earth, makes every attempt to prevent the aforenamed humans from ever even coming into contact with the corresponding hardware. With Word 5.0 on a no-name AT 386 and (as one so nicely says) under the operating system Microsoft DOS 3.3, one can write entire essays on precisely these three entities without even suspecting the strategy of appearance. For one writes—the 'under' says it already—as a subject or underling of the Microsoft Corporation. This worm's-eye view did not always prevail. In the good old days when microprocessor pins were still big enough for simple sol- dering irons, even literary critics could do whatever they wished with Intel's 8086 Processor. Even standard chips, which at that time still required one hundred thirty-three cycles for the multiplication of a single whole number, could be raised to the processing speed of primitive signal processors through a variety of strategies: not dif- ferentiating between RAM and ROM, misusing both of the stack 156 Protected Mode registers as universal registers, avoiding any interrupts, employing the wait-state for other than its intended purpose, and so on.
    [Show full text]
  • ||||||||IIIHIIII O USOO544551A United States Patent (19) 11) Patent Number: 5,144,551 Cepulis (45) Date of Patent: Sep
    ||||||||IIIHIIII o USOO544551A United States Patent (19) 11) Patent Number: 5,144,551 Cepulis (45) Date of Patent: Sep. 1, 1992 (54) COMPUTER MEMORY MANAGEMENT METHOD UTILIZING SEGMENTATION OTHER PUBLICATIONS AND PROTECTION TECHNIQUES Oct. 20, 1988 Intel Corporation letter and attachments from Ms. S. Roach regarding emulating 286 Loadall 75)75 InventorI : Darrenen J. Cepulis, Houston,s Tex instruction. Attachments include suggested code for (73) Assignee: Compaq Computer Corporation, emulation. Houston, Tex. Microprocessor and peripheral handbook, vol. I, Intel (21) Appl. No.: 714,552 Corp. 1988, pp. 4-121-4-127. e J. Crawford, P. Gelsinger, Programming the 80386, (22 Filed: Jun. 13, 1991 Sybex, 1987, pp. 54-59, 431-477, 488-489, 644-646. Related U.S. Application Data Primary Examiner-Kevin A. Kriess Attorney, Agent, or Firm-Pravel, Gambrell, Hewitt, 63) Continuation of Ser. No. 354,144, May 19, 1989, aban- Kimball & Krieger doned. ABST 5) Int. C. .............................................. G06F 12/00 (57)7 RAct 52) U.S. C. ............................. 395/425; 364/DIG. 1; A method for managing memory in a computer system 364/232.9, 364/246.6, 364/246.7:364/247; utilizing Intel Corporation's method of segmentation, 364/247.3; 364/247.2; 364/243; 364/243.4; memory management and protection techniques. The 364/243.41; 364/255.7; 364/255.1; 364/254.8; method is directed toward loading all computer regis 364/264; 364/264. 1; 364/DIG. 1; 395/650; ters and segment descriptor tables from a table of pre 395/700 stored values in memory while operating in real mode.
    [Show full text]
  • Dynamic Re-Compilation of Binary RISC Code for CISC Architectures
    d d d d d d d d d d d d d d d d d d d d Technische Universitat¨ Munchen¨ Institut fur¨ Informatik Diplomarbeit Dynamic Re-compilation of Binary RISC Code for CISC Architectures Verfasser: Michael Steil Betreuer: Dr. Georg Acher Aufgabensteller: Prof. Dr. A.Bode Abgabetermin: 15. September 2004 Ich versichere, daß ich diese Diplomarbeit selbstandig¨ verfaßt und keine anderen als die angegebenen Quellen und Hilfsmittel verwendet habe. Munchen,¨ den 15.09.2004 Abstract This thesis describes a dynamic binary translation system that has the following features: • RISC (PowerPC) machine code is translated into CISC (i386) code. Special prob- lems caused by this combination, such as register allocation and condition code con- version, are addressed. • A modified hotspot method is used to do recompilation in two translation passes in order to gain speed. • The first translation pass is optimized for maximum translation speed and designed to be only slightly slower than one interpretive run. • The system optimizes common cases found in compiled user mode code, such as certain stack operations. The idea of this system is not to develop a high-level decompiler/compiler combination, but to do translation on a very low level and on an instruction basis. The recompiler that has been developed contains • recompiler technology that only needs about 25% more time per instruction for trans- lation compared to a single interpretation, and produces code that is only 3 to 4 times slower than native code. • recompiler technology that only needs about double the time per instruction for trans- lation compared to a single interpretation, and produces code that only takes twice as long for execution as native code.
    [Show full text]