Jump to content
Champions_2002

USR function code not working

Recommended Posts

i am looking through old Atari User magazaines and i came across an article on the USR function from the Nov 1987 issue

 

The code looks like this

10 *=$600
20 PLA
30 LDA #0
40 STA 710
50 RTS

I have compiled this with the Assembler Cartridge and i get error 6 on lines 10,30 and 40, also i have tried MADS and i get an error illegal instruction

 

can anybody get this to work (it should only change the colour)

 

Champions

Share this post


Link to post
Share on other sites

How many spaces do you have between the line number and the rest of the line?

You should have at least 2, otherwise it will see the mnemonic as a label, rather than code

Share this post


Link to post
Share on other sites

How many spaces do you have between the line number and the rest of the line?

You should have at least 2, otherwise it will see the mnemonic as a label, rather than code

Yes i have 2 on lines 20,30,40 and 50

Edited by Champions_2002

Share this post


Link to post
Share on other sites

You also need at least 2 spaces on line 10.

The asterisk is the equivalent of the ORG directive in some compilers, so it should be treated as a mnemonic as well.

Share this post


Link to post
Share on other sites

You might want to check your line spacing again. You need two spaces between the line number and the first character of your instruction. ASM/ED is complaining about the goofy instructions after the labels on lines 10, 30, and 40.

 

Bob

Share this post


Link to post
Share on other sites
10 *=$600

20 PLA

30 LDA #0

40 STA 710

50 RTS


Copy and paste to your assembler.


You may want to switch to 1) Using tabs rather then spaces. As several noticed, you only have one space between line number and label field. 2) Switch to using a program editor like Notepad++ as these will highlight labels.

  • Like 1

Share this post


Link to post
Share on other sites

You also need at least 2 spaces on line 10.

The asterisk is the equivalent of the ORG directive in some compilers, so it should be treated as a mnemonic as well.

R yes i thought it would be different i just tried it .

 

 

10 *=$600
20 PLA
30 LDA #0
40 STA 710
50 RTS
Copy and paste to your assembler.
You may want to switch to 1) Using tabs rather then spaces. As several noticed, you only have one space between line number and label field. 2) Switch to using a program editor like Notepad++ as these will highlight labels.

 

Thanks for that it now works for me

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...