0% found this document useful (0 votes)
6 views

Assembly C

This document provides information about assembly instructions, their machine codes, GPIO registers and other useful SFRs for an embedded systems course. It includes 17 assembly instructions, their descriptions and machine codes. It also lists GPIO registers, other useful SFRs and their addresses. Finally, it describes useful registers and their bit-level functionality.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views

Assembly C

This document provides information about assembly instructions, their machine codes, GPIO registers and other useful SFRs for an embedded systems course. It includes 17 assembly instructions, their descriptions and machine codes. It also lists GPIO registers, other useful SFRs and their addresses. Finally, it describes useful registers and their bit-level functionality.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Embedded Systems (EE-354) Instructions Set and Register Description Annexure

NAME: Roll Number: Section: .


Section 1: Assembly Instructions and their Machine Codes
S.No. Instruction Description Machine Code
Syntax
1 LDI Rd, K ; load Rd (destination) with immediate value K
;d must be between 16 and 31
; K is an 8-bit value that can be 0-255 in
; decimal
2 ADD Rd, Rr ;ADD Rr to Rd and store the result in Rd
;d = r = 0 – 31

3 LDS Rd, K ;load Rd with the contents of location K


;d = 0 – 31
;K is an address between 0x0000 to 0xFFFF

4 STS K, Rr ;stores register Rr into location K


;K is an address between 0x0000 to 0xFFFF
;r = 0 – 31

5 IN Rd, A ;load an I/O location to one of the GPRs


;d = 0 – 31
;A = 0 – 63 (I/O memory address)
6 OUT A, Rr ;store register to I/O location
;r = 0 – 31
;A = 0 – 63 (I/O memory address)

7 MOV Rd, Rr ;Rd = Rr (copy Rr to Rd)


;d = r = 0 – 31

8 INC Rd ;increment the content of GPR Rd by 1


;Rd = Rd + 1
;d = 0 – 31
9 DEC Rd ;decrement the content of GPR Rd by 1
;Rd = Rd – 1
;d = 0 – 31
10 SUB Rd, Rr ;Rd = Rd – Rr
;d = r = 0 – 31

11 COM Rd ;complements Rd, Rd=Rd’


;d = 0 – 31

12 JMP label ;jump to name ‘label’ in the program

13 MUL Rd,Rr ;0 ≤ d ≤ 31, 0 ≤ r ≤ 31,


;the result is stored in R1:R0 in this order

14 SBI a, b ;a is ioReg can be any one of the first 32


; I/O registers (addresses 0 to 31)
;b is bit number. It is the desired bit ;number
from 0 to 7.

Approved for use in Mid-term Exam, Spring 2024


Embedded Systems (EE-354) Instructions Set and Register Description Annexure
NAME: Roll Number: Section: .
15 CBI a, b ;a is io Register can be any one of the first 32
;I/O registers (addresses 0 to 31)
;b is bit number is the desired bit number from
;0 to 7.

16 SBIS a, b ; tests bit ‘b’ of location a (I/O address)


; a = 0 – 31 (first 32 I/O Memory Addresses)
;b=0–7

17 SBIC a, b ;tests bit ‘b’ of location a (I/O address)


; a = 0 – 31(first 32 I/O Memory Addresses)
;b=0–7

Section 2: GPIO Registers, other useful SFRs and their Addresses

Data Memory Address I/O Memory Address Register Names


0x25 0x05 PORTB
0x24 0x04 DDRB
0x23 0x03 PINB
0x28 0x08 PORTC
0x27 0x07 DDRC
0x26 0x06 PINC
0x2B 0x0B PORTD
0x2A 0x0A DDRD
0x29 0x09 PIND
0x3E 0x1E GPIOR0
0x7E 0x5E DIDR0
0x7C 0x5C ADMUX
0x7A 0x5A ADCSRA
0x79 0x59 ADCH
0x78 0x58 ADCL

Section 3: Useful Registers along with their bit-level Description

Approved for use in Mid-term Exam, Spring 2024


Embedded Systems (EE-354) Instructions Set and Register Description Annexure
NAME: Roll Number: Section: .

Approved for use in Mid-term Exam, Spring 2024


Embedded Systems (EE-354) Instructions Set and Register Description Annexure
NAME: Roll Number: Section: .

Approved for use in Mid-term Exam, Spring 2024

You might also like