mips

How to run Valgrind to find out memory leaks on my Embedded MIPSEL- linux box?

故事扮演 提交于 2020-07-06 03:39:58
问题 How can I run valgrind on an embedded Linux box to find memory leaks in my main software? In the rcS script, I am running like this: ./main_app How can I associate the ./main_app program with valgrind? The main_app process never terminates. I want to constantly log the data to file. Also, I want to access the log file without terminating the main_app process. I can do telnet and can access the log file. But the problem is until and unless the handler is closed, how can I open the file i.e. I

Iterating through and modifying a string in MIPS

一世执手 提交于 2020-06-25 22:01:07
问题 I'm trying to write a method to do a caesar shift on a string of text in the MIPS assembly language. My encryption method is as follows: encryptMessage: la $s0, message #s0 will hold message that will be iterated through lw $t1, key #s1 will hold the key to shift by li $t0, 0 #t0 will be iterator, starting at 0 encryptionLoop: add $s1, $s0, $t0 #$s1 = message[i] lb $s2, 0($s1) #Loading char to shift into $s2 beq $s2, $zero, exit #Breaking the loop if we've reached the end: http:/

Iterating through and modifying a string in MIPS

╄→尐↘猪︶ㄣ 提交于 2020-06-25 21:59:09
问题 I'm trying to write a method to do a caesar shift on a string of text in the MIPS assembly language. My encryption method is as follows: encryptMessage: la $s0, message #s0 will hold message that will be iterated through lw $t1, key #s1 will hold the key to shift by li $t0, 0 #t0 will be iterator, starting at 0 encryptionLoop: add $s1, $s0, $t0 #$s1 = message[i] lb $s2, 0($s1) #Loading char to shift into $s2 beq $s2, $zero, exit #Breaking the loop if we've reached the end: http:/

writing iteration in MIPS

生来就可爱ヽ(ⅴ<●) 提交于 2020-06-18 04:42:30
问题 I am writing this program in MIPS to calculate 2 to a power given by me and sum the sequential powers down to 0. For example, if I put 4 in $a0 like in the code below, I want it to calculate (4^2)+(3^2)+(2^2)+(1^2) which should come out to be 15. It should stop before it reaches zero. This is what I have written so far main: addi $a0, $zero, 4 #put k in $a0 in this case addi $a1, $zero, 0 #put 0 in current sum addi $v1, $v1, 0 #tally the total in $v1 for: lw $10, $a0 #load k into reg $10 lw

writing iteration in MIPS

ε祈祈猫儿з 提交于 2020-06-18 04:42:21
问题 I am writing this program in MIPS to calculate 2 to a power given by me and sum the sequential powers down to 0. For example, if I put 4 in $a0 like in the code below, I want it to calculate (4^2)+(3^2)+(2^2)+(1^2) which should come out to be 15. It should stop before it reaches zero. This is what I have written so far main: addi $a0, $zero, 4 #put k in $a0 in this case addi $a1, $zero, 0 #put 0 in current sum addi $v1, $v1, 0 #tally the total in $v1 for: lw $10, $a0 #load k into reg $10 lw

writing iteration in MIPS

℡╲_俬逩灬. 提交于 2020-06-18 04:42:00
问题 I am writing this program in MIPS to calculate 2 to a power given by me and sum the sequential powers down to 0. For example, if I put 4 in $a0 like in the code below, I want it to calculate (4^2)+(3^2)+(2^2)+(1^2) which should come out to be 15. It should stop before it reaches zero. This is what I have written so far main: addi $a0, $zero, 4 #put k in $a0 in this case addi $a1, $zero, 0 #put 0 in current sum addi $v1, $v1, 0 #tally the total in $v1 for: lw $10, $a0 #load k into reg $10 lw

Recursion in MIPS with arrays

邮差的信 提交于 2020-06-02 05:37:08
问题 I'm a beginner user of MARS for programming in MIPS language. I started to study the recursion and I wrote a little method in java that take in input an array and an index, and make a recursive sum of all its elements. But I don't know how to write it in mips language, someone can help me? public int recursiveSum(int i, int[] array) { if(i == array.length-1) return array[i]; return array[i]+recursiveSum(i+1, array); } 回答1: When you create a recursive function in mips , you need to save the

Recursion in MIPS with arrays

♀尐吖头ヾ 提交于 2020-06-02 05:36:50
问题 I'm a beginner user of MARS for programming in MIPS language. I started to study the recursion and I wrote a little method in java that take in input an array and an index, and make a recursive sum of all its elements. But I don't know how to write it in mips language, someone can help me? public int recursiveSum(int i, int[] array) { if(i == array.length-1) return array[i]; return array[i]+recursiveSum(i+1, array); } 回答1: When you create a recursive function in mips , you need to save the

Recursion in MIPS with arrays

左心房为你撑大大i 提交于 2020-06-02 05:36:10
问题 I'm a beginner user of MARS for programming in MIPS language. I started to study the recursion and I wrote a little method in java that take in input an array and an index, and make a recursive sum of all its elements. But I don't know how to write it in mips language, someone can help me? public int recursiveSum(int i, int[] array) { if(i == array.length-1) return array[i]; return array[i]+recursiveSum(i+1, array); } 回答1: When you create a recursive function in mips , you need to save the

MIPS Basic For Loop

孤街浪徒 提交于 2020-05-17 07:05:12
问题 im trying to implement this java code into MIPS assembly language and i am quite confused. this is what i have so far: java code: for (int c = 1; c <= rows; c++) { number = highestValue; // reset number to the highest value from previous line for (i = 0; i < c; i++) { System.out.print(++number + " "); } highestValue = number; // setting the highest value in line assembly code: .text # tells the program where the code begins move $t0, $zero # t0=0 move $t1, $zero # this will be similar to "int