Advertisement
Guest User

Untitled

a guest
Aug 19th, 2017
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ;************************************************************
  2. ;Beispielprogramm fr die Vorlesung Maschinenorientierte Programmierung
  3.  
  4. ;Verfasser: W.Schebesta/caldeum
  5. ;Version: 1.0/2.0
  6. ;Erstellungsdatum: 1.4.2011/20.5.2011
  7.  
  8. ;Aufgabenstellung:
  9. ;Dieses Programm erzeugt auf dem Bildschirm drei farbige Streifen.
  10. ;Dazu wird direkt der Bildschirmspeicher programmiert.
  11. ;*************************************************************
  12.  
  13.  
  14. .model small            ;Festlegung des Speichermodells
  15. include macros.mac
  16.  
  17.  
  18. bilds   segment at 0b800h   ;Adresse des Bildschirmspeichers
  19. lo  label   byte
  20. bilds   ends
  21.  
  22.  
  23. datas segment
  24.     Offset_triangle dw 160
  25. datas ends
  26.  
  27.  
  28. code segment                ;Beginn des Hauptprogrammes
  29.     assume  cs: code, ds: datas
  30.     assume  es: bilds, ss: nothing
  31.    
  32. start:
  33.     mov ax,bilds
  34.     mov es,ax
  35.     mov di,offset lo
  36.     mov cx,7*80
  37.     mov ax,9020h             
  38.     rep stosw
  39.     mov cx,17*80
  40.     mov ax,0A020h
  41.     rep stosw      
  42.                
  43.     mov di,(3*160)+80
  44.     mov dx,0
  45.     mov cx,2
  46.     mov bx,2
  47.     mov ax,datas
  48.     mov ds,ax
  49.  
  50. paint1:
  51.     mov ax,0C020h       ;
  52.     rep stosw       ;
  53.     add bx,4        ;bx+4
  54.     mov cx,bx       ;bx-->cx
  55.     sub Offset_triangle,8   ;[ds:0000h]-8
  56.     add di,Offset_triangle  ;di+[ds:0000h]
  57.     inc dx          ;Inkrement
  58.     cmp dx,6        ;compare: 6 minus dx (6 Zeilen)
  59. jb paint1
  60.    
  61.     mov di,(9*160)+60   ;Offset: 9*160==9 Zeilen, +60==30 Zeichen
  62.     mov dx,0        ;dx=0
  63.  
  64. paint2:    
  65.     mov cx,1*22     ;cx=22
  66.     mov ax,6020h        ;Farbe
  67.     rep stosw       ;22x ausgeben
  68.     add di,116      ;Offset +116 (fr die n„chste Zeile)
  69.     inc dx          ;Inkrement
  70.     cmp dx,8        ;compare: 8 minus dx (8 Zeilen)
  71. jb paint2
  72.  
  73.     mov di,(11*160)+76  ;Offset: 11*160==11 Zeilen, +76 == 38 Zeichen
  74.     mov dx,0        ;dx=0
  75.  
  76. paint3:
  77.     mov cx,1*10     ;cx=10
  78.     mov ax,5020h        ;Farbe
  79.     rep stosw       ;10x ausgeben
  80.     add di,140      ;Offset +140 (fr die n„chste Zeile)
  81.     inc dx          ;Inkrement
  82.     cmp dx,6        ;compare: 6 minus dx (6 Zeilen)
  83. jb paint3
  84.    
  85.     mov di,(17*160)+76  ;Offset: 17*160==17 Zeilen, +76==38 Zeichen
  86.     mov dx,0        ;dx=0
  87.  
  88. paint4:    
  89.     mov cx,1*10     ;cx=10
  90.     mov ax,7020h        ;Farbe
  91.     rep stosw       ;10x ausgeben
  92.     add di,144      ;Offset +144 (fr die n„chste Zeile)
  93.     inc dx          ;Inkrement
  94.     cmp dx,7        ;compare: 7 minus dx (7 Zeilen)
  95. jb paint4
  96.  
  97.     mov ax,04c00h       ;Interrupt zur Programm Terminierung
  98.     int 21h
  99. code    ends            ;Ende des Code-Segmentes und gleichzeitig
  100.                 ;des Programmes
  101. end start           ;Anweisung zum Programmanfang zu gehen
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement