• Hello!

    Either you have not registered on this site yet, or you are registered but have not logged in. In either case, you will not be able to use the full functionality of this site until you have registered, and then logged in after your registration has been approved.

    Registration is FREE, so please register so you can participate instead of remaining a lurker....

    Please be certain that the location field is correctly filled out when you register. All registrations that appear to be bogus will be rejected. Which means that if your location field does NOT match the actual location of your registration IP address, then your registration will be rejected.

    Sorry about the strictness of this requirement, but it is necessary to block spammers and scammers at the door as much as possible.

Correspondence lag time........

Wow, this makes me wish I knew something about programming (besides QBasic from high school! lol.) As a network administrator I only use binary for sub and super netting IP addresses but Rich's 01 makes more sense to me than Kat's 10. That could just be because I was taught to use binary in a different way but to me 01 is 2 in decimal format. I was taught that in one octet of an IP address:

01 would equal 2 in decimal (because you can have that one bit on or off...01 or 00)
10 would equal 4 in decimal (because you can have both bits off, the first bit on and the second bit off, the second bit on and the first bit off, and both bits on.....00, 01, 10, and 11)

Am I wayyyy off base here or what?

Oh, and PS: Sorry for using forum space for such drivel Rich but this is bothering me now! Lol.
 
Counting...

The way counting systems work is that each digit in the number exists in a "place" which determines its actual value. The value of any digit is "(value of that digit) X (base to the nth power)"

So in the decimal system, you have the ones place (10^0), the tens place (10^1), the hundreds place (10^2) etc.

In the binary system, you have the ones place (2^0), the twos place (2^1), the fours place (2^2) etc.

In the Hexadecimal system you have the ones place (16^0) the sixteens place (16^1) the two-fifty-six place (16^2) etc.

(Notice the Ones place is common to all counting systems because anything to the zero power equals one)

In any number system, you start with zero (universally represented by zeroes in every "place") and count up from there by incrementing the ones place one at a time. When the ones place has reached its limit, you add one to the next place up, and wrap the ones place back to zero.

If "01" = 2, then it necessitates that the first place in the binary counting system is the twos place? So how do you represent the value 1? If you say "00" binary = 1 dec, then how do you represent the number zero in binary?

I know that you know that IP addresses do not go from 1 to 256, but from 0 to 255, so in that case, how exactly are you supposed to represent the value zero?

As I mentioned, in reality this can be interpreted differently depending on the actual hardwiring of the transistors of the memory and CPU, or based on how a particular compiler interprets these numbers, but in all of my experience I've never seen or heard of anything where the number "0" in ANY counting system should EVER represent anything other than zero.

But then, seeing how the skewl systems teach things, it would not surprise me that this might be taught instead of an actual understanding of how binary counting really works... I mean it's not like they even teach people how to count in decimal, it would be silly to expect them to teach how to count in binary.
 
OK, it's late and I'm sure all of my brain cells aren't still awake.

But I believe what started as a computer geek joke has gotten way out of hand.

Programming is often the art of looking at the world at a different angle. Memory addressing and the way the data is accessed and manipulated at the machine level can be an interesting exercise when you are free of any constraints other than those that you devise yourself. This discussion brings back thoughts I haven't had to think about a quite some time.

When you look at memory (and the way the cells are counted) by value, there can certainly be a zero value in any given location. So the value within the cell must necessarily start at zero. But if you look at memory by reference, there is no such thing as a 'zero' memory location, because be definition, memory must have at least one cell that can hold a value. Therefore, all references to memory must start relative to the first position in addressable memory. Be value, 8 bits used as an address can reference 256 discreet locations (0 thru 255). Consider this a pointer that holds a value that references a cell in memory. Thinking of these as an array (which actually they are - a single dimension array), and referencing them (which actually means COUNTING the locations, there can be no such thing as a zero location, because that would mean that the array does not exist. The array must have at least one element to exist. So the reference is 1 thru 256. The pointer to the array cannot contain a value of zero (not unless you want a memory leak), because it would reference a memory cell outside of the array. In many instances this sort of problem is referred to as a 'crash', if the programming language being used is not designed to catch this sort of program. The older assembler I used would quite happily allow you to crash and burn if you tried a stunt like this, particularly if you were using the pointer to reference a stack. Since I was saving my work on a 300 baud audio tape, I learned to be REAL careful.

I guess that's enough of this for me. But it's certainly been fun thinking about things I haven't had to ponder for at least 20 years.
 
Rich Z said:


I bought my first computer in 1978 and cut my teeth on Z80 assembler. .


Hmmm in "78" I was three and was cutting my real teeth. Sorry I just had to add something here since I am oh so lost reading this stuff! Hope I didn't make ya feel old Rich:p
 
I bought my first computer in 1978 and cut my teeth on Z80 assembler. .

Hmm, or was that 8080 assembler coding?

I remember it was an Exidy Sorcerer computer that I got. I was really looking for the hot new 4mHz Z80 chip but this one only came with a 2 mHz one. The salesman said there was absolutely no need to have that much power in a home situation with a computer, so the 2 mHz would suit me fine. Plus I got the optional memory add-on and had 32 kilobytes of RAM. I was told this much RAM would last my entire lifetime.

Anyway, the reason I started puttering around with assembled was because I bought a floppy disk subsystem for this computer from Thinker Toys (dual 8 inch floppy disks, mind you) and it didn't work. I loaded the disassembler and looked over the code to discover that they had written the program interfacing the disks so that the calls that were supposed to be going to the video were calling the keyboard routine instead. Obviously the code could never have been tested before it was sent to me.

While I was waiting for them to fix the problem and burn a new ROM, I started writing my own disk diagnostic routines with the assember. Couldn't do much else with it at the time, and I liked to putter around.

I wonder what the instruction set for the Pentium looks like? I can remember thinking that the jump from 8080 to 8086 seemed like a quantum leap at the time............

My next computer was the NEC APC with an 8086 and 8087 math coprocessor. At the time I played around with C and Pascal, and discovered that Pascal was not only faster, but it was the only language available at the time that could access the math coprocessor as well as the graphics system of the computer. Plus it was just a more elegant language than C. Wish I had kept up with working in it...........
 
My god. And here I thought I was an old hand when it came to computers. My first machine was a TRS80, Followed up by my favorite computer of all time. The Commodore-64. Followed up by a C-128, C-128D and every Amiga in existence.

Anyone remember the old Fast load cartridge for the C-64? That and my trusty 300Baud VIC modem. lol.
 
I don't get it...

BTW the oldest thing I ever used was in electronics classes... we had an old switch-based machine (dunno the model) and it had address and value switches and you would read/write values from each address in memory with those. It also had a manual clock... you flipped a switch to make the machine execute one machine cycle and load that value in memory (as opposed to it constantly going at millions per second) Really interesting stuff!

The Radar set I worked on in the Air Force did not even have a CPU, it was a huge chain of logic and a simple counter. There were AND gates hooked to specific lines on the counter so that specific "events" would be initiated at specific counts. Gigantic trails of cascading logic circuits then controlled every "event" such as turning the transmitter on and off, drawing the actual blips on the screen, etc. It was like having a hard-wired program. Every "line of code" was actually physically present as a hard-wired logic circuit. Each "subroutine" was a chain of components.

Thinking of these as an array (which actually they are - a single dimension array), and referencing them (which actually means COUNTING the locations, there can be no such thing as a zero location, because that would mean that the array does not exist. The array must have at least one element to exist. So the reference is 1 thru 256. The pointer to the array cannot contain a value of zero (not unless you want a memory leak), because it would reference a memory cell outside of the array.

When I worked in assembly, if I wanted a 1-D array, say for example I had an array of 10 1-byte values, and I had those 10 bytes free at addresses $0100 through $0109, I would use direct indexed addressing to access the array.

So for example if I wanted to grab the value of any item in that array, IIRC I would LDX with the index value from zero to nine (or use a memory location, such as another var, to hold the index) and then get the value from $0100 (direct indexed) which would return the value at memory address "$0100 + (X)".

I don't see how "zero" is impossible. I don't even believe "10" (decimal) is impossible, or would generate any kind of error either, unless some other piece of code actually allocates specific bytes to the array and then checks to see if the array is accessed with an index of something other than any of those values. But it's not as if the CPU is not capable of addressing that address in memory.

(Wow, what an incredible waste of processing time, no wonder so many languages are so ridiculously inefficient. It's like watching Norton flick his hands around for 5 minutes before doing anything.)

Must have been some bizarre totally anti-intuitive stuff you had to deal with. I don't think I would have liked it.
 
and moved up to a C=64 and learned assembly on that. (I believe that was also a Z80 chip.

I had to check on this one. Nope. The Commodore 64 used the 6510 processor chip.

Must have been some bizarre totally anti-intuitive stuff you had to deal with. I don't think I would have liked it.

Nah, the languages were pretty standard (BASIC, C, PASCAL, etc), it's just that I didn't follow the rules about how to use those tools. Many problems that resist being solved finally relented when I just looked at them from a different angle. Even the programmers that wrote a language don't know all of the possibilities. Heck I discovered that the old original Microsoft BASIC allowed the equality operator to be an assignment operator interchangeably in many cases. This was not documented anywhere and came in right handy at times. Those of you whom know BASIC certainly know the MID$ function and how it can be used to query a string for a substring. What was interesting was that you could also use it to stuff a character string value INTO a string. FoxPro (a database language that was about my favorite to work with) actually has a STUFF function that does exactly this operation.

Anyway, I guess the point of that was that not everyone evidently has the capability to look at something from an oblique angle. In a job interview I once had, my prospective employer called me a 'visual' because of the way I see things in print and make them images in my mind. I could never understand how someone could not enjoy reading until it dawned on me that to them, they were only looking at printed letters on a page. To this day, I have a hard time recalling if I just read the book or saw the movie of many books I have read because to me it was all the same.

Dang, it's nearly 5am already. Got to get some shuteye, I guess.
 
Back
Top