|
Yes, on 3 generations of the chip: Rabbit 2000, 3000, 4000.
Mircea
|
|
|
|
|
A sand crab? Or maybe a sand flea? Cool.
modified 17-Feb-21 15:14pm.
|
|
|
|
|
Never found a processor bug, but not all USART chips were the same: one brand that the purchase dept found cheap only worked async, and failed horribly with synchronous data. Yeuch, but that was a git to find - my dev hardware and half the production stuff had the "good chips".
I remember finding my first compiler bug though: A Fortran problem on a GEC 4070 which generated the wrong machine code if the same variable was used in an IF and assigned in the next line of code. Joy when I worked out what it was and reported it to the ops manager. Who just said "yeah, we know about that one..." and left me feeling very flat.
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
As Griff was saying:
Quote: Joy when I worked out what it was and reported it to the ops manager. Who just said "yeah, we know about that one..." and left me feeling very flat.
I worked it out what it is and here is my result.
Z80 processor has/had an instruction DJNZ that decrements register B and jumps if not zero. This is bread and butter of most small loops in Z80 assembly. It also has a set of "alternate" registers BC', DE' HL' but rather few instructions operate on those alternate registers. To compensate for this, Rabbit introduced an ALTD prefix that can be added to most instructions to make them operate on the alternate registers. Now what happens with the instruction ALTD DJNZ ? Well, it takes the content of B register, decrements it and stores it in B' register making it a fairly useless instruction.
Of course, this is not documented in the manual and you have to figure it out for yourself.
Anyway, it left me feeling very flat
Mircea
|
|
|
|
|
The alt registers (or "shadow" registers) I always kept for interrupts (or NMI when we used that) so we could work faster - memory access to stack the registers is a load slower than EXX which was only 4 T states, compared to a minimum of 11 (plus any memory wait states) for a PUSH.
With a 4MHz processor, you shaved T states where you could!
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Looks documented to me. The ALTD flag only changes the destination.
Mircea Neacsu wrote: it takes the content of B register, decrements it and stores it in B register I believe what is actually happening here is that the ALTD instruction is setting the destination of the DJNZ operation to one of the "alternate" registers which leaves the B register unchanged.
Best Wishes,
-David Delaune
|
|
|
|
|
You are right; I should have paid more attention. However, it seems to me that it drastically reduces the usefulness of the instruction.
Mircea
|
|
|
|
|
Mircea Neacsu wrote: You are right; I should have paid more attention. Too bad you didn't find a cpu bug.
Mircea Neacsu wrote: However, it seems to me that it drastically reduces the usefulness of the instruction. Of course, more registers are almost always better!
Best Wishes,
-David Delaune
|
|
|
|
|
Quote: Too bad you didn't find a cpu bug. Well the chase was exiting
Mircea
|
|
|
|
|
Mircea Neacsu wrote: chase was exiting Your chase might be exiting but with an altd djnz instruction your loops will never be exiting.
However with this pedantic joke this thread has become much more exciting.
Best Wishes,
-David Delaune
|
|
|
|
|
@Mircea
We have some of those boards integrated as part of industrial control systems, anything specific we need to worry about?
|
|
|
|
|
No, I don't think so. The only possible damage is to my ego but I'm a big boy and I can take it
I was programming a particularly tight loop to read from an SPI device and thought I could use ALTD DJNZ instruction to shave some cycles and use the alternate B register. It turns out the ALTD prefix in this case is useless as I explained in a previous message.
However, an instruction not doing what I expected can hardly be called a bug. No one has yet implemented the RPM (Read Programmer's Mind) instruction.
Mircea
|
|
|
|
|
Hi Paul have you got AOMEI working with your Surface ? I can't get it working it fails with cannot create bitmap - Macrium works though
"I didn't mention the bats - he'd see them soon enough" - Hunter S Thompson - RIP
|
|
|
|
|
|
He has now assumed the role of Agent 47.
|
|
|
|
|
Ah ... my external drives are all Micro-B connectors, and I just never get around to buying a USB-C adapter cable.
It's not a priority for me as I don't keep anything serious on it - but it'd be a pain to reset to factory and then reload everything. Hmm. I should get a cable ... and a USB-C thumb drive to boot from ...
Thanks for the reminder ...
I just installed the standard version, and it runs. I added the SD as the destination, and it seems to be working fine, 6% already.
So, yes - "it works for me".
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Quote: London calling to the imitation zone
Forget it, brother, you can go it alone
|
|
|
|
|
Update: It just finished, and the backup looks OK.
So yes, it's working.
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
I have an external USB and it fails - Windows updates totally f***ked my Surface 7 last night so I've had to reset it to default ( lost everything ) and reinstall ( like you I don't keep data on it ) I think it's a VSS problem it had two providers entered in the registry and apparently there should only be one registered - so I deleted one of them ( the Hyper V one ) and Macrium worked after that but AOMEI is still failing. I installed Macrium purely because of the AOMEI problem
"I didn't mention the bats - he'd see them soon enough" - Hunter S Thompson - RIP
|
|
|
|
|
Especially when combined with extension methods and fluent-style methods.
envvars
.Municipalities()
.Select(m => m.Fixups())
.NotServiceAccess()
.Where(m => m.VerifyConnection(_ => Log($"{m.Municipality}: {m.ConnectionString} => Connection failed.")))
.Do(munis =>
munis.SelectWith(m => M5.GetTableNames(AUDIT_SCHEMA, m.ConnectionString), (m, with) => (auditableEntities.NotIn(with, s => s.TableName.ToLower(), t => t.ToLower()), m))
.ForEach(q => q
.Iterate((t, m) =>
t
.Do(_ => Log($"{m.Municipality}: {t.TableName} => Audit table missing"))
.GenerateMissingAuditTableSql(m)
.Execute(m.ConnectionString, (sql, e) => Log($"{m.Municipality}: {t.TableName} => {e.Message}\r\nFailed to execute SQL: {sql.ToString()}"))
)))
.Do(munis =>
{
munis.SelectWith(m => M5.GetTableNames(AUDIT_SCHEMA, m.ConnectionString), (m, with) => (auditableEntities.In(with, s => s.TableName.ToLower(), t => t.ToLower()), m))
.ForEach(q => q
.Iterate((t, m) =>
{
Log($"{m.Municipality}: {t.TableName} => Checking...");
var entityColumns = M5.GetColumnList(DBO_SCHEMA, m.ConnectionString, t.TableName);
var auditColumns = M5.GetColumnList(AUDIT_SCHEMA, m.ConnectionString, t.TableName);
entityColumns.NotIn(auditColumns, s => s.Name.ToLower(), f => f.Name.ToLower())
.DoIf(q2 => q2.Count() > 0, q3 => Log($" {q3.Count()} missing fields"))
.ForEach(f =>
{
Log($" {m.Municipality}: {t.TableName} => Field {f} missing in audit table");
f
.GenerateMissingColumnSql(m, AUDIT_SCHEMA, t.TableName)
.Execute(m.ConnectionString, (sql, e) => Log($"{m.Municipality}: {t.TableName} => {e.Message}\r\nFailed to execute SQL: {sql.ToString()}"));
});
}));
});
This is a custom "one line" function that creates missing audit tables or adds the missing columns that the entity defines but someone forgot to add to the audit table.
|
|
|
|
|
That's ... uhh ... a rather impressive abuse of LINQ that screams "oh hell no! I'm not getting anywhere near that to support it!"
|
|
|
|
|
Years ago, my teacher would say that any program in C++ "could" be written in a single line, and that one definitely shouldn't.
Bastard Programmer from Hell
"If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
|
|
|
|
|
In high-level languages there are no lines -- only statements.
|
|
|
|
|
So; you'd like to see one statement per line, or all off them in a single line?
Bastard Programmer from Hell
"If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
|
|
|
|
|
looks a lot like the kind of horrors i find in Typescript...
|
|
|
|