home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.amiga.programmer
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!usenet.coe.montana.edu!nntp.uoregon.edu!cie.uoregon.edu!jlavin
- From: jlavin@cie.uoregon.edu (Jeff Lavin)
- Subject: Re: Assembly questions.
- Message-ID: <1992Sep4.070415.15104@nntp.uoregon.edu>
- Sender: news@nntp.uoregon.edu
- Organization: The Puzzle Factory
- References: <1802@grivel.une.edu.au>
- Date: Fri, 4 Sep 92 07:04:15 GMT
- Lines: 72
-
- In article <1802@grivel.une.edu.au> cfiddyme@neumann.une.edu.au (Chris Fiddyment) writes:
- >
- > Hi,
- > I have a few (hopefully simple) questions to ask. I am new to assembler and
- > can't afford a book yet (besides a borrowed copy of the RKM's).
- >
- > First I am using the commands
- >
- > move.l #186,d0
- > divu #10,d0
- > moveq.l #0,d1
- > move.b d0,d1
- >
- > to get d1 = 18. How canI get the remainder of the division (the upper part
- > of d0) into register d2. Is there some way to shift the register?
- >
- > Another question. I have written a program that opens a screen and moves a
- > sprite around. How do I print images to the screen. I tried the following :
- >
- > move.l intbase,a6
- > move.l rastport,a1 ; these could be back to front.
- > lea blockimage,a0
- > move.l #10,d0
- > move.l #10,d1
- > jsr -114(a6) ;DrawImage()
- >
- >with the following variables:
- >
- > blockimage
- > dc.w 0,0,15,10,2 ; Is this the correct format. It seems right from
- > dc.l myimage ; looking in the RKM's
- > dc.b 0,0
- > dc.l 0
- >
- > myimage
- > dc.w %0000000000000000,%0000000000000000
- > ;10 lines of image data
- > dc.w %0000000000000000,%0000000000000000
- >
- >When the program is run the image is not drawn, the sprite dissapears from the
- >screen but the sprite handling routines still work.
- >What am I doing wrong??
- >When I get some money what is a book on assembler to get?
- >
- > Thanks, Chris.
- >
- >* Chris Fiddyment. | I never promised anybody *
- >* cfiddyme@neumann.une.edu.au | anything. Kermit. *
-
- Well, for starters use:
-
- swap d0
-
- this instruction swaps the 2 16 bit halves of a 32 bit register, so:
-
- Before: D0 = $12345678
- After: D0 = $56781234
-
- BTW, the mnemonic 'moveq' is implicitly LONG, so the '.l' is superfluous.
-
- As to the graphics -- the actual image data (myimage) needs to be in chip
- memory. In assembler this is done:
-
- SECTION MyImages,DATA,CHIP
-
- Don't know about C.
-
- --
- The Puzzle Factory, Inc. | Jeff Lavin -- jlavin@cie.uoregon.edu
- Veneta, Oregon |-------------------------------------
- Voice : (503) 935-3709 | Remainder of signature line
- Data : (503) 935-7883 | under construction.
-