Search:

Type: Posts; User: clag

Page 1 of 2 1 2

Search: Search took 0.00 seconds.

  1. Replies
    0
    Views
    2,632

    Funny Binary to Mips

    MY friend told me that this was something neat so I've been working on it for a while but I can't see it. He gave a set of machine code, told me it'd be interesting in MIPS instruction set (The...
  2. Replies
    5
    Views
    18,319

    Converting C into MIPS Assembly

    Hi, I wanted to convert this code into assembly but I'm having trouble. Here's what I got :]



    int b = 0, x;
    while (x != 0) {
    b += ((x & 03) == 2);
    x >>= 1;
  3. Replies
    2
    Views
    7,030

    Convert ASM to C Code

    Basically I want to convert this into C.

    addi $s3, $0, 1
    add $t0, $s2, $s3
    lw $t1, 0($t0)
    add $t2, $s1, $t1
    lw $s4, 0($t2)

    ($s0 = A, $s1 = B, $s2 = C and so on..)
    This could...
  4. Replies
    3
    Views
    2,224

    Binary Representation

    void printOnes (int x)
    {
    int i;
    int numOnes = 0;
    for (0 = i; i < 32; i++) {
    if ((x & 0x1) = 1)
    numOnes++;
    x = x >> 1;
    }
    printf("The number of ones is %c\n",...
  5. Replies
    0
    Views
    1,070

    Function reading/converting/returning

    delete
  6. Thread: clearing buffer

    by clag
    Replies
    3
    Views
    3,054

    ooops, thanks for pointg that out :) is this...

    ooops, thanks for pointg that out :)
    is this right now?



    void clrbuf (int character)
    {

    if(character == '\n') /* if stdin is already clear */
    {
  7. Thread: clearing buffer

    by clag
    Replies
    3
    Views
    3,054

    clearing buffer

    the purpose of the clrbuf function is to remove any characters in stdin by repeatedly calling fgetc until a newline character is detected. Here's what I have..

    I check to see if the incoming ...
  8. Replies
    27
    Views
    3,574

    //base-conversion algorithm while(number !=...

    //base-conversion algorithm
    while(number != 0)
    {
    converted[index] = number % base;
    number = number / base;
    index++;
    }
    // back up to last entry
    ...
  9. Replies
    19
    Views
    1,764

    delete

    delete
  10. Replies
    27
    Views
    3,574

    void decout (unsigned long number, FILE * stream)...

    void decout (unsigned long number, FILE * stream)
    {
    int converted[64];
    long digit_count = 0;
    int base = 10;
    int index = 0;


    while(digit_count != 0)
    {
  11. Replies
    19
    Views
    1,764

    delete

    delete
  12. Replies
    19
    Views
    1,764

    delete

    delete
  13. Replies
    19
    Views
    1,764

    delete

    delete
  14. Replies
    19
    Views
    1,764

    delete

    delete
  15. Replies
    19
    Views
    1,764

    cause Values of message are expected to be a NULL...

    cause Values of message are expected to be a NULL terminated character arrays.
  16. Replies
    19
    Views
    1,764

    if I just use fputc, it compiles fine, but is the...

    if I just use fputc, it compiles fine, but is the program erroneous?
  17. Replies
    19
    Views
    1,764

    delete

    delete
  18. Replies
    19
    Views
    1,764

    what should I return if I use fputs...will mine...

    what should I return if I use fputs...will mine still be valid?
  19. Replies
    19
    Views
    1,764

    error in comparing pointer and intger

    delete
  20. Replies
    27
    Views
    3,574

    so i can just replace 64 with base right? cause I...

    so i can just replace 64 with base right? cause I also have a hexout function.
  21. Replies
    27
    Views
    3,574

    but i feel like 64 is a magical number..but...

    but i feel like 64 is a magical number..but that's the only way I got it to work.. what does it represent?
  22. Replies
    27
    Views
    3,574

    how is this?

    how is this?
  23. Replies
    27
    Views
    3,574

    void decout (unsigned long number, FILE * stream)...

    void decout (unsigned long number, FILE * stream)
    {
    int converted[64];
    long digit_count = 0;
    int base = 10;
    int index = 0;


    while(digit_count != 0)
    {
  24. Replies
    27
    Views
    3,574

    i understand in Java that code would be trivial.....

    i understand in Java that code would be trivial.. can you give me an example in C, how I would implement that not directly (since it just gives it away) but something similar? thank you!
  25. Replies
    27
    Views
    3,574

    the array is incorrect ahh.. i drew out a...

    the array is incorrect ahh..

    i drew out a pseudo-code to try and figure it out but it seems like there will always be an error if there is a zero and it will always read it incorrectly.

    ignore...
Results 1 to 25 of 32
Page 1 of 2 1 2