h1:Understanding Register Addressing Mode Syntax and Instruction in Assembly Language

29 Apr 2023 Balmiki Mandal 0 Assembly language

What is Register Addressing Mode Syntax and Instruction

Register addressing mode is a type of memory addressing that uses processor registers to store data and instructions. It's used in assembly language programming as a way to quickly access data and instructions stored in the processor's registers. The syntax for register addressing mode instruction is quite simple, consisting of two parts: the destination register and the source register. The destination register is the instruction's target, while the source register is the register that contains the data or instruction to be accessed.

As an example, let's take the following instruction: MOV R1, R2. In this instruction, the destination register is R1, and the source register is R2. This instruction will move the contents of R2 into R1. This instruction is just one of many that can be used in register addressing mode.

Example Program in Assembly Language

Here is an example program written in assembly language using register addressing mode:

MOV R1, #10 // move 10 into R1 MOV R2, #20 // move 20 into R2 MOV R3, R1 // move the value in R1 into R3 ADD R3, R2 // add the value in R2 to R3 JMP 0x1234 // jump to address 0x1234

This program will first move the value 10 into the register R1, then moves the value 20 into the register R2. Next, it will move the value in R1 into R3. Finally, it will add the value from R2 to the value in R3 and then jump to address 0x1234.

BY: Balmiki Mandal

Related Blogs

Post Comments.

Login to Post a Comment

No comments yet, Be the first to comment.