SCC.131: ARM Assembly Serialization

Choose a study mode

Play Quiz
Study Flashcards
Spaced Repetition
Chat to Lesson

Podcast

Play an AI-generated podcast conversation about this lesson

Questions and Answers

______ is the most basic unit of computer processing.

Instruction

Instructions are words in the ______ of a computer.

language

______ (ISA) is the vocabulary.

Instruction Set Architecture

______: Computer-readable representation (that is, O's and 1's).

<p>Machine language</p> Signup and view all the answers

Computer-readable representation is also known as ______ Language.

<p>Machine</p> Signup and view all the answers

______: Human-readable representation

<p>Assembly language</p> Signup and view all the answers

We will study ______ (in detail).

<p>ARM</p> Signup and view all the answers

Principles are similar in all ISAs (x86, SPARC, RISC-V, ______).

<p>etc</p> Signup and view all the answers

______, #include directives, #xxxx statements.

<p>Macros</p> Signup and view all the answers

The output of Preprocessor: "pure" ______ code.

<p>C</p> Signup and view all the answers

______ transforms C into assembly code.

<p>Compiler</p> Signup and view all the answers

Assembly code is not machine code: still ______.

<p>human-readable</p> Signup and view all the answers

Compiler is Dependent on ______ architecture.

<p>machine</p> Signup and view all the answers

______ creates machine code, stored in an object file.

<p>Assembler</p> Signup and view all the answers

______ Combines several object files together.

<p>Linker</p> Signup and view all the answers

The assembler converts each instruction into a ______ bit representation.

<p>16/32</p> Signup and view all the answers

Each binary instruction contains Instruction, Registers and ______ values.

<p>immediate</p> Signup and view all the answers

______ M3 supports ARM T32 and Thumb-2 (thumb by default).

<p>ARM-Cortex</p> Signup and view all the answers

The three MIPS instruction types covered were Register, Jump and ______ types.

<p>Immediate</p> Signup and view all the answers

For the ARM instruction ADD{S}.W <Rd>, <Rn>, <Rm>{, }, the ______ is unique for each instruction.

<p>instruction opcode</p> Signup and view all the answers

The ARM Data processing instruction allows for condition flags, when the ______ is set.

<p>suffix</p> Signup and view all the answers

When using the ARM data processing instruction, the rotation applied to Imm leverages parameters defined in ______.

<p>Rotate</p> Signup and view all the answers

According to ______, it is easier to speed up the CPU than the memory.

<p>Moore's Law</p> Signup and view all the answers

Off-chip memory (SRAM) is ______ than on-chip memory (M1,M2 cache).

<p>slower</p> Signup and view all the answers

Flash is slower to ______ than RAM.

<p>read or write</p> Signup and view all the answers

For high performance systems, one can ______ instruction set size to reduce instruction bandwidth needed.

<p>change</p> Signup and view all the answers

Microbit directly uses ______ instructions in thumb state.

<p>Thumb</p> Signup and view all the answers

In ARM assembly, if the value of bits ______ of the instruction is one of the following (0b11101, 0b11110, 0b11111), the instruction is 32-bits long.

<p>[15:11]</p> Signup and view all the answers

Thumb reduces program memory size and ______ requirements.

<p>bandwidth</p> Signup and view all the answers

The ARMv4 32-bit system provides ______ registers.

<p>16</p> Signup and view all the answers

Flashcards

Instruction

The most basic unit of computer processing.

Instructions

Words in the language of a computer.

Instruction Set Architecture (ISA)

The vocabulary that is available.

Machine language

Computer-readable representation (that is, 0's and 1's).

Signup and view all the flashcards

Assembly language

Human-readable representation of machine code

Signup and view all the flashcards

Preprocessor

Macros, #include directives. Output: "pure" C code.

Signup and view all the flashcards

Compiler

Transforms C into assembly code.

Signup and view all the flashcards

Assembler

Creates machine code, stored in an object file.

Signup and view all the flashcards

Linker

Combines several object files together.

Signup and view all the flashcards

The assembler

Converts each instruction into a 16/32-bit representation.

Signup and view all the flashcards

Assembly

Assembly-level code

Signup and view all the flashcards

Machine code

Result of the assembler

Signup and view all the flashcards

R-type

Register type instructions

Signup and view all the flashcards

I-type

Immediate type instructions

Signup and view all the flashcards

J-type

Jump type instructions

Signup and view all the flashcards

Thumb code

Thumb reduces program memory size and bandwith requirements

Signup and view all the flashcards

recoding to smaller code

Subset of instructions recoded into fewer bits.

Signup and view all the flashcards

Thumb-2

Adds some 32-bit instructions, faster, low memory overhead

Signup and view all the flashcards

Thumb code in context?

MicroBit uses thumb instructions.

