If you have experience with Axe, assembly will probably be a bit easier to learn. If you are familiar with the following, z80 assembly shouldn't be too difficult to get into:
- How memory works (such as addresses, reading/writing bytes)
- Integer math (8- and 16-bits)
- Binary/hexadecimal knowledge
Compared to modern assembly languages, z80 assembly is fairly limited. First, it is an 8 bit processor with some limited 16-bit operations, and it doesn't have any advanced math such as multiplication or division instructions. If you are used to 32-bit and 64-bit assembly with support for multiplication, division, and an FPU, z80 will be… "fun." (It really is fun, though.)
Compared to other languages, I am only slightly familiar with Python and C. C would have you better prepared for assembly, I think (depending on how advanced you are with it). TI-BASIC is vastly different.
If you want a site to check out, you can try [z80-heaven.wikidot.com Z80 Heaven] and feel free to ask questions since it will help us to figure out which problems need to be detailed more.
Now, for a very short, tiny introduction to z80 assembly…
- In assembly you work with CPU instructions. These are your commands.
- You have registers which are similar to real vars in TI-BASIC or 1-byte integers in other languages.
- Note that you have access to the registers A,B,C,D,E,H,L (there are a few more, but those require more advanced knowledge).
- Each register can hold an integer from 0 to 255 (it is 8-bit, 28=256)
- Special combinations of registers may be used to form a 16-bit register pair. These are AF,BC,DE,HL. F is the flags register and is not easily used
- Register pairs simply concatenate the two registers. For example, if B=03h, C=17h, then BC=0317h
- The available math instructions are:
- ADD - Add the A register to another register (or the byte pointed to by HL), store the result back into A.
- There is also an ADD instruction for HL with BC or DE. For example, ADD HL,DE adds HL and DE and stores the result in HL
- If there is an overflow, a flag is set and you can handle if you want to.
- SUB -Subtraction. This is not available for 16-bit register pairs
- SBC - Like SUB, but if the C flag is set, it subtracts 1 more. So if A=9, B=3 and the c flag is set, SBC A,B would store 9-3-1 (5) into A. If the c flag is not set (reset, 0) then 9-3-0 is stored into A.
- ADC -Add with Carry
- INC - increment a register or register pair
- DEC - decrement a register or register pair
- RL - rotate the bits of the register Left, rotate in the value of the c flag. The c flag is set to the value of the bit that was rotated out.
- RR - Rotate Right
- RLC - Rotate the bits left. The upper bit is now in the c flag and the lower bit.
- SRA - Shift Right Arithmetic. Shift the register right without changing bit 7. This is essentially a signed division by 2.
- SLA - Shift Left Arithmetic. Shift the register left, loading a zero in the lower bit. Essentially mutliplication by 2.
- XOR - performs bitwise XOR with the A register
- AND - performs bitwise AND with the A register
- OR - performs bitwise OR with the A register
- CP - Compares A to another register.
- CPL - invert the bits of A
- RES - reset a bit in a register
- SET - set a bit in a register
You will also have to get used to using conditional jumps and calls (which are pretty similar to GOTO or IF)