home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / ddkx86v2.zip / DDKX86 / DBCSDD / SRC_DBCS / VDHV / ATLS_LVB.ASM next >
Assembly Source File  |  1995-04-14  |  29KB  |  600 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   ATLS_LVB.ASM -- Buffer Write Routines for ATLAS U.S. Format
  14.  
  15. ;/*****************************************************************************
  16. ;*
  17. ;* SOURCE FILE NAME = ATLS_LVB.ASM
  18. ;*
  19. ;* DESCRIPTIVE NAME = BUFFERUPDATE write routines
  20. ;*
  21. ;*
  22. ;* VERSION      V2.0
  23. ;*
  24. ;* DATE
  25. ;*
  26. ;* DESCRIPTION
  27. ;*
  28. ;* FUNCTIONS    WriteCellStrB, WriteCharStrB, WriteCharStrAttrB,
  29. ;*              WriteNCharB, WriteNAttrB, WriteNCellB
  30. ;*
  31. ;* NOTES        NONE
  32. ;*
  33. ;* STRUCTURES   NONE
  34. ;*
  35. ;* EXTERNAL REFERENCES  UpdateRegenB    (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. ;*   10/24/89  j-ys1024           for MS-Xvio support.
  47. ;*   11/29/89  J-KK1129           KKJ, Limit Check for NCELL and NCHAR with DBCS.
  48. ;*   11/30/89  J-KK1130           KKJ, CLD is assumed in CFill.
  49. ;*   06/16/93  J-TS0616           TSO, DBCS Exception handling of VioWrtNAttr
  50. ;*   07/07/93  J-TS0707           TSO, DBCS J-TS0616 doesn't take care of buffer end
  51. ;****************************************************************************/
  52.  
  53.         .286c                           ; 286 protect mode instructions
  54.  
  55.         .xlist
  56.         INCLUDE struc.inc               ; Structure macro
  57.         INCLUDE vdhequ.inc              ; Buffer update equates
  58.         INCLUDE vdhstruc.inc            ; Buffer update data structures
  59.         .list
  60.  
  61.         EXTRN   CheckDBCS:NEAR
  62.         EXTRN   UpdateRegenB:NEAR
  63.         EXTRN   UpdateAttrB:NEAR
  64.  
  65.         EXTRN   UpdateCARegenB:NEAR     ; For MS-XVIO                   j-ys1106
  66.         EXTRN   UpdateCAAttrB:NEAR      ;                               j-ys1106
  67.  
  68. R2CSEG  SEGMENT WORD    PUBLIC 'CODE'
  69.         ASSUME  CS:R2CSEG,DS:NOTHING,ES:NOTHING
  70.  
  71.  
  72. ;********************** START OF SPECIFICATIONS *************************
  73. ;*                                                                      *
  74. ;* SUBROUTINE NAME:     WriteCStrB                                      *
  75. ;*                                                                      *
  76. ;* DESCRIPTIVE NAME:    Video device handler write cells/chars/charsA   *
  77. ;*                                                                      *
  78. ;* INPUT:                                                               *
  79. ;* SS:BP  --->  Stack frame                     (see VDHSTRUC.INC)      *
  80. ;* DS:SI  --->  Source Buffer Address           (see XGAWRITE.ASM)      *
  81. ;* ES:DI  --->  LVB Address                     (see XGAWRITE.ASM)      *
  82. ;*                                                                      *
  83. ;********************** END OF SPECIFICATIONS ***************************
  84. WriteCStrB proc
  85.         public  WriteCStrB
  86.  
  87.         mov     bx, [bp].Sub_index      ; Get Function Index
  88. ;;*** Update LVB
  89.         Call    HeadBoundB              ; 
  90.         xor     dx,dx                   ;clear the char counter
  91.         .while  ncxz  near              ; 
  92.             xor     ax,ax
  93.             .if     < bx e WCELL >      ;Cell ?
  94.                 lodsw                   ;get a next cell
  95.             .elseif < bx e WCHAR >      ;Char ?
  96.                 lodsb                   ;get a next char
  97.             .else                       ;CharAttribute
  98.                 lodsb                   ;get a next char
  99.                 mov     ah,byte ptr [bp].Sub_attribute ;get attribute
  100.             .endif                      ; 
  101.             dec     cx                  ;adjust the loop counter (CX)
  102.             inc     dx                  ;increment the char counter (DX)
  103.  
  104.             call    CheckDBCS           ; 
  105.             .if     c                   ;if char have DBCS lead byte
  106.                 .if     < dx gt 1 >     ; Hankaku Char Counter must be GT 1.
  107.                     push    ax          ; save ax
  108.                     dec     dx          ; Adjust
  109.                     push    si          ; 
  110.                     dec     si          ; Adjust
  111.                     cmp     bx,WCELL    ; 
  112.                     .if     e           ; 
  113.                         dec     si      ; adjust si for attr
  114.                     .endif              ; 
  115.                     call    WriteB      ; Write the leading Hankaku String
  116.                     pop     si          ; 
  117.                     pop     ax          ; 
  118.                 .endif
  119.  
  120.                 xor     dx,dx           ;clear the char counter (DX)
  121.                 .if     ncxz            ;   & cx > 0
  122.                     mov     ah,al       ;ah is DBCS lead
  123.                     lodsb
  124.                     cmp     bx,WCELL
  125.                     .if     e           ; 
  126.                         inc     si      ;adust si for attr
  127.                     .endif              ; 
  128.                     dec     cx          ;adjust the loop counter (CX)
  129.  
  130.                     xchg    al,ah       ; 
  131.                     call    PutDBCSB    ;write dbcs into LVB
  132.                 .else                   ; Terminate with DBCS leading byte
  133.                                         ; Ignored the last byte
  134.                     dec     [bp].Sub_length
  135.                 .endif                  ; 
  136.             .endif                      ; End of DBCS Case
  137.         .endwhile                       ; 
  138.  
  139.         call    WriteB                  ;Write Hankaku Char to LVB
  140.         call    TailBoundB
  141.  
  142. ;;*** Update PVB
  143.         .if     < bit [bp].Sub_Option nand CA_Request > ;              ;j-ys111
  144.             call    UpdateRegenB        ; 
  145.         .else                           ;                              ;j-ys1024
  146.             call    UpdateCARegenB      ;                              ;j-ys111
  147.         .endif                          ;                              ;j-ys111
  148.  
  149.         ret
  150. WriteCStrB endp
  151.  
  152. ;********************** START OF SPECIFICATIONS *************************
  153. ;*                                                                      *
  154. ;* SUBROUTINE NAME:     WriteNCharB                                     *
  155. ;*                                                                      *
  156. ;* DESCRIPTIVE NAME:    Video device handler write N chars              *
  157. ;*                                                                      *
  158. ;* INPUT:                                                               *
  159. ;* SS:BP  --->  Stack frame                     (see VDHSTRUC.INC)      *
  160. ;* DS:SI  --->  Source Buffer Address           (see XGAWRITE.ASM)      *
  161. ;* ES:DI  --->  LVB Address                     (see XGAWRITE.ASM)      *
  162. ;*                                                                      *
  163. ;********************** END OF SPECIFICATIONS ***************************
  164. WriteNCharB proc
  165.         public  WriteNCharB
  166.  
  167. ;;*** Update LVB
  168.         pushf
  169.         Call    HeadBoundB              ; 
  170.         popf
  171.         .if     c                       ;*** DBCS handling
  172.             mov     ah,ds:[si]          ; Get 2nd Character
  173.             .repeat                     ; 
  174.                 stosb                   ;Set the lead byte
  175.                 mov     word ptr es:[di+TOEXT-1], EXTRA_ATTR1 ; DBCS 1st Attr
  176.                 inc     di              ; 
  177.                 mov     byte ptr es:[di],ah ;Store the second byte
  178.                 inc     di              ; 
  179.                 mov     word ptr es:[di+TOEXT-1], EXTRA_ATTR2 ; DBCS 2nd Attr
  180.                 inc     di              ; 
  181.             .loop
  182.         .else                           ;*** SBCS handling
  183.             .repeat                     ; 
  184.                 stosb                   ;Store character
  185.                 mov     word ptr es:[di+TOEXT-1], EXTRA_ATTR ; Clear DBCS Attr
  186.                 inc     di              ;Skip attribute
  187.             .loop                       ; 
  188.         .endif                          ; 
  189.         call    TailBoundB
  190.  
  191. ;;*** Update PVB
  192.         .if     < bit [bp].Sub_Option nand CA_Request > ;              ;j-ys111
  193.             call    UpdateRegenB        ; 
  194.         .else                           ;                              ;j-ys1024
  195.             call    UpdateCARegenB      ;                              ;j-ys111
  196.         .endif                          ;                              ;j-ys111
  197.  
  198.         ret
  199. WriteNCharB endp
  200.  
  201. ;********************** START OF SPECIFICATIONS *************************
  202. ;*                                                                      *
  203. ;* SUBROUTINE NAME:     WriteNAttrB                                     *
  204. ;*                                                                      *
  205. ;* DESCRIPTIVE NAME:    Video device handler write N attribute          *
  206. ;*                                                                      *
  207. ;* INPUT:                                                               *
  208. ;* SS:BP  --->  Stack frame                     (see VDHSTRUC.INC)      *
  209. ;* DS:SI  --->  Source Buffer Address           (see XGAWRITE.ASM)      *
  210. ;* ES:DI  --->  LVB Address                     (see XGAWRITE.ASM)      *
  211. ;* AL     --->  Attribute Byte                  (see XGAWRITE.ASM)      *
  212. ;*                                                                      *
  213. ;********************** END OF SPECIFICATIONS ***************************
  214. WriteNAttrB proc
  215.         public  WriteNAttrB
  216.  
  217.         mov     ah, es:[di+TOEXT+1]     ; First char is DBCS 2nd ?      ;J-TS0616
  218.         and     ah, dbcsA1+dbcsA2                                       ;J-TS0616
  219.         .if     <ah eq dbcsA1+dbcsA2>                                   ;J-TS0616
  220.             inc     [bp].Sub_length                                     ;J-TS0616
  221.             sub     [bp].Sub_offset, 2                                  ;J-TS0616
  222.             sub     [bp].PVBOff, 2                                      ;J-TS0616
  223.         .endif                                                          ;J-TS0616
  224.  
  225. ;;*** Update LVB
  226.         .repeat
  227.             inc     di                  ;Skip char byte
  228.             stosb                       ;set attribute
  229.         .loop
  230.  
  231.         mov     ah, es:[di+TOEXT-1]     ; Last char is DBCS 1st ?       ;J-TS0707
  232.         and     ah, dbcsA1+dbcsA2                                       ;J-TS0616
  233.         .if     <ah eq dbcsA1>                                          ;J-TS0707
  234.             inc     [bp].Sub_length                                     ;J-TS0616
  235.         .endif                                                          ;J-TS0616
  236.  
  237. ;;*** Update PVB
  238.         .if     < bit [bp].Sub_Option nand CA_Request > ;              ;j-ys111
  239.             call    UpdateAttrB         ; 
  240.         .else                           ;                              ;j-ys1024
  241.             call    UpdateCAAttrB       ;                              ;j-ys111
  242.         .endif                          ;                              ;j-ys111
  243.  
  244.         ret
  245. WriteNAttrB endp
  246.  
  247. ;********************** START OF SPECIFICATIONS *************************
  248. ;*                                                                      *
  249. ;* SUBROUTINE NAME:     WriteNCellB                                     *
  250. ;*                                                                      *
  251. ;* DESCRIPTIVE NAME:    Video device handler write N cells              *
  252. ;*                                                                      *
  253. ;* INPUT:                                                               *
  254. ;* SS:BP  --->  Stack frame                     (see VDHSTRUC.INC)      *
  255. ;* DS:SI  --->  Source Buffer Address           (see XGAWRITE.ASM)      *
  256. ;* ES:DI  --->  LVB Address                     (see XGAWRITE.ASM)      *
  257. ;*                                                                      *
  258. ;********************** END OF SPECIFICATIONS ***************************
  259. WriteNCellB proc
  260.         public  WriteNCellB
  261.  
  262. ;;*** Update LVB
  263.         pushf                           ; 
  264.         Call    HeadBoundB              ; 
  265.         popf                            ; 
  266.         .if     c                       ;*** DBCS Cell
  267.             mov     dx,ds:[si]          ;Get 2nd Cell
  268.             .repeat                     ; 
  269.                 stosw                   ;Store 1st Cell
  270.                 mov     word ptr es:[di+TOEXT-2], EXTRA_ATTR1 ; Set DBCS 1st
  271.                 xchg    ax,dx           ; 
  272.                 stosw                   ;Store 2nd Cell
  273.                 mov     word ptr es:[di+TOEXT-2], EXTRA_ATTR2 ; Set DBCS 2nd
  274.                 xchg    ax,dx           ; 
  275.             .loop                       ; 
  276.         .else                           ;*** SBCS Cell
  277.             .repeat                     ; 
  278.                 stosw                   ;Fill buffer with Cells
  279.                 mov     word ptr es:[di+TOEXT-2], EXTRA_ATTR ; Clear DBCS Attr
  280.             .loop                       ; 
  281.         .endif                          ; 
  282.         call    TailBoundB              ; 
  283.  
  284. ;;*** Update PVB
  285.         .if     < bit [bp].Sub_Option nand CA_Request > ;              ;j-ys111
  286.             call    UpdateRegenB        ; 
  287.         .else                           ;                              ;j-ys1024
  288.             call    UpdateCARegenB      ;                              ;j-ys111
  289.         .endif                          ;                              ;j-ys111
  290.  
  291.         ret
  292. WriteNCellB endp
  293.  
  294. ;********************** START OF SPECIFICATIONS *************************
  295. ;*                                                                      *
  296. ;* SUBROUTINE NAME: XXXXX                                               *
  297. ;*                                                                      *
  298. ;* DESCRIPTIVE NAME:    DBCS Exeption Handling Routine                  *
  299. ;*                                                                      *
  300. ;* INPUT:                                                               *
  301. ;* SS:BP  --->  Stack frame                     (see VDHSTRUC.INC)      *
  302. ;* ES:DI  --->  LVB Address                     (see XGAWRITE.ASM)      *
  303. ;*                                                                      *
  304. ;********************** END OF SPECIFICATIONS ***************************
  305. ;; OverWriting Handling
  306. ;; DS:SI - User Buffer
  307. ;; ES:DI - LVB
  308. HeadBoundB PROC NEAR                    ;OverWriting of Head DBCS Widow
  309.         cmp     di,2                    ;check start of screen or not ?
  310.         .if     ge
  311.             test    byte ptr es:[di+TOEXT+1],dbcsA2 ;DBCS 2nd ?
  312.             .if     nz                  ; 
  313.                 mov     byte ptr es:[di-2],20h ;set space
  314.                 mov     word ptr es:[di+TOEXT-2], EXTRA_ATTR ;reset flag
  315.                 inc     [bp].Sub_length ;adjust repeat count
  316.                 sub     [bp].Sub_offset,2 ;adjust offset
  317.                 sub     [bp].PVBOFF,2   ;adjust offset     ;j-ys1024
  318.             .endif                      ; 
  319.         .endif
  320.         ret                             ; 
  321. HeadBoundB ENDP                         ; 
  322.  
  323. TailBoundB PROC NEAR                    ;Overwriting of Tail DBCS Widow
  324.         cmp     di, [bp].Sub_Buffsize   ;check end of screen or not ?
  325.         .if     b
  326.             test    byte ptr ES:[DI+TOEXT+1],dbcsA2 ; Target Tail+1 is DBCS 2nd ?
  327.             .if     nz                  ; 
  328.                 mov     byte ptr es:[di],20h ;set space
  329.                 inc     di              ; 
  330.                 mov     word ptr es:[di+TOEXT-1], EXTRA_ATTR ;reset attr
  331.                 inc     di              ; 
  332.                 inc     [bp].Sub_length ;adjust repeat count
  333.             .endif                      ; 
  334.         .endif
  335.         ret                             ; 
  336. TailBoundB ENDP                         ; 
  337.  
  338. PutDBCSB PROC
  339. ;  al:lead   dbcs
  340. ;  ah:second dbcs
  341.         cmp     bx,WCELL                ; 
  342.         .if     e                       ;Cell ?
  343.             stosb                       ;store dbcs lead byte
  344.             mov     al,ds:[si-3]        ;get 1st cell attribute
  345.             stosb                       ;store dbcs lead byte attribute
  346.             mov     word ptr es:[di+TOEXT-2], EXTRA_ATTR1 ; set dbcs 1st flag
  347.             xchg    al,ah               ; 
  348.             stosb                       ;store dbcs second byte
  349.             mov     al,ds:[si-1]        ; 
  350.             stosb                       ;store dbcs second byte attribute
  351.             mov     word ptr es:[di+TOEXT-2], EXTRA_ATTR2 ; set dbcs 2nd flag
  352.         .elseif < bx e WCHAR >          ;Char ?
  353.             stosb                       ;store dbcs lead byte
  354.             mov     word ptr es:[di+TOEXT-1], EXTRA_ATTR1 ; set dbcs 1st flag
  355.             inc     di
  356.             xchg    al,ah
  357.             stosb                       ;store dbcs second byte
  358.             mov     word ptr es:[di+TOEXT-1], EXTRA_ATTR2 ; set dbcs 2nd flag
  359.             inc     di
  360.         .else                           ;Char Attribute
  361.             push    ax                  ;store dbcs first byte
  362.             mov     ah,byte ptr [bp].Sub_attribute
  363.             mov     word ptr es:[di+TOEXT], EXTRA_ATTR1 ; set dbcs 1st flag
  364.             stosw
  365.             pop     ax
  366.  
  367.             xchg    al,ah               ;store dbcs second byte
  368.             mov     ah,byte ptr [bp].Sub_attribute
  369.             mov     word ptr es:[di+TOEXT], EXTRA_ATTR2 ; set dbcs 2nd flag
  370.             stosw
  371.         .endif
  372.         ret
  373. PutDBCSB ENDP
  374.  
  375. WriteB  PROC                            ;Hankaku write routine
  376.         Public  WriteB
  377.         push    cx
  378.         sub     si,dx                   ;adjust si
  379.         mov     cx,dx
  380.         .if     ncxz
  381.             .if     < bx e WCELL >      ;Cell ?
  382.                 sub     si,dx           ;adjust si more!
  383.                 .repeat
  384.                     mov     word ptr es:[di+TOEXT], EXTRA_ATTR ; clear dbcs flag
  385.                     movsw
  386.                 .loop
  387.             .elseif < bx e WCHAR >      ;Char ?
  388.                 .repeat
  389.                     mov     word ptr es:[di+TOEXT], EXTRA_ATTR ; clear dbcs flag
  390.                     movsb
  391.                     inc     di          ;Skip Attr
  392.                 .loop
  393.             .else                       ;CharAttribute
  394.                 mov     al,byte ptr [bp].Sub_attribute
  395.                 .repeat
  396.                     mov     word ptr es:[di+TOEXT], EXTRA_ATTR ; clear dbcs flag
  397.                     movsb
  398.                     stosb
  399.                 .loop
  400.             .endif
  401.         .endif
  402.         pop     cx
  403.         ret
  404. WriteB  ENDP
  405.  
  406. ;********************** START OF SPECIFICATIONS *************************
  407. ;*                                                                      *
  408. ;* SUBROUTINE NAME:     ATLAS_UpLeft                                    *
  409. ;*                                                                      *
  410. ;* DESCRIPTIVE NAME:    Video device handler Scroll Up/Left             *
  411. ;*                      Move a one line.                                *
  412. ;*                                                                      *
  413. ;* INPUT:                                                               *
  414. ;* SS:BP  --->  Stack frame                     (see VDHSTRUC.INC)      *
  415. ;* DS:SI  --->  Source Buffer Address           (see XGASCROL.ASM)      *
  416. ;* ES:DI  --->  LVB Address                     (see XGASCROL.ASM)      *
  417. ;* CX     --->  Words (Cell) to be moved        (see XGASCROL.ASM)      *
  418. ;* Flag   --->  CLD                             (see XGASCROL.ASM)      *
  419. ;*                                                                      *
  420. ;********************** END OF SPECIFICATIONS ***************************
  421. ATLAS_UpLeft proc
  422.         public  ATLAS_UpLeft
  423.  
  424.         .if     < si ge 2 >  and        ; 
  425.         test    byte ptr ds:[si+TOEXT+1],dbcsA2 ; Source Head is DBCS 2nd ?
  426.         .if     nz                      ; 
  427.             mov     byte ptr ds:[si], 20h ; Fill Blank to Second
  428.             mov     byte ptr ds:[si-2], 20h ; Fill Blank to First
  429.             mov     word ptr ds:[si+TOEXT], EXTRA_ATTR ;reset flag
  430.             mov     word ptr ds:[si+TOEXT-2], EXTRA_ATTR ;reset flag
  431.         .endif                          ; 
  432.  
  433.         .if     < di ge 2 >  and        ; 
  434.         test    byte ptr es:[di+TOEXT+1],dbcsA2 ; Target Head is DBCS 2nd ?
  435.         .if     nz                      ; Overwrite DBCS 1st
  436.             mov     byte ptr es:[di-2],20h ;set space
  437.             mov     word ptr es:[di+TOEXT-2], EXTRA_ATTR ;reset flag
  438.         .endif                          ; 
  439.  
  440.         push    si
  441.         push    di
  442.         push    cx
  443.         rep     movsw                   ; Move Cells
  444.         pop     cx
  445.         pop     di
  446.         pop     si
  447.         add     si, TOEXT
  448.         add     di, TOEXT
  449.         rep     movsw                   ; Move Extra Attr1/2
  450.         sub     si, TOEXT
  451.         sub     di, TOEXT
  452.  
  453. ;;                                      ; SI/DI-Pointed to Last+2 Cell
  454.         .if     < si lt [bp].Sub_Buffsize > and
  455.         test    byte ptr ds:[si+TOEXT+1],dbcsA2 ; Source Tail is DBCS 1st ?
  456.         .if     nz                      ; Overwrite DBCS 2nd
  457.             mov     byte ptr ds:[si], 20h ; Fill Blank to Second
  458.             mov     byte ptr ds:[si-2], 20h ; Fill Blank to First
  459.             mov     word ptr ds:[si+TOEXT], EXTRA_ATTR ;reset flag
  460.             mov     word ptr ds:[si+TOEXT-2], EXTRA_ATTR ;reset flag
  461.             mov     byte ptr es:[di-2],20h ;Change Copied Byte to Space
  462.             mov     word ptr es:[di+TOEXT-2], EXTRA_ATTR ;reset flag
  463.         .endif
  464.  
  465.         .if     < di lt [bp].Sub_Buffsize > and
  466.         test    byte ptr es:[di+TOEXT+1],dbcsA2 ; Target Tail is DBCS 1st ?
  467.         .if     nz                      ; Overwrite DBCS 2nd
  468.             mov     byte ptr es:[di],20h ;set space
  469.             mov     word ptr es:[di+TOEXT], EXTRA_ATTR ;reset flag
  470.         .endif                          ; 
  471.  
  472.         ret
  473. ATLAS_UpLeft endp
  474.  
  475. ;********************** START OF SPECIFICATIONS *************************
  476. ;*                                                                      *
  477. ;* SUBROUTINE NAME:     ATLAS_DnRight                                   *
  478. ;*                                                                      *
  479. ;* DESCRIPTIVE NAME:    Video device handler Scroll Down/Right          *
  480. ;*                      Move a one line.                                *
  481. ;*                                                                      *
  482. ;* INPUT:                                                               *
  483. ;* SS:BP  --->  Stack frame                     (see VDHSTRUC.INC)      *
  484. ;* DS:SI  --->  Source Buffer Address           (see XGASCROL.ASM)      *
  485. ;* ES:DI  --->  LVB Address                     (see XGASCROL.ASM)      *
  486. ;* CX     --->  Words (Cell) to be moved        (see XGASCROL.ASM)      *
  487. ;* Flag   --->  STD                             (see XGASCROL.ASM)      *
  488. ;*                                                                      *
  489. ;********************** END OF SPECIFICATIONS ***************************
  490. ATLAS_DnRight proc
  491.         public  ATLAS_DnRight
  492.         push    ax
  493.  
  494.         mov     ax, [bp].Sub_Buffsize   ; 
  495.         sub     ax, 2                   ; 
  496.         push    ax                      ; Save Last Size
  497.         .if     < si lt ax > and        ; 
  498.         mov     al, ds:[si+TOEXT+1]     ; Source Head is DBCS 1st ?
  499.         and     al, dbcsA1+dbcsA2       ; 
  500.         .if     < al e dbcsA1 >         ; 
  501.             mov     byte ptr ds:[si], 20h ; Fill Blank to First
  502.             mov     byte ptr ds:[si+2], 20h ; Fill Blank to Second
  503.             mov     word ptr ds:[si+TOEXT], EXTRA_ATTR ;reset flag
  504.             mov     word ptr ds:[si+TOEXT+2], EXTRA_ATTR ;reset flag
  505.         .endif
  506.         pop     ax                      ; Restore Last Size
  507.  
  508.         .if     < di lt ax > and        ; 
  509.         mov     al, es:[di+TOEXT+1]     ; Target Head is DBCS 1st ?
  510.         and     al, dbcsA1+dbcsA2       ; 
  511.         .if     < al e dbcsA1 >         ; Overwrite DBCS 2nd
  512.             mov     byte ptr es:[di+2],20h ;set space
  513.             mov     word ptr es:[di+TOEXT+2], EXTRA_ATTR ;reset flag
  514.         .endif                          ; 
  515.  
  516.         push    si
  517.         push    di
  518.         push    cx
  519.         rep     movsw                   ; Move Cells
  520.         pop     cx
  521.         pop     di
  522.         pop     si
  523.         add     si, TOEXT
  524.         add     di, TOEXT
  525.         rep     movsw                   ; Move Extra Attr1/2
  526.         sub     si, TOEXT
  527.         sub     di, TOEXT
  528. ;;                                      ; SI/DI-Pointed to Last Cell-1
  529.         .if     < si ge 0 > and         ; 
  530.         mov     al, ds:[si+TOEXT+1]     ; Source Tail is DBCS 2nd ?
  531.         and     al, dbcsA1+dbcsA2       ; 
  532.         .if     < al e dbcsA1 >         ; 
  533.             mov     byte ptr ds:[si], 20h ; Fill Blank to First
  534.             mov     byte ptr ds:[si+2], 20h ; Fill Blank to Second
  535.             mov     word ptr ds:[si+TOEXT], EXTRA_ATTR ;reset flag
  536.             mov     word ptr ds:[si+TOEXT+2], EXTRA_ATTR ;reset flag
  537.             mov     byte ptr es:[di+2],20h ; Change Copied byte to Space
  538.             mov     word ptr es:[di+TOEXT+2], EXTRA_ATTR ;reset flag
  539.         .endif
  540.  
  541.         .if     < di ge 0 > and         ; 
  542.         mov     al, es:[di+TOEXT+1]     ; Target Tail is DBCS 2nd ?
  543.         and     al, dbcsA1+dbcsA2       ; 
  544.         .if     < al e dbcsA1 >         ; Overwrite DBCS 1st
  545.             mov     byte ptr es:[di],20h ;set space
  546.             mov     word ptr es:[di+TOEXT], EXTRA_ATTR ;reset flag
  547.         .endif                          ; 
  548.  
  549.         pop     ax
  550.         ret
  551. ATLAS_DnRight endp
  552.  
  553. ;********************** START OF SPECIFICATIONS *************************
  554. ;*                                                                      *
  555. ;* SUBROUTINE NAME:     ATLAS_CFill                                     *
  556. ;*                                                                      *
  557. ;* DESCRIPTIVE NAME:    Video device handler Scroll Fill Cell           *
  558. ;*                      Fill one line with Cell into LVB.               *
  559. ;*                                                                      *
  560. ;* INPUT:                                                               *
  561. ;* SS:BP  --->  Stack frame                     (see VDHSTRUC.INC)      *
  562. ;* ES:DI  --->  Tartget LVB Address             (see XGASCROL.ASM)      *
  563. ;* CX     --->  Words (Cell) to be moved        (see XGASCROL.ASM)      *
  564. ;* Flag   --->  CLD                             (see XGASCROL.ASM)      *
  565. ;*                                                                      *
  566. ;********************** END OF SPECIFICATIONS ***************************
  567. ATLAS_CFill proc
  568.         public  ATLAS_CFill
  569.  
  570.         .if     < di ge 2 > and         ; 
  571.         test    byte ptr es:[di+TOEXT+1],dbcsA2 ; Target Head is DBCS 2nd ?
  572.         .if     nz                      ; Overwrite DBCS 1st
  573.             mov     byte ptr es:[di-2],20h ;set space
  574.             mov     word ptr es:[di+TOEXT-2], EXTRA_ATTR ;reset flag
  575.         .endif                          ; 
  576.  
  577.         mov     ax,[bp].FillCellLow
  578.         push    di
  579.         push    cx
  580.         rep     stosw                   ; Fill line with cell
  581.         pop     cx
  582.         pop     di
  583.         add     di, TOEXT
  584.         mov     ax, EXTRA_ATTR
  585.         rep     stosw                   ; Fill Extra Attr1/2
  586.         sub     di, TOEXT
  587.  
  588.         .if     < di lt [bp].Sub_Buffsize > and ; 
  589.         test    byte ptr es:[di+TOEXT+1],dbcsA2 ; Target Tail is DBCS 1st ?
  590.         .if     nz                      ; Overwrite DBCS 2nd
  591.             mov     byte ptr es:[di],20h ;set space
  592.             mov     word ptr es:[di+TOEXT], EXTRA_ATTR ;reset flag
  593.         .endif                          ; 
  594.  
  595.         ret
  596. ATLAS_CFill endp
  597.  
  598. R2CSEG  ENDS
  599.         END
  600.