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
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``````

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?
benryves
Maxcoderz Staff
Posts: 3078
Joined: Thu 16 Dec, 2004 10:06 pm
Location: Croydon, England
Contact:
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
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
benryves
Maxcoderz Staff
Posts: 3078
Joined: Thu 16 Dec, 2004 10:06 pm
Location: Croydon, England
Contact:
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
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?
benryves
Maxcoderz Staff
Posts: 3078
Joined: Thu 16 Dec, 2004 10:06 pm
Location: Croydon, England
Contact:
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
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.
benryves
Maxcoderz Staff
Posts: 3078
Joined: Thu 16 Dec, 2004 10:06 pm
Location: Croydon, England
Contact:
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
Not that window - the intelli-window
benryves
Maxcoderz Staff
Posts: 3078
Joined: Thu 16 Dec, 2004 10:06 pm
Location: Croydon, England
Contact:
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
so why does it(latenite) close it(the other window)?
benryves
Maxcoderz Staff
Posts: 3078
Joined: Thu 16 Dec, 2004 10:06 pm
Location: Croydon, England
Contact:
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
ok, I see.
silver calc
New Member
Posts: 73
Joined: Tue 28 Mar, 2006 10:50 pm
Location: Wouldn't you like to know?
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 any way you deem necessary
King Harold
Calc King
Posts: 1513
Joined: Sat 05 Aug, 2006 7:22 am
is Brass supposed to echo the .echo directive in pass 1?