-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathgoasm.s
More file actions
29 lines (24 loc) · 759 Bytes
/
goasm.s
File metadata and controls
29 lines (24 loc) · 759 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
TEXT ·Gen2Rands(SB),7,$0
MOVQ addr+0(FP), BP
MOVL 0(BP),DX
BYTE $0x8d; BYTE $0x4c; BYTE $0x12; BYTE $0x01// lea 0x1(%rdx,%rdx,1),%ecx
ADDL DX, DX
MOVL DX, AX
XORL $0x88888eee,AX
ORL $0x1,DX
BYTE $0x0f; BYTE $0x49; BYTE $0xc1// cmovns %ecx,%eax
MOVL AX, new+8(FP)
MOVL AX,DX
BYTE $0x8d; BYTE $0x4c; BYTE $0x12; BYTE $0x01// lea 0x1(%rdx,%rdx,1),%ecx
ADDL DX, DX
MOVL DX, AX
XORL $0x88888eee,AX
ORL $0x1,DX
BYTE $0x0f; BYTE $0x49; BYTE $0xc1// cmovns %ecx,%eax
MOVL AX, new+12(FP)
MOVL AX, 0(BP)
RET
/*This assembly program should be included in a folder in gopath/src called goasm, in the same directory as a file called goasm.go that contains:
package goasm
func Gen2Rands(addr *uint32) (res1,res2 uint32)
*/