Login [Register]
Don't have an account? Register now to chat, post, use our tools, and much more.

Do you find this table helpful for Z80 ASM programmers
No
 45%  [ 5 ]
Yes
 54%  [ 6 ]
Total Votes : 11

Ah ok, thanks for clearing things up. Is there any way to subtract from another variable other than A?
The registers aren't like BASIC variables, they are constantly changing and will practically never hold long-term values (with the possible exception of the index registers), so generally if you want to subtract two 8-bit numbers you will put the number you want to subtract from into a first. You can also add negative numbers to simulate subtraction, for example if you want to do "e-a", you can do:

Code:
neg    ; (this is basically "a * -1 -> a")
add a,e
...essentially, you are doing "-a + e".

If you want to do something like e-d, that's more straightforward:

Code:
ld e,a
sub d
...essentially loading e into a and then doing a-d.

You can also use SBC (subtract with carry) to subtract a 16-bit register from hl, just watch out for the carry. If the carry is set it will subtract an extra 1.
Sorry with the broken link. There was a problem with the OneDrive Sync on Windows 10 TP build 9879, so I downloaded the table document, deleted the table document from OneDrive, and re-uploaded the table document.

Here's the new link:
http://1drv.ms/1v7UJIr
I like this idea, and I added a couple more. At one point I was working on a list like this as well as a tutorial. I have no clue where it went Razz GOod luck!
Updated table:

Updated table:

I think the last two are backwards, you've got the assembly in the BASIC section and the BASIC in the asm side.
chickendude wrote:
I think the last two are backwards, you've got the assembly in the BASIC section and the BASIC in the asm side.


Oops! Thanks

Updated Table:

Updated table:

Updated table:
  
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 GMT - 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