I have become interested in assembly programming. I have started with Hot Dogs ASM tutor since it appears more interesting than Z80 in 28 days. To make it even more interesting and challenging, I have translated the listings to compile with 'Brass'. I have done a Google search and found a listing for 'Brass' syntax. 'bcall' is not on this listing, and obviously 'bcall' is used a fair bit in assembly language. Is there another listing which I can download which includes this 'bcall' or is there something I'm missing ? I have already translated a couple of the program listings from Hot Dog and got them to work OK.
bcall is usually implemented as a macro - it's not part of the assembler's own syntax, as it's a TI calculator-specific way to call system routines.

Typically bcall will be provided by one of the include files (e.g. in the DoorsCS SDK which sets everything up for you) but if not it can be implemented as follows (along with the corresponding bjump):


Code:
.deflong bjump(label)               ; Jump macro
    call BRT_JUMP0
    .dw label
.enddeflong

.deflong bcall(label)               ; Call macro
    rst rBR_CALL
    .dw label
.enddeflong
Good answer, understood perfectly. I have included 'dcs7.inc' in my source codes. 'dcs7.inc' is not included in the Hot Dog source codes.
A lot of times bcall will be defined as B_CALL or b_call, the original include file given by TI defined it as B_CALL. You'd run a bcall like this: "B_CALL _Routine". I think ion popularized the bcall() format, or at least that's when i started using bcall instead of B_CALL.
Yes chickendude, I have noticed the two different syntaxes. I have been using 'bcall(_function) since day 1, and it works for me. At my stage of learning and understanding, I am happy that it works. At some time in the future, I may assimilate the difference. Thanks for you interest.
And that's absolutely fine, whether you type bcall() or B_CALL it all gets assembled into the same code Wink I also like the bcall() syntax better. Anyway, it's always nice to see a new face learning assembly Very Happy
That's worth knowing ! Cheers. Good Idea
Technically TI's own macro (for ZDS) removes the need to prefix the label with an underscore (note how it glues the _ prefix on for you):


Code:
B_CALL macro   label
        RST     rBR_CALL
        DW      _&label
       .endm


The idea is that you have the original label (without an underscore) and the label in the jump table (with the underscore) and the macro above allows you to fairly transparently call the routine. The bcall(_label) syntax certainly seems to be more popular, however.
Fascinating. Unfortunately, it is still a foreign language to me as yet.
Thank heaven 'bcall(_xxxx) works for me. Rolling Eyes
To climb up on my soap box for a while, I am not fond of Hot Dog's tutorials. While he put a lot of effort into them, which I admire, I feel he catered to a low common denominator of programmers with little programming experience focusing on games. I am particularly rankled that he waited far into the tutorial to teach hexadecimal and bit math, and instead used very non-standard decimal equivalents for much of the tutorial. I feel that will only confuse readers.
Hi again Kerm. Fortunately I am savvy on hex and bimath from my interest in programming the Commodore 64, 33 years ago. (although I have done nothing since.) I have had another quick glance at '28 days' and I have to say that every assembly language learner wants something NOW which can show something on the screen. HOT DOG does just that. I've only got to Lesson 4, where the first actual displays are presented. OK, I've had to tweak the source codes a bit, but it has been interesting and challenging.
Having said all that, it is likely that I will go through '28 days' at the same time. Add to it all, I am working on 'C' programming as well (courtesy of 'C for Dummies') After all, I have 12 hours per day to fill in.
Another very good tutorial is CoBB's: http://sgate.emt.bme.hu/patai/publications/z80guide/

From the first page of the tutorial:
Quote:
...Since starting this guide, my personal experience proved that people new to assembly live among misconceptions. For example, they are used to the fact that clearing the screen means no more than using a simple ClrScr or similar command. This apparently implies that clearing the screen is an elementary operation for the computer. Many guides I read are also written in this spirit. People are used to the fact that teaching any programming language should start with a “Hello World” program. Unfortunately, such a program would be impossible to understand for a newbie if written completely in assembly (the source of this program would be several kilobytes long, depending on the actual hardware). The guides I am talking about solve this problem by using an external program to display a text, therefore the first program only teaches you how to use that particular display routine. This would be no problem of course, but unfortunately such guides often stick to this practice to explain everything else, so the result is that the reader will learn to use a particular library of routines, and nothing more...


And don't forget one of the best tutorials of all: other people's source!
Thanks again for that chickendude. You're so right. The slight problem with other peoples source is, at my stage of learning, it is not quite so easy to find short listings which I can understand (ie. which make sense to me), and which put something on the calculator screen. My next step is to look at the guide you mention. I learned many years ago that when you become interested in a subject, the best idea is to obtain every book you can find on the subject because one of those books may contain one important snippet of information which none of the others contain. I have looked around on eBay and Amazon for something as good as 'C for Dummies' (for learning C). There have been one or two titles which may have been useful, but which have no details of actual content. Most of the books I have looked at are also expensive. I am not skint, but I cannot see the point of spending a lot of money on something which 'might' be useful to me.
If you're looking for any z80 books, Rodney Zaks released a pdf version of their 1981 book for free download:
www.z80.info/zip/zaks_book.pdf
Not everything will be immediately applicable to the TI calculators, but it's got a ton of interesting info. It's also interesting to learn just how exactly the z80 processor works and how instructions are run (in particular why they take so many t-states to execute as they do) Smile It's a bit more technical than the other tutorials mentioned, though.

EDIT: There's also a new code review project to try and break down routines and explain what they do. A couple have been done already, for example one of Kerm's 84+c se ball demo and another of a program that let's you change the calculator's contrast.
a !. I bought this book a couple of weeks ago. 630 pages. I'll never get through that this week ! Just Joking I'll certainly examine the ball revue you mention.
If you don't mind something a bit dry the Z80 Family CPU User Manual is an invaluable reference guide too.
Hi benryves. Downloaded and a quick look. A good reference book, but well beyond me at the moment. Crying
And another resource i use all the time: http://eeems.omnimaga.org/files/Resources/Tutorials/ASMin28Days/ref/z80is.html
The z80 instruction set, it lists what they do, their hex codes, size, t-states, how they affect the flags, and what registers they can take Smile It might be helpful for helping to decode some code you don't quite understand or (later on) when you're trying to optimize for speed/size. There's lots of stuff out there and also lots of people willing to answer your questions, just try not to get lost in it all Wink
chickendude wrote:
There's lots of stuff out there and also lots of people willing to answer your questions, just try not to get lost in it all Wink
Especially us! We're always more than happy to bring our collective ASM expertise to bear on any questions you might have. Also, for a z80 timing, flag, and opcode reference, I like the simpler, dense formatting of this file:
http://www.ticalc.org/archives/files/fileinfo/1/110.html
KermMartian wrote:
Also, for a z80 timing, flag, and opcode reference, I like the simpler, dense formatting of this file:
http://www.ticalc.org/archives/files/fileinfo/1/110.html

Be warned that that document propagates the myth that some instructions execute in 1 T-state when they should read 10 T-states (e.g. CALL cc,nn says "17/1" when it should be "17/10"). I'm not sure where this originates but I've seen a few documents that make this mistake.
  
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 1 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