Mapar007 wrote:
Check instruction syntaxes? (SUB and ADD are "strange" sometimes)

This may seem ridiculous, but maybe you should try putting a space between the comma and the number?

This could be it. Usually "sub" doesn't take A as an argument, since it's understood (there is no sub command for HL)
wow I feel really stupid lol, I didn't realize you couldn't load a 16-bit register to another one or that sub wouldn't take a...

Thanks for the help people, I can finish debugging now.
lindenk wrote:
[...]I didn't realize you couldn't load a 16-bit register to another one or that sub wouldn't take a...[...]
Well, not directly, anyway. You can use the stack, such as push hl \ pop de, or you can do it in two eight-bit register steps, such as ld d,h \ ld e,l. Of course, doing things with sp is more complex, but that's a discussion for another time, since I doubt you're attempting that.
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 2 of 2
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement