;/*## (c) SECURITY EXPLORATIONS    2011-2018 poland                           #*/
;/*##     http://www.security-explorations.com                                #*/
;
;/* RESEARCH MATERIAL:	SRP-2018-02                                            */
;/* [Exploitation Framework for STMicroelectronics DVB chipsets]               */
;
;SlimCORE sample illustrating ADD operation
;INPUT:  ARG0 - value1
;        ARG1 - value2
;OUTPUT: RES0 - 0
;        RES1 - 0
;        RES2 - 0
;        RES3 - the result of adding value1 and value2

.data 0x4140

.def ARG0
.def ARG1
.def ARG2
.def ARG3

.def RES0
.def RES1
.def RES2
.def RES3

.code 0x05b7
  ld  r1,[r0+ARG0]
  ld  r2,[r0+ARG1]
  mov r0,#0000
  add r3,r1,r2,#0000
  st r0,[r0+RES1]
  st r0,[r0+RES2]
  st r0,[r0+RES3]
  st r3,[r0+RES0]
