turboscrew's Profile User Rating: -----

Reputation: 104 Stalwart
Active Posts:
688 (0.54 per day)
03-April 12
Profile Views:
Last Active:
User is offline Sep 29 2015 05:16 PM

Previous Fields

OS Preference:
Who Cares
Favorite Browser:
Who Cares
Favorite Processor:
Who Cares
Favorite Gaming Platform:
Who Cares
Your Car:
Who Cares
Dream Kudos:

Latest Visitors

Icon   turboscrew has not set their status

Posts I've Made

  1. In Topic: Converting Java to MIPS

    Posted 29 Sep 2015

    In your earlier post, you showed this:


    68 sw $v0, 0($t9)
    69 addi $t0, $t0, 1 #
    70 ble $t0, $t2, read #
    71 add $t0, $zero, $zero #
    72 # add the code that is missing from right here
    74 search: add $t4, $t1, $t1
    75 addi $t5, $t1, 1
    76 sgt $t1, $t4, $t5
    77 addi $t4, $t1, 1

    So what you are supposed to do is write this in MIPS code?

    33	    t0 = 0;
    34	    do {
    35	        t1 = 0;
    36	        do {
    37	            t4 = list [t1];
    38	            t5 = list [t1 + 1];
    39	            if (t4 > t5) {
    40	                list [t1 + 1] = t4;
    41	                list [t1] = t5;
    42	            }
    43	            t1 ++;
    44	        } while (t1 < t3);
    45	        t3 --;
    46	        t0 ++;
    47	    } while (t0 < t2);

    t0 = 0
    do {
    } while (t0 < t2)

    translates, for example , to
    add $t0, $zero, $zero # t0 = 0
    loop:           # do {
    sltu s1, t0, t2 # (t0 < t2)
    bgtz s1, loop   # } while

    t4 = list [t1];

    translates to:
    lw t4, list(t1)

    t5 = list [t1 + 1];

    translates to:
    add s1, t1, 1 
    lw t5, list(s1)

    list [t1 + 1] = t4;

    translates to:
    add s1, t1, 1
    sw t4, list(s1)
  2. In Topic: Converting Java to MIPS

    Posted 28 Sep 2015

    The error says (most probably) that you are trying to rwite or read a word from an odd address (0x00000001). Words (4 bytes) need to be on 4-byte boundary.

    if t3 is not already in use
    "t5 = list [t1 + 1];"
    add t3, t1, #1
    lw t5, list(t3)

    if it is, find some other free register

    I tried to figure out what the code should do, but I didn't quite get it. Comments would have been nice...
  3. In Topic: Assembly Code interpretation... Confused

    Posted 18 Sep 2015

    1) yes.
    2) yes.
    3) addl Adds long (32-bit)
    salq =Shift Arithmetic Left Quad(64-bit)
    4) Defines a local label (labels starting with 'L' are local)
    5) jumps to address
    6) Not sure what you mean...
    It returns what you make it to return - you put thr return value in some register and the calling program gets it in that register. If you mean how C is compiled,
    there is usually a call convention that is used: Check the ABI (Application Binary Interface) or EABI (Embedded Application Binary Interface - for embedded systems)

    Ch 3.2.3 Parameter Passing
    And there especially Figure 3.4: Register Usage

    Here you can find the basics of AT&T syntax x86 assembly:

    I'm not sure, but I think labels of form .LCn (where n is a number) means 'label of constant' .LFBn is label of function beginning and .LFEn is label of function end.
  4. In Topic: Problems with implementing a small program in MIPS

    Posted 15 Sep 2015

    It looks like you don't store anything to overwrite the text, and in the calculations you seem to keep overwriting $v0.

    Your hexasc takes a number in $a0 and returns the character in $v0.


    102 jal hexasc # Convert to ASCII char
    104 PUSH ($a1)
    105 POP ($a0)
    106 jal hexasc
    108 addi $v0,$0,0x3a # Add a ':' betwwen the minutes and seconds

    and you overwrite it by ':'.



    030 # call your function time2string
    031 la $a0,timstr
    032 la $t0,mytime
    033 lw $a1,0($t0)
    034 jal time2string
    035 nop

    you get the text address in $a0 and the time in $a1 (word) and:


    096 time2string:
    097 andi $a1,$a1,0xffff # Clear all the 16 non-LSB's in register $a1
    098 PUSH ($ra) # Save the return adress to main in a stack
    100 PUSH ($a1) # Store the hexadecimal value on the stack
    101 POP ($a0) # Pick the recently stored value to be converted to character

    Here you overwrite the address in $a0 by POPing the $a1 you pushed.
  5. In Topic: Floating Point Quadratic Equation Solver, FSTP Help!

    Posted 5 Sep 2015

    My knowledge about x86 stuff is pretty limited, but just a thought:
    Does the storage for qword be qword-aligned?

My Information

Member Title:
D.I.C Addict
52 years old
February 6, 1963
Nokia (town), Finland
Computers, programming, different branches of science, different branches of technology
Full Name:
Juha Aaltonen
Years Programming:
Programming Languages:
C, C++, Ada, Pascal, Lisp, Occam, Forth, Fortran and some assembly
(6502, 6800, 6809, 68000, 8085, 8031, PDP11/70, basics of C64x+ and PPC)

Contact Information




Page 1 of 1
  1. Photo

    askyy Icon

    06 Apr 2013 - 19:42
    would you like tom give me some help doing a programm in aseembly MIPS to verify if a number is power of two?
  2. Photo

    cool_moon Icon

    24 Apr 2012 - 03:49
    I didnt undestand ur explanation will u please explain it clearly
  3. Photo

    cool_moon Icon

    23 Apr 2012 - 23:29
    hi..Im new to lpc1768 please help me to understand the GPIO selection. how to select the gpio. i worked in mc8051 but it is entirly different from that. kindly help me
  4. Photo

    jon.kiparsky Icon

    10 Apr 2012 - 23:53
    Well, I've tried to set up a discussion. Let's see what comes of it.
    In answer to your question, I found my way to Finnish because my father is a Finn, and I'm interested in languages. As I say, though, Finnish defeated me pretty soundly.
Page 1 of 1