; -------------------------------------------------------------------------------- ; @Title: PRACTICE training - conditional execution and functions ; @Description: ; This script is accompanied by a tutorial video, see ; http://www.lauterbach.com/tut_practice.html ; ; It shows how to use control structures (IF/ELSE/WHILE) and TRACE32 ; functions, using an ARM OMAP4430 chip as example. ; @Keywords: control, else, functions, if, tutorial, video, while ; @Author: LBA ; @Copyright: (C) 1989-2014 Lauterbach GmbH, licensed for use with TRACE32(R) only ; -------------------------------------------------------------------------------- ; $Id: script_conditional_execution_and_functions.cmm 7817 2014-10-28 13:13:01Z lbahloul $ RESet SYStem.RESet SYStem.CPU OMAP4430APP1 SYStem.Up Data.LOAD.Elf ~~~~/sieve_arm.elf ; "~~~~" is the directory of the current script WinPOS 0% 50% 50% 50% List.auto Mode.Hll Go.direct main WAIT !STATE.RUN() 5.s IF STATE.RUN() ( Break.direct ) IF Register(PC)==ADDRESS.OFFSET(main) ( PRINT "Booted to function main" ) ELSE ( PRINT %ERROR "Booting to function main did not succeed!" ENDDO ) WinPOS 50% 50% 50% 50% Var.DRAW sinewave Var.Break.Set sinewave /Write RePeaT ( Go.direct WAIT !STATE.RUN() ) WHILE (Var.VALUE(sinewave[x])>=0.) PRINT "sinewave[x] is negative: " %Decimal Var.VALUE(sinewave[x]) ENDDO