CS1550 - Assembly commands

0.0(0)
studied byStudied by 0 people
0.0(0)
full-widthCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/29

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

30 Terms

1
New cards

ADC

Add with carry | ADC Rd, Rr |
Adds two registers and the contents of the C bit in the SREG and places the result in the destination register Rd.

2
New cards

ADD

Add without carry | ADD Rd, Rr |
Adds two registers and places the result in the destination register Rd. This command does not consider the C bit from the SREG.

3
New cards

AND

Logical AND | AND Rd, Rr |

Computes the logical and of the contents of register Rd and register Rr and stores the result in register Rd.

4
New cards

ANDI

Logical AND with Immediate | ANDI Rd, K |

Computes the logical and of the contents of register Rd and constant K and stores the result in register Rd.

5
New cards

ASR

Arithmetic Shift Right | ASR Rd |

Shifts all bits in Rd one place to the right. Bit 7 of Rd is held constant. Bit 0 of Rd is loaded into the C flag of the SREG. This operation effectively divides a signed value by 2 without changing its sign. The C flag can be used to round the result.

6
New cards

BRBC

Branch if Bit is Clear | BRBC s, k |

Conditional relative branch predicated by a single bit in the status register (SREG). This instruction tests a single bit in the SREG specified by the programmer. If the specified bit in teh SREG is clear, this instruction branches to an instruction relative to the PC. If the specified bit in the SREG is set, no branch is take. This instruction branches relative to the PC in either direction ( PC - 63 <= destination <= PC + 64). The parameter k is the offset from the PC and is represented in two’s complement form.

7
New cards

BRBS

Branch if Bit is Set | BRBS s, k |

Conditional relative branch predicated by a single bit in the status register (SREG). This instruction tests a single bit in SREG specified by the programmer. If the specified bit in the SREG is set, this instruction branches to an instruction relative to the PC. If the specified bit in the SREG is clear, no branch is take. This instruction branches relative to the PC in either direction (PC - 63 <= destination <= PC + 64). The parameter k is the offset from the PC and is represented in two’s complement form. 

8
New cards

CALL

Call to a subroutine | CALL k |

This instruction makes an unconditional absolute branch to a subroutine located anywhere within Program Memory. This instruction stores the return address ( the address of the instruction immediately after the CALL) on the stack. After the return address is stored on the stack, this instruction decrements the stack pointed by 2 (uses a post-decrement scheme). 

9
New cards

COM

One’s complement | COM Rd |

This instruction computes the cone’s complement of the value in Rd and stores the result in Rd.

10
New cards

CP

Compare Registers | CP Rd, Rr |

This instruction compares the values of registers Rd and Rr. The values in Rd and Rr are not modified by this instruction

11
New cards

CPI

Compare Register with Immediate | CPI Rd, K |

This instruction compares the value of register Rd and a constant value. The value in Rd is not modified by this instruction.

12
New cards

EOR

Exclusive OR | EOR Rd, Rr |

This instruction computes the logical exclusive-or of register Rd and register Rr and places the result in the destination register Rd.

13
New cards

IN

Load an I/O location into a register | IN Rd, A |

This instruction loads the data at an address in I/O space into register Rd.

14
New cards

JMP

Jump | JMP k |

This instruction makes an unconditional absolute branch to a location anywhere within Program Memory.

15
New cards

LDI

Load Immediate | LDI Rd, K |

This instruction loads an 8-bit constant into register Rd.

16
New cards

LDS

Load Direct from Data Space | LDS Rd, k | 

This instruction loads one byte from data space into register Rd. The data space consists of the register file, I/O memory, and internal SRAM.

17
New cards

LSR

Logical Shift Right | LSR Rd |

Shifts all bits in Rd one place to the right. Bit 7 of Rd is cleared. Bit 0 of Rd is loaded into the C flag of the SREG. This operation effectively divides an unsigned value by two. The C flag can be used to round the result.

18
New cards

MOV

Move value from register | MOV Rd, Rr |

This instruction moves the value in Rr into Rd. The value in Rr remains unchanged, while the destination register Rd is loaded with a copy of Rr.

19
New cards

NEG

Two’s complement | NEG Rd |

This instruction replaces the contents of register Rd with its two’s complement; the value $80 is left unchanged

20
New cards

NOP

No operation | NOP |

This instruction performs a single-cycle No Operation.

21
New cards

OR

Logical OR | OR Rd, Rr |

Computes the bitwise logical OR of the contents of registers Rd and Rr and places the result in Rd.

22
New cards

ORI

Logical OR with Immediate | ORI Rd, K |

Computes the bitwise logical OR of the contents of register Rd and constant and places the result in Rd. 

23
New cards

OUT

Store Register Value into I/O location | OUT A, Rr |

This instruction stores the value of register Rr into an address in I/O space.

24
New cards

POP

Pop value from stack into register | POP Rd |

This instruction loads register Rd with a value from the stack. The stack pointer (SP) is incremented by 1 before the pop. The stack is not scrubbed as a result of this operation.

25
New cards

PUSH

Push Register Value onto Stack | PUSH Rr |

This instruction stores the value of register Rr on the stack. The stack pointer (SP) is decremented by 1 after the push. The value in register Rr is not affected by this instruction.

26
New cards

RCALL

Relative call to subroutine | RCALL k |

This instruction makes a relative call to an address within PC - 2K + 1 and PC + 2K instruction words. The address of the instruction after the RCALL is stored onto the stack as the return address. The stack pointer (SP) is decremented by two bytes (one instruction word) after the return address is stored.

27
New cards

RET

Return from subroutine | RET |

This instruction actualizes a return from a subroutine. The return address is loaded from the stack. The stack pointer (SP) is incremented by two bytes (one instruction word) before the return address is retrieved from the stack.

28
New cards

RETI

Return from Interrupt | RETI | 

This instruction actualizes a return from an interrupt. The return address is loaded from the stack. The stack pointer (SP) is incremented by two bytes (one instruction word) before the return address is retrieved from the stack. This instruction sets the Global Interrupt flag in SREG to permit further interrupts. 

29
New cards

RJMP

Relative jump | RJUMP k |

This instruction makes an unconditional absolute branch to a location within PC - 2K + 1 and PC + 2K instruction words in Program Memory. 

30
New cards

STS

Store direct to data space | STS k, Rr |

This instruction stores one byte from register Rr into data space. The data space consists of the register file, I/O memory, and internal SRAM.