neuerlehrplan:klasse10:algorithmusbegriff
Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
| Beide Seiten der vorigen RevisionVorhergehende ÜberarbeitungNächste Überarbeitung | Vorhergehende Überarbeitung | ||
| neuerlehrplan:klasse10:algorithmusbegriff [2025/05/15 10:25] – [Beispiel: "Hallo Welt!"-Programm mit Assembler] lutz | neuerlehrplan: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: | + | ====Beispiel: |
| - | <code hallo.asm> | + | < |
| section .text | section .text | ||
| global _start | global _start | ||
| Zeile 79: | Zeile 79: | ||
| len equ $ - msg ; | len equ $ - msg ; | ||
| </ | </ | ||
| + | |||
| + | Aufruf des Assemblers in der Kommandozeile: | ||
| + | |||
| + | < | ||
| + | nasm -f elf64 hallo.asm | ||
| + | </ | ||
| + | |||
| + | Programm linken: | ||
| + | |||
| + | < | ||
| + | ld hallo.o -o hallo | ||
| + | </ | ||
| + | |||
| + | Programm ausführen: | ||
| + | |||
| + | < | ||
| + | ./hallo | ||
| + | </ | ||
| + | |||
| + | Ausgabe: | ||
| + | < | ||
| + | Hello, world! | ||
| + | </ | ||
| + | |||
| + | ====Beispiel: | ||
| + | |||
| + | <code c hallo.c> | ||
| + | #include < | ||
| + | |||
| + | int main() | ||
| + | { | ||
| + | printf(" | ||
| + | |||
| + | return 0; | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | Programm compilieren: | ||
| + | |||
| + | < | ||
| + | gcc hallo.c -o hallo | ||
| + | </ | ||
| + | |||
| + | Programm ausführen: | ||
| + | |||
| + | < | ||
| + | ./hallo | ||
| + | </ | ||
| + | |||
| + | Ausgabe: | ||
| + | < | ||
| + | Hello, world! | ||
| + | </ | ||
| + | |||
| + | ====Beispiel: | ||
| + | |||
| + | <code python hallo.py> | ||
| + | print (" | ||
| + | </ | ||
| + | |||
| + | Programm ausführen: | ||
| + | |||
| + | < | ||
| + | python hallo.py | ||
| + | </ | ||
| + | |||
| + | Ausgabe: | ||
| + | < | ||
| + | Hello, world! | ||
| + | </ | ||
| + | |||
neuerlehrplan/klasse10/algorithmusbegriff.1747297543.txt.gz · Zuletzt geändert: von lutz
