PPaste!

Home - All the pastes - Authored by Thooms

Raw version

 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
30
31
32
33
34
35
36
37
38
39
$ cat RC4.s.m4
m4_include(macros.m4)m4_dnl
NEWFUNC(testfunc)
    DEFVAR(INT64, theInt)
    DEFVAR(INT32, theSmallInt)
    DEFVAR(ARRAY, INT8, 256, theArray)
START_FUNC
    movq $256, %rcx
    xorq %rax, %rax
testfunc_loop_start:
    movb %al, V_theArray(%rax)
    incq %rax
    decq %rcx
    jnz testfunc_loop_start
    movq $50, %rax
    movb V_theArray(%rax), %al
END_FUNC
$ m4 -P RC4.s.m4
    .globl testfunc
    .type testfunc, @function
testfunc:
    # INT64 theInt = -8(%rbp)
    # INT32 theSmallInt = -12(%rbp)
    # INT8 theArray[256] = -268(%rbp)    
    pushq %rbp
    movq %rsp, %rbp
    subq $268, %rsp
    movq $256, %rcx
    xorq %rax, %rax
testfunc_loop_start:
    movb %al, -268(%rbp, %rax, 1)
    incq %rax
    decq %rcx
    jnz testfunc_loop_start
    movq $50, %rax
    movb -268(%rbp, %rax, 1), %al
    movq %rbp, %rsp
    popq %rbp
    ret