haha yeah, I need to get out of that double-posting habit. glad I found the delete post button.

So, is the actual doorscs more like my routine? Is doors CS open source?
Rascherite wrote:
haha yeah, I need to get out of that double-posting habit. glad I found the delete post button.

So, is the actual doorscs more like my routine? Is doors CS open source?
No, it's not. The thing is, though, the Doors CS line routines handle vertical, horizontal, and skewed lines all within the same routine, as well as white lines, black lines, checkered lines, and inverting lines. Therefore, picking out the specific pieces is a little bit harder to do. You can easily just use them yourself, though:

http://dcs.cemetech.net/index.php?title=Fastline
KermMartian wrote:
No, it's not.

not open source or not like mine?

I guess all asm is open-source, in a way Razz

...is there a disasm for z80?


so, in the DCS fastline, is the line routine just one routine and the vertical and horizontal lines are just drawn coincidentally when h=d or l=e without any special attention given to their verticalness or horizontalness?
That's correct. The way it works out, it's just as fast as having separate routines for those special cases, and saves the memory of needing to have code for the special cases. Doors CS is closed-source, although if people ask nicely and I trust them as individuals to not re-use or re-distribute my code without asking, I generally give pieces of my code to people.
KermMartian wrote:
Doors CS is closed-source, although if people ask nicely and I trust them as individuals to not re-use or re-distribute my code without asking, I generally give pieces of my code to people.


That's understandable. If I spent that much time working on an OS and a library of DCS's scope, I would hesitate before showing it to anyone.

not that I'm going to try and steal your DCS code or anything evil like that, but is there some sort of disassembler for z80?
There are a few; the most impressive is the IDA Pro disassembler that BrandonW recommends. Also, my policy on open-sourcing calculator code comes from a few rather significant incidents in which members of the community blatantly stole and used code I had released under a limited license without proper attribution, then claimed it was OK to violate my license. That sort of behavior makes me very angry, not that I think you would ever do something like that.
KermMartian wrote:
Also, my policy on open-sourcing calculator code comes from a few rather significant incidents in which members of the community blatantly stole and used code I had released under a limited license without proper attribution, then claimed it was OK to violate my license. That sort of behavior makes me very angry, not that I think you would ever do something like that.

That's terrible!! I'm honored to know that you trust me in that respect, and no, I would never do that to another programmer, least of all one who I respect so much!

Now that I have a sense of resolution about my line drawing programs, I want to talk about interrupts. Z80 in 28 days explains the subject very poorly, in my opinion, so I'd appreciate it if someone would explain the basics to me.

I know what an interrupt IS, but , first of all, i need to know how they are triggered on the z80.
Interrupts are triggered in many ways, depending on the IM (Interrupt Mode). IM 0 is unusable on the 84+, since it requires sending an instruction on the data bus (and we cannot do that) such as RST 38h, RST 8h, etc. IM 1 will jump to address 0x0038 on each call, and is triggered by peripheral devices usually. IM 2 is what you usually use, and involves using a vector table, working with the I register, etc. (It's a bit more to explain, so looking at something like brandonw's wiki should say enough about it).
Thanks, ashbad! Can you maybe link me up to the page?

Random question about code appearance... Is it more common to have tabs or spaces between instructions and operands?


Code:
ld [tab] a, b

Versus

Code:
ld [space] a, b
It's more common in community code to use a space. TI code almost always uses a tab in between, and frequently uppercase registers and opcodes.
<badjoke>I guess ti just knows that CAPSLOCK IS CRUISE CONTROL FOR COOL</badjoke>

Seriously, though, I can't stand it when register names and opcodes are in all caps. Its so annoying.
Rascherite wrote:
<badjoke>I guess ti just knows that CAPSLOCK IS CRUISE CONTROL FOR COOL</badjoke>

Seriously, though, I can't stand it when register names and opcodes are in all caps. Its so annoying.
Absolutely agreed on that. Also, let me clarify more things about interrupts; what can I teach you? Smile
As for a link, http://z80-heaven.wikidot.com/interrupts seems to be a very good generalization of basically everything you'll need to know about interrupts on the 84+. Any questions beyond that, Kerm is definitely your man.
If you're writing a subroutine that will be used over and over, e.g, a line drawer, is it bad practice to reserve 3 or 4 bytes of ram for it, or should you use only the registers and the stack?

like, is this acceptable?

Code:
my_routine:
   ld b, 4
   ld hl, _var1
_loop:
   ld a, (hl)
   inc a
   ld (hl), a
   inc hl
   djnz _loop
 
   ret

_var1:
   .db $00
_var2:
   .db $1A
_var3:
   .dw $4C53


I feel like this is a kinda dumb question, because there are some subroutines that are complex enough to require ram use and not just register/stack use, so it seems like I can assume that this is allowed.
That's generally acceptable if you absolutely have to, but keep in mind it will prevent the following things:

- Recursion won't work.
- You can't call the routine from an interrupt if you use it elsewhere.
Quote:
If you're writing a subroutine that will be used over and over, e.g, a line drawer, is it bad practice to reserve 3 or 4 bytes of ram for it, or should you use only the registers and the stack?
You should be using safeRAM for that rather than using scratch RAM within the program itself, especially since the latter tends to confuse writeback routines.
What is saferam?
Saferam in axe can be easily accessed with L1 through L6 (they're in the Command list with descriptions on just how safe they really are)

Basically it's ram outside your program that can be used for temporary storage
Rascherite wrote:
What is saferam?


SafeRAM is a general term for non-volatile chunks of RAM left by TIOS for program use. An example is SaveSScreen, which is 768 bytes large.
I'm not using axe... and I also want to know WHAT it is, HOW it is different from normal RAM, and WHY it can be used for subroutines.

edit:
Ashbad wrote:
SafeRAM is a general term for non-volatile chunks of RAM left by TIOS for program use. An example is SaveSScreen, which is 768 bytes large.


What if your main needs to use the ram in SaveSScreen? Or is it bad practice to let your programs use the ram at SaveSScreen unless they're meant to be called?
  
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 4 of 5
» 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