home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-387-Vol-3of3.iso / p / pchdemo.zip / SOURCEFA.ZIP / 320X200.ASM < prev    next >
Assembly Source File  |  1992-10-28  |  2KB  |  120 lines

  1. code    segment public
  2.  
  3. assume  cs:code,ds:code,es:code,ss:stack
  4.  
  5. extrn    digit:near,convert:near
  6.  
  7.     push    cs
  8.     pop    ds
  9.     push    cs
  10.     pop    es
  11.  
  12.     mov    di,offset tab1        ; Erstellen der Palette mit 256 Farben
  13.     mov    ax,0
  14.     mov    bl,0
  15. s0:
  16.     stosw
  17.     mov    [di],bl
  18.     inc    di
  19.     add    bl,21
  20.     cmp    bl,64
  21.     jb    s0
  22.     mov    bl,0
  23.     add    ah,9
  24.     cmp    ah,64
  25.     jb    s0
  26.     mov    ah,0
  27.     add    al,9
  28.     cmp    al,64
  29.     jb    s0
  30.  
  31.         mov     ax,13h
  32.     int    10h            ; Grafik einschalten (VGA 320 x 200)
  33.         mov     ax,1012h
  34.     mov    bx,0
  35.     mov    cx,256
  36.     mov    dx,offset tab1
  37.     int    10h            ; und Palette auf 64 Graustufen ändern.
  38. s1:
  39.     push    es
  40.     mov    ax,es
  41.     add    ax,1000h
  42.     mov    es,ax
  43.     mov    al,15            ; mittlere Kontrastwert
  44.     mov    bl,32            ; ab dem 32.Pixel von links
  45.     mov    bh,44            ; ab der 44.Zeile von oben
  46.     mov    cx,320            ; 320 Pixel digitalisieren
  47.     mov    dx,200            ; 200 Zeilen digitalisieren
  48.     mov    di,0            ; Offsetadresse des Buffers
  49.     call    digit            ; und Digitalisieren
  50.     pop    es
  51.  
  52.         push    ds
  53.     mov    bx,0            ; Offsetadresse der VGA
  54.         mov     ax,ds
  55.     add    ax,1000h
  56.     mov    ds,ax            ; Segmentadresse des Buffers
  57.     mov    cx,200            ; 200 Zeilen
  58. s2:
  59.     push    cx
  60.     mov    si,0            ; Offsetadresse des Buffers
  61.     mov    di,offset cs:buffer    ; Offsetadresse des Zwischenspeichers
  62.     mov    cx,320            ; 320 Pixel konvertieren
  63.     call    convert
  64.     push    es
  65.     push    ds
  66.     push    cs
  67.     pop    ds
  68.     les    di,vstart        ; Adresse der VGA
  69.     add    di,bx
  70.     mov    si,offset buffer    ; Offsetadresse des Zwischenspeichers
  71.     mov    cx,320            ; 320 Pixel
  72. s3:
  73.     lodsw                ; Konvertierung von 0RRRRRGGGGGBBBBB
  74.     rol    ax,1            ; nach RRRGGGBB
  75.     rol    al,1
  76.     rol    al,1
  77.     ror    ax,1
  78.     ror    ax,1
  79.     ror    ax,1
  80.     ror    ah,1
  81.     ror    ah,1
  82.     ror    ax,1
  83.     ror    ax,1
  84.     ror    ax,1
  85.     stosb
  86.     loop    s3
  87.     pop    ds
  88.     pop    es
  89.     mov    ax,ds
  90.     add    ax,20
  91.     mov    ds,ax            ; Segmentadresse um 40 erhöhen
  92.     add    bx,320            ; 320 Pixel überspringen
  93.     pop    cx
  94.     loop    s2
  95.     pop    ds
  96.  
  97.     mov    ah,1
  98.     int    16h
  99.     jz    s1            ; Wenn keine Taste gedrückt
  100.     mov    ah,0
  101.     int    16h
  102.  
  103.     mov    ax,3
  104.     int    10h            ; Auf Textmodus schalten
  105.  
  106.     mov    ah,4ch
  107.     int    21h            ; Programm beenden
  108.  
  109. tab1    db    768 dup (?)
  110. vstart    dd    0a0000000h
  111. buffer    dw    768 dup (?)
  112.  
  113. code    ends
  114. stack    segment para stack
  115.     dw    256 dup (?)
  116. stack    ends
  117.  
  118. end
  119.  
  120.