Signup and view all the flashcards

CPU Streaming

The CPU Control Unit Instructions as Stream

Signup and view all the flashcards

Study Notes

  • The lecture covers SCC.131: ARM Assembly serialization.

Plan for the Day

  • It is expected that by now you know how to perform numerical operations with registers and constants, along with how to change the execution flow of a program
  • Convert ARM Assembly to binary
  • The lecture will deep dive in the ISA design

The Instruction

  • An instruction represents the most basic unit of computer processing
  • Instructions serve as words in a computer's language
  • An instruction set architecture (ISA) is the vocabulary
  • The language of the computer can be written as machine and assembly code
  • Machine language is the computer-readable representation of that language composed of 0's and 1's
  • Assembly language is the human-readable representation
  • ARM will be studied in detail
  • The principles are comparable across all ISAs like x86, SPARC, and RISC-V.

Executable File Creation

  • A preprocessor utilises macros, #include directives, and #xxxx statements, to output "pure" C code.
  • Compilation transforms C code into assembly code. However, it still remains human-readable and is dependent on machine architecture
  • Assemblies create machine code, stored in an object file
  • Linkers combine several object files together

Assembler in Detail

  • Assemblers convert each instruction into either a 16-bit or 32-bit representation in a process that is well-defined
  • Each binary instruction contains an instruction, registers and immediate values
  • ARM-Cortex M3 supports both ARM T32 and Thumb-2, with Thumb-2 used by default

MIPS Code

  • MIPS machine code is used for demonstration other architectures, and not ARM
  • MIPS can be categorized into three instructions: Register (R-type), Immediate (I-type), and Jump (J-type)

Example Instruction – Add ARM

  • add r0, r1, r2 is an example of an ARM instruction
  •   The ARM instruction type is characterized as ADD{S}<c>.W <Rd>, <Rn>, <Rm>{, <shift>}.
  • This includes the instruction opcode which is unique for each instruction, registers and optional shift

ARM Data Processing Instruction

  • ARM instructions are encoded using a specific data processing instruction format

Example Addition Instruction – Add ARM

  • Registers RO-R7 are "low registers" where as R8, R9, R10, R11, R12, SP, LR and PC are considered "High Registers."
  • Showing how add ro, r1, r2 can be represented
  • R0 = 0: 0000
  •  R1 = 1: 0001
  •  R2 = 2: 0010
  • The instruction can be written as 1110 1011 0000 0000 1000 0000 0000 0010
  • In hex this looks like 0x 4 4 0 2

Moore's Law Revisited

  • Speeding up the CPU is generally easier than speeding up memory
  • Off-chip memory such as SRAM (Static Random-Access Memory) is slower compared to on-chip memory such as M1, M2 caches
  • flash memory has slower read and write speeds relative to RAM, and fast RAM is more expensive than slow RAM
  • CPUs use caches (small fast RAM) to make main memory look faster at a lower cost
  • Alternatively, CPUs have memory on-chip with the CPU. RAM, or flash ROM.
  • Flash ROM bandwidth can be increased by widening the memory bus, as well as adding a prefetch buffer, together with a branch target buffer, and cache
  • The size of the instruction set can also be changed to reduce instruction bandwidth needed.

ARM and Thumb

  • Thumb reduces program memory size and bandwidth requirements through a subset of instructions, re-encoded into fewer bits, most being 16 bits but some reaching 32 bits
  • Thumb-1 was introduced as 16-bit instructions (1995)
  • Thumb-2 was introduced, adding some 32-bit instructions in 2003 resulting in faster execution and lowermemory overhead
  • Some ARM CPUs allow controlling the operating state
  • With registers, the program status register T bit, which decodes instructions in Thumb or ARM state. The thumb state is indicated by the program counter being and odd number
  • Microbit always uses Thumb instructions

Instruction Encoding

  • The CPU reads instructions as a stream
  • The first five bits determine if an instruction is 16 or 32 bit
  • Otherwise, the halfword is considered a 16-bit instruction.

Conclusion

  • The lecture briefly covered machine code, its relationship to Moore's Law, and ARM encoding
  • The next lecture will cover MMΙΟ

Studying That Suits You

Use AI to generate personalized quizzes and flashcards to suit your learning preferences.

Quiz Team

Related Documents

More Like This

ARM Assembly Syntax and Instructions
39 questions

ARM Assembly Syntax and Instructions

CharismaticSerpentine5245 avatar
CharismaticSerpentine5245
ARM Assembly Instructions Quiz
45 questions

ARM Assembly Instructions Quiz

AmusingRoentgenium2222 avatar
AmusingRoentgenium2222
Assembly Coding and ARM Architecture
45 questions
Cortex-M3 Assembly Language: Memory Access
20 questions
Use Quizgecko on...
Browser
Browser