Rechnerarchitekturen 1

Lösungen des RA- Praktikums an der TU-Ilmenau vom 14.11.2002.

Versuch E

SEGM SEGMENT
 
 ASSUME CS:SEGM, DS:SEGM, ES:SEGM, SS:SEGM
 
 ORG 100H
 
PROGRAMM:
;Versuch E- einfache Assemblerprogramme
 
INIT: MOV AL,80h              ;al = #80
 
M1:   OUT [00h],AL            ;LED- Port  auf 1000.0000
      MOV AH,AL               ;LED- Ausgang temporär speichern
       IN AL,[00h]            ;Schalterstellung einlesen
      MOV BL,AL               ;Schaltereinstellungen speichern
      MOV AL,AH               ;LED- Ausgang lesen
     TEST BL,40h              ;BT- Gegenstück
                              ;0x00.0000 -> if (x==1) z = 1 else z = 0 
                              ;bei z = 1 -> schnell, ansonsten langsam
      JNZ S2                  ;if (z) S2 else S1
      JMP S1                  ;
 
M2:  TEST BL,80h              ;x000.0000 -> if (x==1) z = 1 else z = 0
                              ;bei z = 1 -> rechts nach links
      JNZ M4                  ;if (z) M4 else M3
 
M3:   ROR AL,1                ;al = al / 2 
      JMP M1                  ;M1
 
M4:   ROL AL,1                ;al = al * 2 
      JMP M1                  ;M1
 
;2 Schleifen verschiedener Länge 
S1:   MOV CX,8000h            ;cx = #8000
      JMP L                   ;L
 
S2:   MOV CX,4000h            ;cx = #4000
 
L:   LOOP S                  ;wait s
      JMP M2                 ;M2
 
      JMP $
 
 
      ORG 1000H
 
DATEN:
 
SEGM ENDS
 
END PROGRAMM
 
wiki/study/prakt/ra1.txt · Last modified: 2005/06/05 21:42 (external edit)
 
Except where otherwise noted, content on this wiki is licensed under the following license:CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki