home *** CD-ROM | disk | FTP | other *** search
/ World of Shareware - Software Farm 2 / wosw_2.zip / wosw_2 / CPROG / CEXPRESS.ZIP / GRAPHIC.ASM / CHARBOXB.ASM < prev    next >
Assembly Source File  |  1989-05-03  |  1KB  |  55 lines

  1. ;void  char_box_b(ch,,col,row,width,depth,color);
  2. ;  unsigned char  ch,col,row,width,depth,color;
  3.  
  4.  
  5.     EXTRN  _memory_model:byte
  6.     EXTRN  _video_page:byte
  7.  
  8. _TEXT    SEGMENT  BYTE PUBLIC 'CODE'
  9.     ASSUME  CS:_TEXT
  10.     PUBLIC _char_box_b
  11. _char_box_b proc near
  12.     push bp            ;
  13.     mov  bp,sp        ;set stack frame
  14.     push di            ;
  15.     push si            ;
  16.     cmp  _memory_model,0    ;near or far?
  17.     jle  begin        ;jump if near
  18.     inc  bp            ;else add 2 to BP
  19.     inc  bp            ;
  20. begin:    mov  bh,_video_page    ;set the page number
  21.     mov  al,[bp+4]        ;character to AL
  22.     mov  ah,9        ;function to write char
  23.     mov  di,ax        ;copy in DI
  24.     mov  bl,[bp+14]        ;attribute in BL
  25.     mov  dl,[bp+6]        ;column in DL
  26.     dec  dl            ;count from 0
  27.     mov  dh,[bp+8]        ;row in DH
  28.     dec  dh            ;count from 0
  29.     sub  cx,cx        ;
  30.     mov  cl,[bp+12]        ;depth in si
  31.     mov  si,cx        ;
  32.     dec  si            ;dec for range test
  33.     inc  si            ;undo adjustment
  34.     sub  cx,cx        ;
  35.     mov  cl,[bp+10]        ;width in CX
  36.     dec  cx            ;dec for range test
  37.     inc  cx            ;undo adjustment
  38. L1:    mov  ah,2        ;function to set cursor
  39.     int  10h        ;set the cursor
  40.     mov  ax,di        ;function num and char
  41.     int  10h        ;write CX chars
  42.     inc  dh            ;forward row count
  43.     dec  si            ;dec row counter
  44.     jnz  L1            ;go write next row
  45. L2:    pop  si            ;
  46.     pop  di            ;
  47.     pop  bp            ;
  48.     cmp  _memory_model,0    ;quit
  49.     jle  quit        ;
  50.     db   0CBh        ;RET far
  51. quit:    ret            ;RET near
  52. _char_box_b endp
  53. _TEXT    ENDS
  54.     END
  55.