Texas Instruments UCD3138 Technical Reference Manual page 460

Digital power supply controller
Hide thumbs Also See for UCD3138:
Table of Contents

Advertisement

Dual-State Interworking
Example-1. Code Compiled for 16-BIS State: Sum( )
C Program
int total = 0;
sum(int val1, int val2)
{
int val = max(val1, val2);
total += val;
}
16-bit assembly program
;*****************************************************************
;
function venner: _sum
;*****************************************************************
_sum:
.state32
STMFD sp!, {lr}
ADD lr, pc, #1
BX lr
.state16
BL $sum
BX pc
NOP
.state16
.sect ".text"
.global $sum
;*****************************************************************
;
function def: $sum
;*****************************************************************
$sum:
PUSH {LR}
BL $max
LDR A2, CON1
LDR A3, [A2, #0]
ADD A1, A1, A3
STR A1, [A2, #0]
POP {PC}
;*****************************************************************
;
constant table
;*****************************************************************
sect
".text"
.align4
460
ARM7TDMI-S MPUSS
Copyright © 2016, Texas Instruments Incorporated
*
*
*
SNIU028A – February 2016 – Revised April 2016
Submit Documentation Feedback
www.ti.com

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents