präprozessor und linkerfehler gefixt

This commit is contained in:
Tobias Kachel 2026-03-26 14:40:22 +01:00
parent c8490df248
commit 382203559c
4 changed files with 57 additions and 6 deletions

View File

@ -0,0 +1,48 @@
.file "laufzeitfehler.cpp"
.text
#APP
.globl _ZSt21ios_base_library_initv
.section .rodata
.LC0:
.string "\n"
#NO_APP
.text
.globl main
.type main, @function
main:
.LFB1984:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $16, %rsp
movl $0, -16(%rbp)
movl $1, -12(%rbp)
movl $2, -8(%rbp)
movl $0, -4(%rbp)
jmp .L2
.L3:
movl -4(%rbp), %eax
cltq
movl -16(%rbp,%rax,4), %eax
movl %eax, %esi
movl $_ZSt4cout, %edi
call _ZNSolsEi
movl $.LC0, %esi
movq %rax, %rdi
call _ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc
addl $1, -4(%rbp)
.L2:
cmpl $9, -4(%rbp)
jle .L3
movl $0, %eax
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE1984:
.size main, .-main
.ident "GCC: (GNU) 15.2.1 20260123 (Red Hat 15.2.1-7)"
.section .note.GNU-stack,"",@progbits

View File

@ -1,2 +1,3 @@
int addtwo(int s1, int s2)
{}

View File

@ -1,9 +1,9 @@
#include "link.h"
#include <iostream>
void addtwo();
int main(){
int a = 1;
int b = 2;
addtwo(a, b);
addtwo();
}

View File

@ -1,6 +1,8 @@
void function();
#include <iostream>
using namespace std
#include <eror.h>
int main(){
function();
a = 1 + 2;
cout << a << "\n";
}