Auch kann der Code meistens noch verbessert werden wie ich es schon teilweise in anderen Beiträgen anhand von dortigen Beispielen und Erklärungen dazu erwähnt habe.
STON1024
Dieses kleine Grafikdemo benötigt einen 80386+, eine Vesa 2-Grafikkarte und einem Monitor den man mit dem Videomode von 1024x768 betreiben kann. Der Quellcode wurde für MASM 5 entwickelt.
Es wird der Vesamode 105h für 1024x768x256 mit Bankumschaltung verwendet. Dort bewegen sich über den Bildschirm kleine weisse Pixel die am Anfang in einem Labyrinth starten.
Wenn die Pixel den Rand des Labyrinths berühren, oder den Rand des Bildschirms berühren, oder sich gegenseitig berühren, dann prallen sie ab und machen einen Richtungswechsel.
Nach und nach kommen die meisten Pixel aus dem Labyrinth heraus. (Bei mir läuft diese Anwendung auch unter Windows XP, obwohl dort im Codebereich zur Laufzeit Schreibzugriffe gemacht werden.)
Die Anwendung kann mit der Escape-Taste beendet werden. Der Quellcode und die fertige Anwendung kann man zusammen von meiner Homepage herunterladen:
http://www.alice-dsl.net/freecracmaps/Tool/STON1024.ZIP
Code: Alles auswählen
; Dieser Quellcode kann z.B. mit dem Namen "Ston1024.asm" gespeichert werden.
; Assemblieren mit: Masm Ston1024.asm
; Linken mit: Link Ston1024.obj
.MODEL SMALL
.386
Video_Mode = 105h ; VESA:1024x768x256
;--------------------------------------
Video_Seg = 0A000h ; Grafik-Bildschirm-Segment
;--------------------------------------
Xmax = 400h ; 1024
Ymax = 300h ; 768
;----------------------------------------------------------------------------
Cr = 0Dh ; Carriage Return
Lf = 0Ah ; Line Feed
;----------------------------------------------------------------------------
RGB_Port = 3C8h ; Farb-Anteile (write)
Rast_Port = 3DAh ; Raster-Strahl
;--------------------------------------
Tast_Port = 60h ; Tastatur-Controler
Cmos_Port = 70h ; CMOS-Baustein
;----------------------------------------------------------------------------
Anzahl = 0FFh ; Anzahl der Pixel (max 0FFh)
;----------------------------------------------------------------------------
Farbe = 0Fh ; Farb-Nummer: 0 bis 255
LFarbe = 0Ch ; Farb-Nummer: 0 bis 255
;----------------------------------------------------------------------------
Max_X = Xmax-16 ; maximale und minimale
Max_Y = Xmax*(Ymax-16); X/Y Positionen,
Min_X = 6 ; des Bewegungs-Bereichs
Min_Y = Xmax*6
;----------------------------------------------------------------------------
CODE SEGMENT use16 'CODE'
assume cs:CODE,ds:DATEN,ss:STAPEL
org 100h
START: mov ax, DATEN ; DS auf Daten-Bereich
mov ds, ax
;----------------------------------------------------------------------------
call SETFREE ; nicht belegten Speicher freigeben
;--------------------------------------
mov bx, 110h / 10h ; Länge in Paragraphen
call GETSPACE ; Speicher anfordern
jc FEHLER2 ; zuwenig Speicher
mov es, ax ; Segment Video-Mode Information
;---------------------------------------------------------------------------
mov ax, 4F01h ; Modus-Spezifische Informationen holen
mov cx, Video_Mode
xor di, di ; Ziel-Offset
int 10h ; VESA-BIOS
cmp ax, 4Fh
jnz FEHLER3 ; Funktion wird nicht unterstützt
;---------------------------------------------------------------------------
mov eax, DWORD PTR es:[0Ch] ; Zeiger auf Bankumschaltungs-Routine
and eax, eax
jz FEHLER3 ; Funktion wird nicht unterstützt
mov DWORD PTR cs:[BANK1], eax
mov DWORD PTR cs:[BANK2], eax
mov DWORD PTR cs:[BANK3], eax
;---------------------------------------------------------------------------
mov ax, 4F02h ; Video-Mode einschalten
mov bx, Video_Mode
int 10h
cmp ax, 4Fh
jnz FEHLER3 ; Funktion wird nicht unterstützt
;---------------------------------------------------------------------------
cli ; Software-Interrupts sperren
in al, Cmos_Port ; Über CMOS-Baustein NMIs sperren
or al, 80h ; dazu Bit 7 setzen
out Cmos_Port, al
;--------------------------------------
mov ax, Video_Seg ; Bildschirm-Segment
mov fs, ax
;---------------------------------------------------------------------------
call PIXOFF
;---------------------------------------------------------------------------
mov si, OFFSET SX0 ; Zeiger auf Positions-Tabelle
;--------------------------------------
HUN: mov ebp, [si] ; X-Position holen
K0: cmp ebp, 150
ja short K1
add ebp, 9
jmp short K0
;--------------------------------------
org START + ((($-START)/16)*16) + 16
;--------------------------------------
K1: cmp ebp, 340
jb short K2
sub ebp, 9
jmp short K1
;--------------------------------------
org START + ((($-START)/16)*16) + 16
;--------------------------------------
K2: mov [si], ebp
mov ebp, [si+4] ; Y-Position holen
K3: cmp ebp, 150*Xmax
ja short K4
add ebp, 9*Xmax
jmp short K3
;--------------------------------------
org START + ((($-START)/16)*16) + 16
;--------------------------------------
K4: cmp ebp, 320*Xmax
jb short K5
sub ebp, 9*Xmax
jmp short K4
;--------------------------------------
org START + ((($-START)/16)*16) + 16
;--------------------------------------
K5: mov [si+4], ebp
add si, 0Ch
cmp si, Anzahl*0Ch+OFFSET SX0
jb HUN
;---------------------------------------------------------------------------
mov si, OFFSET SX0 ; Zeiger auf Positions-Tabelle
;--------------------------------------
HIN: mov ebp, [si] ; X-Position holen
add ebp, [si+4] ; X-Position + Y-Position
mov [si+8], ebp ; Adress-Offset retten
add si, 0Ch
cmp si, Anzahl*0Ch+OFFSET SX0
jb HIN
;---------------------------------------------------------------------------
mov WORD PTR[RETTDI], 100
LI0: mov bp, RETTDI ; X1-Position holen links
mov si, 100 ; Y1-Position holen
mov cx, bp ; X2-Position holen
mov dx, 400 ; Y2-Position holen
inc WORD PTR[RETTDI]
call LINE
cmp WORD PTR[RETTDI], 107
jnz LI0
;--------------------------------------
mov WORD PTR[RETTDI], 100
LI1: mov bp, 100 ; X1-Position holen oben
mov si, RETTDI ; Y1-Position holen
mov cx, 400 ; X2-Position holen
mov dx, si ; Y2-Position holen
inc WORD PTR[RETTDI]
call LINE
cmp WORD PTR[RETTDI], 107
jnz LI1
;--------------------------------------
mov WORD PTR[RETTDI], 400
LI3: mov bp, RETTDI ; X1-Position holen rechts
mov si, 100 ; Y1-Position holen
mov cx, bp ; X2-Position holen
mov dx, 407 ; Y2-Position holen
inc WORD PTR[RETTDI]
call LINE
cmp WORD PTR[RETTDI], 407
jnz LI3
;--------------------------------------
mov WORD PTR[RETTDI], 400
LI4: mov bp, 100 ; X1-Position holen unten
mov si, RETTDI ; Y1-Position holen
mov cx, 370 ; X2-Position holen
mov dx, si ; Y2-Position holen
inc WORD PTR[RETTDI]
call LINE
cmp WORD PTR[RETTDI], 407
jnz LI4
;--------------------------------------
mov WORD PTR[RETTDI], 370
LI5: mov bp, RETTDI ; X1-Position holen rechts innen
mov si, 130 ; Y1-Position holen
mov cx, bp ; X2-Position holen
mov dx, 407 ; Y2-Position holen
inc WORD PTR[RETTDI]
call LINE
cmp WORD PTR[RETTDI], 377
jnz LI5
;--------------------------------------
mov WORD PTR[RETTDI], 130
LI6: mov bp, 130 ; X1-Position holen oben innen
mov si, RETTDI ; Y1-Position holen
mov cx, 370 ; X2-Position holen
mov dx, si ; Y2-Position holen
inc WORD PTR[RETTDI]
call LINE
cmp WORD PTR[RETTDI], 137
jnz LI6
;--------------------------------------
mov WORD PTR[RETTDI], 130
LI7: mov bp, RETTDI ; X1-Position holen links innen
mov si, 130 ; Y1-Position holen
mov cx, bp ; X2-Position holen
mov dx, 370 ; Y2-Position holen
inc WORD PTR[RETTDI]
call LINE
cmp WORD PTR[RETTDI], 137
jnz LI7
;--------------------------------------
mov WORD PTR[RETTDI], 370
LI8: mov bp, 130 ; X1-Position holen unten innen
mov si, RETTDI ; Y1-Position holen
mov cx, 346 ; X2-Position holen
mov dx, si ; Y2-Position holen
inc WORD PTR[RETTDI]
call LINE
cmp WORD PTR[RETTDI], 377
jnz LI8
;---------------------------------------------------------------------------
xor bx, bx ; VESA:Bankumschaltung (Fenster A)
;---------------------------------------------------------------------------
DB 0EAh ; Prefetch-Puffer löschen:
DW (OFFSET BEWEGE) ; Die folgenden Zeilen erzeugen
DW SEG CODE ; das Kommando JMP FAR CS:BEWEGE
;---------------------------------------------------------------------------
; B E W E G U N G
;---------------------------------------------------------------------------
org START + ((($-START)/16)*16)+16 ; Code-Ausrichtung
;----------------------------------------------------------------------------
BEWEGE: mov si, OFFSET SX0 ; Zeiger auf Positions-Tabelle
mov di, OFFSET STEP0X ; Zeiger auf Stepper- Tabelle
;----------------------------------------------------------------------------
mov dx, Rast_Port ; Port des Rasterstrahls
STRAHL: in al, dx ; Bewegung mit Raster-Strahl Port:3DA
and al, 8 ; synchronisieren
jz STRAHL
;----------------------------------------------------------------------------
ALL: mov ebp, [si] ; X-Position holen
mov DWORD PTR[RETTX], ebp
cmp BYTE PTR[di+S_Len], 1 ; Plus/Minus-XFlag vergleichen
jz short FRAGX1 ; wenn minus, dann springen
;--------------------------------------
FRAGX0: cmp ebp, Max_X ; X-Position mit max.-X vergleichen
jb short MAKEX0 ; wenn kleiner, springen
mov BYTE PTR[di+S_Len], 1 ; Minus-XFlag setzen
MAKEX1: sub ebp, [di] ; X - XStepper
jmp short ALLX
;--------------------------------------
org START + ((($-START)/16)*16) + 16
;--------------------------------------
FRAGX1: cmp ebp, Min_X ; X-Position mit min.-X vergleichen
ja short MAKEX1 ; wenn größer, springen
mov BYTE PTR[di+S_Len], 0 ; Plus-XFlag setzen
MAKEX0: add ebp, [di] ; X + XStepper
ALLX: mov [si], ebp ; neue X-Position retten
;----------------------------------------------------------------------------
mov ecx, [si+4] ; Y-Pos. holen
mov DWORD PTR[RETTY], ecx
cmp BYTE PTR[di+S_Len+1],1 ; Plus/Minus-YFlag vergleichen
jz short FRAGY1 ; wenn minus, dann springen
;--------------------------------------
FRAGY0: cmp ecx, Max_Y ; Y-Position mit max.-Y vergleichen
jb short MAKEY0 ; wenn kleiner, springen
mov BYTE PTR[di+S_Len+1],1 ; Minus-YFlag setzen
MAKEY1: sub ecx, [di+4] ; Y - XStepper
jmp short ALLY
;--------------------------------------
org START + ((($-START)/16)*16) + 16
;--------------------------------------
FRAGY1: cmp ecx, Min_Y ; Y-Position mit min.-Y vergleichen
ja short MAKEY1 ; wenn größer, springen
mov BYTE PTR[di+S_Len+1],0 ; Plus-YFlag setzen
MAKEY0: add ecx, [di+4] ; Y + YStepper
ALLY: mov [si+4], ecx ; neue Y-Position retten
;----------------------------------------------------------------------------
add ebp, ecx ; X-Position + Y-Position
mov cx, di ; di retten
mov di, [si+8] ; alten Offset zum löschen holen
mov dx, [si+0Ah] ; alte Bank holen
mov [si+8], ebp ; neuer Adress-Offset + Bank retten
mov RETTDI, di ; alten Offset retten
mov RETTDX, dx ; alte Bank retten
cmp dx, RETTBA ; dieselbe Bank ?
jz short NOBANK
;-------------------------------
mov RETTBA, dx
;---------------------------
DB 9Ah ; CALL FAR: BANKSET
BANK1 DD ? ; Zeiger auf Bankumschaltungs-Routine
;-------------------------------
NOBANK: mov dx, [si+0Ah] ; Bank holen
mov BYTE PTR fs:[di], 0 ; Hintergrund löschen
;----------------------------------------------------------------------------
cmp dx, RETTBA ; dieselbe Bank ?
jz short COLOR
;--------------------------------
mov RETTBA, dx
;---------------------------
DB 9Ah ; CALL FAR: BANKSET
BANK2 DD ? ; Zeiger auf Bankumschaltungs-Routine
;--------------------------------
COLOR: mov di, cx ; di wiederholen
;---------------------------------------------------------------------------
; Abfrage auf Kollision mit Hintergrund
;---------------------------------------------------------------------------
cmp BYTE PTR fs:[bp], 0 ; Hintergrund-Kollision ?
jz FREWA ; nein, weiter
;--------------------------------------
cmp BYTE PTR fs:[bp+8], 0 ; ist 8x rechts daneben etwas ?
jz short GX
cmp BYTE PTR fs:[bp-8], 0 ; ist 8x links daneben etwas ?
jz short GX
;---------
cmp BYTE PTR[di+S_Len+1], 1 ; Richtungs-Flags Y
jz short GO
cmp BYTE PTR fs:[bp+Xmax], 0 ; ist darunter etwas ?
jnz short LL ; ja, Y-Flag umdrehen
jmp short GX
;--------------------------------------
org START + ((($-START)/16)*16) + 16
;--------------------------------------
GO: cmp BYTE PTR fs:[bp-Xmax], 0 ; ist darüber etwas ?
jz short GX ; nein, weiter
LL: xor BYTE PTR[di+S_Len+1], 1 ; Richtungs-Flags Y umdrehen
jmp short RL
;------------------------------------------------------------------------
org START + ((($-START)/16)*16) + 16
;--------------------------------------
GX: cmp BYTE PTR[di+S_Len], 1 ; Richtungs-Flags X
jz short GL
cmp BYTE PTR fs:[bp+1], 0 ; ist rechts daneben etwas ?
jnz short RR ; ja, X-Flag umdrehen
jmp short RL
;--------------------------------------
org START + ((($-START)/16)*16) + 16
;--------------------------------------
GL: cmp BYTE PTR fs:[bp-1], 0 ; ist links daneben etwas ?
jz short RL ; nein, unten/oben abfragen
RR: xor BYTE PTR[di+S_Len], 1 ; Richtungs-Flags X umdrehen
;--------------------------------
RL: mov eax, DWORD PTR[RETTX] ; alte Position restaurieren
mov edx, DWORD PTR[RETTY]
mov [si], eax ; X-Pos.
mov eax, DWORD PTR[RETTDI]
mov [si+4], edx ; Y-Pos.
mov [si+8], eax ; Adress-Offset + Bank
jmp short WALL ; nochmal berechnen
;---------------------------------------------------------------------------
; Abfrage auf Kollision untereinander
;---------------------------------------------------------------------------
org START + ((($-START)/16)*16) + 16
;--------------------------------------
FREWA: mov ax, si
mov si, OFFSET SX0 ; Zeiger auf Positions-Tabelle
mov di, OFFSET STEP0X ; Zeiger auf Stepper- Tabelle
WATCH: cmp si, ax
jz short NOCHE
cmp ebp, [si+8]
jnz short NOCHE
mov si, ax ; Treffer !
xor WORD PTR[di+S_Len], 101h ; beide Richtungen umdrehen
mov di, cx
xor WORD PTR[di+S_Len], 101h
jmp short WALL
;--------------------------------------
org START + ((($-START)/16)*16) + 16
;--------------------------------------
NOCHE: add si, 0Ch
add di, 8
cmp si, Anzahl*0Ch+OFFSET SX0 ; Tabellen-Ende erreicht ?
jnz WATCH
mov si, ax
mov di, cx ; di wiederholen
;---------------------------------------------------------------------------
; Pixel nur setzen, wenn keine Kollision.
;---------------------------------------------------------------------------
mov BYTE PTR fs:[bp],Farbe ; Farb-Byte zum Bildschirm
;---------------------------------------------------------------------------
WALL: add si, 0Ch ; Tabellen-Zeiger erhöhen (Positions)
add di, 8 ; Tabellen-Zeiger erhöhen (Stepper)
cmp si, Anzahl*0Ch+OFFSET SX0 ; Tabellen-Ende erreicht ?
jb ALL ; sonst nächsten Punkt
;----------------------------------------------------------------------------
in al, Tast_Port ; TASTE vom PORT holen
dec al ; Escape-Taste gedrückt ?
jnz BEWEGE
;---------------------------------------------------------------------------
; P r o g r a m m - E n d e
;---------------------------------------------------------------------------
in al, Cmos_Port ; NMIs wieder einschalten.
and al, 7Fh ; Dazu Bit 7 löschen
out Cmos_Port, al
sti ; IRQ`s wieder erlauben
;--------------------------------------
mov ax, 3 ; Text-Mode anschalten
int 10h
;--------------------------------------
mov ah, 1 ; Tastatur-Puffer löschen
int 16h
;----------------------------------------------------------------------------
xor cl, cl ; ERRORLEVEL 0
;----------------------------------------------------------------------------
DOS: mov al, cl
mov ah, 4Ch ; Dos-Rücksprung
int 21h
;---------------------------------------------------------------------------
; F e h l e r T e x t e a u s g e b e n
;---------------------------------------------------------------------------
org START + ((($-START)/16)*16)+16 ; Code-Ausrichtung
;---------------------------------------------------------------------------
FEHLER2: mov cl, 2 ; ERRORLEVEL 2
mov dx, OFFSET ERRTEX2 ; zuwenig Speicher
;--------------------------------------
FILERR: mov ah, 9 ; Text ausgeben
int 21h
jmp short DOS
;---------------------------------------------------------------------------
org START + ((($-START)/16)*16)+16 ; Code-Ausrichtung
;---------------------------------------------------------------------------
FEHLER3: mov cl, 3 ; ERRORLEVEL 3
mov dx, OFFSET ERRTEX3 ; Video-Mode wird nicht unterstützt
jmp short FILERR
;---------------------------------------------------------------------------
; U N T E R - P R O G R A M M E
;---------------------------------------------------------------------------
org START + ((($-START)/16)*16)+16 ; Code-Ausrichtung
;---------------------------------------------------------------------------
; S p e i c h e r f r e i g e b e n
;---------------------------------------------------------------------------
SETFREE: mov bx, ss ; zunächst die beiden Segmentadressen
mov ax, es ; voneinander abziehen. Das ergibt die
sub bx, ax ; Anzahl der Paragraphen vom PSP bis
; zum Anfang des Stack
mov ax, sp ; da sich der Stackpointer am Ende des
add ax, 0Fh ; Stacksegments befindet, gibt sein
shr ax, 4 ; Inhalt die Länge des Stacks an
add bx, ax ; zur bisherigen Länge hinzuaddieren
mov ah, 4Ah ; ES:BX = Größe an DOS übergeben
int 21h
ret
;---------------------------------------------------------------------------
; S p e i c h e r a n f o r d e r n
;---------------------------------------------------------------------------
org START + ((($-START)/16)*16)+16 ; Code-Ausrichtung
;---------------------------------------------------------------------------
GETSPACE: mov ah, 48h ; BX = Größe in Paragraphen
int 21h
ret
;---------------------------------------------------------------------------
org START + ((($-START)/16)*16)+16 ; Code-Ausrichtung
;---------------------------------------------------------------------------
LINE: mov bx, 4345h ; Code für inc bx und inc bp
sub cx, bp ; DELTAX=X2-X1 bilden
jge short DELTAX_P ; X2>X1?
mov bl, 4Dh ; nein, Code für dec bp
neg cx ; und DELTAX umdrehen
DELTAX_P: sub dx, si ; DELTAY=Y2-Y1 bilden
jge short DELTAY_P ; Y2>Y1?
mov bh, 4Bh ; nein, Code für dec bx
neg dx ; und DELTAY umdrehen
DELTAY_P: mov WORD PTR cs:[DABGROS], bx ; Ink/Dek im Code abspeichern
cmp cx, dx ; DELTAX>DELTAY?
jge short DELTAX_G ; ja, verzweige
mov bl, 90h ; Y ist Laufvariable für X NOP eintragen
mov ax, dx
mov dx, cx
mov cx, ax
jmp short ACHSE
;------------------------------------
org START + ((($-START)/16)*16)+16 ; Code-Ausrichtung
;------------------------------------
DELTAX_G: mov bh, 90h ; X ist Laufvariable für Y NOP eintragen
ACHSE: add dx, dx ; Ink. für Laufvariable INCB bestimmen
mov WORD PTR cs:[DABKLEI], bx ; im Code ablegen
mov ax, dx ; nach bp übertragen
sub dx, cx ; DAB bestimmen
mov bx, si ; Y1 holen
mov di, dx ; DAB nach di übertragen
sub dx, cx ; INCA nach dx
;----------------------------------------------------------------------------
SCHLEIFE: mov si, bx ; Pixel-Setzer
mov RETTAX, ax ; AX-Reg. retten
shl si, 2 ; Y * 4 als Index in der Zeilen-Tabelle
mov RETTDX, dx ; DX-Reg. retten
mov dx, [si+2] ; Bank holen
mov si, [si] ; Zeilen-OFFSET holen
add si, bp ; Y + X
adc dl, 0 ; Überlauf zur Bank
cmp dx, RETTBA ; dieselbe Bank ?
jz short NBNK
;-----------------------------------
mov RETTBX, bx
mov RETTBA, dx
xor bx, bx
;---------------------------
DB 9Ah ; CALL FAR: BANKSET
BANK3 DD ? ; Zeiger auf Bankumschaltungs-Routine
;---------------------------
mov bx, RETTBX
;-----------------------------------
NBNK: mov ax, RETTAX ; Register wiederholen
mov dx, RETTDX
mov BYTE PTR fs:[si],LFarbe ; Farb-Byte schreiben 0-255
; - - - - - - - - - - - - - - - - - -
and di, di ; DAB>0?
jge short DABGROS ; ja, verzweige
DABKLEI: inc bp ; hier wird der
inc bx ; Code modifiziert
add di, ax ; DAB=DAB+INCB
dec cx
jnz SCHLEIFE ; Schleife schließen
ret
;------------------------------------
org START + ((($-START)/16)*16)+16 ; Code-Ausrichtung
;------------------------------------
DABGROS: inc bp ; hier wird der
inc bx ; Code modifiziert
add di, dx ; Schleife schließen
dec cx
jnz SCHLEIFE ; und weiter
ret
;---------------------------------------------------------------------------
; T a b e l l e d e r Z e i l e n - A n f ä n g e
;---------------------------------------------------------------------------
org START + ((($-START)/16)*16)+16 ; Code-Ausrichtung
;---------------------------------------------------------------------------
PIXOFF: xor si, si
xor bx, bx
;------------------------------------
AGAIN: mov ax, es:[10h]
mul bx
mov [si], ax
mov [si+2], dx
inc bx
add si, 4
cmp bx, Ymax
jb AGAIN
ret
;---------------------------------------------------------------------------
CODE ends
;---------------------------------------------------------------------------
; D A T E N - B E R E I C H
;---------------------------------------------------------------------------
DATEN SEGMENT use32 'DATA'
org 0
;----------------------------------------------------------------------------
PIXTAB DD Ymax dup (0) ; Tabelle der Zeilen-Anfänge
;----------------------------------------------------------------------------
; Positions - Tabelle
;----------------------------------------------------------------------------
SX0 DD 439, 251 * XMax, ? ; X, Y * XMax, Offset
DD 513, 240 * XMax, ?
DD 625, 30 * XMax, ?
DD 733, 150 * XMax, ?
DD 843, 12 * XMax, ?
DD 955, 248 * XMax, ?
DD 63, 390 * XMax, ?
DD 177, 486 * XMax, ?
DD 482, 573 * XMax, ?
DD 592, 467 * XMax, ?
DD 663, 326 * XMax, ?
DD 711, 683 * XMax, ?
DD 843, 536 * XMax, ?
DD 937, 420 * XMax, ?
DD 48, 317 * XMax, ?
DD 156, 12 * XMax, ?
DD 412, 231 * XMax, ?
DD 542, 326 * XMax, ?
DD 693, 429 * XMax, ?
DD 771, 523 * XMax, ?
DD 823, 685 * XMax, ?
DD 947, 732 * XMax, ?
DD 83, 622 * XMax, ?
DD 126, 515 * XMax, ?
DD 413, 422 * XMax, ?
DD 567, 326 * XMax, ?
DD 633, 234 * XMax, ?
DD 742, 192 * XMax, ?
DD 852, 70 * XMax, ?
DD 923, 250 * XMax, ?
DD 62, 374 * XMax, ?
DD 470, 451 * XMax, ?
DD 566, 433 * XMax, ?
DD 233, 654 * XMax, ?
DD 723, 222 * XMax, ?
DD 926, 274 * XMax, ?
DD 560, 557 * XMax, ?
DD 626, 313 * XMax, ?
DD 418, 177 * XMax, ?
DD 757, 653 * XMax, ?
DD 758, 170 * XMax, ?
DD 85, 735 * XMax, ?
DD 248, 453 * XMax, ?
DD 463, 366 * XMax, ?
DD 770, 632 * XMax, ?
DD 654, 267 * XMax, ?
DD 839, 634 * XMax, ?
DD 545, 722 * XMax, ?
DD 454, 734 * XMax, ?
DD 679, 557 * XMax, ?
DD 946, 323 * XMax, ?
DD 238, 707 * XMax, ?
DD 43, 34 * XMax, ?
DD 546, 677 * XMax, ?
DD 639, 434 * XMax, ?
DD 475, 558 * XMax, ?
DD 954, 654 * XMax, ?
DD 136, 337 * XMax, ?
DD 464, 253 * XMax, ?
DD 577, 566 * XMax, ?
DD 724, 43 * XMax, ?
DD 897, 227 * XMax, ?
DD 668, 345 * XMax, ?
DD 88, 623 * XMax, ?
DD 442, 332 * XMax, ?
DD 723, 676 * XMax, ?
DD 472, 533 * XMax, ?
DD 154, 379 * XMax, ?
DD 546, 123 * XMax, ?
DD 827, 611 * XMax, ?
DD 544, 724 * XMax, ?
DD 359, 565 * XMax, ?
DD 877, 546 * XMax, ?
DD 951, 342 * XMax, ?
DD 878, 168 * XMax, ?
DD 632, 749 * XMax, ?
DD 427, 536 * XMax, ?
DD 614, 483 * XMax, ?
DD 761, 345 * XMax, ?
DD 723, 736 * XMax, ?
DD 249, 36 * XMax, ?
DD 579, 644 * XMax, ?
DD 839, 423 * XMax, ?
DD 438, 347 * XMax, ?
DD 888, 248 * XMax, ?
DD 643, 658 * XMax, ?
DD 828, 746 * XMax, ?
DD 583, 453 * XMax, ?
DD 147, 288 * XMax, ?
DD 433, 235 * XMax, ?
DD 698, 586 * XMax, ?
DD 53, 747 * XMax, ?
DD 797, 573 * XMax, ?
DD 836, 231 * XMax, ?
DD 479, 450 * XMax, ?
DD 243, 727 * XMax, ?
DD 657, 265 * XMax, ?
DD 711, 622 * XMax, ?
DD 889, 458 * XMax, ?
DD 558, 285 * XMax, ?
DD 224, 737 * XMax, ?
DD 582, 622 * XMax, ?
DD 766, 511 * XMax, ?
DD 814, 351 * XMax, ?
DD 921, 275 * XMax, ?
DD 433, 659 * XMax, ?
DD 40, 254 * XMax, ?
DD 496, 660 * XMax, ?
DD 48, 438 * XMax, ?
DD 624, 369 * XMax, ?
DD 312, 474 * XMax, ?
DD 667, 666 * XMax, ?
DD 278, 753 * XMax, ?
DD 533, 436 * XMax, ?
DD 756, 291 * XMax, ?
DD 890, 552 * XMax, ?
DD 369, 711 * XMax, ?
DD 230, 534 * XMax, ?
DD 677, 727 * XMax, ?
DD 819, 443 * XMax, ?
DD 553, 399 * XMax, ?
DD 836, 266 * XMax, ?
DD 474, 630 * XMax, ?
DD 797, 317 * XMax, ?
DD 638, 569 * XMax, ?
DD 842, 686 * XMax, ?
DD 971, 83 * XMax, ?
DD 599, 638 * XMax, ?
DD 368, 767 * XMax, ?
DD 24, 424 * XMax, ?
DD 597, 259 * XMax, ?
DD 865, 197 * XMax, ?
DD 743, 270 * XMax, ?
DD 459, 349 * XMax, ?
DD 59, 459 * XMax, ?
DD 427, 327 * XMax, ?
DD 715, 715 * XMax, ?
DD 980, 680 * XMax, ?
DD 377, 577 * XMax, ?
DD 845, 345 * XMax, ?
DD 473, 173 * XMax, ?
DD 608, 408 * XMax, ?
DD 783, 283 * XMax, ?
DD 825, 625 * XMax, ?
DD 412, 512 * XMax, ?
DD 242, 642 * XMax, ?
DD 293, 733 * XMax, ?
DD 571, 571 * XMax, ?
DD 623, 323 * XMax, ?
DD 467, 267 * XMax, ?
DD 683, 713 * XMax, ?
DD 826, 526 * XMax, ?
DD 113, 413 * XMax, ?
DD 667, 267 * XMax, ?
DD 533, 633 * XMax, ?
DD 648, 188 * XMax, ?
DD 858, 458 * XMax, ?
DD 883, 383 * XMax, ?
DD 962, 162 * XMax, ?
DD 770, 670 * XMax, ?
DD 434, 634 * XMax, ?
DD 357, 457 * XMax, ?
DD 123, 323 * XMax, ?
DD 777, 767 * XMax, ?
DD 834, 634 * XMax, ?
DD 477, 177 * XMax, ?
DD 264, 724 * XMax, ?
DD 458, 538 * XMax, ?
DD 654, 144 * XMax, ?
DD 837, 537 * XMax, ?
DD 93, 353 * XMax, ?
DD 776, 776 * XMax, ?
DD 543, 243 * XMax, ?
DD 427, 527 * XMax, ?
DD 45, 345 * XMax, ?
DD 523, 123 * XMax, ?
DD 638, 558 * XMax, ?
DD 773, 425 * XMax, ?
DD 196, 683 * XMax, ?
DD 443, 594 * XMax, ?
DD 558, 643 * XMax, ?
DD 830, 634 * XMax, ?
DD 414, 362 * XMax, ?
DD 331, 145 * XMax, ?
DD 661, 232 * XMax, ?
DD 434, 321 * XMax, ?
DD 376, 555 * XMax, ?
DD 598, 388 * XMax, ?
DD 814, 645 * XMax, ?
DD 940, 243 * XMax, ?
DD 537, 589 * XMax, ?
DD 375, 534 * XMax, ?
DD 225, 457 * XMax, ?
DD 168, 283 * XMax, ?
DD 57, 725 * XMax, ?
DD 296, 558 * XMax, ?
DD 372, 335 * XMax, ?
DD 484, 692 * XMax, ?
DD 543, 634 * XMax, ?
DD 639, 212 * XMax, ?
DD 738, 166 * XMax, ?
DD 867, 288 * XMax, ?
DD 933, 543 * XMax, ?
DD 696, 313 * XMax, ?
DD 429, 64 * XMax, ?
DD 122, 448 * XMax, ?
DD 585, 727 * XMax, ?
DD 745, 573 * XMax, ?
DD 534, 34 * XMax, ?
DD 757, 657 * XMax, ?
DD 23, 323 * XMax, ?
DD 777, 167 * XMax, ?
DD 934, 634 * XMax, ?
DD 277, 477 * XMax, ?
DD 164, 734 * XMax, ?
DD 558, 358 * XMax, ?
DD 654, 454 * XMax, ?
DD 787, 237 * XMax, ?
DD 893, 453 * XMax, ?
DD 476, 376 * XMax, ?
DD 243, 543 * XMax, ?
DD 627, 727 * XMax, ?
DD 845, 545 * XMax, ?
DD 923, 223 * XMax, ?
DD 938, 258 * XMax, ?
DD 673, 525 * XMax, ?
DD 96, 383 * XMax, ?
DD 143, 794 * XMax, ?
DD 258, 643 * XMax, ?
DD 330, 734 * XMax, ?
DD 414, 562 * XMax, ?
DD 531, 385 * XMax, ?
DD 661, 132 * XMax, ?
DD 734, 621 * XMax, ?
DD 876, 755 * XMax, ?
DD 998, 288 * XMax, ?
DD 914, 645 * XMax, ?
DD 840, 343 * XMax, ?
DD 737, 589 * XMax, ?
DD 675, 234 * XMax, ?
DD 525, 257 * XMax, ?
DD 478, 483 * XMax, ?
DD 557, 325 * XMax, ?
DD 696, 258 * XMax, ?
DD 572, 535 * XMax, ?
DD 484, 692 * XMax, ?
DD 343, 634 * XMax, ?
DD 239, 512 * XMax, ?
DD 138, 266 * XMax, ?
DD 467, 388 * XMax, ?
DD 833, 143 * XMax, ?
DD 696, 513 * XMax, ?
DD 529, 674 * XMax, ?
DD 422, 448 * XMax, ?
DD 385, 657 * XMax, ?
DD 245, 673 * XMax, ?
;---------------------------------------------------------------------------
; Stepper - Tabelle
;---------------------------------------------------------------------------
STEP0X DD 1, 1 * XMax ; Anzahl Pixel, der horizontalen
DD 1, 1 * XMax ; und vertikalen Bewegung(Step X,Y)
DD 1, 3 * XMax
DD 1, 4 * XMax
DD 1, 1 * XMax
DD 2, 1 * XMax
DD 2, 2 * XMax
DD 2, 3 * XMax
DD 2, 4 * XMax
DD 2, 1 * XMax
DD 5, 1 * XMax
DD 3, 2 * XMax
DD 3, 3 * XMax
DD 3, 4 * XMax
DD 3, 1 * XMax
DD 4, 1 * XMax
DD 4, 2 * XMax
DD 4, 3 * XMax
DD 4, 4 * XMax
DD 1, 1 * XMax
DD 1, 2 * XMax
DD 1, 5 * XMax
DD 1, 4 * XMax
DD 1, 1 * XMax
DD 1, 1 * XMax
DD 2, 1 * XMax
DD 3, 5 * XMax
DD 4, 1 * XMax
DD 1, 1 * XMax
DD 1, 2 * XMax
DD 1, 3 * XMax
DD 1, 4 * XMax
DD 1, 1 * XMax
DD 1, 2 * XMax
DD 1, 3 * XMax
DD 2, 3 * XMax
DD 2, 5 * XMax
DD 2, 2 * XMax
DD 2, 2 * XMax
DD 2, 1 * XMax
DD 3, 1 * XMax
DD 5, 2 * XMax
DD 3, 3 * XMax
DD 3, 3 * XMax
DD 4, 1 * XMax
DD 2, 2 * XMax
DD 4, 3 * XMax
DD 4, 5 * XMax
DD 1, 1 * XMax
DD 1, 2 * XMax
DD 1, 2 * XMax
DD 1, 4 * XMax
DD 2, 1 * XMax
DD 2, 2 * XMax
DD 3, 3 * XMax
DD 2, 5 * XMax
DD 3, 1 * XMax
DD 3, 3 * XMax
DD 3, 2 * XMax
DD 3, 5 * XMax
DD 4, 1 * XMax
DD 5, 2 * XMax
DD 4, 3 * XMax
DD 1, 2 * XMax
DD 3, 1 * XMax
DD 1, 2 * XMax
DD 5, 3 * XMax
DD 2, 4 * XMax
DD 2, 1 * XMax
DD 2, 2 * XMax
DD 5, 3 * XMax
DD 2, 4 * XMax
DD 3, 1 * XMax
DD 3, 2 * XMax
DD 3, 5 * XMax
DD 3, 4 * XMax
DD 4, 1 * XMax
DD 3, 2 * XMax
DD 4, 5 * XMax
DD 2, 2 * XMax
DD 1, 1 * XMax
DD 1, 2 * XMax
DD 1, 5 * XMax
DD 1, 2 * XMax
DD 2, 1 * XMax
DD 1, 5 * XMax
DD 2, 3 * XMax
DD 5, 2 * XMax
DD 1, 1 * XMax
DD 3, 2 * XMax
DD 3, 5 * XMax
DD 1, 1 * XMax
DD 2, 1 * XMax
DD 3, 2 * XMax
DD 1, 5 * XMax
DD 1, 2 * XMax
DD 1, 1 * XMax
DD 1, 2 * XMax
DD 1, 5 * XMax
DD 1, 3 * XMax
DD 3, 1 * XMax
DD 2, 5 * XMax
DD 2, 1 * XMax
DD 2, 1 * XMax
DD 5, 1 * XMax
DD 3, 2 * XMax
DD 3, 3 * XMax
DD 3, 1 * XMax
DD 3, 5 * XMax
DD 3, 2 * XMax
DD 2, 3 * XMax
DD 4, 1 * XMax
DD 1, 1 * XMax
DD 1, 2 * XMax
DD 1, 5 * XMax
DD 5, 4 * XMax
DD 2, 1 * XMax
DD 1, 1 * XMax
DD 2, 3 * XMax
DD 2, 5 * XMax
DD 3, 1 * XMax
DD 3, 2 * XMax
DD 1, 3 * XMax
DD 2, 5 * XMax
DD 3, 1 * XMax
DD 5, 2 * XMax
DD 1, 5 * XMax
DD 2, 1 * XMax
DD 1, 1 * XMax
DD 1, 1 * XMax
DD 5, 3 * XMax
DD 1, 2 * XMax
DD 2, 1 * XMax
DD 5, 2 * XMax
DD 2, 3 * XMax
DD 2, 5 * XMax
DD 1, 1 * XMax
DD 3, 2 * XMax
DD 3, 5 * XMax
DD 3, 3 * XMax
DD 1, 1 * XMax
DD 4, 1 * XMax
DD 5, 3 * XMax
DD 4, 2 * XMax
DD 3, 1 * XMax
DD 1, 2 * XMax
DD 1, 3 * XMax
DD 5, 3 * XMax
DD 2, 1 * XMax
DD 2, 2 * XMax
DD 5, 3 * XMax
DD 2, 1 * XMax
DD 3, 1 * XMax
DD 3, 2 * XMax
DD 3, 5 * XMax
DD 1, 3 * XMax
DD 4, 1 * XMax
DD 1, 2 * XMax
DD 4, 1 * XMax
DD 1, 5 * XMax
DD 1, 1 * XMax
DD 1, 1 * XMax
DD 1, 3 * XMax
DD 1, 5 * XMax
DD 2, 1 * XMax
DD 2, 2 * XMax
DD 1, 1 * XMax
DD 1, 5 * XMax
DD 1, 1 * XMax
DD 1, 2 * XMax
DD 3, 1 * XMax
DD 3, 5 * XMax
DD 4, 1 * XMax
DD 1, 2 * XMax
DD 5, 3 * XMax
DD 3, 1 * XMax
DD 1, 1 * XMax
DD 5, 1 * XMax
DD 3, 3 * XMax
DD 1, 4 * XMax
DD 2, 3 * XMax
DD 5, 1 * XMax
DD 2, 3 * XMax
DD 2, 5 * XMax
DD 3, 1 * XMax
DD 3, 2 * XMax
DD 1, 5 * XMax
DD 3, 1 * XMax
DD 5, 3 * XMax
DD 3, 1 * XMax
DD 4, 3 * XMax
DD 5, 2 * XMax
DD 1, 1 * XMax
DD 1, 2 * XMax
DD 1, 3 * XMax
DD 5, 4 * XMax
DD 2, 1 * XMax
DD 1, 1 * XMax
DD 2, 5 * XMax
DD 3, 4 * XMax
DD 3, 3 * XMax
DD 1, 2 * XMax
DD 3, 5 * XMax
DD 3, 4 * XMax
DD 4, 1 * XMax
DD 3, 5 * XMax
DD 1, 3 * XMax
DD 5, 4 * XMax
DD 1, 1 * XMax
DD 1, 2 * XMax
DD 5, 3 * XMax
DD 1, 2 * XMax
DD 2, 1 * XMax
DD 5, 2 * XMax
DD 2, 1 * XMax
DD 2, 3 * XMax
DD 5, 1 * XMax
DD 3, 3 * XMax
DD 3, 3 * XMax
DD 3, 5 * XMax
DD 2, 1 * XMax
DD 3, 1 * XMax
DD 2, 5 * XMax
DD 4, 2 * XMax
DD 1, 5 * XMax
DD 3, 1 * XMax
DD 1, 3 * XMax
DD 1, 5 * XMax
DD 2, 1 * XMax
DD 1, 2 * XMax
DD 2, 3 * XMax
DD 5, 1 * XMax
DD 3, 3 * XMax
DD 3, 2 * XMax
DD 5, 3 * XMax
DD 3, 3 * XMax
DD 1, 1 * XMax
DD 5, 2 * XMax
DD 2, 3 * XMax
DD 4, 5 * XMax
DD 1, 1 * XMax
DD 1, 2 * XMax
DD 1, 5 * XMax
DD 1, 4 * XMax
DD 2, 1 * XMax
DD 1, 5 * XMax
DD 2, 3 * XMax
DD 2, 4 * XMax
DD 3, 5 * XMax
DD 5, 2 * XMax
DD 3, 1 * XMax
DD 2, 5 * XMax
DD 3, 1 * XMax
DD 2, 2 * XMax
DD 1, 3 * XMax
DD 5, 2 * XMax
;----------------------
S_Len = ($-STEP0X)
;---------------------------------------------------------------------------
; Tabelle der Richtungs-Flags
;---------------------------------------------------------------------------
; plus(0) / minus(1) für X,Y
W0 DB (Anzahl+1)/4 DUP(0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0)
;---------------------------------------------------------------------------
RETTX DD ?
RETTY DD ?
RETTBA DW 0 ; aktuelle Video-Bank
RETTAX DW ?
RETTBX DW ?
RETTDI DW ?
RETTDX DW ?
;---------------------------------------------------------------------------
ERRTEX2 DB Cr, Lf, "zuwenig Speicher frei.", Cr, Lf, "$"
ERRTEX3 DB Cr, Lf, "Der benutzte Video-Mode, wird nicht unterstützt.", Cr, Lf, "$"
DATEN ends
;---------------------------------------------------------------------------
STAPEL SEGMENT use16 STACK 'STACK'
DB 10h dup (?)
STAPEL ends
end
Eine Tabelle der verwendeten x86-Opcodes findet man hier: http://ref.x86asm.net/coder32.html
MASM 5 kann man hier herunterladen: http://microprocessados.lesc.ufc.br/dow ... masm51.zip
Das Public-Dokument für Vesa findet man hier(Login erforderlich): http://www.vesa.org/Standards/free.htm
vbe3.pdf
Haftungsausschluß:
Eine Haftung für Schäden die durch die Benutzung der Demos möglicherweise auftreten können übernehme ich nicht. Die Benutzung geschieht auf eigenes Risiko. Dieses gilt auch für alle nachfolgenden Demos.
Dirk