Announcement

Collapse
No announcement yet.

x86 (amd64) assembly

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • x86 (amd64) assembly





    Turns out you have to learn assembly to pass intro computer systems

    OK, so the internet has failed me here, where poly (and by poly I mean probably Asher ) can come and save the day. What is this instruction doing?

    0x000000000040101a <+40>: cmp %eax,0x4(%rbp,%rbx,4)

    In intel flavor:
    0x000000000040101a <+40>: cmp DWORD PTR [rbp+rbx*4+0x4],eax

    I know it's comparing two pieces of memory. I figure it's performing the arithmetic operation shown in brackets on the values in those registers but this seems to create a memory address that is out of bounds
    I assume I am not understanding something here. Can anyone help? Thanks.
    If there is no sound in space, how come you can hear the lasers?
    ){ :|:& };:

  • #2
    I know assembly on the 6502/65C12...a little out of date I'm afraid.
    Speaking of Erith:

    "It's not twinned with anywhere, but it does have a suicide pact with Dagenham" - Linda Smith

    Comment


    • #3
      If the calculated adress is out of bound, you probably have a bug in your program
      With or without religion, you would have good people doing good things and evil people doing evil things. But for good people to do evil things, that takes religion.

      Steven Weinberg

      Comment


      • #4
        It's not my program. My assignment is to reverse engineer the professor's program.
        If there is no sound in space, how come you can hear the lasers?
        ){ :|:& };:

        Comment


        • #5
          RTFM

          Comment


          • #6
            Originally posted by Hauldren Collider View Post
            It's not my program. My assignment is to reverse engineer the professor's program.
            Well, then the bug is in your "debugger"
            With or without religion, you would have good people doing good things and evil people doing evil things. But for good people to do evil things, that takes religion.

            Steven Weinberg

            Comment


            • #7
              I found the problem, I wasn't at the correct step, the register had not been assigned to what I thought it was.

              I would seriously doubt the problem would lie with GDB.
              Last edited by Hauldren Collider; February 13, 2012, 17:36. Reason: typo
              If there is no sound in space, how come you can hear the lasers?
              ){ :|:& };:

              Comment


              • #8
                The "debugger" I thought about was some 40-50 cm from the screen
                With or without religion, you would have good people doing good things and evil people doing evil things. But for good people to do evil things, that takes religion.

                Steven Weinberg

                Comment


                • #9
                  ah, good old PEBCAC. Yes, that was part of it.
                  If there is no sound in space, how come you can hear the lasers?
                  ){ :|:& };:

                  Comment


                  • #10
                    Originally posted by Hauldren Collider View Post
                    ah, good old PEBCAC. Yes, that was part of it.
                    I usually spell Keyboard with a K.

                    EDIT: well I guess it could be computer...

                    Comment


                    • #11
                      Oh.
                      Speaking of Erith:

                      "It's not twinned with anywhere, but it does have a suicide pact with Dagenham" - Linda Smith

                      Comment

                      Working...
                      X