aeTIos wrote:
I don't actually see what's wrong with .org 40339, I think it's much more easy to remember than .org $9D93.
On a side note, he uses it now, if I remember it well.
Seconded, to each his own. I really like it, it is really well-explained.
aeTIos, that's most likely because you learned from those tutorials. If you read other people's code, you're likely to be confused, because the decades-old convention is hexadecimal addresses.
No, I will recognise $9D93 also.
But, let us not stay in discussing wheter or not using .org 40339 or .org $9D93. In fact, it's the same.
aeTIos wrote:
No, I will recognise $9D93 also.
But, let us not stay in discussing wheter or not using .org 40339 or .org $9D93. In fact, it's the same.
Numerically, it's the same; stylistically, it's like creating a whole new set of reserved words for C++ and #define'ing them to the originals. Smile At any rate, I'm waiting for questions and thoughts from calcman based on his ASM experiences thus far.
KermM: i know what hexadecimal is... $F18D...
i know what binary is... %10010010...
i just cannot figure out the flags.
do registers act as variables in z80?


so registers are similar to "ans"?
They act as very temporary variables. You want your variables to have their own memory location for something longer lasting. Also, if possible you should edit your older posts with new thoughts to avoid double posting within in a very short time span.
They act as variables, but they can just hold a value up to 255. also, there are only ~8 registers (?)
are the registers the only variables in z80?

sorry just found out about stacks.Smile
calcman wrote:
are the registers the only variables in z80?

sorry just found out about stacks.Smile

You can also save to memory locations, but you want to limit yourself to the areas that are known to be safe ("Safe RAM").
Calcman: I didnt say that registers were the only variables, I said that there were just ~8(?) registers.
1) Registers are indeed like Ans. There are several 8-bit registers: a, b, c, d, e, h, l. There are several 16-bit registers that are combinations of the others: bc, de, hl (and ix and iy, but don't modify iy).

2) There are several Safe RAM locations that you can use when you're running under Doors CS or another shell where you can store more long-term values. Registers usually get trashed when you make calls out to functions and routines, so you need to either push and pop registers around those calls, or store the values to safeRAM. Also, there's only one stack.

Can you clarify what about flags is confusing you? And please don't double-post.
i know they are in the f register but how do you trigger them and how do they effect your program?
calcman wrote:
i know they are in the f register but how do you trigger them and how do they effect your program?
Oh, you mean those kinds of flags. They let you know the results of comparisons. For example:
Code:
    ld a,2
    cp 2
    jr z,TwoEqualsTwo
TwoNotEqualTwo:
There's also nz (which is the opposite of z), carry (c) and no-carry (nc), and also p, n, pe, and po, but those latter four are more advanced than you need now.
so flags are stored into the f register after a comparison, which can be used as a if...then format?
calcman wrote:
so flags are stored into the f register after a comparison, which can be used as a if...then format?
Correct. You use things like call z or jr nz or jp nc after you perform a comparison with cp. Flags can also get modified by things like bit, or, and, and xor.
question about compiling:

why does the compiler bring up a black screen and before i can do anything, goes away? Because of this cannot compile any z80 programs i write.
calcman wrote:
question about compiling:

why does the compiler bring up a black screen and before i can do anything, goes away? Because of this cannot compile any z80 programs i write.
You need to use the command prompt to run the compiler.
what and how do i do that?



how do i open the command window/prompt???
Or you can just create a compile batch file containing "compile blah" if your source file is blah.asm in the /source/ directory. Opening a command window (win-R, command, enter) will let you see errors better, though.
HOW DO I OPEN COMMAND PROMPT?
  
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
» Goto page Previous  1, 2, 3, ... 12, 13, 14  Next
» View previous topic :: View next topic  
Page 2 of 14
» 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