Bugs

One suite to code them all. An complete IDE and assembler for all your z80 projects!

Moderators: benryves, kv83

King Harold
Calc King
Posts: 1513
Joined: Sat 05 Aug, 2006 7:22 am

Post by King Harold »

maybe it would be easier to use the S flag instead (sign)
It'd bit 7 of the F register, if you do anything to A that doesnt kill it (or a, or 0, and a, and $FF) then bit 7 of a is written into the S bit, and you could then use a conditional non-relative jump which has somehthing to do with the sign (eg: jp p,label or jp m,label).
Which is 4 T-states faster if you allready were using JP, and 1 or 5 T-states faster if you were using JR previously (depending on whether the condition in JR was true (5 faster) or false (1 faster))
so

Code: Select all

ld a,$FF
or a
jp P/M, label
instead of

Code: Select all

ld a,$FF
bit 7,a
jr z,label / jp z,label
M means bit 7 is set, P means it is reset. And the Z80 doesn't know whether a byte is signed or not, for the S flag it will just assume it is and just write bit 7 to it no matter what.

Edit: I haven't tested it yet, but after OR, P/V is parity, so maybe it could be used instead of Bit 1,x?
User avatar
benryves
Maxcoderz Staff
Posts: 3087
Joined: Thu 16 Dec, 2004 10:06 pm
Location: Croydon, England
Contact:

Post by benryves »

Parity does not correspond to any particular bit, but the total number of set bits. %00000010 and %00000001 have the same parity.

If you want to test the least significant bit and don't need to preserve the accumulator, I'd shift or rotate it right and pick up the carry.
King Harold
Calc King
Posts: 1513
Joined: Sat 05 Aug, 2006 7:22 am

Post by King Harold »

that's a pitty.. I had allways wondered what that P/V really does you know.. And what it is used for.

as for shifting, it also goes for bit 7, but if you want the accumulator back after doing that you end up being just as fast as when using BIT, no gain no loss, but if you don't need to preserve it its 4 T-states faster..

Still the sign trick works :)
User avatar
benryves
Maxcoderz Staff
Posts: 3087
Joined: Thu 16 Dec, 2004 10:06 pm
Location: Croydon, England
Contact:

Post by benryves »

The most obvious application of parity is in communications and the parity bit. Let's say you are using a "parity even" communications protocol. For every byte you send, you attach a ninth bit. This bit's purpose is to force the number of set bits to be even each time - so if the byte you are sending has an even number of set bits you send a 0, if it has an odd number you send a 1 to make it even.

By even, I mean the number of set bits, not whether the original number was even or not.

At the other end, the device receives the 8 bits then uses the 9th bit to check that the parity is even. If not, something went wrong and it signals an error.

It's obviously not very robust, but it's one level of protection.
King Harold
Calc King
Posts: 1513
Joined: Sat 05 Aug, 2006 7:22 am

Post by King Harold »

I guess it'd work, but if that 9th bit is corrupted it could reject good data or accept bad data, but chances are bigger that it'll work as planned (although there's a bigger chance that it won't work when there's a lot of corruption overall and that would be when you needed it to work)
so why didn't 'they' make it a seperate bit but rather give 1 bit 2 uses?
doesn't x86 have seperate flags for parity and overflow?
User avatar
benryves
Maxcoderz Staff
Posts: 3087
Joined: Thu 16 Dec, 2004 10:06 pm
Location: Croydon, England
Contact:

Post by benryves »

King Harold wrote:so why didn't 'they' make it a seperate bit but rather give 1 bit 2 uses?
Overflow is meaningless for logical operations, so it represents parity in those instances. I suppose they reasoned that you'd only ever want to use one meaning or the other at a time.
It might also have resulted in less circuitry this way. Who knows?
King Harold
Calc King
Posts: 1513
Joined: Sat 05 Aug, 2006 7:22 am

Post by King Harold »

I found 2 weird things, they're in the 'intellisense' thingy
When you type something like "bc" hit ctrl-space and then go on typing something that doesnt exist, say, "fdg", then the intelli-window will consist of 1 empty line but continue moving as you type.
The other thing is that you cant click its scrollbar, well you can but it closes directly after, and it doesnt close when you click outside it, a bit contradictionary.
User avatar
benryves
Maxcoderz Staff
Posts: 3087
Joined: Thu 16 Dec, 2004 10:06 pm
Location: Croydon, England
Contact:

Post by benryves »

When you click on it, the outside window (Latenite) loses focus, so it closes the window. If you click outside it, but within Latenite, it doesn't lose focus - and so keeps open.
King Harold
Calc King
Posts: 1513
Joined: Sat 05 Aug, 2006 7:22 am

Post by King Harold »

Not that window - the intelli-window :P
User avatar
benryves
Maxcoderz Staff
Posts: 3087
Joined: Thu 16 Dec, 2004 10:06 pm
Location: Croydon, England
Contact:

Post by benryves »

When you click on it [the autocompletion window], the outside window (Latenite) loses focus, so it [Latenite] closes the [autocompletion] window. If you click outside it [the autocompletion window], but within Latenite, it [the autocompletion window] doesn't lose focus - and so keeps open.
King Harold
Calc King
Posts: 1513
Joined: Sat 05 Aug, 2006 7:22 am

Post by King Harold »

so why does it(latenite) close it(the other window)?
User avatar
benryves
Maxcoderz Staff
Posts: 3087
Joined: Thu 16 Dec, 2004 10:06 pm
Location: Croydon, England
Contact:

Post by benryves »

Because I couldn't find a cleaner, reliable solution. The window is always on top (it has to be) and I didn't want it to end up floating on top of other windows if you switched out of it.

This will be fixed with my new custom text editor.
King Harold
Calc King
Posts: 1513
Joined: Sat 05 Aug, 2006 7:22 am

Post by King Harold »

ok, I see.
User avatar
silver calc
New Member
Posts: 73
Joined: Tue 28 Mar, 2006 10:50 pm
Location: Wouldn't you like to know?

Post by silver calc »

Another Bug (or maybe not):
When trying to compile an application (using the TI-83+ native script) & with everything else set up, Brass creates a .8xp and a .8xk file. Also, when you try to debug it, it always tries to send the .8xp file instead of the .8xk file (even if i delete it in the compile script)
Please "encourage" me to work more on Image any way you deem necessary
King Harold
Calc King
Posts: 1513
Joined: Sat 05 Aug, 2006 7:22 am

Post by King Harold »

is Brass supposed to echo the .echo directive in pass 1?
Post Reply