diff --git a/20210531/catcan2.red b/20210531/catcan2.red new file mode 100644 index 0000000000000000000000000000000000000000..f0aa1dcf34b4ecda5fe14a170ec69c6ad3044fe3 --- /dev/null +++ b/20210531/catcan2.red @@ -0,0 +1,21 @@ +;name Cat Can +;author A. Kirchner, F. Uy, minor changes by P. Gerwinski +;assert 1 +; +; Your basic two sweep methodical bomber. +; Fires SPL 0 and JMP -1 at every eight +; addresses, then erases the core with +; DAT bombs. + +start mov trap2, < bomb + mov trap1, < bomb + sub # 6, bomb + jmn start, bomb ; trap loop +set mov # -5, bomb +kill mov bomb, @ bomb + djn kill, bomb ; kill loop +reset jmp set +bomb dat # -8 +trap1 spl 0 +trap2 jmp -1 + end start diff --git a/20210531/chml78b.red b/20210531/chml78b.red new file mode 100644 index 0000000000000000000000000000000000000000..dc12708ab8b5dc93351a6f3fa046a12416b69576 --- /dev/null +++ b/20210531/chml78b.red @@ -0,0 +1,88 @@ +;name Chamaeleon +;version 7.8b (19.9.1991, modifiziert am 12. und 17.11.2012) +;author Peter Gerwinski +;assert 1 + +step equ 97 + +pos dat #42, #-20 + +melden mov hallo, ctrl ; Gefangener Gegner meldet sich + +cntdwn sub #1, ctr ; Runtime-Fallen-Fini +falle spl cntdwn + mov fnum, <hallo + jmn falle, ctr + +fnum dat #0, #(cntdwn - hallo) ; echtes Fini +ctrl djn ctrl, test ; Haupt-Task überwachen + spl piranh +fini mov fnum, <hallo +ctr jmp fini, #MAXPROCESSES + +hallo jmp (fini - ctrl), #(selbst + 20 - hallo) ; Klingel für gefangenen Gegner + +muni2 jmp 1 +muni jmp @42, #(melden - pos) ; Munition + +piranh mov #9, muni ; Piranhas, Version 2.4 +ploop mov @muni, <ppos +pziel mov pmuni, (ppos - 20) + sub #73, pziel + djn ploop, muni +ppos spl @0, #833 + add #653, ppos + jmz piranh, muni +pmuni dat #0, #0 + +start spl ctrl ; Überwachungs-Task aktivieren +loop mov #12, test ; Watchdog zurücksetzen + cmp @pos, <pos ; Gegner mit großer Schrittweite suchen + jmp feuer + sub #step, pos + cmp @pos, <pos + jmp feuer + sub #step, pos + cmp @pos, <pos + jmp feuer + sub #step, pos + jmp loop + +feuer mov pos, psave + add #step, pos +such mov #11, test ; Watchdog + jmn gefu, <pos ; Gegner mit Schrittweite 1 suchen + jmn gefu, <pos + jmn gefu, <pos + jmn gefu, <pos + jmz such, <pos + +gefu cmp pos, spos ; Erkenne dich selbst! + jmn drauf, 1 + mov psave, pos + sub #step, pos + djn loop, selbst + mov hallo, ctrl ; Bei Langeweile: fini + jmp fini + +drauf mov #13, test ; Gegner mit jmp-Bomben eindecken + mov muni, @pos + sub pos, @pos ; Sprung in die Falle + mov muni2, <pos + mov muni2, <pos + mov muni2, <pos + mov muni2, <pos + mov muni2, <pos + mov muni2, <pos + mov psave, pos + sub #step, pos + djn loop, genug + jmp fini ; Zu viel zu Bombardieren: fini und Piranhas + +spos dat #42, #(selbst - pos) +psave dat #0, #0 +test dat #0, #2 +genug dat #0, #10 +selbst dat #0, #37 + + end start diff --git a/20210531/fini.red b/20210531/fini.red new file mode 100644 index 0000000000000000000000000000000000000000..977eac6472c78624d3aceb9929009d4f48e69341 --- /dev/null +++ b/20210531/fini.red @@ -0,0 +1,16 @@ +;redcode +;name fini +;version (8.1990) +;author Bodo M�ller +;assert 1 + +;+--------------------------------------------------------------------------+ +;| FINI ( = Endstufe von PARALYSE) Version 1.0 by B.M. Aug. '90 | +;+--------------------------------------------------------------------------+ + +NUM DAT #-2 +START MOV NUM, <POS +LOOP JMP START +POS DAT #-3 + + END START diff --git a/20210531/logo-hochschule-bochum-cvh-text-v2.pdf b/20210531/logo-hochschule-bochum-cvh-text-v2.pdf new file mode 100644 index 0000000000000000000000000000000000000000..3725a72c764b4d9ab200553474e4262161f7a5b5 Binary files /dev/null and b/20210531/logo-hochschule-bochum-cvh-text-v2.pdf differ diff --git a/20210531/logo-hochschule-bochum.pdf b/20210531/logo-hochschule-bochum.pdf new file mode 100644 index 0000000000000000000000000000000000000000..8cad73dbb48a2b550bf29355b5a6ec895ce091f8 Binary files /dev/null and b/20210531/logo-hochschule-bochum.pdf differ diff --git a/20210525/oft.red b/20210531/oft.red similarity index 100% rename from 20210525/oft.red rename to 20210531/oft.red diff --git a/20210531/pgslides.sty b/20210531/pgslides.sty new file mode 100644 index 0000000000000000000000000000000000000000..9a019ce99f03d27a17942facc56fe2145f46b6a6 --- /dev/null +++ b/20210531/pgslides.sty @@ -0,0 +1,233 @@ +% pgslides.sty - LaTeX Settings for Lecture Slides +% Copyright (C) 2012, 2013 Peter Gerwinski +% +% This document is free software: you can redistribute it and/or +% modify it either under the terms of the Creative Commons +% Attribution-ShareAlike 3.0 License, or under the terms of the +% GNU General Public License as published by the Free Software +% Foundation, either version 3 of the License, or (at your option) +% any later version. +% +% This document is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this document. If not, see <http://www.gnu.org/licenses/>. +% +% You should have received a copy of the Creative Commons +% Attribution-ShareAlike 3.0 Unported License along with this +% document. If not, see <http://creativecommons.org/licenses/>. + +\usepackage{amsfonts} +\usepackage[british,german]{babel} % Yes, really "german" and not "ngerman". +\usepackage[utf8]{luainputenc} % Without this, umlauts are broken. Weird. +\usepackage{microtype} +\usepackage[T1]{fontenc} +\usepackage{times} +\usepackage{helvet} +\renewcommand*\familydefault{\sfdefault} +\usepackage{graphicx} +\usepackage{pstricks} + +\hypersetup{colorlinks,allcolors=blue} + +%% @@@ Not necessary for slides. Why??? +%% Repair kerning: Automatically insert "\kern{-0.15em}" between "//" % (in URLs). +%\directlua{ +% local glyph = node.id ("glyph") +% local function my_kerning (head) +% for t in node.traverse (head) do +% if t.id == glyph and t.char == 47 then +% if t.next +% and t.next.next +% and t.next.next.id == glyph +% and t.next.next.char == 47 then +% local k = node.new ("kern") +% k.kern = tex.sp ("-0.15em") +% k.next = t.next +% k.prev = t +% t.next.prev = k +% t.next = k +% end +% end +% end +% node.kerning (head) +% end +% luatexbase.add_to_callback ("kerning", my_kerning, "URL kerning") +%} + +\usetheme{default} +\usefonttheme{structurebold} +\setbeamertemplate{navigation symbols}{} +\setbeamersize{text margin left = 0.3cm, text margin right = 0.2cm} +\setbeamertemplate{itemize item}{$\bullet$} +\setbeamertemplate{itemize subitem}{--} +\setbeamerfont{itemize/enumerate subbody}{size=\normalsize} +\setbeamerfont{itemize/enumerate subsubbody}{size=\normalsize} +\setbeamercolor{footline}{fg=gray} + +\newcommand{\sep}{~$\cdot$~} + +\newif\ifminimalistic +\minimalistictrue + +\institute[Hochschule Bochum\sep CVH]{% + \makebox(0,0.005)[tl]{\includegraphics[scale=0.72]{logo-hochschule-bochum-cvh-text-v2.pdf}}\hfill + \makebox(0,0)[tr]{\includegraphics[scale=0.5]{logo-hochschule-bochum.pdf}}% +} + +\setbeamertemplate{headline}{% + \leavevmode + \hbox to \textwidth{% + \ifminimalistic + \strut\hfill + \else + \rule{0pt}{5.7pt}% + \hspace*{8.55pt}\insertinstitute\hspace*{5.7pt}% + \raisebox{-30pt}{\rule{0pt}{1pt}}% + \fi + }% + \vskip0pt% +} + +\iffalse + \setbeamertemplate{footline}{} +\else + \setbeamertemplate{footline}{% + \leavevmode + \hbox to \textwidth{% + \usebeamercolor{footline}% + \usebeamerfont{footline}% + \ifminimalistic + \strut\hfill + \else + \,\insertshorttitle\sep + \insertshortauthor\sep + \insertshortinstitute\sep + \insertshortdate\hfill + \fi + \insertframenumber/\inserttotalframenumber + %Folie\,\insertframenumber\sep Seite\,\insertpagenumber\, + }% + \vskip0pt% + } +\fi + +\newcommand{\maketitleframe}{% + \ifminimalistic + \begin{frame}[t,plain] + \insertinstitute + \par\vfill + \begin{center} + {\LARGE\color{structure}\inserttitle\par}\bigskip\bigskip + {\large \insertauthor\par}\bigskip\medskip + \insertdate + \end{center} + \end{frame} + \else + \begin{frame} + \vfill + \begin{center} + {\LARGE\color{structure}\inserttitle\par}\bigskip\bigskip + {\large \insertauthor\par}\bigskip\medskip + \insertdate + \end{center} + \vfill + \end{frame} + \fi +} + +\definecolor{medgreen}{rgb}{0.0,0.5,0.0} +\definecolor{darkgreen}{rgb}{0.0,0.3,0.0} +\definecolor{lightred}{rgb}{1.0,0.7,0.7} +\definecolor{medred}{rgb}{0.5,0.0,0.0} +\definecolor{bored}{rgb}{0.89,0.0,0.098} +\definecolor{lightgray}{rgb}{0.85,0.85,0.85} +\definecolor{orange}{rgb}{1.0,0.5,0.0} +\definecolor{darkgray}{rgb}{0.4,0.4,0.4} + +\newenvironment{experts}{\color{darkgray}}{} + +\usepackage{listings} +\lstset{basicstyle=\color{structure}, + language=C, + captionpos=b, + gobble=4, + columns=fullflexible, + aboveskip=0pt, + belowskip=0pt, + moredelim=**[is][\color{structure}]{¡}{¿}, + moredelim=**[is][\only<2->{\color{structure}}]{²}{¿}, + moredelim=**[is][\only<3->{\color{structure}}]{³}{¿}, + moredelim=**[is][\only<4->{\color{structure}}]{°}{¿}, + moredelim=**[is][\only<5->{\color{structure}}]{¤}{¿}, + moredelim=**[is][\only<6->{\color{structure}}]{¢}{¿}, + moredelim=**[is][\only<7->{\color{structure}}]{æ}{¿}, + moredelim=**[is][\only<8->{\color{structure}}]{ø}{¿}} +\lstdefinestyle{terminal}{basicstyle=\ttfamily\color{darkgreen}, + language={}, + columns=fixed, + moredelim=**[is][\color{red}]{¡}{¿}, + moredelim=**[is][\color{blendedblue}]{°}{¿}, + moredelim=**[is][\sffamily\it\lstset{columns=fullflexible}]{²}{¿}} +\lstdefinestyle{cmd}{basicstyle=\ttfamily\color{red}, + language={}, + gobble=2, + columns=fixed, + moredelim=**[is][\color{darkgreen}]{¡}{¿}, + moredelim=**[is][\color{structure}]{°}{¿}, + moredelim=**[is][\sffamily\it\lstset{columns=fullflexible}]{²}{¿}} +\lstdefinestyle{shy}{basicstyle=\color{lightgray}} + +\setcounter{topnumber}{3} +\renewcommand\topfraction{0.7} +\setcounter{bottomnumber}{3} +\renewcommand\bottomfraction{0.7} +\setcounter{totalnumber}{5} +\renewcommand\textfraction{0.1} +\renewcommand\floatpagefraction{0.9} + +\setlength{\unitlength}{1cm} + +\newcommand{\protectfile}[1]{#1} +\urlstyle{sf} +\newcommand{\file}[1]{{\color{structure}\protectfile{#1}}} +\newcommand{\textarrow}{{\boldmath $\longrightarrow$}} +\newcommand{\arrowitem}{\item[\textarrow]} +\newcommand{\newterm}[1]{\emph{\color{darkgreen}#1}} +\newcommand{\BIGskip}{\vspace{1cm}} +\newcommand{\shy}{\color{lightgray}} +\newcommand{\hot}{\color{red}} +\newcommand{\shyhot}{\color{lightred}} + +\newcommand{\sectionnonumber}[1]{\section{#1}\addtocounter{section}{-1}} + +\def\showsectionnonumber{\hbox{\Large\color{structure}\bf + \vtop{\secname}\par}\bigskip} + +\newcommand{\nosectionnonumber}[1]{\gdef\nosectionnonumbername{#1}} + +\def\shownosectionnonumber{\hbox{\Large\color{structure}\bf + \vtop{\nosectionnonumbername}\par}\bigskip} + +\def\showsection{\hbox{\Large\color{structure}\bf + \vtop{\hbox{\arabic{section}}}\kern1em% + \vtop{\secname}\par}\bigskip} + +\newcommand{\subsectionnonumber}[1]{\subsection{#1}\addtocounter{subsection}{-1}} + +\def\showsubsectionnonumber{{\large\color{structure}\bf\subsecname\par}\bigskip} + +\def\showsubsection{\hbox{\large\color{structure}\bf + \vtop{\hbox{\arabic{section}.\arabic{subsection}}}\kern1em% + \vtop{\subsecname}\par}\bigskip} + +\newcommand{\subsubsectionnonumber}[1]{\subsubsection{#1}\addtocounter{subsubsection}{-1}} + +\def\showsubsubsectionnonumber{{\normalsize\color{structure}\bf\subsubsecname\par}\bigskip} + +\def\showsubsubsection{\hbox{\normalsize\color{structure}\bf + \vtop{\hbox{\arabic{section}.\arabic{subsection}.\arabic{subsubsection}}}\kern1em% + \vtop{\subsubsecname}\par}\bigskip} diff --git a/20210531/piranh24b.red b/20210531/piranh24b.red new file mode 100644 index 0000000000000000000000000000000000000000..6a9baa437a283e7a51c990bea65ec1859ff8c901 --- /dev/null +++ b/20210531/piranh24b.red @@ -0,0 +1,17 @@ +;name Piranhas +;version 2.4b (25.4.1991, modifiziert am 8.11.2012) +;author Peter Gerwinski +;assert 1 + +ptr dat #0 +start mov #9, ptr +loop mov @ptr, <pos +ziel mov muni, -20 + sub #257, ziel + djn loop, ptr +pos spl @0, #833 + add #653, pos + jmz start, ptr +muni dat #0 + + end start diff --git a/20210531/rtech-20210531.pdf b/20210531/rtech-20210531.pdf new file mode 100644 index 0000000000000000000000000000000000000000..7722fac360f54407112a5fcd2a71c61a914560e1 Binary files /dev/null and b/20210531/rtech-20210531.pdf differ diff --git a/20210531/rtech-20210531.tex b/20210531/rtech-20210531.tex new file mode 100644 index 0000000000000000000000000000000000000000..7fc10b756812491e3f367ca98f2a29c73785efba --- /dev/null +++ b/20210531/rtech-20210531.tex @@ -0,0 +1,786 @@ +% rtech-20210531.pdf - Lecture Slides on Computer Technology +% Copyright (C) 2012, 2013, 2014, 2021 Peter Gerwinski +% +% This document is free software: you can redistribute it and/or +% modify it either under the terms of the Creative Commons +% Attribution-ShareAlike 3.0 License, or under the terms of the +% GNU General Public License as published by the Free Software +% Foundation, either version 3 of the License, or (at your option) +% any later version. +% +% This document is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this document. If not, see <http://www.gnu.org/licenses/>. +% +% You should have received a copy of the Creative Commons +% Attribution-ShareAlike 3.0 Unported License along with this +% document. If not, see <http://creativecommons.org/licenses/>. + +% README: Architekturmerkmale von Prozessoren + +\documentclass[10pt,t]{beamer} + +\usepackage{pgslides} + +\lstdefinestyle{asm}{basicstyle=\color{structure}, + language={}, + gobble=4} + +\title{Rechnertechnik} +\author{Prof.\ Dr.\ rer.\ nat.\ Peter Gerwinski} +\date{31.\ Mai 2021} + +\begin{document} + +\maketitleframe + +\sectionnonumber{\inserttitle} + +\begin{frame} + + \showsectionnonumber + + \begin{itemize} + \item[\textbf{1}] \textbf{Einführung} + \item[\textbf{2}] \textbf{Vom Schaltkreis zum Computer} + \begin{itemize} + \item[2.1] Logik-Schaltkreise + \item[2.2] Binärdarstellung von Zahlen + \item[2.3] Vom Logik-Schaltkreis zum Addierer + \item[2.4] Negative Zahlen + \item[2.5] Vom Addierer zum Computer + \item[2.6] Computer-Sprachen + \item[2.7] Programmieren in Assembler + \color{orange} + \item[2.8] Struktur von Assembler-Programmen + \end{itemize} + \item[\textbf{3}] \textbf{Architekturmerkmale von Prozessoren} + \color{gray} + \item[\textbf{4}] \textbf{Der CPU-Stack} +% \item[\textbf{5}] \textbf{Hardwarenahe Programmierung} +% \item[\textbf{6}] \textbf{Anwender-Software} +% \item[\textbf{7}] \textbf{Bus-Systeme} +% \item[\textbf{8}] \textbf{Pipelining} + \item[\textbf{\dots\hspace{-0.75em}}] +% \item[\textbf{9}] \textbf{Ausblick} + \end{itemize} + +\end{frame} + +\setcounter{section}{1} +\section{Vom Schaltkreis zum Computer} +\setcounter{subsection}{7} +\subsection{Struktur von Assembler-Programmen} + +\begin{frame}[fragile] + + \showsubsection + + Beispiel 2: Redcode (ICWS '88) -- Core War[s] (Krieg der Kerne)\\ + Virtuelle Maschine: Memory Array Redcode Simulator (MARS) + + \bigskip + + \begin{minipage}[t]{7.2cm} + Instruktionen:\\[\smallskipamount] + \lstinline{dat B} -- Daten \only<1->{-- "`Du hast verloren!"'}\\ + \lstinline{mov A, B} -- kopiere A nach B\\ + \lstinline{add A, B} -- addiere A zu B\\ + \lstinline{sub A, B} -- subtrahiere A von B\\ + \lstinline{jmp A} -- unbedingter Sprung nach A\\ + \lstinline{jmz A, B} -- Sprung nach A, wenn B $=$ 0\\ + \lstinline{jmn A, B} -- Sprung nach A, wenn B $\ne$ 0\\ + \lstinline{djn A, B} -- "`decrement and jump if not zero"'\\ + \lstinline{cmp A, B} -- "`compare"': überspringe, falls gleich\\ + \lstinline{spl A} -- "`split"': Programm verzweigen + \end{minipage}\hfill + \begin{minipage}[t]{4.7cm} + Adressierungsarten:\\[\smallskipamount] + grundsätzlich: Speicher relativ\\[\smallskipamount] + \lstinline{#} -- unmittelbar\\ + \lstinline{$} -- direkt\\ + \lstinline{@} -- indirekt\\ + \lstinline{<} -- indirekt mit Prä-Dekrement + +% \pause[5] + \bigskip + Programm "`Nothing"': + \begin{lstlisting}[gobble=6] + jmp 0 + \end{lstlisting} +% \pause + \bigskip + Programm "`Knirps"': + \begin{lstlisting}[gobble=6] + mov 0, 1 + \end{lstlisting} + + \end{minipage} + +\end{frame} + +\begin{frame}[fragile] + + \showsubsection + + Unbedingte Verzweigung + + Beispiel: Endlosschleife von "`Dwarf"' + + \begin{minipage}[t]{1.2cm} + \begin{lstlisting}[style=asm,gobble=6] + bomb + start + \end{lstlisting} + \end{minipage}% + \begin{minipage}[t]{3cm} + \begin{lstlisting}[style=asm,gobble=6] + dat #0 + add #4, bomb + mov bomb, @bomb + jmp start + end start + \end{lstlisting} + \end{minipage}\hfill + \begin{minipage}[t]{3.9cm} + \small + \bigskip + Instruktionen:\\[\smallskipamount] + \lstinline{dat B}\\ + \lstinline{mov A, B}\\ + \lstinline{add A, B}\\ + \lstinline{sub A, B}\\ + \lstinline{jmp A}\\ + \lstinline{jmz A, B} -- "`jump if zero"'\\ + \lstinline{jmn A, B} -- "`if not zero"'\\ + \lstinline{djn A, B} -- "`dec. \& jmn"'\\ + \lstinline{cmp A, B} -- vgl.\ \& überspr.\\ + \lstinline{spl A} -- verzweigen + \end{minipage}% + \begin{minipage}[t]{2.7cm} + \small + \bigskip + Adressierungsarten:\\[\medskipamount] + grundsätzlich:\\ + Speicher relativ\\[\medskipamount] + \lstinline{#} -- unmittelbar\\[\smallskipamount] + \lstinline{$} -- direkt\\[\smallskipamount] + \lstinline{@} -- indirekt\\[\smallskipamount] + \lstinline{<} -- indirekt mit\\ + \hspace*{0.52cm}Prä-Decrement + \end{minipage} + +\end{frame} + +\begin{frame}[fragile] + + \showsubsection + + \alt<2->{Mehrere Threads}{Bedingte Verzweigung} + + Beispiel: \alt<2->{Multithreading}{Kopierschleife} von "`Mice"' + + \begin{minipage}[t]{1.2cm} + \begin{lstlisting}[style=asm,gobble=6] + ptr + start + loop + + + + + dest + + \end{lstlisting} + \end{minipage}% + \begin{minipage}[t]{3cm} + \begin{lstlisting}[style=asm,gobble=6] + dat #0 + mov #12, ptr + mov @ptr, <dest + djn loop, ptr + spl @dest + add #653, dest + jmz start, ptr + dat #833 + end start + \end{lstlisting} + \end{minipage}\hfill + \begin{minipage}[t]{3.9cm} + \small + \bigskip + Instruktionen:\\[\smallskipamount] + \lstinline{dat B}\\ + \lstinline{mov A, B}\\ + \lstinline{add A, B}\\ + \lstinline{sub A, B}\\ + \lstinline{jmp A}\\ + \lstinline{jmz A, B} -- "`jump if zero"'\\ + \lstinline{jmn A, B} -- "`if not zero"'\\ + \lstinline{djn A, B} -- "`dec. \& jmn"'\\ + \lstinline{cmp A, B} -- vgl.\ \& überspr.\\ + \lstinline{spl A} -- verzweigen + \end{minipage}% + \begin{minipage}[t]{2.7cm} + \small + \bigskip + Adressierungsarten:\\[\medskipamount] + grundsätzlich:\\ + Speicher relativ\\[\medskipamount] + \lstinline{#} -- unmittelbar\\[\smallskipamount] + \lstinline{$} -- direkt\\[\smallskipamount] + \lstinline{@} -- indirekt\\[\smallskipamount] + \lstinline{<} -- indirekt mit\\ + \hspace*{0.52cm}Prä-Decrement + \end{minipage} + +\end{frame} + +\begin{frame}[fragile] + + \showsubsection + + Selbstmodifizierender Code + + Beispiel: Selbsterkennung von "`Fini"' + + \begin{minipage}[t]{1.2cm} + \begin{lstlisting}[language={},gobble=6] + num + start + + pos + + \end{lstlisting} + \end{minipage}% + \begin{minipage}[t]{0.9cm} + \begin{lstlisting}[language={},gobble=6] + dat #-2 + mov num, <pos + jmp start + dat + end start + \end{lstlisting} + \end{minipage}\hfill + \begin{minipage}[t]{3.9cm} + \small + \bigskip + Instruktionen:\\[\smallskipamount] + \lstinline{dat B}\\ + \lstinline{mov A, B}\\ + \lstinline{add A, B}\\ + \lstinline{sub A, B}\\ + \lstinline{jmp A}\\ + \lstinline{jmz A, B} -- "`jump if zero"'\\ + \lstinline{jmn A, B} -- "`if not zero"'\\ + \lstinline{djn A, B} -- "`dec. \& jmn"'\\ + \lstinline{cmp A, B} -- vgl.\ \& überspr.\\ + \lstinline{spl A} -- verzweigen + \end{minipage}% + \begin{minipage}[t]{2.7cm} + \small + \bigskip + Adressierungsarten:\\[\medskipamount] + grundsätzlich:\\ + Speicher relativ\\[\medskipamount] + \lstinline{#} -- unmittelbar\\[\smallskipamount] + \lstinline{$} -- direkt\\[\smallskipamount] + \lstinline{@} -- indirekt\\[\smallskipamount] + \lstinline{<} -- indirekt mit\\ + \hspace*{0.52cm}Prä-Decrement + \end{minipage} + +\end{frame} + +\begin{frame}[fragile] + + \showsubsection + + \strut + + \strut\makebox(0,0)[bl]{\large\color{structure}\textbf{Ehemaliger Praktikumsversuch (2014)}} + \hfill Inspiration für Projekt? + + \begin{minipage}[t]{5cm} + \medskip + Schreiben Sie ein\\ + Redcode-Programm,\\ + das die Gegner\\ + \file{Nothing}, \file{Knirps}\\ + und \file{Mice} besiegt. + + \medskip + + ICWS-88-Standard,\\ + max.\ 64 Prozesse,\\ + Speichergröße zufällig + + \medskip + + Teams bis zu 3 Personen\\ + sind zulässig. + \end{minipage}\hfill + \begin{minipage}[t]{3.9cm} + \small + \bigskip + Instruktionen:\\[\smallskipamount] + \lstinline{dat B}\\ + \lstinline{mov A, B}\\ + \lstinline{add A, B}\\ + \lstinline{sub A, B}\\ + \lstinline{jmp A}\\ + \lstinline{jmz A, B} -- "`jump if zero"'\\ + \lstinline{jmn A, B} -- "`if not zero"'\\ + \lstinline{djn A, B} -- "`dec. \& jmn"'\\ + \lstinline{cmp A, B} -- vgl.\ \& überspr.\\ + \lstinline{spl A} -- verzweigen + \end{minipage}% + \begin{minipage}[t]{2.7cm} + \small + \bigskip + Adressierungsarten:\\[\medskipamount] + grundsätzlich:\\ + Speicher relativ\\[\medskipamount] + \lstinline{#} -- unmittelbar\\[\smallskipamount] + \lstinline{$} -- direkt\\[\smallskipamount] + \lstinline{@} -- indirekt\\[\smallskipamount] + \lstinline{<} -- indirekt mit\\ + \hspace*{0.52cm}Prä-Decrement + \end{minipage} + +\end{frame} + +\sectionnonumber{\inserttitle} + +\begin{frame} + + \showsectionnonumber + + \begin{itemize} + \item[\textbf{1}] \textbf{Einführung} + \item[\textbf{2}] \textbf{Vom Schaltkreis zum Computer} + \begin{itemize} + \item[2.1] Logik-Schaltkreise + \item[2.2] Binärdarstellung von Zahlen + \item[2.3] Vom Logik-Schaltkreis zum Addierer + \item[2.4] Negative Zahlen + \item[2.5] Vom Addierer zum Computer + \item[2.6] Computer-Sprachen + \item[2.7] Programmieren in Assembler + \color{medgreen} + \item[2.8] Struktur von Assembler-Programmen + \end{itemize} + \item[\textbf{3}] \textbf{Architekturmerkmale von Prozessoren} + \begin{itemize} + \color{red} + \item[3.1] Speicherarchitekturen + \item[3.2] Registerarchitekturen + \item[3.3] Befehlssätze + \end{itemize} + \color{gray} + \item[\textbf{4}] \textbf{Der CPU-Stack} +% \item[\textbf{5}] \textbf{Hardwarenahe Programmierung} +% \item[\textbf{6}] \textbf{Anwender-Software} +% \item[\textbf{7}] \textbf{Bus-Systeme} +% \item[\textbf{8}] \textbf{Pipelining} + \item[\textbf{\dots\hspace{-0.75em}}] +% \item[\textbf{9}] \textbf{Ausblick} + \end{itemize} + +\end{frame} + +\section{Architekturmerkmale von Prozessoren} +\subsection{Speicherarchitekturen} + +\begin{frame} + + \showsection + \showsubsection + + Bezeichnungen + \begin{itemize} + \item + \newterm{Bit\/} = 0 oder 1 -- kleinste Einheit an Information + \item + \newterm{Byte\/} = Zusammenfassung mehrerer \newterm{Bits}\\ + zu einer Binärzahl, die ein Zeichen (\newterm{Character\/}) darstellen kann,\\ + häufig 8 Bits (\newterm{Oktett\/}) + \item + \newterm{Speicherwort\/} = Zusammenfassung mehrerer Bits\\ + zu der kleinsten adressierbaren Einheit, häufig 1 Byte + \item + \newterm{RAM\/} = \newterm{Random Access Memory\/} = Hauptspeicher + \item + \newterm{ROM\/} = \newterm{Read Only Memory\/} = nur lesbarer Speicher + \end{itemize} + +\end{frame} + +\begin{frame} + + \showsubsection + + Verschiedene Arten von Speicher + \begin{itemize} + \item + \newterm{Prozessor-Register}\\ + können direkt mit ALU verbunden werden,\\ + besonders schnell (Flipflops),\\ + überschaubare Anzahl von Registern + \item + \newterm{Hauptspeicher}\\ + kann direkt adressisert und mit Prozessor-Registern abgeglichen werden,\\ + heute i.\,d.\,R.\ dynamischer Speicher (Kondensatoren) + \item + \newterm{I/O-Ports}\\ + sind spezielle Speicheradressen, über die\\ + mit externen Geräten kommuniziert wird + \item + \newterm{Massenspeicher}\\ + liegt auf externem Gerät, wird über I/O-Ports angesprochen,\\ + Festplatte, Flash-Speicher, \dots + \end{itemize} + +\end{frame} + +\begin{frame} + + \showsubsection + + \begin{itemize} + \item + \newterm{Von-Neumann-Architektur}\\ + Es gibt nur 1 Hauptspeicher, in dem sich sowohl die Befehle\\ + als auch die Daten befinden. + + \begin{onlyenv}<1> + Vorteil: Flexibilität in der Speichernutzung + + Nachteil: Befehle können überschrieben werden.\\ + $\longrightarrow$ Abstürze und Malware möglich + \end{onlyenv} + + \pause + \item + \newterm{Harvard-Architektur}\\ + Es gibt 2 Hauptspeicher. In einem befinden sich die Befehle,\\ + im anderen die Daten. + + \begin{onlyenv}<2> + Vorteil: Befehle können nicht überschrieben werden\\ + $\longrightarrow$ sicherer als Von-Neumann-Architektur + + Nachteile: Leitungen zum Speicher (Bus) müssen doppelt vorhanden sein,\\ + freier Befehlsspeicher kann nicht für Daten genutzt werden. + \end{onlyenv} + + \pause + \item + Weitere Kombinationen\\ + Hauptspeicher und I/O-Ports gemeinsam oder getrennt,\\ + Hauptspeicher und Prozessorregister gemeinsam oder getrennt + \end{itemize} + +\end{frame} + +\begin{frame} + + \showsubsection + + Beispiele: + \begin{itemize} + \item + Intel IA-32 (i386, Nachfolger und Kompatible):\\ + Von-Neumann-Architektur (plus Speicherschutzmechanismen),\\ + Prozessorregister und I/O-Ports vom Hauptspeicher getrennt + \item + Atmel AVR (z.\,B.\ ATmega):\\ + Harvard-Architektur (Befehlsspeicher als Flash-Speicher grundsätzlich auch schreibbar),\\ + Prozessorregister und I/O-Ports in gemeinsamem Adressbereich mit Hauptspeicher + \item + 6502 (heute: Renesas-Mikro-Controller):\\ + Von-Neumann-Architektur,\\ + I/O-Ports in gemeinsamem Adressbereich mit Hauptspeicher,\\ + Prozessorregister und Hauptspeicher getrennt + \end{itemize} + +\end{frame} + +\subsection{Registerarchitekturen} + +\begin{frame}[fragile] + + \showsubsection + + \vspace*{-\medskipamount} + + \begin{itemize} + \item + Mehrere Register, einzeln ansprechbar + \item + \newterm{Akkumulator\/}: Nur 1 Register kann rechnen. + \item + \newterm{Stack-Architektur\/}: Stapel, "`umgekehrte Polnische Notation"' + \end{itemize} + + \pause + + Operationen: typischerweise nur + \lstinline{=}, \lstinline{+=}, \lstinline{-=}, \lstinline{*=}, \lstinline{/=}, \dots + + \pause + \medskip + + Beispiel: \lstinline{c = a + 2 * b;} + + \pause + \medskip + + \begin{minipage}[t]{2cm} + C:\smallskip\par + \begin{lstlisting}[gobble=6] + R = b; + R *= 2; + R += a; + c = R; + \end{lstlisting} + \end{minipage}\pause + \begin{minipage}[t]{4cm} + Mehrere Register:\smallskip\par + \begin{lstlisting}[style=asm,gobble=6] + movl (b), %eax + imull $2, %eax, %eax + addl (a), %eax + movl %eax, (c) + \end{lstlisting} + \smallskip\par + (IA-32-Assembler) + \end{minipage}\pause + \begin{minipage}[t]{3cm} + Akkumulator:\smallskip\par + \begin{lstlisting}[style=asm,gobble=6] + load (b) + mul $2 + add (a) + store (c) + \end{lstlisting} + \smallskip\par + (Pseudo-Assembler) + \end{minipage}\pause + \begin{minipage}[t]{3cm} + Register-Stack:\smallskip\par + \begin{lstlisting}[style=asm,gobble=6] + push (a) + push (b) + push $2 + mul + add + pop (c) + \end{lstlisting} + \end{minipage} + +\end{frame} + +\begin{frame} + + \showsubsection + + Beispiele: + \begin{itemize} + \item + Intel IA-32 (i386, Nachfolger und Kompatible):\\ + Mehrere Register, für verschiedene Zwecke spezialisiert (unübersichtlich),\\[\smallskipamount] + Fließkommaregister: Stack-Architektur + \item + Atmel AVR (z.\,B.\ ATmega):\\ + 32 Register + \item + 6502 (heute: Renesas-Mikro-Controller):\\ + 3 Register: A, X, Y. Nur A kann rechnen $\longrightarrow$ Akkumulator + \item + Java Virtual Machine (JVM):\\ + Stack-Architektur + \item + Redcode:\\ + Jede Speicherzelle fungiert als Register + \end{itemize} + +\end{frame} + +\subsection{Befehlssätze} + +\begin{frame} + + \showsubsection + + \begin{itemize} + \item + \newterm{Complex Instruction Set Computer (CISC)} + + \smallskip + + Umfangreiche Befehlssätze, mächtige Befehle + + \begin{onlyenv}<1> + \textarrow\ komfortable manuelle Programmierung in Assembler\\ + \textarrow\ längere Abarbeitungszeit der einzelnen Befehle + + \smallskip + + Realisierung: "`Prozessor im Prozessor"' -- \newterm{Mikroprogramme} + + \smallskip + + Beispiele: IA-32, AMD-64 + \end{onlyenv} + + \medskip + \pause + \item + \newterm{Reduced Instruction Set Computer (RISC)} + + \smallskip + + wenige, wenig mächtige Befehle + + \begin{onlyenv}<2> + \textarrow\ Programmierung in Assembler für Menschen unkomfortabel\\ + \textarrow\ schnelle Abarbeitung der Befehle + + \smallskip + + Beispiele: Atmel AVR, Redcode + \end{onlyenv} + + \pause + \medskip + \item + \newterm{Very Long Instruction Word (VLIW)\/} und\\ + \newterm{Explicitly Parallel Instruction Computing (EPIC)} + + \smallskip + + mehrere Befehle gleichzeitig ausführbar + + \begin{onlyenv}<3> + \textarrow\ mehr Rechenleistung möglich\\ + \textarrow\ Programmierung sehr aufwendig + + \smallskip + + Beispiel: IA-64 + \end{onlyenv} + + \pause + \medskip + \item + \newterm{Orthogonaler Befehlssatz} + + \smallskip + + jeder Befehl mit jeder Adressierungsart kombinierbar + \end{itemize} + +\end{frame} + +\iffalse + +\section{Der CPU-Stack\label{CPU-Stack}} +\subsection{Implementation} + +\begin{frame} + + \showsection + \showsubsection + + Speicher, in dem Werte "`gestapelt"' werden: \newterm{Stack} + + \begin{itemize} + \item + Speicherbereich (ein array) reservieren + \item + Variable (typischerweise: Prozessorregister) als + \newterm{Stack Pointer\/} reservieren \textarrow\ \lstinline{SP} + \item + Assembler-Befehl \lstinline[style=asm]{push foo}: \quad + \lstinline{*SP++ = foo;} + \item + Assembler-Befehl \lstinline[style=asm]{pop bar}: \quad + \lstinline{bar = *--SP;} + \end{itemize} + + \pause + \medskip + Speziell: Unterprogramme + +\end{frame} + +\subsection{Unterprogramme} + +\begin{frame}[fragile] + + \showsection + \showsubsection + + \begin{minipage}[t]{4.5cm} + Parameter: + \begin{itemize} + \item + Prozessorregister + \item + CPU-Stack + \end{itemize} + + \smallskip + + Rückgabewert: + \begin{itemize} + \item + Prozessorregister + \end{itemize} + \end{minipage}% + \begin{minipage}[t]{5cm} + Aufruf: + \begin{itemize} + \item + \lstinline[style=asm]{push IP}\\ + \lstinline[style=asm]{jmp foo} + {\color{red}\boldmath $\longleftarrow$ mov \#foo IP}\\ + \textarrow\ \lstinline[style=asm]{call foo} + \end{itemize} + Rücksprung: + \begin{itemize} + \item + \lstinline[style=asm]{pop IP}\\ + \textarrow\ \lstinline[style=asm]{ret} + \end{itemize} + \end{minipage} + +\end{frame} + +\subsection{Register sichern} + +\begin{frame} + + \showsection + \showsubsection + + Ein Unterprogramm verändert Registerinhalte. + \begin{itemize} + \item + im Hauptprogramm nötigenfalls vor Aufruf sichern + \item + im Unterprogramm vor Benutzung sichern + \item + Kombinationen (manche Register so, manche so) + \end{itemize} + +\end{frame} + +\fi + +\end{document} diff --git a/projekte.txt b/projekte.txt index 0c700f93a1ec338a7ee53d630402f750ee403ef3..4f2f5b628e77435cbfca6fbb6f114d9c537a1f5a 100644 --- a/projekte.txt +++ b/projekte.txt @@ -34,6 +34,18 @@ Projektideen: - Es gibt einen Streaming-Server OwnCast, der Bild und Ton übertragen kann und außerdem eine Chat-Funktion hat. --> mit Mumble-Chat zusammenbringen +Rechnertechnik-Projekte: + + o Entfernungsmessung per Schallgeschwindigkeit + o Mechanischer Rechner mit Murmeln + o DMX-Protokoll in Arduino implementieren + o Taschenrechner mit 5-Bit-Dualzahlen - Grundrechenarten + Ausgabe per 7-Segment-Anzeige + o Arduino als VU-Meter + o Soft-serielle Schnittstelle per TCP/IP übertragen + o Core War + - Minecraft + Allgemeine Projektideen: Smiley = bereits abgeschlossen oder fast abgeschlossen @@ -48,7 +60,7 @@ Allgemeine Projektideen: :o dynamische Kamera-Positionierung für PULT o Mumsi die Anzeige der Telefonnummer abgewöhnen o Telefon-Wahl aus Mumble heraus - - Mumble-Chat mit BBB-Chat verbinden + o Mumble-Chat mit BBB-Chat verbinden --> mkorostovskiy - cvh-bot mit BBB-Umfragen verbinden * noVNC in BBB einbauen * yesVNC in BBB einbauen @@ -73,4 +85,4 @@ Allgemeine Projektideen: Bsp-Instanz aus Bochum (von dem dortigen Hackspace): https://virtuallab.das-labor.org/ Doku dazu: https://howto.rc3.world/workadventure.en.html * 3d-Scan aus einem Film heraus - - BBB: Standard-Umfrage: Ja/Nein/Enthaltung +;) BBB: Standard-Umfrage: Ja/Nein/Enthaltung