FAQ
Hi!

I tried to disassemble this small go code snippet:
https://play.golang.org/p/kqVhFlbZGX

The result output is something like this:

[e@localhost]$ go tool 6g -S code.go

"".SumXXX t=1 size=48 value=0 args=0x10 locals=0x0
0x0000 00000 (code.go:7) TEXT "".SumXXX+0(SB),4,$0-16
0x0000 00000 (code.go:7) NOP ,
0x0000 00000 (code.go:7) NOP ,
0x0000 00000 (code.go:7) FUNCDATA
$0,gclocals·9308e7ef08d2cc2f72ae1228688dacf9+0(SB)
0x0000 00000 (code.go:7) FUNCDATA
$1,gclocals·3280bececceccd33cb74587feedb1f9f+0(SB)

0x0000 00000 (code.go:8) MOVBQZX "".xXXX+8(FP),BX
0x0005 00005 (code.go:8) MOVBQZX "".yXXX+9(FP),BP

0x000a 00010 (code.go:8) ADDQ BP,BX
0x000d 00013 (code.go:8) MOVQ BX,AX
0x0010 00016 (code.go:9) MOVBQZX "".accumXXX+0(SB),BX
0x0017 00023 (code.go:9) ADDQ AX,BX
0x001a 00026 (code.go:9) MOVB BL,"".accumXXX+0(SB)
0x0020 00032 (code.go:9) NOP ,
0x0020 00032 (code.go:10) MOVB AL,"".~r2+16(FP)
0x0024 00036 (code.go:10) RET ,
...

What is MOVBQZX instruction ?
I tried to google it but could not found any references out there ...

Thanks,

