Although
it's possible to create software that will run on an 8080
(or an 8085) and not a Z80 (I used to do this to really annoy a
friend who had a Cromemco Z80 system when I still used the
Altair 8080 :-) ... By and large, the Z80 is a superset of the
8080 - There are some flag differences which prevent it from
being a fully proper superset, however these affected very little
"real" code.
How do you define "real" code? If you're on a boat at sea and
your navigation system suddenly decides that this opcode should
not behave the way it "does", you might get a bit annoyed
when you can't find any of your lobster pots, etc. I think code
that controls the rudder of a several ton vessel moving at 20
knots is just as "real" as the code that draws a tic tac toe
board on a glass tty... :-(
By "real" code I refer to the 1000s of programs that ran under CP/M
on either an 8080 or Z80 with no problems, I also refer to the large
volume of code that I personally wrote and an quite confident that it
would run on either chip.
If you are writing an embedded or critical system (like a ship navigation
system) then you should be damn sure about a lot more detail of the final
system than just which CPU it will run on - and I agree completely that for
a system of this nature, you would want to spec every detail in the final
implementation - but how many 8080 or Z80 based navigation systems
were implemented compared to the large 8080/Z80 "general purpose
computer" software base? By "real" code, I am referring to the base
of software that was likely to be run on either processor.
I would guess that Zilog thought this was reasonable as well - it would
seem odd for them to have made the CPU 99% compaible with the 8080
and then put in a significantly incompatible difference (hey guys - lets
swap the INR A and HLT opcode!)
Actually, you
did have to MOV things fairly often on the
8080 (dedicated registers and all - don't forget that in spite
of Intel always documenting it separately, 'M' was one of the
Octal register representations).
Sure, but that's just two instructions -- mov a to memory and
move memory to a.
No, you also have MVI r,M, ADD M, SUB M, ADC M, SBB M,
CMP M ...
But more
importantly - It's not just MOV ... IIRC, the following
instructions on the 8080 have an octal field encoded:
"MOV", "MVI", "ADD", "ADC", "SUB",
"SBB", "INR", "DCR",
"ANA", "XRA", "ORA", "CMP",
"JZ", "JNZ", "JC", "JNC", "JP",
"JM", "JPE", "JPO",
"CZ", "CNZ", "CC", "CNC", "CP",
"CM", "CPE", "CPO",
"RC", "RNZ", "RC", "RNC", "RP",
"RM", "RPE", "RPO",
"RST"
Sure, and LXI, PSH, POP, INX have a "quad" field.
What's your point? How does memorizing the mappings of
registers to 3 bit fields help you remember the mappings
of condition codes to *that* 3 bit field?
Bottom line, you end up having to just memorize the opcodes
that you use frequently -- and remember WHERE on the quick
reference card each of the other opcodes will be found.
Definately in hex (which is what I did - I think I still have some of
my "reference cards" that I made and printed out on the university
system).
But I knew at least one guy who was "very octal", and he knew most
of the instruction set without a reference card - He explained to me
once that he did it by rememberng the meaning of the various
triplets. I can see that if you "think" in Octal, this would make sense
to do (I don't).
As to how
often I use these instruction - how about some hard
data instead of conjecture - I wrote a program to analyze 8080
source, and launched it against two of my earliest code examples,
namely - a small 8080 Monitor and BASIC interpreter that I wrote
for the UNB computer club in the 70's:
In the output below:
Directives - are any non-opcode source lines, EQU, ORG, DB etc.
Octal opcodes - are opcodes from the above list (with an octal field in them)
Non-octal opcodes - are all other opcodes (which don't have an octal field)
Filename : MONITOR.ASM
Total lines : 645
Comment/blank : 100
Directives : 39
Octal opcodes : 200
Non-octal opcodes: 306
Looks like 2/3 of the instructions encoded in my monitor have at least one
octal field representation.
Filename : BASIC.ASM
Total lines : 1975
Comment/blank : 386
Directives : 143
Octal opcodes : 494
Non-octal opcodes: 952
Looks like more than 1/2 of the instructions encoded in my BASIC have
at least one octal field.
But, again, that doesn't *mean* anything. Every JMP/CALL has an
octal field. But, do you REMEMBER them as "JMP ALWAYS" and
"CALL ALWAYS" and thus synthesize the opcodes from a 5 bit
template with an "ALWAYS" condition? Or, do you just remember
that C3 is JMP and CD is CALL?
No, I don't - partly because the "always" versions of these instructions
are NOT encoded with a conditional triplet, and partly because I tended
to just remember the opcodes for the instructions that I used - but I
knew guys who could instantly give you the octal representation for any
of the conditional transfer instructions. Very few of us hex guys could
keep them all in (we new Z, NZ, C, NC - P & M when were were coding
and PE/PO I always had to lookup - hardly ever used them).
Note that I
have only use the octal fields depicted in the Intel databook
(mainly the registers, the conditional coding and the RST vector) - in
practice (and this is going way back now) ... Octal makes sense for
other parts of the opcode as well - for example, all arithmetic opcodes
are encoded as 10 rrr aaa
Where aaa is a triplet encoding the arithmetic operation.
And you remember *those* encodings, as well??
No, I used my cheat sheet - but the guy I referred to above could write
down any arithemetic opcode as three octal digits - two bits for "arithmetic",
three bits for "register", and three bits for "operation".
Yeah, and my quick reference card gives them all nice
HEX values that I can dig up just as easy as you can
build an opcode using all of these little tables.
I don't think so - (well with me probably, but up against one of the
good Octal guys no) - they could write the opcode down instantly,
and you would have to take time to look at the reference card.
>> As
noted earlier, I happen to be from the "hex" camp ... but I don't
>> think it's fair to dismiss the octal guys as "nuts" ... the use of
octal
Hmmm... *I* don't recall calling anyone "nuts". Rather, this started
with my observation:
When I was developing Z80-based products, an ongoing *battle*
was the use of hex vs. "split octal" (e.g., 0xFFFF -> 0377 0377).
The octal camp claimed the Z80 was an "octal machine" (oh, really?)
and, for "proof", showed how so many of the opcodes could be
committed to memory just my noting the source & destination
register "codes" and packing them into an octal representation:
xx xxx xxx (of course, I wonder how well their argument would
stand up if Zilog had opted to encode the register fields
as: xs dds dsx?? :> )
It would appear that the *nuts* was implied: by (oh, really?)m Quotes
around "proof", suggestion that the opcode encoding is randomly
organized etc.
Octal? Hex? Just give me a symbolic debugger and
let *it*
keep track of these minutae...
Like your mouse below, symbolic debuggers didn't exist for many
of us in the mid 70's.
Probably not -
but I seem to recall that even though the 8080 was
a rather expensive chip to get, it still didn't always come with an
MDS-800 - I don't recall any of the guys in our "homebrew computer
club" having an MDS-800 (or any production computer for that
matter).
Sure. But, the rules applying to hobbyists are obviously
different than those applying to corporations trying to bring
products to market. You wouldn't suggest we NOT purchase
the MDS and, instead, get a bunch of SDK's wired to our
target hardware?
No, and I'm not even suggesting that you need to learn Octal (or Hex).
What I am suggesting is that guys working in different situations than
you (actually, from your original posting - guys working in the same
situation than you) had valid viewpoints when they thought a little differently
than you.
It's great that you got to work in a well funded setup in the 70's. A lot
of startups came into being during this time (many of whom went on
to define much of the industry), and many (most) of these were garage
operations without the budget for "professional" tools. Should they have
just packed it (oh well, can't afford an MDS-800 - lets try farming instead),
or did it make sense that they worked out other means to do the job at
hand. Development systems were nowhere near as common as todays
PC - many people who worked in the industry didn't have them - Our
university didn't have an MDS-800, yet we built and programmed some
rather impressive for the time systems.
> > Some of the guys claimed that thinking of the opcode in Octal made
> > it much easier for them ... All I am saying is that I can see some
> > validity to their claim.
>
> And the last P in my comment (above) was:
>
Octal? Hex? Just give me a symbolic debugger and
let *it*
keep track of these minutae...
Yes - we know your view - what does this have to do with the
validity of the octal guys claims?
I don't imagine those hobbyists *prefer* using
hex/decimal
keypads and 7 segment displays to write their code?
Well... I think they *DID* prefer using keypads and displays - If
they hadn't, they would not have used them. In my case: I could
have dropped out of school and used my tuition money to buy a
development system, but I preferred to do something within my
means. I could have tossed the 8080 and taken up fly-fishing as
a hoppy, but I preferred make do with what was available to me.
For me, the keypad/display was "the way to go" at the time.
I went on to a career in development systems - and I can trace
the roots all the way back to the low-level basics I learned on
hand-built 8080 boards, and the tools I created over the years
to improve on that environment.
When I was doing Z80-based designs (in the "split
octal" world),
a helluva lot of energy was expended to support the "octal"
encoding -- rewriting the Zilog assembler to generate listings
in octal (INCLUDING displaying addresses in split octal!),
building run-time "monitors" to examine and patch code images
during execution, writing the associated software to do so, etc.
This would be because you didn't work in Octal (split or otherwise).
The same could be said for any encoding scheme - If some of your
users had demanded to use base 13 this too would have presented a
challange to you - but at least the "ultimate answer" would work out
correctly: (6x9=42 in base 13 :-)
You're missing the point: it was a waste of time to invest
all that energy in half-*ssed tools instead of moving to
more "current" technology. If your goal is to bring a product
to market (NOT to deal with hobbyists), you devote your
resources to things that can measurably improve your
productivity. Throwing resources (software and hardware
development time and money) on tools that don't make a
dramatic increase in your productivity is just foolish.
My points:
1) for many, Octal was natural - just because you consider it
half-donkeyed doesn't "make it so".
2) Had you been from the "octal camp", you would now be
stating how it wasn't suitable to put time and energy into
dealing with the half-assed hex crap.
3) Many of us started during this time period and made do with
what we had (and learned a lot more because of it) - A lot of
us went on to productive lifetime careers in the business - so
there must have been some benefit to our approach.
4) I would argue that in the mid-70's, our approach was in line
with "current" microprocessor technology, and high-end
development systems were "cutting edge" technology - I know
a lotta little (at the time) companies who worked near the
bottom.
5) Learning instruction set encodings, and finding ways to
simplify that and speed up our mental "access time" to it
DID dramatically improve our productivity.
Like writing code in assembler when you could just as
readily
use a HLL.
I'm not even going to go there (I still write a substantial amount of
assembly language).
But, you're still dealing with the hobbyist world.
Every product
*we* shipped was a "single board 808x/4004 machine"... yet, they
didn't "use octal" (and we shipped thousands and thousands
of machines).
Who said that a product had to use Octal (or Hex for that matter)?
I thought we were talking about development methodology. Should
pocket calculators be developed using decimal encodings for the
micro - because the machine needs to work in decimal?
If you're a hobbyist, your time is (often) worth
nothing.
I've watched people disassemble video arcade pieces "by hand"
and reverse engineer all of the copy protection hacks in the
code.
Um, *why*?
Perhaps for the enjoyment, perhaps to learn
Because they are curious and have decided that they
can
AFFORD the time to engage in this activity. But a *business*
would never waste their time on this -- unless there was some
key IP that they were after, etc. (there are firms that expend
a great deal of resources on these sorts of activities!)
Often businesses in this industry grew from roots as a hobby,
especailly during the 70-80s.
Why even
bother with that ... why not just use mouse clicks
and "drag and drop".
Mid 70's. No GUIs. No mice.
And for many of us, no professional development systems.
I never saw it
as a huge waste of "resources" - In the early
You didn't rewrite ("re-bug") WORKING development tools
in a production environment to add these "features".
If you've got an assembler, linkage editor, etc. that all
WORK but produce HEX listings, why rewrite them to spit out
listings in split octal? Including addresses (of opcodes,
arguments, link maps, etc.) Are you going to gain that much
in terms of productivity to offset the time spent doing this?
And the bugs that get introduced in the process?
Who said anything about rewriting development tools?
(Btw - the guy you are talkin to made a career out of writing
development tools).
What I'm talking about is when I got a listing in Octal, I
didn't have a great deal of trouble entering it on my hex
keypad - I could go very quickly down a column of numbers
and turn them into HEX bytes (new column) - and btw, this
was one case where "split octal" was an advantage - I found
it much harder to turn "full octal" addresses into hex.
Did I produce Octal listing for the Hex guys - nope, they
were equally good at translating the other way.
Was it optimal? Nope - but it was the way it was. It would
be great if the world could agree on one spoken/written
language too.
Wouldn't it be better to just live with the hex
listings
and purchase a hex keypad for your "run-time monitor"?
After all, you're only going to build a handful of those...
what's it going to cost you vs. a decimal/octal keypad -- an
extra $10??
Why would the Octal camp guys purchase Hex keypads?
Why would the Hex camp guys purchase Octal keypads?
Was there ever a "decimal camp"? - who used decimal
keypads (actually, I did, with little stickers over +, -, X, /,
C, = to convert them to A-F.
And yes, wouldn't it be better to just live with whatever
listing you get. (or even better - write the tool to produce
what you need in the first place).
Spend the resources that you "wasted"
hacking the toolchain
to purchase another *real* development system. Or, a
symbolic debugger. Etc. Don't sell your adherence to
The Old Ways as a virtue -- concentrate on getting ahead
of the curve and your competition!
We didn't "hack" toolchains - we wrote them. And the Octal
guys wrote tools that worked in Octal, Hex guys wrote tools
that worked in Hex - everyone was happy.
> days, some guys liked Octal, some guys liked hex
- I worked
> mainly in hex, but I didn't have a great deal of trouble going
> back and forth - you were happy just to find someone who
> knew the language - the particular dialect that he chose didn't
> seem all that important at the time.
>
> Clearly the debate can rage on forever - If you like hex, and
> consider it the "only game in town", then thats OK by me. I
> happen to see advantages to both viewpoints.
Nuff said - lets just agree to disagree.
--
dave06a (at) Dave Dunfield
dunfield (dot) Firmware development services & tools:
www.dunfield.com
com Collector of vintage computing equipment:
http://www.parse.com/~ddunfield/museum/index.html