TAILIEUCHUNG - Lecture Introduction to computing systems: Chapter Introduction to Part II - Yale N. Patt, Sanjay J. Patel

After studying this lecture you will be able to understand: Higher level languages, translation, variables, activation records, function calls, returning from a call. | Introduction to Part II HLL Structures Variables Activation records Higher Level Languages HLLs allow symbolic naming of variables After mastering Assemly, you can now appreciate what a luxury this is! HLLs provide expressiveness Compare an if statement to a conditional Branch instruction! HLLs abstract from the underlying hardware While each microprocessor has its own ISA, HLL code is usually portable between many different platforms etc., etc. Pt. II - Translation HLL code has to be translated into the ISA of each machine it runs on: Interpretation: The HLL code is simply a set of commands for a program called an interpreter, which is a virtual machine that translates the HLL code a piece at a time into Machine Language, executes it on the spot, then goes back for another piece. Both the HLL source code and the interpreter are required every time the program is run. Compilation The HLL code is translated into an entire ML program (an executable image) by a program called a compiler. Only the executable image is needed to run the program. Most application software is sold in this form. Pt. II - Variables Symbolic names for variables The compiler creates a symbol table which holds information about each variable: Identifier (name), data type, memory location (as an offset from a “frame pointer”), scope, etc. Suppose a variable “seconds” has been assigned an offset of -5 from the frame pointer, which is maintained in R5: then we can access seconds by the Base+Offset addressing mode: LDR R0, R5, # -5 . each reference to the variable seconds is translated by the compiler to (R5) - 5 We have finally found a use for the offset in LDR! Pt. II - Activation Records A Record A collection of contiguous memory locations treated as one entity The struct construct in C/C++ describes a record Activation Record Is allocated for each function invocation in memory The area of memory where activation records are allocated is called the stack memory or run-time stack .

TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.