Eduardo

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Search Discussions

  • Khr at Dec 25, 2014 at 11:53 pm
    Move byte to quadword (8 bytes) zero extend. It is the equivalent to
    movzbl/movzbq in standard x86 assembly speak.
    On Thursday, December 25, 2014 11:39:33 AM UTC-8, EduRam wrote:

    Hi!

    I tried to disassemble this small go code snippet:
    https://play.golang.org/p/kqVhFlbZGX

    The result output is something like this:

    [e@localhost]$ go tool 6g -S code.go

    "".SumXXX t=1 size=48 value=0 args=0x10 locals=0x0
    0x0000 00000 (code.go:7) TEXT "".SumXXX+0(SB),4,$0-16
    0x0000 00000 (code.go:7) NOP ,
    0x0000 00000 (code.go:7) NOP ,
    0x0000 00000 (code.go:7) FUNCDATA
    $0,gclocals·9308e7ef08d2cc2f72ae1228688dacf9+0(SB)
    0x0000 00000 (code.go:7) FUNCDATA
    $1,gclocals·3280bececceccd33cb74587feedb1f9f+0(SB)

    0x0000 00000 (code.go:8) MOVBQZX "".xXXX+8(FP),BX
    0x0005 00005 (code.go:8) MOVBQZX "".yXXX+9(FP),BP

    0x000a 00010 (code.go:8) ADDQ BP,BX
    0x000d 00013 (code.go:8) MOVQ BX,AX
    0x0010 00016 (code.go:9) MOVBQZX "".accumXXX+0(SB),BX
    0x0017 00023 (code.go:9) ADDQ AX,BX
    0x001a 00026 (code.go:9) MOVB BL,"".accumXXX+0(SB)
    0x0020 00032 (code.go:9) NOP ,
    0x0020 00032 (code.go:10) MOVB AL,"".~r2+16(FP)
    0x0024 00036 (code.go:10) RET ,
    ...

    What is MOVBQZX instruction ?
    I tried to google it but could not found any references out there ...

    Thanks,

    Eduardo
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Bryan Turley at Dec 25, 2014 at 11:55 pm

    On Thursday, December 25, 2014 1:39:33 PM UTC-6, EduRam wrote:
    Hi!

    I tried to disassemble this small go code snippet:
    https://play.golang.org/p/kqVhFlbZGX

    The result output is something like this:

    [e@localhost]$ go tool 6g -S code.go

    "".SumXXX t=1 size=48 value=0 args=0x10 locals=0x0
    0x0000 00000 (code.go:7) TEXT "".SumXXX+0(SB),4,$0-16
    0x0000 00000 (code.go:7) NOP ,
    0x0000 00000 (code.go:7) NOP ,
    0x0000 00000 (code.go:7) FUNCDATA
    $0,gclocals·9308e7ef08d2cc2f72ae1228688dacf9+0(SB)
    0x0000 00000 (code.go:7) FUNCDATA
    $1,gclocals·3280bececceccd33cb74587feedb1f9f+0(SB)

    0x0000 00000 (code.go:8) MOVBQZX "".xXXX+8(FP),BX
    0x0005 00005 (code.go:8) MOVBQZX "".yXXX+9(FP),BP

    0x000a 00010 (code.go:8) ADDQ BP,BX
    0x000d 00013 (code.go:8) MOVQ BX,AX
    0x0010 00016 (code.go:9) MOVBQZX "".accumXXX+0(SB),BX
    0x0017 00023 (code.go:9) ADDQ AX,BX
    0x001a 00026 (code.go:9) MOVB BL,"".accumXXX+0(SB)
    0x0020 00032 (code.go:9) NOP ,
    0x0020 00032 (code.go:10) MOVB AL,"".~r2+16(FP)
    0x0024 00036 (code.go:10) RET ,
    ...

    What is MOVBQZX instruction ?
    I tried to google it but could not found any references out there ...
    The assembler is a bit strange.

    MOV Byte to Quadword (64bits) with Zero Extension or
    var a byte
    b := uint64(a)

    It would be SX for signed ints

    In x86 land "word" was/is 16bits. W = 16bits L == 32bits

    In AMD's x86 manuals it is MOVSX and MOVSXD (probably the same in Intel's)


    Thanks,
    Eduardo
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Bryan Turley at Dec 25, 2014 at 11:59 pm

    On Thursday, December 25, 2014 5:55:21 PM UTC-6, Bryan Turley wrote:

    On Thursday, December 25, 2014 1:39:33 PM UTC-6, EduRam wrote:

    Hi!

    I tried to disassemble this small go code snippet:
    https://play.golang.org/p/kqVhFlbZGX

    The result output is something like this:

    [e@localhost]$ go tool 6g -S code.go

    "".SumXXX t=1 size=48 value=0 args=0x10 locals=0x0
    0x0000 00000 (code.go:7) TEXT "".SumXXX+0(SB),4,$0-16
    0x0000 00000 (code.go:7) NOP ,
    0x0000 00000 (code.go:7) NOP ,
    0x0000 00000 (code.go:7) FUNCDATA
    $0,gclocals·9308e7ef08d2cc2f72ae1228688dacf9+0(SB)
    0x0000 00000 (code.go:7) FUNCDATA
    $1,gclocals·3280bececceccd33cb74587feedb1f9f+0(SB)

    0x0000 00000 (code.go:8) MOVBQZX "".xXXX+8(FP),BX
    0x0005 00005 (code.go:8) MOVBQZX "".yXXX+9(FP),BP

    0x000a 00010 (code.go:8) ADDQ BP,BX
    0x000d 00013 (code.go:8) MOVQ BX,AX
    0x0010 00016 (code.go:9) MOVBQZX "".accumXXX+0(SB),BX
    0x0017 00023 (code.go:9) ADDQ AX,BX
    0x001a 00026 (code.go:9) MOVB BL,"".accumXXX+0(SB)
    0x0020 00032 (code.go:9) NOP ,
    0x0020 00032 (code.go:10) MOVB AL,"".~r2+16(FP)
    0x0024 00036 (code.go:10) RET ,
    ...

    What is MOVBQZX instruction ?
    I tried to google it but could not found any references out there ...
    The assembler is a bit strange.

    MOV Byte to Quadword (64bits) with Zero Extension or
    var a byte
    b := uint64(a)

    It would be SX for signed ints

    In x86 land "word" was/is 16bits. W = 16bits L == 32bits

    In AMD's x86 manuals it is MOVSX and MOVSXD (probably the same in Intel's)

    Or MOVZX... since we where originally talking about the unsigned
    version....
    Thanks,
    Eduardo
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-nuts @
categoriesgo
postedDec 25, '14 at 7:39p
activeDec 25, '14 at 11:59p
posts4
users3
websitegolang.org

3 users in discussion

Bryan Turley: 2 posts Khr: 1 post EduRam: 1 post

People

Translate

site design / logo © 2021 Grokbase