home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Interactive Guide / c-cplusplus-interactive-guide.iso / c_ref / csource4 / 255_01 / gpinitrd.asm < prev    next >
Encoding:
Assembly Source File  |  1988-03-30  |  2.1 KB  |  97 lines

  1.           page   80,132
  2.           page
  3. ;
  4. ;       EGA Graphic Primitive for Microsoft C 3.0, Version 01APR86.
  5. ;       (C) 1986 by Kent Cedola, 2015 Meadow Lake Ct., Norfolk, VA, 23518
  6. ;
  7.  
  8. stackval  struc
  9.           dw     ?
  10.           dw     ?
  11. x_coor    dw     ?
  12. y_coor    dw     ?
  13. x_len     dw     ?
  14. y_len     dw     ?
  15. page      dw     ?
  16. buffer    dw     ?
  17. dir       dw     ?
  18. stackval  ends
  19.  
  20. workarea  struc
  21. base      db     ?
  22. device    db     ?
  23. xorigin   dw     ?
  24. yorigin   dw     ?
  25. width     dw     ?
  26. height    dw     ?
  27. x         dw     ?
  28. y         dw     ?
  29. w         dw     ?
  30. h         dw     ?
  31. aspect1   dw     ?
  32. aspect2   dw     ?
  33. workarea  ends
  34.  
  35. dgroup    group  _data
  36.  
  37. _data     segment word public 'data'
  38.           assume ds:dgroup
  39.           extrn  _GDGSEG:word,_GDMERGE:byte
  40.           extrn  _xdreadbp:word
  41.           extrn  _xdreadw1:word,_xdreadw2:word,_xdreadw3:word
  42.           extrn  _xdreadb1:byte
  43. _data     ends
  44.  
  45. _text     segment byte public 'code'
  46.  
  47.           assume cs:_text,ds:dgroup
  48.           public _gpinitrd
  49.  
  50. _gpinitrd proc   near
  51.  
  52.           push   bp
  53.           mov    bp,sp
  54.  
  55.           mov    ax,[bp].buffer
  56.           mov    _xdreadbp,ax
  57.           cmp    [bp].dir,0
  58.           jnz    bottotop
  59. toptobot:
  60.           mov    ax,5
  61.           mov    _xdreadw2,ax
  62.           mov    ax,[bp].y_coor
  63.           jmp    short cont
  64. bottotop:
  65.           mov    ax,-5
  66.           mov    _xdreadw2,ax
  67.           mov    ax,[bp].y_coor
  68.           add    ax,[bp].y_len
  69.           dec    ax
  70. cont:
  71.           mov    cx,ax
  72.           shl    ax,1
  73.           shl    ax,1
  74.           add    ax,cx
  75.           add    ax,_gdgseg
  76.           mov    dx,[bp].x_coor
  77.           mov    cx,dx
  78.           shr    dx,1                  ;   X / 8;
  79.           shr    dx,1                  ;   ...
  80.           shr    dx,1                  ;   ...
  81.           add    ax,dx
  82.           mov    _xdreadw1,ax
  83.  
  84.           and    cl,7
  85.           mov    _xdreadb1,cl
  86.  
  87.           mov    ax,[bp].x_len
  88.           mov    _xdreadw3,ax
  89.  
  90.           pop    bp
  91.           ret
  92.  
  93. _gpinitrd endp
  94.  
  95. _text     ends
  96.           end
  97.