Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;************************************************************
- ;Beispielprogramm fr die Vorlesung Maschinenorientierte Programmierung
- ;Verfasser: W.Schebesta/caldeum
- ;Version: 1.0/2.0
- ;Erstellungsdatum: 1.4.2011/20.5.2011
- ;Aufgabenstellung:
- ;Dieses Programm erzeugt auf dem Bildschirm drei farbige Streifen.
- ;Dazu wird direkt der Bildschirmspeicher programmiert.
- ;*************************************************************
- .model small ;Festlegung des Speichermodells
- include macros.mac
- bilds segment at 0b800h ;Adresse des Bildschirmspeichers
- lo label byte
- bilds ends
- datas segment
- Offset_triangle dw 160
- datas ends
- code segment ;Beginn des Hauptprogrammes
- assume cs: code, ds: datas
- assume es: bilds, ss: nothing
- start:
- mov ax,bilds
- mov es,ax
- mov di,offset lo
- mov cx,7*80
- mov ax,9020h
- rep stosw
- mov cx,17*80
- mov ax,0A020h
- rep stosw
- mov di,(3*160)+80
- mov dx,0
- mov cx,2
- mov bx,2
- mov ax,datas
- mov ds,ax
- paint1:
- mov ax,0C020h ;
- rep stosw ;
- add bx,4 ;bx+4
- mov cx,bx ;bx-->cx
- sub Offset_triangle,8 ;[ds:0000h]-8
- add di,Offset_triangle ;di+[ds:0000h]
- inc dx ;Inkrement
- cmp dx,6 ;compare: 6 minus dx (6 Zeilen)
- jb paint1
- mov di,(9*160)+60 ;Offset: 9*160==9 Zeilen, +60==30 Zeichen
- mov dx,0 ;dx=0
- paint2:
- mov cx,1*22 ;cx=22
- mov ax,6020h ;Farbe
- rep stosw ;22x ausgeben
- add di,116 ;Offset +116 (fr die nchste Zeile)
- inc dx ;Inkrement
- cmp dx,8 ;compare: 8 minus dx (8 Zeilen)
- jb paint2
- mov di,(11*160)+76 ;Offset: 11*160==11 Zeilen, +76 == 38 Zeichen
- mov dx,0 ;dx=0
- paint3:
- mov cx,1*10 ;cx=10
- mov ax,5020h ;Farbe
- rep stosw ;10x ausgeben
- add di,140 ;Offset +140 (fr die nchste Zeile)
- inc dx ;Inkrement
- cmp dx,6 ;compare: 6 minus dx (6 Zeilen)
- jb paint3
- mov di,(17*160)+76 ;Offset: 17*160==17 Zeilen, +76==38 Zeichen
- mov dx,0 ;dx=0
- paint4:
- mov cx,1*10 ;cx=10
- mov ax,7020h ;Farbe
- rep stosw ;10x ausgeben
- add di,144 ;Offset +144 (fr die nchste Zeile)
- inc dx ;Inkrement
- cmp dx,7 ;compare: 7 minus dx (7 Zeilen)
- jb paint4
- mov ax,04c00h ;Interrupt zur Programm Terminierung
- int 21h
- code ends ;Ende des Code-Segmentes und gleichzeitig
- ;des Programmes
- end start ;Anweisung zum Programmanfang zu gehen
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement