15-213/18-243 Introduction to Computer Systems: Frequently Asked Questions

Table of Contents

Generic Questions

  • How can I get help in 15-213?:

    We're glad you asked! You can always email us at 15-213-staff@cs.cmu.edu, join in on the 213 IRC chatroom (details below), or stop by office hours: every Sunday-Thursday from 6:00-9:00pm in Wean 5207.

  • How do I get into the 15-213 IRC chatroom?:

    The 15-213 course staff maintain an IRC chatroom to provide instant help to students. You can join by going here entering a username, and clicking on "Connect". Alternatively, if you'd like to use your own IRC client you can join to ##213 on irc.freenode.net .

Datalab

  • For float_f2i do we round or truncate?

    Truncate! Example: uf = 5/8 ==> int = 0.
    uf = 1.9 ==> int = 1.
    uf = -1.9 ==> int = -1.

  • Can I use operators like '/' and '*' in the floating point questions?

    Yes, you can! As long as you are operating on integer datatypes.

  • Can I use constants larger than 255 in the floating point questions?

    Yes, you can!

Bomblab

  • What does the "movsql" instruction do?

    It moves a sign extended long (32 bits) to a quad (64 bits). A similar instruction, movzlq does the same thing but doesn't sign extend the long.
    movslq S, R is the equivalent of R = SignExtend(S) where R is 64 bits and S is 32 bits.

  • What does the "ja" instruction do?

    It stands for jump above. It is the unsigned version of the jg instruction.

  • How do I do X, Y, and Z in GDB?

    Use the reference guides that are linked to in the resources page of the course website!

  • What does sscanf do?

    sscanf basically scans a given string and pulls out values based on a given format and stores the values into given variables.
    It also returns the number of values which were scanned successfully.
    For example, sscanf("1 2 3", "%d %d %c", &a, &b, &c); stores 1 into a, 2 into b, and the number 51(the ascii value of 3) into c. It then also returns 3.
    More info can be found by typing "man scanf" in a terminal.

  • What does "nop" and "data16" do?

    "data16" means "16 bits of data that the disaassembler can't parse as an instruction"
    "nop" means "no operation" All it does is advance the instruction pointer to the next instruction.

  • How do I print out a string in GDB?

    The command "x/s ADDR" will print out the string which is pointed to by ADDR.
    Example: x/s 0x503eaf0 will print out the string that starts at address 0x503eaf0.

Buflab

  • The lab documentation states that "Returning anywhere except for the very beginning of any function is considered an invalid submission and will receive zero points". But what about the dynamite and nitro stages where we must return back to test? :

    It is acceptable to return back to the original return address from the test function. That is: When the getbuf function is called, you may return back to the return address that is pushed onto the stack. You may not however, jump past the stack smashing check, or the test of the return value from getbufn.