home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / assemblr / library / screen / uniform / ufas015.asm < prev    next >
Assembly Source File  |  1993-07-28  |  3KB  |  100 lines

  1. ; MASM/ MS Quick ASM/ Turbo ASM
  2. ; example for dynamic attribute modification
  3. ;
  4. ;attribut file <testfmt.att>
  5. ;---------------------------
  6. ;Format-Textattribut:    8
  7. ;Format-Rahmenattribut: 10
  8. ;fld0             DB     12 DUP(020h)
  9. ; Distanzen in Bereich <Daten>:   Feldattribut: 500    Feldtyp: 502
  10. ;fld1             DD     0
  11. ; Distanzen in Bereich <Daten>:   Feldattribut: 507    Feldtyp: 509
  12. ;fld2             DB     40 DUP(020h)
  13. ; Distanzen in Bereich <Daten>:   Feldattribut: 514    Feldtyp: 516
  14.  
  15. UFCALLK MACRO OKZ, OFN, OFL, ORETC, OSM, ODAT
  16.         lea   bx,OKZ             ;; Offset Kennzeichen
  17.         push  bx
  18.         lea   bx,OFN             ;; Offset Formatname 
  19.         push  bx
  20.         lea   bx,OFL             ;; Offset 1. Feld    
  21.         push  bx
  22.         lea   bx,ORETC            ;; Offset Returncode 
  23.         push  bx
  24.         lea   bx,OSM             ;; Offset Schreibmarke
  25.         push  bx
  26.         lea   bx,ODAT            ;; Offset Daten
  27.         push  bx
  28.         call  UNIF               ;; Unterprogrammaufruf
  29.         add   sp,12              ;; Stack aktualisieren
  30.         ENDM
  31.  
  32. STRETCPY  MACRO ZADR, SADR, LEN
  33.     cld                       ;; increment
  34.     lea   di,ZADR             ;; target adress
  35.     lea   si,SADR             ;; source adress
  36.     mov   cx,LEN              ;; length
  37.     rep   movsb
  38.     ENDM
  39.  
  40.         DOSSEG
  41.         TITLE example
  42. EXTRN   UNIF:NEAR
  43. EXTRN   MOUSEON:NEAR
  44. EXTRN   MOUSEOFF:NEAR
  45.        .MODEL   SMALL 
  46.        .Code
  47.        jmp anfang
  48.  
  49. INCLUDE ufas01.mac
  50. INCLUDE testfmt.mac
  51. const1  DB  " output with generated attributes !     "
  52. const2  DB  " new colour of fld0 and fld1 !          "
  53. const3  DB  " new access of fld0 and fld1 !          "
  54. const4  DB  " new colour of text and frame !         "
  55. format1 DB "testfmt "
  56.  
  57. anfang: push   cs                         ; DS ist CS
  58.         pop    ds
  59.         push   cs                         ; ES ist CS
  60.         pop    es
  61.  
  62.     call   MOUSEON
  63. ; normal output
  64. af1:
  65.     STRETCPY fld2,const1,40
  66.         mov   word ptr FKZ,2
  67.         mov   word ptr SM,0
  68.     mov   word ptr RETC,55
  69.         UFCALLK FKZ, format1, fld0, RETC, SM, Atestfmt
  70.  
  71. ; change colour of field fld0 and fld1
  72.     STRETCPY fld2,const2,40
  73.     mov   byte ptr [Atestfmt+500],15
  74.     mov   byte ptr [Atestfmt+507],7
  75.     mov   word ptr FKZ,3
  76.     mov   word ptr RETC,55
  77.         UFCALLK FKZ, format1, fld0, RETC, SM, Atestfmt
  78.  
  79. ; change access of field fld0 and fld1
  80.     STRETCPY fld2,const3,40
  81.     mov   byte ptr [Atestfmt+502],97
  82.     mov   byte ptr [Atestfmt+509],97
  83.     mov   word ptr FKZ,3
  84.     mov   word ptr RETC,55
  85.     UFCALLK FKZ, format1, fld0, RETC, SM, Atestfmt
  86.  
  87. ; change colour of text and frame
  88.     STRETCPY fld2,const4,40
  89.     mov   byte ptr [Atestfmt+8],112
  90.     mov   byte ptr [Atestfmt+10],44
  91.     mov   word ptr FKZ,2
  92.     mov   word ptr RETC,55
  93.     UFCALLK FKZ, format1, fld0, RETC, SM, Atestfmt
  94.  
  95. ende:   call   MOUSEOFF
  96.         mov    ah,4ch                     ; program end
  97.         mov    al,0                       ; Errorlevel 0
  98.         int    21h
  99.         END
  100.