Assembly Language Part 1 cs princeton edu

Assembly Language Part 1 Cs Princeton Edu-Free PDF

  • Date:17 Nov 2020
  • Views:3
  • Downloads:0
  • Pages:57
  • Size:679.96 KB

Share Pdf : Assembly Language Part 1 Cs Princeton Edu

Download and Preview : Assembly Language Part 1 Cs Princeton Edu


Report CopyRight/DMCA Form For : Assembly Language Part 1 Cs Princeton Edu


Transcription:

Context of this Lecture, First half of the semester Programming in the large. Second half Under the hood,Starting Now Later,C Language Application Program. language service,Assembly Language levels Operating System levels. Machine Language Hardware,Lectures vs Precepts,Approach to studying assembly language. Lectures Precepts,Study partial pgms Study complete pgms.
Begin with simple constructs Begin with small pgms. proceed to complex ones proceed to large ones,Emphasis on reading code Emphasis on writing code. Language Levels,Architecture,Assembly Language Performing Arithmetic. Assembly Language Load Store and Defining Global Data. High Level Languages,Characteristics count 0,Portable while n 1. To varying degrees count,One statement can do,much work good ratio of n n 3 1. functionality to code size else,Human readable n n 2.
Structured if for,Machine Languages,0000 0000 0000 0000 0000 0000 0000 0000. Characteristics 0000 0000 0000 0000 0000 0000 0000 0000. 9222 9120 1121 A120 1121 A121 7211 0000, Not portable 0000 0001 0002 0003 0004 0005 0006 0007. Specific to hardware 0008 0009 000A 000B 000C 000D 000E 000F. 0000 0000 0000 FE10 FACE CAFE ACED CEDE,Each instruction does a. simple task poor ratio of 1234 5678 9ABC DEF0 0000 0000 F00D 0000. functionality to code size 0000 0000 EEEE 1111 EEEE 1111 0000 0000. B1B2 F1F5 0000 0000 0000 0000 0000 0000,Not human readable. Not structured,Requires lots of effort,Requires tool support.
Assembly Languages,Characteristics,Not portable cmp w0 1. ble endloop,Each assembly lang,add w0 w0 1,instruction maps to one ands wzr w0 1. machine lang instruction beq else,Simple add w2 w0 w0. add w0 w0 w2,Each instruction does a add w0 w0 1,simple task b endif. Human readable asr w0 w0 1,In the same sense that Polish is.
human readable if you know Polish endif,Why Learn Assembly Language. Q Why learn assembly language,A Knowing assembly language helps you. Write faster code,In assembly language,In a high level language. Write safer code, Understanding mechanism of potential security problems. helps you avoid them even in high level languages,Understand what s happening under the hood.
Someone needs to develop future computer systems,Maybe that will be you. Become more comfortable with levels of abstraction. Become a better programmer,Why Learn ARM Assembly Lang. Why learn ARMv8 a k a AARCH64 assembly language, ARM is the most widely used processor in the world in your phone. in your Chromebook in the internet of things Armlab. ARM has a modern and relatively elegant instruction set. compared to the big and ugly x86 64 instruction set. x86 64 dominates the desktop laptop for now, but there are rumors that Apple is going to shift Macs to ARM. Language Levels,Architecture,Assembly Language Performing Arithmetic.
Assembly Language Load Store and Defining Global Data. John Von Neumann 1903 1957,In computing,Stored program computers. Cellular automata,Self replication,Other interests. Mathematics,Inventor of game theory,Nuclear physics hydrogen bomb. Princeton connection,Princeton Univ IAS 1930 1957,Known for Von Neumann architecture 1950. In which programs are just data in the memory,Contrast to the now obsolete Harvard architecture.
Von Neumann Architecture,Instructions encoded within words CPU. are fetched from RAM Control,Control unit interprets instructions. to shuffle data between,registers and RAM,to move data from registers to. ALU arithmetic logic unit,where operations are performed. Von Neumann Architecture,RAM Random Access Memory CPU.
Conceptually large array of bytes Control,gigabytes in modern machines Unit. Contains data,program variables structs arrays,and the program Registers. Instructions are fetched from RAM,Von Neumann Architecture. Registers CPU,Small amount of storage on the CPU Control. tens of words in modern machines Unit,Much faster than RAM.
Top of the storage hierarchy,above RAM disk etc Registers. ALU arithmetic logic unit instructions,operate on registers Data bus. Registers and RAM,Typical pattern,Load data from RAM to registers. Manipulate data in registers,Store data from registers to RAM. On AARCH64 this pattern is enforced, Manipulation instructions can only access registers.
This is known as a Load store architecture, Characteristic of RISC Reduced Instruction Set Computer vs. CISC Complex Instruction Set Computer architectures e g x86. In assembly language In a high level language Write safer code Understanding mechanism of potential security problems helps you avoid them even in high level languages Understand what s happening under the hood Someone needs to develop future computer systems Maybe that will be you

Related Books