home *** CD-ROM | disk | FTP | other *** search
/ Compendium Deluxe 1 / LSD Compendium Deluxe 1.iso / a / programming / assembly / talinasm.lha / expandibox.asm next >
Encoding:
Assembly Source File  |  1992-03-19  |  993 b   |  36 lines

  1. * ============================================================================ *
  2. *    ExpandIBox.asm: expands or contracts an IBox on all sides
  3. *
  4. *        struct IBox *ExpandIBox(struct IBox *b, int dx, int dy)
  5. *                                 a1              d0      d1
  6. *
  7. *    This function moves the left and right edges of an IBox outward by the
  8. *    amount specified in dx, and the top and bottom edges by dy.
  9. * ============================================================================ *
  10.  
  11.             include        "exec/types.i"
  12.             include        "intuition/intuition.i"
  13.             include        "macros.i"
  14.  
  15.             SECTION        expandibox.asm,CODE
  16.  
  17.             xdef        _ExpandIBox,ExpandIBox
  18.  
  19. _ExpandIBox:
  20. ; changed to use register calling parameters
  21. ;            move.l        4(sp),a1                ; IBox
  22. ;            move.l        8(sp),d0                ; dx
  23. ;            move.l        12(sp),d1                ; dy
  24. ExpandIBox:
  25.             sub.w        d0,ibox_Left(a1)
  26.             add.w        d0,ibox_Width(a1)
  27.             add.w        d0,ibox_Width(a1)
  28.             sub.w        d1,ibox_Top(a1)
  29.             add.w        d1,ibox_Height(a1)
  30.             add.w        d1,ibox_Height(a1)
  31.             move.l        a1,d0                    ; return address of box
  32.             rts
  33.  
  34.             end
  35.  
  36.