12 December 2011, 01:10 | #1 |
Registered User
Join Date: Sep 2011
Location: Denmark
Posts: 175
|
Problems with a little ASM code
I can't get this code to work though it's in a manual for ASM for the Amiga. What could be wrong?
move.w #$4000,$DFF09A rtsmove.w #$03A0,$DFF096 loop: move.w $DFF006,SDFF180 btst #6,$BFE001 bne.s loop move.w #$83A0,$DFF096 move.w #$C000,$DFF09A Thanks Volt. |
12 December 2011, 02:12 | #2 |
Join Date: Jul 2008
Location: Sweden
Posts: 2,269
|
The manual you're reading isn't teaching very good practices, but to make that code run correct change it into this:
Code:
move.w #$4000, $dff09a move.w #$200, $dff096 loop move.w $dff006, $dff180 btst #6, $bfe001 bne loop move.w #$8200, $dff096 move.w #$c000, $dff09a moveq #0, d0 rts |
12 December 2011, 08:57 | #3 |
Registered User
Join Date: Sep 2011
Location: Denmark
Posts: 175
|
I still get an error on the first line in ASM-Pro.
Volt. |
12 December 2011, 09:00 | #4 |
move.l #$c0ff33,throat
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,865
|
Precede each line with a TAB.
|
12 December 2011, 11:02 | #5 |
Computer Nerd
Join Date: Sep 2007
Location: Rotterdam/Netherlands
Age: 48
Posts: 3,849
|
|
12 December 2011, 11:24 | #6 |
Registered User
Join Date: Sep 2011
Location: Denmark
Posts: 175
|
Why do I get an "Illegal Operator" in this line?
move.w #$4000, $dff09a Volt. I got it to work. The TABS were missing. Thanks for guiding me Last edited by VoltureX; 12 December 2011 at 11:53. |
12 December 2011, 11:53 | #7 |
Computer Nerd
Join Date: Sep 2007
Location: Rotterdam/Netherlands
Age: 48
Posts: 3,849
|
|
12 December 2011, 13:10 | #8 |
move.l #$c0ff33,throat
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,865
|
Indeed.
Thorham already explained it but here's some more additional info. The assembler needs to distinguish between labels and actual instructions thus instructions must not start at the first column. You can change that behaviour in the AsmPro settings though, if you tick the "Label :" checkbox, you have to end each label with a colon but can then also start instructions at the first column since the assembler will use the colon to recognise the labels. |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Looking for Ultimate Soundtracker ASM source code | 8bitbubsy | Coders. Asm / Hardware | 1 | 13 April 2013 00:17 |
Wanting to start learning to code amiga in asm | fishyfish | Coders. Asm / Hardware | 5 | 03 March 2012 06:11 |
Lots of ASM code | Ray Norrish | Coders. General | 9 | 22 February 2006 02:20 |
Asm-One debugger problems | WayneK | Coders. General | 2 | 26 December 2005 07:06 |
3D code and/or internet code for Blitz Basic 2.1 | EdzUp | Retrogaming General Discussion | 0 | 10 February 2002 11:40 |
|
|