; Replace with your application code
.include "m128def.inc"
ldi r16, 0x99 ;ldi is load immediate so it will load 0x99 hexadecimal to r16 which is 1001
1001 in binary.(R16=0x99)
sts 0x212, r16 ;sts is store direct to data space 0X212 is part of the ram in its specific
name so (0x212=R16)
ldi r16, 0x85 ;R16=0x85 it does the same thing over and over again so ı just write what
content goes where to where
sts 0x213, r16 ;0x213=R16
ldi r16, 0x3f ;R16=0x3f
sts 0x214, r16 ;0x214=R16
ldi r16, 0x63 ;R16=0x63
sts 0x215, r16 ;0x215=R16
ldi r16, 0x12 ;R16=0x12
sts 0x216, r16 ;0x216=R16
This is the code with the explanations
İn the upper image I provided the ram locations from 212$ to 216$ and it shows that
So $212=99,$213=85,$214=3f,$215=63,$216=12
TASK 3
;
; AssemblerApplication1.asm
;
; Created: 6.03.2024 19:34:00
; Author : Akın Başar Özsaygın
;
; Replace with your application code
.include "m128def.inc"
ldi r20, 5 ;so the number 5 is stored to R20 (R20=5).
ldi r21, 2 ;so the number 2 is stored to R21 (R21=2).
add r20, r21 ;so the content of the r21 plus r20 will store in r20 (R20=R20+R21). R20=5+2
R20=7
add r20, r21 ;so the content of the r21 plus r20 will store in r20(R20=R20+R21).R20=7+2