• locations in main memory to be referenced by descriptive names rather than by numeric addresses


    Computer Science An Overview _J. Glenn Brookshear _11th Edition

    Chapter 6 Programming Languages

    As suggested in Section 6.1, high-level programming languages allow locations in main memory to be referenced by descriptive names rather than by numeric addresses. Such a name is known as a variable, in recognition of the fact that by changing the value stored at the location, the value associated with the name changes as the program executes.

    --

    Early Generations

    As we learned in Chapter 2, programs for modern computers consist of sequences of instructions that are encoded as numeric digits. Such an encoding system is known as a machine language. Unfortunately, writing programs in a machine language is a tedious task that often leads to errors that must be located and corrected (a process known as debugging) before the job is finished.

    In the 1940s, researchers simplified the programming process by developing notational systems by which instructions could be represented in mnemonic rather than numeric form.

    For example, the instruction

    Move the contents of register 5 to register 6

    would be expressed as

    4056

    using the machine language introduced in Chapter 2, whereas in a mnemonic system it might appear as

    MOV R5, R6.

    As a more extensive example, the machine language routine

    156C

    166D

    5056

    306E

    C000

    which adds the contents of memory cells 6C and 6D and stores the result at location 6E (Figure 2.7 of Chapter 2) might be expressed as

    LD R5,Price

    LD R6,ShippingCharge

    ADDI R0,R5 R6

    ST R0,TotalCost

    HLT

    using mnemonics. (Here we have used LD, ADDI, ST, and HLT to represent load, add, store, and halt. Moreover, we have used the descriptive names Price, ShippingCharge, and TotalCost to refer to the memory cells at locations 6C, 6D, and 6E, respectively. Such descriptive names are often called identifiers.)

    Once such a mnemonic system was established, programs called assemblers were developed to convert mnemonic expressions into machine language instructions. Thus, rather than being forced to develop a program directly in machine language, a human could develop a program in mnemonic form and then have it converted into machine language by means of an assembler.

    A mnemonic system for representing programs is collectively called an assembly language. At the time assembly languages were first developed, they represented a giant step forward in the search for better programming techniques. In fact, assembly languages were so revolutionary that they became known as second-generation languages, the first generation being the machine languages themselves.

    --programming languages - assembly language - identifiers -  mnemonic - 

  • 相关阅读:
    用C++实现网络编程---抓取网络数据包的实现方法
    UNICODE字符串与多字节字符串的转换
    MFC ComboBox的使用
    Windows API学习---线程与内核对象的同步
    Windows API学习---用户方式中的线程同步
    MFC读取XML文件并解析
    Windows API学习---插入DLL和挂接API
    常用[js,css,jquery,html]
    JDBC链接MySQL和Oracle
    使用.NET MVC框架项目开发流程(项目开发流程)
  • 原文地址:https://www.cnblogs.com/rsapaper/p/6042561.html
Copyright © 2020-2023  润新知