English Amiga Board


Go Back   English Amiga Board > Coders > Coders. General

 
 
Thread Tools
Old 12 December 2011, 01:10   #1
VoltureX
Registered User
VoltureX's Avatar
 
Join Date: Sep 2011
Location: Denmark
Posts: 165
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
move.w #$03A0,$DFF096
loop:

move.w $DFF006,SDFF180

btst #6,$BFE001
bne.s loop
move.w #$83A0,$DFF096
move.w #$C000,$DFF09A
rts

Thanks

Volt.
VoltureX is offline  
Old 12 December 2011, 02:12   #2
Leffmann
 
Join Date: Jul 2008
Location: Sweden
Posts: 2,265
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
Leffmann is offline  
Old 12 December 2011, 08:57   #3
VoltureX
Registered User
VoltureX's Avatar
 
Join Date: Sep 2011
Location: Denmark
Posts: 165
I still get an error on the first line in ASM-Pro.

Volt.
VoltureX is offline  
Old 12 December 2011, 09:00   #4
StingRay
move.l #$c0ff33,throat

StingRay's Avatar
 
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,479
Precede each line with a TAB.
StingRay is offline  
Old 12 December 2011, 11:02   #5
Thorham
Computer Nerd

Thorham's Avatar
 
Join Date: Sep 2007
Location: Rotterdam/Netherlands
Age: 44
Posts: 3,089
Quote:
Originally Posted by StingRay View Post
Precede each line with a TAB.
Except the label lines
Thorham is offline  
Old 12 December 2011, 11:24   #6
VoltureX
Registered User
VoltureX's Avatar
 
Join Date: Sep 2011
Location: Denmark
Posts: 165
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.
VoltureX is offline  
Old 12 December 2011, 11:53   #7
Thorham
Computer Nerd

Thorham's Avatar
 
Join Date: Sep 2007
Location: Rotterdam/Netherlands
Age: 44
Posts: 3,089
Quote:
Originally Posted by VoltureX View Post
Why do I get an "Illegal Operator" in this line?

move.w #$4000, $dff09a

Volt.
Because there's no space or tab in front of the move. Things like labels and constants start at column one, and the actual assembler instructions should go into columns two or higher.
Thorham is offline  
Old 12 December 2011, 13:10   #8
StingRay
move.l #$c0ff33,throat

StingRay's Avatar
 
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,479
Quote:
Originally Posted by Thorham View Post
Except the label lines
Indeed.

Quote:
Originally Posted by VoltureX View Post
Why do I get an "Illegal Operator" in this line?

move.w #$4000, $dff09a
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.
StingRay is offline  
 


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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 16:50.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.
Page generated in 0.07199 seconds with 13 queries