Preview

THUMB Tutorial

Powerful Essays
Open Document
Open Document
7539 Words
Grammar
Grammar
Plagiarism
Plagiarism
Writing
Writing
Score
Score
THUMB Tutorial
This document is made to teach those who want to learn assembly for the ARM7-Thumb mode. In this document I shall teach the components more on a need-to-know basis.

1 Registry

2 Making a program that runs: -The Push and Pop commands

3 Arithmetic functions: Add, Sub, mul, neg

4 Logic Functions: orr, and, mvn. eor, lsl, lsr, ror

5 Memory access: ldr, ldrh, ldrb, str, strh, strb

6 Control Flow and Unconditional Jumps: cmp, b, b<xx>

7 Call and return to functions: bl, bx, swi

Before I begin, I shall explain briefly some concepts you need to know.

Registry

Registers are small, extremely fast, extremely low capacity memory that sits inside the processor. Why are they so important? Because processors only know how to work with them. All operations involve at least one register, but should normally involve two or three directly. The processor cannot work directly on any other memory, so every piece of data to be worked on must be loaded into one of these.

How many are there?
For the Thumb mode (the one in this document) only 16 registers are available. Of those 16, only 8 are available for any use. Those registers are called low registers, and are all-purpose, meaning the processor doesn’t have any designed use for them. Those are called R0 to R7 respectively, and are the ones you will normally use on most programs.
The remaining 8 are called High registers and are usually unavailable to manipulate directly. The last three of them have special names: SP, LR and PC.

SP is the Stack Pointer. The stack pointer contains an address in memory where data is stored when the Push command is called. More on that later.

LR is the Link Return register. When a branch and link(bl) function is called, the value of the line where it was called is stored here. Not very important right now, but it needs to be kept safe.

PC is the Program Counter it’s the address of the next instruction to be executed. This is where the Processor finds out where on the memory is the next

You May Also Find These Documents Helpful

  • Satisfactory Essays

    Cis 207 Week 2/3 Quiz

    • 383 Words
    • 2 Pages

    Registers are used to store data in RAM, the control unit, and the arithmetic logic unit. True…

    • 383 Words
    • 2 Pages
    Satisfactory Essays
  • Good Essays

    13.) What do you use to specify what bits are being used to lock a number into place?…

    • 641 Words
    • 3 Pages
    Good Essays
  • Powerful Essays

    En1320 Unit 1 Research Paper 1

    • 27742 Words
    • 111 Pages

    write back the result to memory. The complete assembly program to compute the value of…

    • 27742 Words
    • 111 Pages
    Powerful Essays
  • Good Essays

    Arrays store items that have the same type of data type like a group of employees’ names and social security numbers for a team of 2000 personal. Pointer is a variable that greatly extends the power and flexibility of a program, each memory location that is used to store data value has an address. The address provides the means for a PC hardware to reference a particular data item.…

    • 485 Words
    • 2 Pages
    Good Essays
  • Satisfactory Essays

    POS355 Week 1 Individual

    • 574 Words
    • 2 Pages

    There are several items that are pertinent to memory management such as, basic hardware, the binding of symbolic memory addresses to definite physical addresses and the difference between logical and physical addresses. The most important task that memory management executes is the distribution and collection of memory…

    • 574 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    NT1110

    • 315 Words
    • 2 Pages

    The third numbering system that computers use is hexadecimal system, which is complex than the other two numbering systems. This refers to the base16 number system that consists of 16 symbols. The numbers are 0 to 9 and the letters A to F. The decimal number 15 is represented as F in the hexadecimal numbering system. The hexadecimal system is useful because it can represent every byte as two consecutive hexadecimal digits. It is easier for people to read hexadecimal numbers than binary numbers.…

    • 315 Words
    • 2 Pages
    Satisfactory Essays
  • Good Essays

    The operating systems job is managing the memory. The operating system is in charge of bringing this process into main memory (Stallings, 2012). However the processor must deal with references within the program. Branch instructions include an address to reference the order to be executed next. Data reference instructions include the address of the byte or word of data referenced. The processor hardware and operating system software must be able to translate the memory references found in the code of the program into actual physical memory addresses, reflecting the current location of the program in main memory. (Stallings, 2012).…

    • 573 Words
    • 3 Pages
    Good Essays
  • Satisfactory Essays

    CS305 Final Exam Questions

    • 1044 Words
    • 6 Pages

    a. It decrements the stack pointer (by 2 or 4) and copies the operand into the stack at the location pointed to by the stack pointer.…

    • 1044 Words
    • 6 Pages
    Satisfactory Essays
  • Better Essays

    Assembly language enables programmers to relate op codes using symbolic names in place of numbers to perform an instruction or input a piece of data. Programmers can inscribe op codes using purposeful words like JUMP, CLEAR, and ADD as an alternative to cryptic binary codes consisting of series of 0s and 1s. An example of assembly language, machine language and its meaning are listed in the book called, “Invitation to Computer Science” (Schneider & Gersting, 2013, pp. 285, fig. 6.5). In figure 6.5, assembly language is clearly easier to comprehend than machine language, which makes assembly language user friendly.…

    • 2002 Words
    • 9 Pages
    Better Essays
  • Satisfactory Essays

    Homework

    • 343 Words
    • 2 Pages

    69. With each PSHY instruction, the stack pointer register, SP, is _______________ (incremented, decremented) by _______.…

    • 343 Words
    • 2 Pages
    Satisfactory Essays
  • Powerful Essays

    Embedded Systems 2 marks

    • 760 Words
    • 4 Pages

    The stack is used to keep track of the current and all suspended execution contexts. Thus, the stack contains all “live” local or automatic variables and all function and interrupt “return addresses.” When a program calls a function.…

    • 760 Words
    • 4 Pages
    Powerful Essays
  • Good Essays

    The name used to refer to a memory location that contains a value of a particular.…

    • 1031 Words
    • 5 Pages
    Good Essays
  • Good Essays

    The testbench required to test the RTL design is coded using HVL. Examples are (VERA, e language and system C).…

    • 2409 Words
    • 10 Pages
    Good Essays
  • Satisfactory Essays

    Microprocessor

    • 520 Words
    • 3 Pages

    1. Draw the functional block diagram of SAP-I architecture and also discuss the main difference with SAP-II.…

    • 520 Words
    • 3 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Bill of right

    • 896 Words
    • 17 Pages

    Only SI, DI and BX can be used inside [ ] from memory addressing point of view. From…

    • 896 Words
    • 17 Pages
    Satisfactory Essays

Related Topics