.file "userapp.c" .arch msp430x149 /* Hardware multiplier registers: */ __MPY=0x130 __MPYS=0x132 __MAC=0x134 __MACS=0x136 __OP2=0x138 __RESLO=0x13a __RESHI=0x13c __SUMEXT=0x13e .global userappEnd .section .userappdata,"a",@progbits .p2align 1,0 .type userappEnd,@object .size userappEnd,2 userappEnd: .short __userapp_end .global userappRamEnd .p2align 1,0 .type userappRamEnd,@object .size userappRamEnd,2 userappRamEnd: .short __userapp_ram_end .global userappVersion .p2align 1,0 .type userappVersion,@object .size userappVersion,2 userappVersion: .short 1 .text .LC0: .string "Start user application\r\n" .LC1: .string "\r\n" .LC2: .string "Stop user application\r\n" .LC3: .string "Feld:\r\n" .LC4: .string "Minimum: " .LC5: .string "Maximum: " .section .userappinit,"ax",@progbits .p2align 1,0 .global userappInit .type userappInit,@function /*********************** * Function `userappInit' ***********************/ userappInit: /* prologue: frame size = 6 */ .L__FrameSize_userappInit=0x6 .L__FrameOffset_userappInit=0xe push r11 push r10 push r5 push r4 mov r1, r5 add #10, r5 sub #6, r1 ; 6, fpn 1 mov r1,r4 /* prologue end (size=10) */ call #stopWatchdog call #initSensors /********************************** Beginn des Hauptprogramms **********************************/ .comm feld,10 ; Speicherplatz fuer Feld .comm min,2 ; Speicherplatz fuer Minimum .comm max,2 ; Speicherplatz fuer Maximum mov #feld,r10 ; Feld initialisieren mov #4,0(r10) mov #5,2(r10) mov #3,4(r10) mov #1,6(r10) mov #2,8(r10) mov #.LC3,r15 ; Feld ausgeben call #sendRS232String mov #feld,r10 mov #5,r11 call #printArray lab1: sub #8,r1 ; Minimum und Maximum berechnen mov #feld,0(r1) mov #5,2(r1) mov #min,4(r1) mov #max,6(r1) call #minmax ; Funktion minmax aufrufen add #8,r1 mov #.LC4,r15 ; "Minimum" schreiben call #sendRS232String mov #min,r10 ; Wert des Minimum schreiben mov @r10,r15 call #sendRS232Address mov #.LC1,r15 ; newline schreiben call #sendRS232String mov #.LC5,r15 ; "Maximum" schreiben call #sendRS232String mov #max,r10 ; Wert des Maximum schreiben mov @r10,r15 call #sendRS232Address mov #.LC1,r15 ; newline schreiben call #sendRS232String /********************************** Ende des Hauptprogramms **********************************/ /* epilogue: frame size=6 */ epil: add #6, r1 pop r4 pop r5 pop r10 pop r11 ret /************************************ * Function 'minmax' hier einfuegen ************************************/ /* Ende Funktion minmax */ /*********************** * Function 'printArray' ***********************/ printArray: push r10 ; Registerinhalte retten push r12 push r14 push r15 clr r12 lab0: mov r11,r14 sub r12,r14 jz labend mov 0(r10),r15 ; 0(r10) schreiben call #sendRS232Address mov #.LC1,r15 ; newline schreiben call #sendRS232String add #2,r10 ; zum naechsten Arrayeintrag springen add #1,r12 ; Zaehlvariable inkrementieren jmp lab0 labend: mov #.LC1,r15 call #sendRS232String pop r15 ; Registerinhalte wiederherstellen pop r14 pop r12 pop r10 ret /* epilogue end (size=7) */ /* function userappInit size 66 (49) */ .Lfe1: .size userappInit,.Lfe1-userappInit /********* End of function ******/ .comm newADValues,1 .comm firmwareVersion,2,2 .comm sCounter,2,2 .comm cCounter,1 /********************************************************************* * File src/userapp.c: code size: 66 words (0x42) * incl. words in prologues: 10, epilogues: 7 *********************************************************************/