0% found this document useful (0 votes)
79 views4 pages

Preguza Cristian CR-201 LAB1

This document is a laboratory report from the Computer Science and Engineering Department of the Moldova Technical University. It details Laboratory Work No. 1 completed by student Cristian Preguza and verified by professor I. Calmîcov in Chisinau, Moldova in 2023. The report involves calculating a value stored in memory at address 0x60, multiplying it by 3, subtracting the value of port PB, dividing the result by 32, and storing the output in ports PC and PA.

Uploaded by

Aur Itar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
79 views4 pages

Preguza Cristian CR-201 LAB1

This document is a laboratory report from the Computer Science and Engineering Department of the Moldova Technical University. It details Laboratory Work No. 1 completed by student Cristian Preguza and verified by professor I. Calmîcov in Chisinau, Moldova in 2023. The report involves calculating a value stored in memory at address 0x60, multiplying it by 3, subtracting the value of port PB, dividing the result by 32, and storing the output in ports PC and PA.

Uploaded by

Aur Itar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

Ministerul Educaţiei și Cercetării al Republicii Moldova

Universitatea Tehnică a Moldovei

Departamentul Informatică și Ingineria Sistemelor

RAPORT
Lucrarea de laborator nr. 1

Varianta 4

A efectuat: st. gr. CR-201 Preguza Cristian

Verificat : Calmîcov I.

Chișinău 2023
.equ M_ADDR = 0x60 ; Memory address for [M60h]

.equ PC_ADDR = 0x18 ; Port address for PC

.equ PA_ADDR = 0x1B ; Port address for PA

.equ PB_ADDR = 0x15 ; Port address for PB

calculate_value:

; Load the value from memory into register r24:r25

lds r24, M_ADDR

lds r25, M_ADDR+1

; Multiply the value by 3 and store the result in r18:r19

mov r20, r25 ; Save r25 to r20

mov r19, r24 ; Copy r24:r25 to r18:r19

mov r18, r25

lsl r25 ; Multiply r24:r25 by 2

rol r24

add r24, r20 ; Add r20 to r24

adc r25, r1 ; Add carry to r25

add r24, r20 ; Add r20 to r24

adc r25, r1 ; Add carry to r25

; Subtract PB from the result in r18:r19

sub r18, r22 ; Subtract PB from r18

sbc r19, r1 ; Subtract carry from r19

; Divide the result by 32 and store the quotient in r18:r19


lsr r19

ror r18

lsr r19

ror r18

lsr r19

ror r18

; Store the result in PC and PA

out PC_ADDR, r18 ; Store in PC

out PA_ADDR, r19 ; Store in PA

; Return from the function

ret

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy