But you can't do that in Pasm
Beau Schwabe
Posts: 6,568
I hinted about the ability to do something like this in my last post, so I thought
why not, make the whole program that way.
This code requires the LED setup equivalent to that on a Propeller Demo Board.
Again, this is just an academic exercise that forces you to look at the code in a
different way. Assembly language is just a symbolic representation of what you see
below.
Makes you appreciate Assembly huh? ... When I started out with computers in the
late 70's early 80's, I would hard code stuff like this, only I worked it out on
paper first.
why not, make the whole program that way.
This code requires the LED setup equivalent to that on a Propeller Demo Board.
Again, this is just an academic exercise that forces you to look at the code in a
different way. Assembly language is just a symbolic representation of what you see
below.
Makes you appreciate Assembly huh? ... When I started out with computers in the
late 70's early 80's, I would hard code stuff like this, only I worked it out on
paper first.
CON _CLKMODE = XTAL1 + PLL16X _XINFREQ = 5_000_000 PUB PasmTest cognew(@Entry,0) DAT Entry long %01011000_11111111_11110000_11111000 long %10100000_11111111_11110100_00000001 byte temp1 ,%11101100,%10111111,%10100000 temp2 long %10100000_11111111_11111000_00000000 temp3 cmp temp4 , phsa wc byte temp3 ,%00000000,%01001100,%01011100 byte temp1 ,%11101000,%10111111,%10100000 long %10100000_11111111_11111000_00000000 Loop2 cmp temp4 , phsa wc byte Loop2 ,%00000000,%01001100,%01011100 long %10100000_11111111_11101000_00000000 byte temp2 ,%00000000,%01111100,%01011100 temp1 long %00000000_11111111_00000000_00000000 temp4 long %00000010_00000000_00000000_00000000
Comments
I once worked at a place with a system like this:
1) Think of what you want your program to do.
2) Write your program on paper in pseudo code, looks like ALGOL.
3) Convert that pseudo code to assembler, on paper.
4) Convert that assembler to HEX opcodes, data etc. On printed paper coding sheets.
5) Have a data entry girl type that into a machine and make a paper tape from it.
6) Blow PROMS from tape, insert PROMS to target and test.
7) Find bugs, fix code and start again at step 1, 2, 3, 4, 5, 6 as appropriate.
For production code most of those steps had to be reviewed and signed off by 2 other engineers and then slipped through the quality control department.
That's forgetting step 0) where you have to work up a design specification document first but that's a whole other nightmare.
"And you try and tell the young people of today that ..... they won't believe you."
Nice example Beau btw! and yes, it does make you appreciate assembly!
I also noticed, you did sneak a couple of CMPs in there lol
Good example Beau.
J
I'm surprised nobody has invoked the term "machine language", which is what this is. Assembly language is one layer up, where a program ASSEMBLES human mnemonics into machine language, which is the numbers shown.
http://www.computermuseumgroningen.nl/motorola/mek6800d2.html
It cost me £209 (quite a lot of money in 1976), and I had to put it together myself. I wrote my programs in assembler and hand-assembled them. I wrote a little program to calculate relative branch offsets, which made things easier.
There would normally only be two lines of code:
That last line would sometimes fill up the screen with seemingly random characters and even words (actually BASIC commands.)
Bill
Heater,
I'm 30 and I believe you. Of course I tended to enjoy learning about all kinds of tech stuff thanks to my grandpa. I grew up looking at all of his old tv and radio repair equipment in his garage. I'm probably the only 30yr old that has a vaccum tube tester and knows what it is.
I do like the fact that I never had to stuff a paper reel into a computer in order to run a program though.
So, I tip my hat and have a lot of respect of those that have worked on the earlier computers ie...building, programing, and such. New computers and lots of handy software has made thing a lot eaiser these days.
Well I like to think I'm not so ancient yet:)
I just happened to enter the scene at the tail end of the glorious times of mini/mainframe computers, mechanical teletypes, punched cards and tapes, 300 baud modems, 8 inch floppy drives. The micro-processors were just on the verge of taking over everything. Those were Motorola 6809s we were using in the description above after all.
However I am old enough to actually want to get my hands on a paper tape punch and perhaps a high speed optical reader to load up my Propellers:)
I remember me and a friend in high school saying that when we got out of school, we were going to have our own computer with 8Mb of ram! It's amazing how technology has changed. I was telling my friends dad about the propeller and it's languages. He was pretty impressed with it. He programed back in 70's with his job. I told him I wanted to learn ASM and he keeps telling me how easy it is. Of course, he knows how to write machine code too. That may be why he's telling me ASM is easy.
Leon,
The first programming language I learned was 6800 on a D2. It was a great system to really learn how hardware and software interact. Just hearing D2 brings back a lot of fond memories.
Jim...
You might be interested as well in the following where someone was using "magnetic core memory" with his microcontroller...
http://forum.sparkfun.com/viewtopic.php?f=14&t=23070
FYI - Magnetic core memory...
http://en.wikipedia.org/wiki/Magnetic_core_memory
My boss told stories about entering programs in machine code on GE's Univac computer.
GE was the first business sale of the Univac (1954).
When I started, GE still had GE 400 computers with no disk drives - just tape. We wrote Cobol, RPG or assembler programs on coding pads which where sent to another building (via hand delivered office mail) to be keypunched, loaded and compiled. You might manage two compiles a day.
For emergencies fixes, my boss would patch the object deck with punch cards and fix the source code deck later.
They also had a new Honeywell and soon we got terminals with read/write casssettes to replace paper tape punch terminals.
Ah, the good ol' days - NOT!
All this reminds me of my father explaining to me how core memory worked when I was 10 years old. I had just been reading a book from the childrens library that described how to build some kind of calculating device from rotary telephone dials and such. So that was fascinating for me at the time. Much to the chagrin of my mother who would have preferred I picked up something more literary at that library.
All this talk makes me want to pick up some FRAMs. Saves all that stitching...
I love all of the "old history" talk. I learn lots from it. For instance...this talk of "core memory" got me wondering and I looked it up. WOW! It's pretty impressive. I never new what it was or what it looked like until today. Thank's guys, you taught a new guy some more good stuff. It makes you appreciate what we have today to work with. Although, after reading about core memory and what it's capable of as far as being non-volitile and resistant to EMP makes it look better than what we have today.
What ever happenend to magnetic bubble memory? I thought that was cool.
-Steve
Oh, and if it ever crashed HP would send out a technician who would figure out what was wrong with it and fixed it. Too bad it cost almost $40,000 in 1974.
http://old-computers.com/history/detail.asp?n=9&t=3
I had the 'luxury' of playing with one of the 5110's only because my dad had one at the office.
I wrote an emulation which was fully validated to run on hand-coded 486 33MHz. Sometime soon I will convert/rewrite the emulation to run on my RamBlade Prop. Imagine my $40 prop running faster that my $200,000 garage-length mini.
Leon: I started micros on a D1 then D2. I recall I bought an assembler rom which made life simpler before I wrote a cross-compiler on my mini. I bought my own 18mth old mini in 1977 - it was the length of my garage and I housed it there in an airconditioned room I built. It was fully operational and used regularly until 2000. My first micro exposure was actually an 8008 although by the time I gathered all the part to build a micro based on this the 6800 was so much simpler.
From memory, the D1 had an ACIA (6850) for 20mA current loop serial interface, a PIA (6820) for 20 parallel I/Os, and 128B RAM (6810).. yes 128 Bytes in a chip. All for $192 and don't forget money is 20x that today.
So, the Prop ProtoBoard is a steal !!!!
Apologies Beau - this is way OT.
Ah, the 5110. My first job was programming its predecessor... the 5100.
In BASIC. 2 character (max) variable names... and the 2nd could only be a digit.
Extremely unfond memory: for some (unknown) reason, IBM decided that character variables (strings) were to be all the same length... 18 characters. The story I heard was that this was the "average" length of character variables in some analysis they did (may or may not be true).
This made string handling VERY interesting. Say you needed up to 50 characters for a report title... so you'd use 3 variables (18, 18, and 14 characters of the last variable). Now write the code to center that 1 to 50 character title on a report... Bonus points for clear and concise comments on how it works.
Of course, comments used up your ram... so when you started to run out of memory (easy to do with only 32K) they were the first thing to go...
That was one of the major issues that IBM fixed when they came out with the 5110. Of course, by that time my mind was already warped.
Pretty wild.
Those REM lines used to drive me crazy when I did not know what they were for. I also thought they were random... no they were not ! . The ZX81 hat a "LET" keycode
Some games where quite clever and did not let you see the "code" in those lines...
I came late to the game because my first computer (1985) was a brazilian TK-85 with 16 KB RAM (a ZX-81 clone) without ULA, the brazilians had replaced it with discrete logic !
Ale
Yep, you could drop in the equivalent of a CR-LF sequence in there and the editor would stop displaying the code, but it would still execute. The only problem with that technique was that you had to modify it after the program was 100% working, otherwise, you'd have to type it all back in by hand again. (Or load from cassette from your previous save.)
Also, you're right about the LET... the first line should be 10 LET A=USR...
Bill
Just think. When all us young-uns are old geezers we will be telling the young-uns about the 2 TB platters hard drives and how we used to have to actually type code in languages and hook up wires to peripherals, and view everything on a monitor.