Search:

Type: Posts; User: williamsonj

Page 1 of 3 1 2 3

Search: Search took 0.00 seconds.

  1. Replies
    6
    Views
    4,349

    Ok, I figured out a way to compile it that seems...

    Ok, I figured out a way to compile it that seems to resolve the issue, thanks for the help
  2. Replies
    6
    Views
    4,349

    that's what I'm trying to do but when I compile...

    that's what I'm trying to do but when I compile it still says it has an undefined reference
  3. Replies
    6
    Views
    4,349

    I have the functions written, and they're in the...

    I have the functions written, and they're in the same directory
  4. Replies
    6
    Views
    4,349

    extern defined functions

    I am trying to include externally defined functions in my main function but when I try to compile using:



    cc assemble.c pass1.o pass2.o getsource.o -o assemble


    I get the following errors:
  5. Replies
    46
    Views
    6,394

    So should this work? ...

    So should this work?



    while(strstr(sourcelist[Scnt], ".") == 0)
    Scnt++;
  6. Replies
    46
    Views
    6,394

    hmmmm other than the fact that it's C++ lol is...

    hmmmm other than the fact that it's C++ lol is there a substr function in C?
  7. Replies
    46
    Views
    6,394

    Can you tell me what's wrong with this statement?...

    Can you tell me what's wrong with this statement?



    while(strcmp(sourcelist[Scnt].substr(0, 1), ".") == 0)
    Scnt++;


    I'm trying to increment the Scnt counter for as long as there's a...
  8. Replies
    46
    Views
    6,394

    Wow, I just realized that the line it's trying to...

    Wow, I just realized that the line it's trying to breakup shouldn't be getting passed at all from pass1 as it is a comment. Let me try to fix that first and then see if the out of bounds issues are...
  9. Replies
    46
    Views
    6,394

    Program received signal SIGSEGV, Segmentation...

    Program received signal SIGSEGV, Segmentation fault.
    0x00000034c3470db0 in strcpy () from /lib64/tls/libc.so.6
    (gdb) bt
    #0 0x00000034c3470db0 in strcpy () from /lib64/tls/libc.so.6
    #1 ...
  10. Replies
    46
    Views
    6,394

    when allocating the memory shouldn't I be doing...

    when allocating the memory shouldn't I be doing the following:



    components.lbl = malloc(sizeof(char) * 100); /*allocate a string of 100 chars; lbl points to it */
  11. Replies
    46
    Views
    6,394

    I thought that was why I was using the following...

    I thought that was why I was using the following code:



    char label[81], opcode[81], opr1[81], opr2[81];
    int ni, xbpe;
    components.lbl = label;
    components.opc = opcode;
    components.opr1 =...
  12. Replies
    46
    Views
    6,394

    I'll give that a shot but if I remember correctly...

    I'll give that a shot but if I remember correctly the professor mentioned that we shouldn't have to allocate memory. Should I be allocating memory in both functions or just the calling function?
  13. Replies
    46
    Views
    6,394

    ni actually represents 2 bits in SIC/XE assembly...

    ni actually represents 2 bits in SIC/XE assembly object code. opcode + nixbpe
  14. Replies
    46
    Views
    6,394

    tabstop: I guess what I'm trying to do is pass...

    tabstop:
    I guess what I'm trying to do is pass the address of the components in pass1 to breakup so that breakup can tokenize the sourceline and assign the correct component parts into the...
  15. Replies
    46
    Views
    6,394

    You may notice in pass1 the first instance of...

    You may notice in pass1 the first instance of calling breakup I tried sending the address of components, I'm not sure if that's correct or not though.
  16. Replies
    46
    Views
    6,394

    Here is my current source as well for...

    Here is my current source as well for review/reference:

    pass1.c


    /* Pre-Processor Directives */
    #include <string.h>

    #ifndef SYMBSIZE
    #define SYMBSIZE 10
  17. Replies
    46
    Views
    6,394

    Well I'm getting a segmentation fault, not really...

    Well I'm getting a segmentation fault, not really sure if I'm looking at the right place in my code. I'm supposed to be reading a test file, breaking it into an array for each line and then...
  18. Replies
    46
    Views
    6,394

    I'm still looking for any help on this if anyone...

    I'm still looking for any help on this if anyone has any ideas.
  19. Replies
    61
    Views
    5,205

    for (0=numraise && numraise

    for (0=numraise && numraise<=9, studentname=numraise+1, numraise++)

    When comparing ints you need to use == not =
    You are assigning 0 to numraise here. Also, if you are comparing numraise to 0...
  20. Replies
    61
    Views
    5,205

    Just for a point of clarification on my part is ...

    Just for a point of clarification on my part is

    if (highscore < grade[i]) highscore = grade[i]);

    the same as

    if (highscore < grade[i])
    highscore = grade[i]);
  21. Replies
    61
    Views
    5,205

    if (highscore < grade[i] highscore = grade[i]) ...

    if (highscore < grade[i] highscore = grade[i])


    I believe you want to try this instead:


    if (highscore < grade[i])
    highscore = grade[i];
  22. Replies
    46
    Views
    6,394

    I don't know if I posted the full functions yet...

    I don't know if I posted the full functions yet or not so here we go:

    pass1.c


    /* Pre-Processor Directives */
    #include <string.h>

    #ifndef SYMBSIZE
    #define SYMBSIZE 10
  23. Replies
    46
    Views
    6,394

    that assignment is in the original calling...

    that assignment is in the original calling function so really I guess I should've called it components.lbl = label1; in the calling function and am trying to do strcpy(components.lbl, label2); in the...
  24. Replies
    46
    Views
    6,394

    I don't see how they could overlap in memory...

    I don't see how they could overlap in memory since components.lbl is created in the calling function and label is a local variable of the function that is called.
  25. Replies
    46
    Views
    6,394

    so label and components.lbl are the same location...

    so label and components.lbl are the same location in memory? And if that is so then would I not need to copy the values?
Results 1 to 25 of 63
Page 1 of 3 1 2 3