Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I'll share my reduced assembly knowledge with you:</p> <pre><code>61 TEXT ·RawSyscall(SB),7,$0 62 MOVQ 16(SP), DI 63 MOVQ 24(SP), SI 64 MOVQ 32(SP), DX 65 MOVQ $0, R10 66 MOVQ $0, R8 67 MOVQ $0, R9 68 MOVQ 8(SP), AX // syscall entry 69 ADDQ $0x2000000, AX 70 SYSCALL 71 JCC ok1 72 MOVQ $-1, 40(SP) // r1 73 MOVQ $0, 48(SP) // r2 74 MOVQ AX, 56(SP) // errno 75 RET 76 ok1: 77 MOVQ AX, 40(SP) // r1 78 MOVQ DX, 48(SP) // r2 79 MOVQ $0, 56(SP) // errno 80 RET 81 </code></pre> <ul> <li>Line 61 is the routine entry point</li> <li>Line 76 is a label called <code>ok1</code></li> <li>Line 71 is a conditional jump to label <code>ok1</code>.</li> </ul> <p>The short names you see on every line on the left side are called <code>mnemonics</code> and stand for assembly instructions:</p> <ul> <li><code>MOVQ</code> means Move Quadword (64 bits of data).</li> <li><code>ADDQ</code> is Add Quadword.</li> <li><code>SYSCALL</code> is kinda obvious</li> <li><code>JCC</code> is Jump if Condition (condition flag set by previous instruction)</li> <li><code>RET</code> is return</li> </ul> <p>On the right side of the mnemonics you'll find each instruction's arguments which are basically constants and <a href="http://tanmayonrun.blogspot.ch/2011/06/purposes-of-having-general-registers.html" rel="noreferrer">registers</a>.</p> <ul> <li><code>SP</code> is the Stack Pointer</li> <li><code>AX</code> is the Accumulator</li> <li><code>BX</code> is the Base register</li> </ul> <p>each register can hold a certain amount of data. On 64 bit CPU architectures I believe it's in fact 64 bits per register.</p> <p>The only difference between <code>Syscall</code> and <code>RawSyscall</code> is on line 14, 28 and 34 where <code>Syscall</code> will call <code>runtime·entersyscall(SB)</code> and <code>runtime·exitsyscall(SB)</code> whereas <code>RawSyscall</code> will not. I assume this means that <code>Syscall</code> notifies the runtime that it's switched to a blocking syscall operations and can yield CPU-time to another goroutine/thread whereas <code>RawSyscall</code> will just block.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload