Champions_2002 Posted February 27, 2014 Share Posted February 27, 2014 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 Quote Link to comment Share on other sites More sharing options...
Pengwin Posted February 27, 2014 Share Posted February 27, 2014 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 Quote Link to comment Share on other sites More sharing options...
Champions_2002 Posted February 27, 2014 Author Share Posted February 27, 2014 (edited) 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 February 27, 2014 by Champions_2002 Quote Link to comment Share on other sites More sharing options...
Pengwin Posted February 27, 2014 Share Posted February 27, 2014 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. Quote Link to comment Share on other sites More sharing options...
Pengwin Posted February 27, 2014 Share Posted February 27, 2014 Regarding MADS: It uses the org directive rather than the asterisk Quote Link to comment Share on other sites More sharing options...
+bob1200xl Posted February 27, 2014 Share Posted February 27, 2014 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 Quote Link to comment Share on other sites More sharing options...
ricortes Posted February 27, 2014 Share Posted February 27, 2014 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. 1 Quote Link to comment Share on other sites More sharing options...
Champions_2002 Posted February 28, 2014 Author Share Posted February 28, 2014 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.