Subversion Repositories Code-Repo

Compare Revisions

Regard whitespace Rev 140 → Rev 141

/Classwork/CS3214 - Computer Systems/Project 1 - Buffer Bomb/Test/test.c
0,0 → 1,19
typedef enum {A,B} op;
 
int main() {
return 0;
}
 
int tmp_func(op o) {
switch(o) {
case A:
return 0;
break;
case B:
return 1;
break;
default:
return -1;
break;
}
}
/Classwork/CS3214 - Computer Systems/Project 1 - Buffer Bomb/Test/test.s
0,0 → 1,37
.file "test.c"
.text
.globl main
.type main, @function
main:
.LFB0:
.cfi_startproc
movl $0, %eax
ret
.cfi_endproc
.LFE0:
.size main, .-main
.globl tmp_func
.type tmp_func, @function
tmp_func:
.LFB1:
.cfi_startproc
movl $-1, %eax
cmpl $1, %edi
ja .L5
mov %edi, %edi
movl CSWTCH.1(,%rdi,4), %eax
.L5:
rep
ret
.cfi_endproc
.LFE1:
.size tmp_func, .-tmp_func
.section .rodata
.align 4
.type CSWTCH.1, @object
.size CSWTCH.1, 8
CSWTCH.1:
.long 0
.long 1
.ident "GCC: (GNU) 4.4.4 20100726 (Red Hat 4.4.4-13)"
.section .note.GNU-stack,"",@progbits
/Classwork/CS3214 - Computer Systems/Project 1 - Buffer Bomb/Test/test2.c
0,0 → 1,22
typedef enum {A,B,C,D,E,F,G} op;
 
extern tmp(char a);
 
int main() {
return 0;
}
 
char tmp_func(op o) {
switch(o) {
case A: tmp('A'); break;
case B: tmp('B'); break;
case C: tmp('C'); break;
case D: tmp('D'); break;
case E: tmp('E'); break;
case F: tmp('F'); break;
case G: tmp('G'); break;
default:
return '?';
break;
}
}
/Classwork/CS3214 - Computer Systems/Project 1 - Buffer Bomb/Test/test2.s
0,0 → 1,78
.file "test2.c"
.text
.globl main
.type main, @function
main:
.LFB0:
.cfi_startproc
movl $0, %eax
ret
.cfi_endproc
.LFE0:
.size main, .-main
.globl tmp_func
.type tmp_func, @function
tmp_func:
.LFB1:
.cfi_startproc
subq $8, %rsp
.cfi_def_cfa_offset 16
movl $63, %eax
cmpl $6, %edi
ja .L14
mov %edi, %edi
jmp *.L12(,%rdi,8)
.section .rodata
.align 8
.align 4
.L12:
.quad .L5
.quad .L6
.quad .L7
.quad .L8
.quad .L9
.quad .L10
.quad .L11
.text
.L5:
movl $65, %edi
call tmp
jmp .L15
.L6:
movl $66, %edi
call tmp
.p2align 4,,3
jmp .L15
.L7:
movl $67, %edi
call tmp
.p2align 4,,3
jmp .L15
.L8:
movl $68, %edi
call tmp
.p2align 4,,3
jmp .L15
.L9:
movl $69, %edi
call tmp
.p2align 4,,3
jmp .L15
.L10:
movl $70, %edi
call tmp
.p2align 4,,3
jmp .L15
.L11:
movl $71, %edi
call tmp
.L15:
.L14:
addq $8, %rsp
.cfi_def_cfa_offset 8
ret
.cfi_endproc
.LFE1:
.size tmp_func, .-tmp_func
.ident "GCC: (GNU) 4.4.4 20100726 (Red Hat 4.4.4-13)"
.section .note.GNU-stack,"",@progbits
/Classwork/CS3214 - Computer Systems/Project 1 - Buffer Bomb/Test/test3.c
0,0 → 1,28
typedef enum {A = 2,
B = 6,
C = 10,
D = 14,
E = 18,
F = 22,
G = 26} op;
 
extern tmp(char a);
 
int main() {
return 0;
}
 
char tmp_func(op o) {
switch(o) {
case A: tmp('A'); break;
case B: tmp('B'); break;
case C: tmp('C'); break;
case D: tmp('D'); break;
case E: tmp('E'); break;
case F: tmp('F'); break;
case G: tmp('G'); break;
default:
return '?';
break;
}
}
/Classwork/CS3214 - Computer Systems/Project 1 - Buffer Bomb/Test/test3.s
0,0 → 1,103
.file "test3.c"
.text
.globl main
.type main, @function
main:
.LFB0:
.cfi_startproc
movl $0, %eax
ret
.cfi_endproc
.LFE0:
.size main, .-main
.globl tmp_func
.type tmp_func, @function
tmp_func:
.LFB1:
.cfi_startproc
subq $8, %rsp
.cfi_def_cfa_offset 16
cmpl $26, %edi
ja .L4
mov %edi, %edi
jmp *.L12(,%rdi,8)
.section .rodata
.align 8
.align 4
.L12:
.quad .L4
.quad .L4
.quad .L5
.quad .L4
.quad .L4
.quad .L4
.quad .L6
.quad .L4
.quad .L4
.quad .L4
.quad .L7
.quad .L4
.quad .L4
.quad .L4
.quad .L8
.quad .L4
.quad .L4
.quad .L4
.quad .L9
.quad .L4
.quad .L4
.quad .L4
.quad .L10
.quad .L4
.quad .L4
.quad .L4
.quad .L11
.text
.L5:
movl $65, %edi
call tmp
jmp .L15
.L6:
movl $66, %edi
call tmp
.p2align 4,,3
jmp .L15
.L7:
movl $67, %edi
call tmp
.p2align 4,,3
jmp .L15
.L8:
movl $68, %edi
call tmp
.p2align 4,,3
jmp .L15
.L9:
movl $69, %edi
call tmp
.p2align 4,,3
jmp .L15
.L10:
movl $70, %edi
call tmp
.p2align 4,,3
jmp .L15
.L11:
movl $71, %edi
call tmp
.p2align 4,,3
jmp .L15
.L4:
movl $63, %eax
jmp .L14
.L15:
.L14:
addq $8, %rsp
.cfi_def_cfa_offset 8
.p2align 4,,2
ret
.cfi_endproc
.LFE1:
.size tmp_func, .-tmp_func
.ident "GCC: (GNU) 4.4.4 20100726 (Red Hat 4.4.4-13)"
.section .note.GNU-stack,"",@progbits