Understanding ARC Instruction Formats and Data Processing in Assembly

itec 352 n.w
1 / 12
Embed
Share

Explore the key concepts of ARC instruction formats, data processing, and register usage in assembly language programming. Learn about ARC instruction layouts, PSR register functions, data formats, and pseudo-ops in detail. Get ready for Exam 1 with review questions and a basic overview of assembly structure and memory. Discover more about ARC instructions and their application in programming loops. Access additional resources for further study and practice.

  • Assembly language
  • ARC instructions
  • Data formats
  • Exam preparation
  • Programming loops

Uploaded on | 1 Views


Download Presentation

Please find below an Image/Link to download the presentation.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author. If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.

You are allowed to download the files provided on this website for personal or commercial use, subject to the condition that they are used lawfully. All files are the property of their respective owners.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author.

E N D

Presentation Transcript


  1. ITEC 352 Lecture 14 ISA(5)

  2. Review Questions? Exam 1 next Friday Assembly Assembler Basic structure Registers Memory ISA(5)

  3. Outline More assembly Instructions Structure Usage Intro to loops Textbook link http://www.mrkay.org/zenpc/ARCHMAN/ ISA(5)

  4. Instruction Format Every ARC instruction is 32 bits in length. For instance, the instruction below must fit within 32 bits when represented in binary. To do this, ARC enforces certain formats that allow us to use the 32 bits in different ways. These are called instruction formats. A format defines how the various bit fields of an instruction are laid out within 32 bits and how it is interpreted by the ARC control unit. ISA(5)

  5. ARC Instruction and PSR Formats ISA(5)

  6. PSR A register that is used to store results of instructions Not values If a result is 0 If a result is negative Carry bit (c) Overflow bit (v) ISA(5)

  7. Data Formats ISA(5)

  8. ARC Pseudo- Ops Pseudo-ops are instructions to the assembler. They are not part of the ISA. ISA(5)

  9. .org 3000 a_start: 3000 counter: 0 output: 0 Adding 5 integers a: 10 25 2 3 4 Variables for the program ld [a_start], %r1 ! Load the starting address of a into %r1 ld [counter], %r2 ! Register r2 is the counter. andcc %r3,%r0, %r3 ! What does this do? loop: subcc %r2, 5, %r0 ! Have we reached the end ? done ! If %r2 5 = 0, exit loop. addcc %r2, 1, %r2 ! Increment counter ld %r1, %r4 ! Load the number from the array addcc %r4, %r3, %r3 ! Accumulate sum into %r3. addcc %r1, 4, %r1 ! Goto next address ba loop done: st %r3, [output] jmpl %r15+4, %r0 be ISA(5)

  10. Summary Storage location for address of the array a. Having this location allows us to load the address 3000 into a register. Length is being used as a counter to determine when to end the loop. ISA(5)

  11. Other ARC instructions Software traps: Allows programs to invoke services from the OS/hardware, e.g., reading a keyboard or writing onto a display. ARC has trap instructions but they do not control the OS/hardware (due to JVM limitations). ISA(5)

  12. Summary Assembly programming 101 Different language, but still within same paradigm ISA(5)

Related


More Related Content