Domeniu: Limbaje de Programare
Conține 9 fișiere:
asm
Pagini : 9 în total
Mărime: 6.98KB (arhivat)
Publicat de: Clara Robu
Puncte necesare: 5
Profesor îndrumător / Prezentat Profesorului:
Catalin Petrescu
Probleme rezolvate de la laborator MAP pentru Automatica anul 3. 9 laboratoare
Extras din notiță
.include "m32def.inc"
.dseg
VAR1: .byte 1
VAR2: .byte 1
VAR3: .byte 1
SUMA1: .byte 1
SUMA2: .byte 1
.cseg
RESET:
; Initializare stiva
ldi R16,low(RAMEND)
ldi R17,high(RAMEND)
out SPL,R16
out SPH,R17
START:
; Scrie in variabila VAR1 valoarea 70
ldi R16,70
sts VAR1,R16
; Scrie in variabila VAR2 valoarea 30
ldi R16,30
sts VAR2,R16
; Scrie in variabila VAR3 valoarea -50
ldi R16,-50
sts VAR3,R16
; Calculeaza SUMA1 = VAR1 + VAR2
lds R0,VAR1
lds R1,VAR2
rcall ADUNARE
sts SUMA1,R2
; Calculeaza SUMA2 = VAR1 + VAR3
lds R0,VAR1
lds R1,VAR3
rcall ADUNARE
sts SUMA2,R2
rjmp START
; Procedura de adunare a doua numere
; Parametrii: R0 - operand 1
; R1 - operand 2
; Rezultat: R2 - suma
ADUNARE:
mov R2,R1
add R2,R0
ret
Conținut arhivă zip
- Probleme Rezolvate Laborator MAP
- lab1.asm
- lab2.asm
- lab3.asm
- lab4.asm
- lab5.asm
- lab6.asm
- lab7.asm
- lab8.asm
- lab9.asm