Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen der Seite angezeigt.
Beide Seiten, vorherige Überarbeitung Vorherige Überarbeitung Nächste Überarbeitung | Vorherige Überarbeitung | ||
gf_informatik:assembler [2022-06-08 11:19] – [Aufgabe 1] sca | gf_informatik:assembler [2025-01-05 08:34] (aktuell) – gelöscht hof | ||
---|---|---|---|
Zeile 1: | Zeile 1: | ||
- | ====== Assembler ====== | ||
- | |||
- | Der Grossteil der Informationen findest du in den Slides. Unten findest du primär Aufträge und Links. | ||
- | |||
- | {{ : | ||
- | ===== Little Man Computer ===== | ||
- | |||
- | [[https:// | ||
- | |||
- | [[https:// | ||
- | |||
- | |||
- | ==== Instruction Set ==== | ||
- | |||
- | ^ Code ^ Name ^ Description ^ | ||
- | | 0 | HLT | Stop (Little Man has a rest). | | ||
- | | 1 | ADD | Add the contents of the memory address to the Accumulator | | ||
- | | 2 | SUB | Subtract the contents of the memory address from the Accumulator | | ||
- | | 3 | STA or STO | Store the value in the Accumulator in the memory address given. | | ||
- | | 4 | | This code is unused and gives an error. | | ||
- | | 5 | LDA | Load the Accumulator with the contents of the memory address given | | ||
- | | 6 | BRA | Branch - use the address given as the address of the next instruction | | ||
- | | 7 | BRZ | Branch to the address given if the Accumulator is zero | | ||
- | | 8 | BRP | Branch to the address given if the Accumulator is zero or positive | | ||
- | | 9 | INP or OUT | Input or Output. Take from Input if address is 1, copy to Output if address is 2. | | ||
- | | 9 | OTC | Output accumulator as a character if address is 22. (Non-standard instruction) | | ||
- | | 9 | DAT | Used to indicate a location that contains data.| | ||
- | |||
- | ===== Aufgaben ===== | ||
- | |||
- | ==== Aufgabe 1 ==== | ||
- | |||
- | Betrachte das einfache Assemblerprogramm, | ||
- | <code asm> | ||
- | LDA 97 | ||
- | ADD 98 | ||
- | STA 99 | ||
- | OUT | ||
- | HLT | ||
- | </ | ||
- | |||
- | Arbeite in 2er-Gruppe. | ||
- | |||
- | 1. Tippe den Code in den LMC (nicht copy-paste). | ||
- | 1. Schreibe die beiden Zahlen, die du addieren möchtest, am richtigen Ort in den Speicher. | ||
- | 1. Führe das Programm wiederholt aus. Verfolge genau, was wann passiert: | ||
- | 1. Beobachte den Instruktionszyklus. | ||
- | 1. Stelle sicher, dass du alles verstehst. | ||
- | 1. Schreibe den Code so um, dass nun vier Zahlen addiert werden können. | ||
- | |||
- | |||