| | |
PCSpim/Assembly HELP
Please support our Assembly advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Dec 2008
Posts: 3
Reputation:
Solved Threads: 0
Hellow,
I have got to make a .s file that can do the following stuff:
-image pixels are tored in memory (32bit/pixels: R-G-B alpha)
-write an image correcting algorithm
*copy a port of the image to another spot
*increase the amount of red in the picture
*Increase the brightness (simple of more complex)
I think i've got to use array but i don't know al lot of assembly
so can somebody help me?
tnx
I have got to make a .s file that can do the following stuff:
-image pixels are tored in memory (32bit/pixels: R-G-B alpha)
-write an image correcting algorithm
*copy a port of the image to another spot
*increase the amount of red in the picture
*Increase the brightness (simple of more complex)
I think i've got to use array but i don't know al lot of assembly
so can somebody help me?
tnx
•
•
Join Date: Dec 2008
Posts: 3
Reputation:
Solved Threads: 0
the post was wrong
I don't got to make the part with the image pixels
I just gotta make an MIPS assembly program that searches the minimum value in the array
here is my java code:
tnx
I also did a try to code the java into assembly:
nummers: .word 20, 22, 25, 3, 28, 2
Size: .word 6
Result: .word 0
Is this good code?
Tnx again for the help
I don't got to make the part with the image pixels
I just gotta make an MIPS assembly program that searches the minimum value in the array
here is my java code:
java Syntax (Toggle Plain Text)
package array; /** * * @author raphael vandaele */ public class Main { /** * @param args the command line arguments */ public static void main(String[] args) { int [] nummers = {20, 22, 25, 3, 28, 2}; int min = nummers[0]; for(int i = 0; i<nummers.length; i++) { if (nummers[i]<min) { min = nummers[i]; } } System.out.println(min); } }
I also did a try to code the java into assembly:
Assembly Syntax (Toggle Plain Text)
#searching the minimum of an array .text .align 2 .globl main # declaration of main as a global variable main: addu $s7, $0, $ra #save the return address in a global register lw $s1, Size # read the size of array li $s2, 0 # index i li $s3, 0 # constant 0 add $t3, $s3, 0 # in een tempke steken lw $s4, nummers($t3) # s4 contains first element of array add $t2, $s2, 0 lw $s5, nummers($t2) # s5 contains n-element of array loop: add $t2, $s2, 0 sub $t6, $s4, $s5 # t6 krijgt het verschil van s4-s5 bltz $t6, loop # als t6 kleiner is dan 0 (dus s5 is niet kleiner dan s4 en er is dus geen nieuw minimum) ga dan naar loop move $s4, $s5 #als s5 dus kleiner is dan s4 wordt s5 de nieuwe minimum addi $s2, $s2, 1 # Decrement loop counter bne $s2, $s1, else # If ($s2 == $s1) Branch to else else: move $s0, $s4 .data .globl message message: .asciiz "\nThe value of f is: " #string to print .text li $v0, 4 #print_str (system call 4) la $a0, message # takes the address of string as an argument syscall li $v0, 1 #print_int (system call 1) add $a0, $0, $s0 #put value to print in $a0 syscall #Usual stuff at the end of the main addu $ra, $0, $s7 #restore the return address jr $ra #return to the main program add $0, $0, $0 #nop .data .align 2
Size: .word 6
Result: .word 0
Is this good code?
Tnx again for the help
Last edited by Narue; Dec 9th, 2008 at 3:15 pm. Reason: added code tags
![]() |
Similar Threads
- Reading and converting a string to a 64-bit integer (Assembly)
- I Desperately need help with this assignment!! (Assembly)
- MIPS Help (Assembly)
- recursive calculations?? (Assembly)
Other Threads in the Assembly Forum
- Previous Thread: using STDCALL
- Next Thread: store input in string
Views: 1302 | Replies: 3
| Thread Tools | Search this Thread |
Tag cloud for Assembly
3d 68hc11 6811 80386 :( adress array asm assembler assembly boot bootloader buffer compression cursor debug directory division docs dos draw emulator endtask error exceptions file int10h integer intel interrupt interrupts language loop newbie nohau osdevelopment print program range read remainder shape string text theory tsr x86






