home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / sys / amiga / programm / 13095 next >
Encoding:
Internet Message Format  |  1992-09-07  |  2.3 KB

  1. Path: sparky!uunet!destroyer!gatech!rutgers!cbmvax!mks
  2. From: mks@cbmvax.commodore.com (Michael Sinz)
  3. Newsgroups: comp.sys.amiga.programmer
  4. Subject: Re: Assembly questions.
  5. Message-ID: <34906@cbmvax.commodore.com>
  6. Date: 4 Sep 92 21:06:29 GMT
  7. References: <1802@grivel.une.edu.au>
  8. Reply-To: mks@cbmvax.commodore.com (Michael Sinz)
  9. Organization: Commodore, West Chester, PA
  10. Lines: 58
  11.  
  12. cfiddyme@neumann.une.edu.au (Chris Fiddyment) writes:
  13. >
  14. >  Hi,
  15. >  I have a few (hopefully simple) questions to ask. I am new to assembler and
  16. >  can't afford a book yet (besides a borrowed copy of the RKM's).
  17. >
  18. >  First I am using the commands
  19. >
  20. >      move.l  #186,d0
  21. >      divu    #10,d0
  22. >      moveq.l #0,d1
  23. >      move.b  d0,d1
  24.  
  25.     You really should do a move.w d0,d1 here...
  26.  
  27. >
  28. >  to get d1 = 18. How canI get the remainder of the division (the upper part
  29. >  of d0) into register d2. Is there some way to shift the register?
  30.  
  31. Simple:
  32.  
  33.     moveq.l    #0,d2
  34.     swap    d0
  35.     move.w    d0,d2
  36.  
  37. >  Another question. I have written a program that opens a screen and moves a
  38. >  sprite around. How do I print images to the screen. I tried the following :
  39. >
  40. >      move.l  intbase,a6
  41. >      move.l  rastport,a1        ; these could be back to front.
  42. >      lea     blockimage,a0
  43. >      move.l  #10,d0
  44. >      move.l  #10,d1
  45. >      jsr    -114(a6)     ;DrawImage()
  46. >
  47. >with the following variables:
  48. >
  49. >   blockimage
  50. >      dc.w 0,0,15,10,2       ; Is this the correct format. It seems right from
  51. >      dc.l myimage           ; looking in the RKM's
  52. >      dc.b 0,0
  53. >      dc.l 0
  54. >
  55. >   myimage
  56. >     dc.w  %0000000000000000,%0000000000000000
  57. >     ;10 lines of image data
  58. >     dc.w  %0000000000000000,%0000000000000000
  59.  
  60. myimage must be loaded into CHIP ram...  This can be done in a number of ways
  61. including by putting it into its own section and defining it as CHIP.
  62.  
  63. /----------------------------------------------------------------------\
  64. |      /// Michael Sinz  -  Senior Amiga Systems Engineer              |
  65. |     ///                   Operating System Development Group         |
  66. |    ///   BIX:  msinz      UUNET:  mks@cbmvax.commodore.com           |
  67. |\\\///                     When people are free to do as they         |
  68. | \XX/                      please, they usually imitate each other.   |
  69. \----------------------------------------------------------------------/
  70.