home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / ddkx86v2.zip / DDKX86 / DBCSDD / SRC_DBCS / VDHV / ATLS3LVB.ASM < prev    next >
Assembly Source File  |  1995-04-14  |  34KB  |  658 lines

  1. ;*DDK*************************************************************************/
  2. ;
  3. ; COPYRIGHT (C) Microsoft Corporation, 1989
  4. ; COPYRIGHT    Copyright (C) 1995 IBM Corporation
  5. ;
  6. ;    The following IBM OS/2 WARP source code is provided to you solely for
  7. ;    the purpose of assisting you in your development of OS/2 WARP device
  8. ;    drivers. You may use this code in accordance with the IBM License
  9. ;    Agreement provided in the IBM Device Driver Source Kit for OS/2. This
  10. ;    Copyright statement may not be removed.;
  11. ;*****************************************************************************/
  12.         PAGE    60,132
  13.         TITLE   ATLS3LVB.ASM -- Buffer Write Routines for ATLAS 3 bytes Format
  14.  
  15. ;/*****************************************************************************
  16. ;*
  17. ;* SOURCE FILE NAME = ATLS3LVB.ASM
  18. ;*
  19. ;* DESCRIPTIVE NAME:    BUFFERUPDATE write routines
  20. ;*
  21. ;*
  22. ;* VERSION      V2.0
  23. ;*
  24. ;* DATE
  25. ;*
  26. ;* DESCRIPTION
  27. ;*
  28. ;* FUNCTIONS    WriteCellStrA, WriteCharStrA, WriteCharStrAttrA,
  29. ;*              WriteNCharA, WriteNAttrA, WriteNCellA
  30. ;*
  31. ;* NOTES:       None
  32. ;*
  33. ;* STRUCTURES   NONE
  34. ;*
  35. ;* EXTERNAL REFERENCES  UpdateRegenA    (in COMMNPVB.ASM)
  36. ;*                      CheckDBCS       (in XGAWRITE.ASM)
  37. ;*
  38. ;* EXTERNAL FUNCTIONS
  39. ;*
  40. ;*              NONE
  41. ;*
  42. ;* CHANGE ACTIVIY =
  43. ;*   DATE      FLAG       APAR    CHANGE DESCRIPTION
  44. ;*   --------  ---------- -----   --------------------------------------
  45. ;*   mm/dd/yy  @Vr.mpppxx xxxxx   xxxxxxx
  46. ;*   09/11/89  j-ys911                 fix for P0013 sct$12cc. In entry, SI/DI points 2nd attribute.
  47. ;*                                But  implementaion treated as if they start at 1st byte of cell.
  48. ;*   09/25/89  J-KK0925           KKJ, ROM Font -> RAM Font
  49. ;*   10/03/89  J-KK1003           KKJ, INSTALLATION
  50. ;*   10/31/89  J-KK1031           KKJ,     Fix for Exception Handling
  51. ;*   11/01/89  J-KK1101           KKJ, Change Extra Hankaku Handling
  52. ;*   11/17/89  J-KK1117           KKJ, P0162 12CC - Not Set DBCS 2nd bit at CharStrAttr.
  53. ;*   11/29/89  J-KK1129           KKJ, Limit Check for NCELL and NCHAR with DBCS.
  54. ;*   11/30/89  J-KK1130           KKJ, CLD is assumed in CFill.
  55. ;*   06/16/93  J-TS0616           TSO, DBCS Exception handling of VioWrtNAttr
  56. ;*   07/07/93  J-TS0707           TSO, DBCS J-TS0616 doesn't take care of buffer end
  57. ;****************************************************************************/
  58.  
  59. ;;J-KK0925 temp    equ     0h
  60. temp    equ     EXTRA_ATTRHigh          ;;ROM Font -> RAM Font J-KK0925
  61.  
  62.         .286c                           ; 286 protect mode instructions
  63.  
  64.         .xlist
  65.         INCLUDE struc.inc               ; Structure macro
  66.         INCLUDE vdhequ.inc              ; Buffer update equates
  67.         INCLUDE vdhstruc.inc            ; Buffer update data structures
  68.         .list
  69.  
  70.         IFNDEF  INSTALLATION            ; Installation J-KK1003
  71.             EXTRN   CheckDBCS:NEAR
  72.             EXTRN   UpdateRegenA:NEAR
  73.             EXTRN   UpdateAttrA:NEAR
  74.         ENDIF
  75.  
  76. R2CSEG  SEGMENT WORD    PUBLIC 'CODE'
  77.         ASSUME  CS:R2CSEG,DS:NOTHING,ES:NOTHING
  78.  
  79.         IFDEF   INSTALLATION            ; Installation J-KK1003
  80. Dummy       proc    near
  81. WriteCStrA  label   byte
  82. WriteNCellA label   byte
  83. WriteNCharA label   byte
  84. WriteNAttrA label   byte
  85. ATLAS3UpLeft label  byte
  86. ATLAS3DnRight label byte
  87. ATLAS3CFill label   byte
  88. ATLAS3CFillR label  byte
  89.             public  WriteCStrA
  90.             public  WriteNCellA
  91.             public  WriteNCharA
  92.             public  WriteNAttrA
  93.             public  ATLAS3UpLeft
  94.             public  ATLAS3DnRight
  95.             public  ATLAS3CFill
  96.             public  ATLAS3CFillR
  97.             ret
  98. Dummy       endp
  99.         ELSE
  100.  
  101. ;********************** START OF SPECIFICATIONS *************************
  102. ;*                                                                      *
  103. ;* SUBROUTINE NAME:     WriteCStrA                                      *
  104. ;*                                                                      *
  105. ;* DESCRIPTIVE NAME:    Video device handler write cells/chars/charsA   *
  106. ;*                                                                      *
  107. ;* INPUT:                                                               *
  108. ;* SS:BP  --->  Stack frame                     (see VDHSTRUC.INC)      *
  109. ;* DS:SI  --->  Source Buffer Address           (see XGAWRITE.ASM)      *
  110. ;* ES:DI  --->  LVB Address                     (see XGAWRITE.ASM)      *
  111. ;*                                                                      *
  112. ;********************** END OF SPECIFICATIONS ***************************
  113. WriteCStrA  proc
  114.             public  WriteCStrA
  115.             mov     bx, [bp].Sub_index  ; Get Function Index
  116.             .if     < bx e WCELL >      ;Cell ?             ;j-ys718
  117.                 shr     cx,1            ;                   ;j-ys718
  118.                 mov     [bp].Sub_length,cx ;                ;j-ys719
  119.             .endif                      ;                   ;j-ys718
  120. ;;*** Update LVB
  121.             Call    HeadBounda          ; 
  122.             xor     dx,dx               ;clear the char counter
  123.             .while  ncxz  near          ; 
  124.                 xor     ax,ax
  125.                 .if     < bx e WCELL >  ;Cell ?
  126.                     lodsb               ;get a next cell
  127.                     add     si,3        ;skip attr0,1,2
  128.                     mov     ah,[si-1]   ;get character set bits (attr2)
  129.                 .elseif < bx e WCHAR >  ;Char ?
  130.                     lodsb               ;get a next char
  131.                 .else                   ;CharAttribute
  132.                     lodsb               ;get a next char
  133.                     mov     ah,byte ptr [bp].Sub_attribute2 ;get attr2 ;J-KK1101
  134.                 .endif                  ; 
  135.                 dec     cx              ;adjust the loop counter (CX)
  136.                 inc     dx              ;increment the char counter (DX)
  137.  
  138.                 .if     <ah e TypeF>    ;extention hankaku  ?     ;j-ys728
  139.                     clc                 ;reset DBCS check flag    ;j-ys728
  140.                 .else                   ;                         ;j-ys728
  141.                     call    CheckDBCS   ; 
  142.                 .endif                  ;                         ;j-ys728
  143.                 .if     c               ;if char have DBCS lead byte
  144.                     .if     < dx gt 1 > ; Hankaku Char Counter must be GT 1.
  145.                         push    ax      ; save ax
  146.                         dec     dx      ; Adjust
  147.                         push    si      ; 
  148.                         dec     si      ; Adjust
  149.                         cmp     bx,WCELL ; 
  150.                         .if     e       ; 
  151.                             sub     si,3 ;adjust si for attr
  152.                         .endif          ; 
  153.                         call    Writea  ; Write the leading Hankaku String
  154.                         pop     si      ; 
  155.                         pop     ax      ; 
  156.                     .endif
  157.  
  158.                     xor     dx,dx       ;clear the char counter (DX)
  159.                     .if     ncxz        ;   & cx > 0
  160.                         mov     ah,al   ;ah is DBCS lead
  161.                         lodsb
  162.                         cmp     bx,WCELL
  163.                         .if     e       ; 
  164.                             add     si,3 ;adust si for attr
  165.                         .endif          ; 
  166.                         dec     cx      ;adjust the loop counter (CX)
  167.  
  168.                         xchg    al,ah   ; 
  169.                         call    PutDBCSa ;write dbcs into LVB
  170.                     .else               ; Terminate with DBCS leading byte
  171.                                         ; Ignored the last byte
  172.                         dec     [bp].Sub_length
  173.                     .endif              ; 
  174.                 .endif                  ; End of DBCS Case
  175.             .endwhile                   ; 
  176.  
  177.             call    Writea              ;Write Hankaku Char to LVB
  178.             call    TailBounda
  179.  
  180. ;;*** Update PVB
  181.             call    UpdateRegenA
  182.  
  183.             ret
  184. WriteCStrA  endp
  185.  
  186. ;********************** START OF SPECIFICATIONS *************************
  187. ;*                                                                      *
  188. ;* SUBROUTINE NAME:     WriteNCellA                                     *
  189. ;*                                                                      *
  190. ;* DESCRIPTIVE NAME:    Video device handler write N cells              *
  191. ;*                                                                      *
  192. ;* INPUT:                                                               *
  193. ;* SS:BP  --->  Stack frame                     (see VDHSTRUC.INC)      *
  194. ;* DS:SI  --->  Source Buffer Address           (see XGAWRITE.ASM)      *
  195. ;* ES:DI  --->  LVB Address                     (see XGAWRITE.ASM)      *
  196. ;*                                                                      *
  197. ;********************** END OF SPECIFICATIONS ***************************
  198. WriteNCellA proc
  199.             public  WriteNCellA
  200. ;;*** Update LVB
  201.  
  202.             pushf                       ; 
  203.             Call    HeadBounda          ; 
  204.             popf                        ; 
  205.             .if     c                   ;*** DBCS Cell
  206.                 mov     dx,ds:[si+2]    ;Get 2nd Cell           ;j-ys718
  207.                 .repeat                 ; 
  208.                     stosw               ;Store 1st Cell
  209.                     movsw               ;store 1st attr1/2
  210.                     and     byte ptr es:[di-1], not (dbcsA1+dbcsA2) ; Clear J-KK1031
  211.                     or      byte ptr es:[di-1], dbcsA1 ; Set DBCS 1st   J-KK1031
  212.                     xchg    ax,dx       ; 
  213.                     stosw               ;Store 2nd Cell
  214.                     add     si,2
  215.                     movsw               ;store 2nd attr1/2
  216.                     and     byte ptr es:[di-1], not (dbcsA1+dbcsA2) ; Clear J-KK1031
  217.                     or      byte ptr es:[di-1], dbcsA2+dbcsA1 ; Set DBCS 2nd J-KK031
  218.                     xchg    ax,dx       ; 
  219.                     sub     si,6        ;<===
  220.                 .loop                   ; 
  221.             .else                       ;*** SBCS Cell
  222.                 mov     dx,ds:[si]      ;get second attr             ;j-ys731
  223.                 and     dh,not (dbcsA1+dbcsA2) ; To Hankaku          ;J-KK1101
  224.                 .repeat                 ;                            ;j-ys728
  225.                     stosw               ;Fill buffer with Cells      ;j-ys728
  226.                     mov     es:[di],dx  ;                            ;j-ys728
  227.                     add     di,2        ;                            ;j-ys728
  228.                 .loop                   ;                            ;j-ys728
  229.             .endif                      ; 
  230.             call    TailBounda          ; 
  231.  
  232. ;;*** Update PVB
  233.             call    UpdateRegenA
  234.  
  235.             ret
  236. WriteNCellA endp
  237.  
  238. ;********************** START OF SPECIFICATIONS *************************
  239. ;*                                                                      *
  240. ;* SUBROUTINE NAME:     WriteNCharA                                     *
  241. ;*                                                                      *
  242. ;* DESCRIPTIVE NAME:    Video device handler write N chars              *
  243. ;*                                                                      *
  244. ;* INPUT:                                                               *
  245. ;* SS:BP  --->  Stack frame                     (see VDHSTRUC.INC)      *
  246. ;* DS:SI  --->  Source Buffer Address           (see XGAWRITE.ASM)      *
  247. ;* ES:DI  --->  LVB Address                     (see XGAWRITE.ASM)      *
  248. ;*                                                                      *
  249. ;********************** END OF SPECIFICATIONS ***************************
  250. WriteNCharA proc
  251.             public  WriteNCharA
  252.  
  253. ;;*** Update LVB
  254. ;;J-KK1129            call    CheckDBCS           ;
  255. ;;J-KK1129            .if     c
  256. ;;J-KK1129                mov     dx, cx
  257. ;;J-KK1129                shl     dx, 1           ; Adjust word offset length
  258. ;;J-KK1129                mov     [bp].Sub_length, dx ;   for DBCS chars
  259. ;;J-KK1129                stc
  260. ;;J-KK1129            .endif
  261.             pushf
  262.             Call    HeadBounda          ; 
  263.             popf
  264.             .if     c                   ;*** DBCS handling
  265.                 mov     ah,ds:[si]      ; Get 2nd Character
  266.                 .repeat                 ; 
  267.                     stosb               ;Set the lead byte
  268. ;;J-KK1031      mov     byte ptr es:[di+2], temp+dbcsA1 ; DBCS 1st Attr
  269.                     and     byte ptr es:[di+2], not (dbcsA1+dbcsA2) ; Clear J-KK1031
  270.                     or      byte ptr es:[di+2], dbcsA1  ; DBCS 1st Attr   J-KK1031
  271.                     add     di,3        ; 
  272.                     mov     byte ptr es:[di],ah ;Store the second byte
  273. ;;J-KK1031      mov     byte ptr es:[di+3], temp+dbcsA2+dbcsA1 ; DBCS 1st Attr
  274.                     and     byte ptr es:[di+3], not (dbcsA1+dbcsA2) ; Clear J-KK1031
  275.                     or      byte ptr es:[di+3], dbcsA2+dbcsA1  ; DBCS 2nd J-KK1031
  276.                     add     di,4        ; 
  277.                 .loop
  278.             .else                       ;*** SBCS handling
  279.                 .repeat                 ; 
  280.                     stosb               ;Store character
  281. ;;J-KK1031      mov     byte ptr es:[di+2], temp       ; Clear DBCS Attr
  282.                     and     byte ptr es:[di+2], not (dbcsA1+dbcsA2) ; Clear J-KK1031
  283.                     add     di,3        ;Skip attribute
  284.                 .loop                   ; 
  285.             .endif                      ; 
  286.             call    TailBounda
  287.  
  288. ;;*** Update PVB
  289.             call    UpdateRegenA
  290.  
  291.             ret
  292. WriteNCharA endp
  293.  
  294. ;********************** START OF SPECIFICATIONS *************************
  295. ;*                                                                      *
  296. ;* SUBROUTINE NAME:     WriteNAttrA                                     *
  297. ;*                                                                      *
  298. ;* DESCRIPTIVE NAME:    Video device handler write N attribute          *
  299. ;*                                                                      *
  300. ;* INPUT:                                                               *
  301. ;* SS:BP  --->  Stack frame                     (see VDHSTRUC.INC)      *
  302. ;* DS:SI  --->  Source Buffer Address           (see XGAWRITE.ASM)      *
  303. ;* ES:DI  --->  LVB Address                     (see XGAWRITE.ASM)      *
  304. ;*                                                                      *
  305. ;********************** END OF SPECIFICATIONS ***************************
  306. WriteNAttrA proc
  307.             public  WriteNAttrA
  308.  
  309.         mov     ah, es:[di+3]           ; First char is DBCS 2nd ?      ;J-TS0616
  310.         and     ah, dbcsA1+dbcsA2                                       ;J-TS0616
  311.         .if     <ah eq dbcsA1+dbcsA2>                                   ;J-TS0616
  312.             inc     [bp].Sub_length                                     ;J-TS0616
  313.             sub     [bp].Sub_offset, 4                                  ;J-TS0616
  314.             sub     [bp].PVBOff, 2                                      ;J-TS0616
  315.         .endif                                                          ;J-TS0616
  316.  
  317.             mov     ax,word ptr ds:[si-1] ; Get Attr0/1
  318.             push    bx                  ;                               J-KK1101
  319.             mov     bl,ds:[si+1]        ; Get Attr2                    ;J-KK1101
  320.             and     bl, not (dbcsA1+dbcsA2) ;                          ;J-KK1101
  321.  
  322. ;;*** Update LVB
  323.             .repeat
  324.                 inc     di              ;Skip char byte
  325.                 stosw                   ;set attribute
  326.                 mov     bh, byte ptr es:[di] ; Store Attr2              J-KK1101
  327.                 and     bh, dbcsA1+dbcsA2 ; Get DBCS bits of Original   J-KK1101
  328.                 or      bh, bl          ; Marge                         J-KK1101
  329.                 mov     es:[di], bh     ; Store Attr2                   J-KK1101
  330.                 inc     di              ;skip sysytem byte and char     ;j-ys718
  331.             .loop
  332.             pop     bx                  ;                               J-KK1101
  333.  
  334.         mov     ah, es:[di-1]           ; Last char is DBCS 1st ?       ;J-TS0707
  335.         and     ah, dbcsA1+dbcsA2                                       ;J-TS0616
  336.         .if     <ah eq dbcsA1>                                          ;J-TS0707
  337.             inc     [bp].Sub_length                                     ;J-TS0616
  338.         .endif                                                          ;J-TS0616
  339.  
  340. ;;*** Update PVB
  341.             call    UpdateAttrA
  342.  
  343.             ret
  344. WriteNAttrA endp
  345.  
  346. ;********************** START OF SPECIFICATIONS *************************
  347. ;*                                                                      *
  348. ;* SUBROUTINE NAME: XXXXX                                               *
  349. ;*                                                                      *
  350. ;* DESCRIPTIVE NAME:    DBCS Exeption Handling Routine                  *
  351. ;*                                                                      *
  352. ;* INPUT:                                                               *
  353. ;* SS:BP  --->  Stack frame                     (see VDHSTRUC.INC)      *
  354. ;* ES:DI  --->  LVB Address                     (see XGAWRITE.ASM)      *
  355. ;*                                                                      *
  356. ;********************** END OF SPECIFICATIONS ***************************
  357. ;; OverWriting Handling
  358. ;; DS:SI - User Buffer
  359. ;; ES:DI - LVB
  360. HeadBounda  PROC    NEAR                ;OverWriting of Head DBCS Widow
  361.             cmp     di,4                ;check start of screen or not ?
  362.             .if     ge
  363.                 test    byte ptr es:[di+3],dbcsA2 ;DBCS 2nd ?
  364.                 .if     nz              ; 
  365.                     mov     byte ptr es:[di-4],20h ;set space
  366.                     and     byte ptr es:[di-1], not (dbcsA1+dbcsA2) ; Clear J-KK1031
  367.                     inc     [bp].Sub_length ;adjust repeat count
  368.                     sub     [bp].Sub_offset,4 ;adjust offset            J-KK1031
  369.                     sub     [bp].PVBOFF,2     ;adjust offset            ;J-TS00
  370.  
  371.                 .endif                  ; 
  372.             .endif
  373.             ret                         ; 
  374. HeadBounda  ENDP                        ; 
  375.  
  376. TailBounda  PROC    NEAR                ;Overwriting of Tail DBCS Widow
  377.             cmp     di, [bp].Sub_Buffsize ;check end of screen or not ?
  378.             .if     b
  379.                 test    byte ptr ES:[DI+3],dbcsA2 ; Target Tail+1 is DBCS 2nd ?
  380.                 .if     nz              ; 
  381.                     mov     byte ptr es:[di],20h ;set space
  382.                     and     byte ptr es:[di+3], not (dbcsA1+dbcsA2) ; Clear J-KK1031
  383.                     add     di,4
  384.                     inc     [bp].Sub_length ;adjust repeat count
  385.                 .endif                  ; 
  386.             .endif
  387.             ret                         ; 
  388. TailBounda  ENDP                        ; 
  389.  
  390. PutDBCSa    PROC
  391. ;  al:lead   dbcs
  392. ;  ah:second dbcs
  393.             .if     < bx e WCELL >      ;Cell ?
  394.                 stosb                   ;store dbcs lead byte
  395.                 push    ax
  396.                 mov     ax,word ptr ds:[si-7] ;get 1st cell attribute
  397.                 stosw                   ;store dbcs lead byte attr0/1
  398.                 and     byte ptr es:[di], not (dbcsA1+dbcsA2) ; Clear   J-KK1031
  399.                 or      byte ptr es:[di], dbcsA1 ; set dbcs 1st flag    J-KK1031
  400.                 inc     di
  401.                 pop     ax
  402.                 xchg    al,ah           ; 
  403.                 stosb                   ;store dbcs second byte
  404.                 mov     ax,word ptr ds:[si-3] ;get 2nd cell attribute
  405.                 stosw                   ;store dbcs second byte attribute
  406.                 and     byte ptr es:[di], not (dbcsA1+dbcsA2) ; Clear   J-KK1031
  407.                 or      byte ptr es:[di], dbcsA1+dbcsA2 ; dbcs 2nd flag J-KK1031
  408.                 inc     di
  409.             .elseif < bx e WCHAR >      ;Char ?
  410.                 stosb                   ;store dbcs lead byte
  411.                 and     byte ptr es:[di+2], not (dbcsA1+dbcsA2) ; Clear   J-KK1031
  412.                 or      byte ptr es:[di+2], dbcsA1 ; dbcs 1st flag       J-KK1031
  413.                 add     di,3
  414.                 xchg    al,ah
  415.                 stosb                   ;store dbcs second byte
  416.                 and     byte ptr es:[di+2], not (dbcsA1+dbcsA2) ; Clear   J-KK1031
  417.                 or      byte ptr es:[di+2], dbcsA1+dbcsA2 ;dbcs 2nd flag J-KK1031
  418.                 add     di,3
  419.             .else                       ;Char Attribute
  420.  
  421.                 stosb                   ;set 1st char
  422.                 push    ax              ;store dbcs first byte
  423.                 mov     ax,word ptr [bp].Sub_attribute ; Set Attr0/1
  424.                 stosw
  425.  
  426.                 mov     al, byte ptr [bp].Sub_attribute2 ; Set Attr2    J-KK1101
  427.                 or      al, dbcsA1      ; set dbcs 1st flag                  J-KK1101
  428.                 stosb                   ;                                               J-KK1101
  429.  
  430.                 pop     ax
  431.  
  432.                 xchg    al,ah           ;store dbcs second byte
  433.                 stosb
  434.                 mov     ax,word ptr [bp].Sub_attribute
  435.                 stosw
  436.                 mov     al, byte ptr [bp].Sub_attribute2 ; Set Attr2    J-KK1101
  437.                 or      al, dbcsA1+dbcsA2 ; set dbcs 2nd flag           J-KK1117
  438.                 stosb                   ;                                               J-KK1101
  439.             .endif
  440.             ret
  441. PutDBCSa    ENDP
  442.  
  443. Writea      PROC                        ;Hankaku write routine
  444.             Public  Writea
  445.             push    cx
  446.             sub     si,dx               ;adjust si
  447.             mov     cx,dx
  448.             .if     ncxz
  449.                 .if     < bx e WCELL >  ;Cell ?
  450.                     sub     si,dx       ;adjust si more!
  451.                     sub     si,dx       ;adjust si more!        ;j-ys718
  452.                     sub     si,dx       ;adjust si more!        ;j-ys718
  453.                     .repeat
  454.                         movsw
  455.                         movsw
  456.                     .loop
  457.                 .elseif < bx e WCHAR >  ;Char ?
  458.                     .repeat
  459.                         and     byte ptr es:[di+3], not (dbcsA1+dbcsA2) ;Clear J-KK1031
  460.                         movsb
  461.                         add     di,3    ;Skip Attr
  462.                     .loop
  463.                 .else                   ;CharAttribute
  464.                     mov     ax,word ptr [bp].Sub_attribute
  465.                     push    bx          ;                                       J-KK1101
  466.                     mov     bl, byte ptr [bp].Sub_attribute2 ; Get Attr2J-KK1101
  467.                     and     bl, not (dbcsA1+dbcsA2) ; Clear DBCS bits   J-KK1101
  468.                     .repeat
  469.                         movsb
  470.                         stosw
  471.                         mov     byte ptr es:[di], bl ; Store Attr2      J-KK1101
  472.                         inc     di
  473.                     .loop
  474.                     pop     bx          ;                                       J-KK1101
  475.                 .endif
  476.             .endif
  477.             pop     cx
  478.             ret
  479. Writea      ENDP
  480.  
  481.  
  482. ;********************** START OF SPECIFICATIONS *************************
  483. ;*                                                                      *
  484. ;* SUBROUTINE NAME:     ATLAS3UpLeft                                    *
  485. ;*                                                                      *
  486. ;* DESCRIPTIVE NAME:    Video device handler Scroll Up/Left             *
  487. ;*                      Move a one line.                                *
  488. ;*                                                                      *
  489. ;* INPUT:                                                               *
  490. ;* SS:BP  --->  Stack frame                     (see VDHSTRUC.INC)      *
  491. ;* DS:SI  --->  Source Buffer Address           (see XGASCROL.ASM)      *
  492. ;* ES:DI  --->  LVB Address                     (see XGASCROL.ASM)      *
  493. ;* CX     --->  Words (Cell) to be moved        (see XGASCROL.ASM)      *
  494. ;* Flag   --->  CLD                             (see XGASCROL.ASM)      *
  495. ;*                                                                      *
  496. ;********************** END OF SPECIFICATIONS ***************************
  497. ATLAS3UpLeft proc
  498.             public  ATLAS3UpLeft
  499.             .if     < si ge 4 >  and    ; 
  500.             test    byte ptr ds:[si+3],dbcsA2 ; Source Head is DBCS 2nd ?
  501.             .if     nz                  ; 
  502.                 mov     byte ptr ds:[si], 20h ; Fill Blank to Second
  503.                 mov     byte ptr ds:[si-4], 20h ; Fill Blank to First
  504.                 and     byte ptr ds:[si+3], not (dbcsA1+dbcsA2) ;Clear J-KK1031
  505.                 and     byte ptr ds:[si-1], not (dbcsA1+dbcsA2) ;Clear J-KK1031
  506.             .endif                      ; 
  507.  
  508.             .if     < di ge 4 >  and    ; 
  509.             test    byte ptr es:[di+3],dbcsA2 ; Target Head is DBCS 2nd ?
  510.             .if     nz                  ; Overwrite DBCS 1st
  511.                 mov     byte ptr es:[di-4],20h ;set space
  512.                 and     byte ptr es:[di-1], not (dbcsA1+dbcsA2) ;Clear J-KK1031
  513.             .endif                      ; 
  514.  
  515.             rep     movsw               ; Move Cells
  516.  
  517. ;;                                      ; SI/DI-Pointed to Last+2 Cell
  518.             .if     < si lt [bp].Sub_Buffsize > and
  519.             test    byte ptr ds:[si+3],dbcsA2 ; Source Tail is DBCS 1st ?
  520.             .if     nz                  ; Overwrite DBCS 2nd
  521.                 mov     byte ptr ds:[si], 20h ; Fill Blank to Second
  522.                 mov     byte ptr ds:[si-4], 20h ; Fill Blank to First
  523.                 and     byte ptr ds:[si+3], not (dbcsA1+dbcsA2) ;Clear J-KK1031
  524.                 and     byte ptr ds:[si-1], not (dbcsA1+dbcsA2) ;Clear J-KK1031
  525.                 mov     byte ptr es:[di-4],20h ;Change Copied Byte to Space
  526.                 and     byte ptr es:[di-1], not (dbcsA1+dbcsA2) ;Clear J-KK1031
  527.             .endif
  528.  
  529.             .if     < di lt [bp].Sub_Buffsize > and
  530.             test    byte ptr es:[di+3],dbcsA2 ; Target Tail is DBCS 1st ?
  531.             .if     nz                  ; Overwrite DBCS 2nd
  532.                 mov     byte ptr es:[di],20h ;set space
  533.                 and     byte ptr es:[di+3], not (dbcsA1+dbcsA2) ;Clear J-KK1031
  534.             .endif                      ; 
  535.             ret
  536. ATLAS3UpLeft endp
  537.  
  538. ;********************** START OF SPECIFICATIONS *************************
  539. ;*                                                                      *
  540. ;* SUBROUTINE NAME:     ATLAS3DnRight                                   *
  541. ;*                                                                      *
  542. ;* DESCRIPTIVE NAME:    Video device handler Scroll Down/Right          *
  543. ;*                      Move a one line.                                *
  544. ;*                                                                      *
  545. ;* INPUT:                                                               *
  546. ;* SS:BP  --->  Stack frame                     (see VDHSTRUC.INC)      *
  547. ;* DS:SI  --->  Source Buffer Address           (see XGASCROL.ASM)      *
  548. ;* ES:DI  --->  LVB Address                     (see XGASCROL.ASM)      *
  549. ;* CX     --->  Words (Cell) to be moved        (see XGASCROL.ASM)      *
  550. ;* Flag   --->  STD                             (see XGASCROL.ASM)      *
  551. ;*                                                                      *
  552. ;********************** END OF SPECIFICATIONS ***************************
  553. ATLAS3DnRight proc
  554.             public  ATLAS3DnRight
  555.             push    ax
  556.  
  557.             mov     ax, [bp].Sub_Buffsize ; 
  558.             sub     ax, 4               ; 
  559.             push    ax                  ; Save Last Size
  560.             .if     < si lt ax > and    ; 
  561.             mov     al, ds:[si+1]       ; Source Head is DBCS 1st ?           ;j-ys911
  562.             and     al, dbcsA1+dbcsA2   ; 
  563.             .if     < al e dbcsA1 >     ; 
  564.                 mov     byte ptr ds:[si-2], 20h ; Fill Blank to First       ;j-ys911
  565.                 mov     byte ptr ds:[si+2], 20h ; Fill Blank to Second      ;j-ys911
  566.                 and     byte ptr ds:[si+1], not (dbcsA1+dbcsA2) ;Clear J-KK1031
  567.                 and     byte ptr ds:[si+5], not (dbcsA1+dbcsA2) ;Clear J-KK1031
  568.             .endif
  569.             pop     ax                  ; Restore Last Size
  570.  
  571.             .if     < di lt ax > and    ; 
  572.             mov     al, es:[di+1]       ; Target Head is DBCS 1st ?           ;j-ys911
  573.             and     al, dbcsA1+dbcsA2   ; 
  574.             .if     < al e dbcsA1 >     ; Overwrite DBCS 2nd
  575.                 mov     byte ptr es:[di+2],20h ;set space                   ;j-ys911
  576.                 and     byte ptr es:[di+5], not (dbcsA1+dbcsA2) ;Clear J-KK1031
  577.             .endif                      ; 
  578.  
  579.             rep     movsw               ; Move Cells
  580. ;;                                      ; SI/DI-Pointed to Last Cell-1
  581.             .if     < si ge 2 > and     ;                            ;j-ys911
  582.             mov     al, ds:[si+1]       ; Source Tail is DBCS 2nd ?        ;j-ys911
  583.             and     al, dbcsA1+dbcsA2   ; 
  584.             .if     < al e dbcsA1 >     ; 
  585.                 mov     byte ptr ds:[si-2], 20h ; Fill Blank to First       ;j-ys911
  586.                 mov     byte ptr ds:[si+2], 20h ; Fill Blank to Second      ;j-ys911
  587.                 and     byte ptr ds:[si+1], not (dbcsA1+dbcsA2) ;Clear J-KK1031
  588.                 and     byte ptr ds:[si+5], not (dbcsA1+dbcsA2) ;Clear J-KK1031
  589.                 mov     byte ptr es:[di+2],20h ; Change Copied byte to Space;j-ys911
  590.                 and     byte ptr es:[di+5], not (dbcsA1+dbcsA2) ;Clear J-KK1031
  591.             .endif
  592.  
  593.             .if     < di ge 0 > and     ; 
  594.             mov     al, es:[di+1]       ; Target Tail is DBCS 2nd ?           ;j-ys911
  595.             and     al, dbcsA1+dbcsA2   ; 
  596.             .if     < al e dbcsA1 >     ; Overwrite DBCS 1st
  597.                 mov     byte ptr es:[di-2],20h ;set space               ;j-ys911
  598.                 and     byte ptr es:[di+1], not (dbcsA1+dbcsA2) ;Clear J-KK1031
  599.             .endif                      ; 
  600.  
  601.             pop     ax
  602.  
  603.             ret
  604. ATLAS3DnRight endp
  605.  
  606. ;********************** START OF SPECIFICATIONS *************************
  607. ;*                                                                      *
  608. ;* SUBROUTINE NAME:     ATLAS3CFill                                     *
  609. ;*                                                                      *
  610. ;* DESCRIPTIVE NAME:    Video device handler Scroll Fill Cell           *
  611. ;*                      Fill one line with Cell into LVB.               *
  612. ;*                                                                      *
  613. ;* INPUT:                                                               *
  614. ;* SS:BP  --->  Stack frame                     (see VDHSTRUC.INC)      *
  615. ;* ES:DI  --->  Tartget LVB Address             (see XGASCROL.ASM)      *
  616. ;* CX     --->  Words (Cell) to be moved        (see XGASCROL.ASM)      *
  617. ;* Flag   --->  CLD                             (see XGASCROL.ASM)      *
  618. ;*                                                                      *
  619. ;********************** END OF SPECIFICATIONS ***************************
  620. ATLAS3CFill proc
  621.             public  ATLAS3CFill
  622.  
  623.             shr     cx,1                ;j-ys727
  624.  
  625.             .if     < di ge 4 > and     ; 
  626.             test    byte ptr es:[di+3],dbcsA2 ; Target Head is DBCS 2nd ?
  627.             .if     nz                  ; Overwrite DBCS 1st
  628.                 mov     byte ptr es:[di-4],20h ;set space
  629.                 and     byte ptr es:[di-1], not (dbcsA1+dbcsA2) ;Clear J-KK1031
  630.             .endif                      ; 
  631.  
  632.             push    dx                  ;                               ;j-ys718
  633.             mov     ax,[bp].FillCellLow
  634.             mov     dx,[bp].FillCellHigh ;                          ;j-ys718
  635.             and     dh, not (dbcsA1+dbcsA2) ; Clear DBCS bits       J-KK1101
  636.             .repeat                     ;                               ;j-ys718
  637.                 stosw                   ; Fill char and attr0
  638.                 xchg    ax,dx           ;                               ;j-ys718
  639.                 stosw                   ; Fill attr1 and attr2          ;j-ys718
  640.                 xchg    ax,dx           ;                               ;j-ys718
  641.             .loop                       ;                               ;j-ys718
  642.             pop     dx                  ;                               ;j-ys718
  643.  
  644.             .if     < di lt [bp].Sub_Buffsize > and ; 
  645.             test    byte ptr es:[di+3],dbcsA2 ; Target Tail is DBCS 1st ?
  646.             .if     nz                  ; Overwrite DBCS 2nd
  647.                 mov     byte ptr es:[di],20h ;set space
  648.                 and     byte ptr es:[di+3], not (dbcsA1+dbcsA2) ;Clear J-KK1031
  649.             .endif                      ; 
  650.  
  651.             ret
  652. ATLAS3CFill endp
  653.  
  654.         ENDIF
  655.  
  656. R2CSEG  ENDS
  657.         END
  658.