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 ...
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 ...
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.