Benutzer-Werkzeuge

Webseiten-Werkzeuge


neuerlehrplan:klasse10:algorithmusbegriff

Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen angezeigt.

Link zu dieser Vergleichsansicht

Beide Seiten der vorigen RevisionVorhergehende Überarbeitung
Nächste Überarbeitung
Vorhergehende Überarbeitung
neuerlehrplan:klasse10:algorithmusbegriff [2025/05/15 10:25] – [Beispiel: "Hallo Welt!"-Programm mit Assembler] lutzneuerlehrplan:klasse10:algorithmusbegriff [2025/05/15 10:46] (aktuell) – [Beispiel: "Hallo Welt!"-Programm in Python] lutz
Zeile 60: Zeile 60:
   * Bei Interpretersprachen wird das Programm direkt mit dem Interpreter aufgerufen und dadurch ausgeführt.   * Bei Interpretersprachen wird das Programm direkt mit dem Interpreter aufgerufen und dadurch ausgeführt.
  
-====Beispiel: "Hallo Welt!"-Programm mit Assembler=====+====Beispiel: "Hallo Welt!"-Programm in Assembler=====
  
-<file hallo.asm>+<code asm hallo.asm>
 section .text section .text
  global _start       ;must be declared for using gcc  global _start       ;must be declared for using gcc
Zeile 78: Zeile 78:
 msg db 'Hello, world!',0xa ;our dear string msg db 'Hello, world!',0xa ;our dear string
 len equ $ - msg ;length of our dear string len equ $ - msg ;length of our dear string
-</file>+</code> 
 + 
 +Aufruf des Assemblers in der Kommandozeile: 
 + 
 +<code> 
 +nasm -f elf64 hallo.asm 
 +</code> 
 + 
 +Programm linken: 
 + 
 +<code> 
 +ld hallo.o -o hallo 
 +</code> 
 + 
 +Programm ausführen: 
 + 
 +<code> 
 +./hallo 
 +</code> 
 + 
 +Ausgabe: 
 +<code> 
 +Hello, world! 
 +</code> 
 + 
 +====Beispiel: "Hallo Welt!"-Programm in C===== 
 + 
 +<code c hallo.c> 
 +#include <stdio.h> 
 + 
 +int main() 
 +
 +    printf("Hello, World!\n"); 
 + 
 +    return 0; 
 +
 +</code> 
 + 
 +Programm compilieren: 
 + 
 +<code> 
 +gcc hallo.c -o hallo 
 +</code> 
 + 
 +Programm ausführen: 
 + 
 +<code> 
 +./hallo 
 +</code> 
 + 
 +Ausgabe: 
 +<code> 
 +Hello, world! 
 +</code> 
 + 
 +====Beispiel: "Hallo Welt!"-Programm in Python===== 
 + 
 +<code python hallo.py> 
 +print ("Hello, world!\n"
 +</code> 
 + 
 +Programm ausführen: 
 + 
 +<code> 
 +python hallo.py 
 +</code> 
 + 
 +Ausgabe: 
 +<code> 
 +Hello, world! 
 +</code> 
neuerlehrplan/klasse10/algorithmusbegriff.1747297518.txt.gz · Zuletzt geändert: von lutz