Main Page | Report this Page
Computers Forum Index  »  Computer - Education  »  Intro to Programming w/ Machine Language
Page 1 of 6    Goto page 1, 2, 3, 4, 5, 6  Next

Intro to Programming w/ Machine Language

Author Message
Eric Mutta
Posted: Mon Feb 07, 2005 6:42 pm
Guest
Jonathan Bartlett wrote:

<snip>

Quote:
Anyway, I thought you all might be interested. I think this is a
really
effective way of teaching programming (or computers, for that
matter)...


....or anything for that matter! Your technique was effective because it
really exploited the fact that humans learn by association. I can bet
you if five years from now one of the ladies is reading up on more
advanced things they'll always recall how much fun they had running
around putting Post-it's in boxes. It may not explain the workings of
an inter-privilege-level context switch through a task gate, but it'll
remind them that it isn't as hard as it seems :-)

<snip>

Quote:
Jon
----
Learn to program using Linux assembly language
http://www.cafeshops.com/bartlettpublish.8640017

Cheers,
Eric Mutta Smile
 
dreamteam
Posted: Mon Feb 07, 2005 8:42 pm
Guest
I shall say your concept is good
 
Randall Hyde
Posted: Tue Feb 08, 2005 4:40 am
Guest
"Jonathan Bartlett" <johnnyb@eskimo.com> wrote in message
news:4207a957$1@news.tulsaconnect.com...
Quote:
I'm teaching at our local community college as an adjunct. They have an
"intro to programming" class which teaches flow charting, logic, and
design principles for new programmers, using mostly pseudo-code rather
than actual programs.

Yep, it works fairly well. Definitely a technique I've used in past courses.
When "machine organization" (i.e., "Baby Architecture") is the main
focus of the course, then this works well. Back in the 16-bit/DOS
days, I actually wrote a little machine interpreter in assembly. For
32-bits/Windows, I wrote the simulator with Delphi so the students
got a nice GUI showing how all the hardware worked. This was
great because under Windows you can have them directly program
things like interrupt service routines, DMA, and so on. But all these
subjects are very easy to emulate.
See
http://webster.cs.ucr.edu/AoA/Windows/HTML/ISA.html
for more details.

Those who are interested can download the AoA examples file,
which includes the "Y86" emulator here:
http://webster.cs.ucr.edu/AsmTools/HLA/dnld.html
(download the sample code for AoA from this page).

The 16-bit edition code can be found here:
http://webster.cs.ucr.edu/AoA/DOS/0_Software.html

Cheers,
Randy Hyde
 
Ben Pfaff
Posted: Fri Feb 11, 2005 6:10 pm
Guest
Jonathan Bartlett <johnnyb@eskimo.com> writes:

Quote:
[...] Anyway, being a believer in knowing assembly language, I
decided to put together a computer simulation. I "designed" a
simplified computer (25 instructions - add, subtract, load,
store, divide, jump, and jump conditional, with a few different
addressing modes for each of them). I had them simulate being
the computer. I had a memory address space as a grid of 255
boxes on posterboard. [...]

I've actually seen this kind of simulation done with relatively
young children--6th graders if I recall correctly. It worked out
really well. I think this is a great way to introduce people to
how computers work internally.
--
"In the PARTIES partition there is a small section called the BEER.
Prior to turning control over to the PARTIES partition,
the BIOS must measure the BEER area into PCR[5]."
--TCPA PC Specific Implementation Specification
 
Randy Howard
Posted: Sat Feb 12, 2005 12:08 am
Guest
In article <873bw3gg6l.fsf@benpfaff.org>, blp@cs.stanford.edu says...
Quote:
Jonathan Bartlett <johnnyb@eskimo.com> writes:

[...] Anyway, being a believer in knowing assembly language, I
decided to put together a computer simulation. I "designed" a
simplified computer (25 instructions - add, subtract, load,
store, divide, jump, and jump conditional, with a few different
addressing modes for each of them). I had them simulate being
the computer. I had a memory address space as a grid of 255
boxes on posterboard. [...]

I've actually seen this kind of simulation done with relatively
young children--6th graders if I recall correctly. It worked out
really well. I think this is a great way to introduce people to
how computers work internally.

I can think of a large number of college graduates that dearly
need such a program right now.

--
Randy Howard (2reply remove FOOBAR)
"Making it hard to do stupid things often makes it hard
to do smart ones too." -- Andrew Koenig
 
George Weisz
Posted: Sat Feb 12, 2005 8:09 pm
Guest
Quote:
I can think of a large number of college graduates that dearly
need such a program right now.



Long long time ago there was a text book by Knuth that had something

like that in the inside of the cover page.....
It may still be in existence....
Good luck
George
 
Guest
Posted: Mon Feb 14, 2005 4:07 am
Jonathan Bartlett wrote:
Quote:
I'm teaching at our local community college as an adjunct. They have
an
"intro to programming" class which teaches flow charting, logic, and
design principles for new programmers, using mostly pseudo-code
rather
than actual programs.

Why not use real code in a readable, high-level language such as
Python? I think that is a better way to intoduce newbies to programming
than pseudo-code or machine language.
 
Guest
Posted: Mon Feb 14, 2005 6:07 am
Quote:
Why not use real code in a readable, high-level language such as
Python? I think that is a better way to intoduce newbies to
programming
than pseudo-code or machine language.

Because then you still have no conception about what the computer is or
does. So many constructs in high-level languages are impacted by the
low-level design. Understanding how a computer works requires thinking
about the programming from the perspective of the computer. Python
doesn't give you that.
 
osmium
Posted: Mon Feb 14, 2005 7:09 pm
Guest
<beliavsky@aol.com> wrote:

Quote:
I'm teaching at our local community college as an adjunct. They have
an
"intro to programming" class which teaches flow charting, logic, and
design principles for new programmers, using mostly pseudo-code
rather
than actual programs.

Why not use real code in a readable, high-level language such as
Python? I think that is a better way to intoduce newbies to programming
than pseudo-code or machine language.

How about because a programmer who can not read a flow chart has a flawed
background?

I think that state diagrams should also be introduced somewhere (later) in
an in-depth study.
 
Brian Harvey
Posted: Mon Feb 14, 2005 9:29 pm
Guest
johnnyb@eskimo.com writes:
Quote:
Why not use real code in a readable, high-level language such as
Python? I think that is a better way to intoduce newbies to
programming
than pseudo-code or machine language.

Because then you still have no conception about what the computer is or
does. So many constructs in high-level languages are impacted by the
low-level design. Understanding how a computer works requires thinking
about the programming from the perspective of the computer. Python
doesn't give you that.

This battle has been fought many times before.

It's true, I agree, that a programmer is not fully educated until
s/he understands how the computer actually carries out a program.

That doesn't imply that the lowest level is the right place to *start*.
Here are two arguments for starting at a higher level of abstraction:

1. Most programmers spend most of their time trying to get a large
system to work; in that context, what counts is the ability to
express the desired behavior using modularity, data abstraction, etc.
Fine-tuning for performance comes later. "It's easier to make a
working program run fast than to make a fast program run correctly."

2. Obsessive attention to small details is a turn-off to many
beginners (perhaps especially women) whose learning style isn't a
good match for that approach, but who might really enjoy computer
science if it is presented, in the beginning, in terms of the
goals an application programmer wants to achieve.

At Berkeley our curriculum is organized on this principle. Our
first course is the (Scheme-based) Abelson and Sussman _Structure
and Interpretation of Computer Programs_, a high-level introduction
to programming paradigms such as functional programming and
object-oriented programming. Our second course, data structures,
is taught in Java, a medium-level language (it's high level in that
it has automatic memory allocation, but low level in that the
programmer is supposed to know things like how many bits in an
integer). And our third course, machine organization, is taught
in C and (MIPS) assembly language, and even an introduction to
hardware (in Verilog), providing the low-level view you favor.

I acknowledge that there are also plausible arguments for moving
in the other direction. But let's not waste time on straw-man
hypothetical curricula that leave out either the high-level or
the low-level view.
 
pH
Posted: Tue Feb 15, 2005 4:07 am
Guest
On Mon, 14 Feb 2005 21:29:35 +0000 (UTC), bh@abbenay.CS.Berkeley.EDU (Brian
Harvey) wrote:

[...]

Quote:
At Berkeley our curriculum is organized on this principle. Our
first course is the (Scheme-based) Abelson and Sussman _Structure
and Interpretation of Computer Programs_, a high-level introduction
to programming paradigms such as functional programming and
object-oriented programming. Our second course, data structures,
is taught in Java, a medium-level language (it's high level in that
it has automatic memory allocation, but low level in that the
programmer is supposed to know things like how many bits in an
integer). And our third course, machine organization, is taught
in C and (MIPS) assembly language, and even an introduction to
hardware (in Verilog), providing the low-level view you favor.

Actually, that doesn't sound too bad.

Quote:
I acknowledge that there are also plausible arguments for moving
in the other direction.

Something which *may* depend on the individual in question, but...
as long as the end result is the same...

Quote:
But let's not waste time on straw-man
hypothetical curricula that leave out either the high-level or
the low-level view.

I've held the opinion that digital electronics (even at the "conceptual"
level) is a... proper foundation for someone interested in being an
honest to goodness programmer. I can't tell you how many people
I've encountered--people who've been schooled in programming,
people whose very *occupation* is programming--who don't know
why we have hexa-decimal numbering (nor, of course, how it relates
to binary).

I was into digital electronics for quite some time before I got into
programming, so... the computer presented no mystery, Plus, when
approaching a task (problem, whatever) from a "binary perspective",
a solution which is *much* more direct, clean, elegant (etc), can quite
often be realized.

So... if it were my job to teach someone programming, I would most
definitely start with digital electronics (at the gate level). Although...
I can appreciate the potential for... different "best foundations", and again,
something which very likely varies per individual.

The curriculum you mention, above, impresses me, and I'd imagine the
use of Verilog is rather effective (sure wish *I* had it, so many years ago).

Jeff

http://www.jefftturner.com
 
Randall Hyde
Posted: Tue Feb 15, 2005 6:06 am
Guest
"Brian Harvey" <bh@abbenay.CS.Berkeley.EDU> wrote in message

Quote:

That doesn't imply that the lowest level is the right place to *start*.
Here are two arguments for starting at a higher level of abstraction:

1. Most programmers spend most of their time trying to get a large
system to work; in that context, what counts is the ability to
express the desired behavior using modularity, data abstraction, etc.
Fine-tuning for performance comes later. "It's easier to make a
working program run fast than to make a fast program run correctly."

Not that I'm disagreeing with your basic premise, but keep in mind
that "working on large systems" is something that comes *long* after
their beginning class. Whether they learn low-level first or high-level
first is irrelevant for this aspect. By the time they start working on
large scale systems, one would hope they've mastered both.

Quote:

2. Obsessive attention to small details is a turn-off to many
beginners (perhaps especially women) whose learning style isn't a
good match for that approach, but who might really enjoy computer
science if it is presented, in the beginning, in terms of the
goals an application programmer wants to achieve.

OTOH, I have also found that most beginners like to understand
the underlying principles. Things make more sense to them at that
point. This isn't an argument for teaching low-level stuff first,
but it is certainly an argument for teaching it very early (e.g., by the
third or fourth course taught in the CS program).

Quote:

At Berkeley our curriculum is organized on this principle. Our
first course is the (Scheme-based) Abelson and Sussman _Structure
and Interpretation of Computer Programs_, a high-level introduction
to programming paradigms such as functional programming and
object-oriented programming. Our second course, data structures,
is taught in Java, a medium-level language (it's high level in that
it has automatic memory allocation, but low level in that the
programmer is supposed to know things like how many bits in an
integer). And our third course, machine organization, is taught
in C and (MIPS) assembly language, and even an introduction to
hardware (in Verilog), providing the low-level view you favor.

Third class is typical for CS programs.
But do keep *one* little thing in mind: Berkeley attracts (actually,
only allows in) very qualified undergraduate students. Trying to
use experiences at Berkeley as a "standard" for everywhere else
is dangerous. Most students are Berkeley are going to be sufficiently
brilliant that they can figure out this stuff on their own (or probably
already know it before even showing up for school. What works
at Berkeley is not, for example, guaranteed to work at Cal Poly
San Luis Obispo or, say, Rio Hondo Community College.
Again, I'm not suggesting that Berkeley's approach won't work
elsewhere, but you won't find too many schools jumping around
in three different languages in the first three classes their students
take.

Quote:

I acknowledge that there are also plausible arguments for moving
in the other direction. But let's not waste time on straw-man
hypothetical curricula that leave out either the high-level or
the low-level view.

Do keep in mind that a relatively well-known guy just across
the bay from Berkeley, one "Donald Knuth", is a big fan of
teaching advanced courses using low-level programming.
He seems to feel that it's the only way for a programmer
to really learn the material. Maybe you've heard of his works?
(The Art of Computer Programming?)
Cheers,
Randy Hyde
 
Jonathan Bartlett
Posted: Wed Feb 16, 2005 12:04 am
Guest
Quote:
That doesn't imply that the lowest level is the right place to *start*.

Here's why I think it's a great place to start:

* Machine language is very concrete. This makes it easy to
_understand_, even if it is hard to _use_ it to solve large problems with.
* People who have never messed with programming often have MAJOR
problems thinking sequentially and exactly. Assembly language breaks
you out of that habit real fast. You can see why the computer needs
instructions so exactly and in sequential order.
* When you learn concepts of other languages, you can see immediately
_why_ they are needed. This promotes curiosity, because you can see as
you learn how everything developed, which will make you curious how
other things develop. If you are just given Java or something "as is",
it tends to limit your question-asking, not extend it.
* Another issue that new programmers have is figuring out how to tie
small operations together to do larger ones. Nothing teaches you that
better than assembly language.


Quote:
1. Most programmers spend most of their time trying to get a large
system to work; in that context, what counts is the ability to
express the desired behavior using modularity, data abstraction, etc.
Fine-tuning for performance comes later. "It's easier to make a
working program run fast than to make a fast program run correctly."

The reasons for teaching assembly language having nothing to do with
speed and everything to do with understanding. In fact, you can
theoretically get better speeds with higher-level languages, because the
type systems can perform optimizations that you won't think of.

Quote:
2. Obsessive attention to small details is a turn-off to many
beginners (perhaps especially women) whose learning style isn't a
good match for that approach, but who might really enjoy computer
science if it is presented, in the beginning, in terms of the
goals an application programmer wants to achieve.

Actually, I've found that the women in my class liked it better than the
men. But that was a pretty small sample. On another note, while I
wouldn't specifically want to turn anyone off to computer science, I do
think we've done WAY too much to coddle students, and it's turned out
lots of bad programmers.

Jon
----
Learn to program using Linux assembly language
http://www.cafeshops.com/bartlettpublish.8640017
 
Jim Clarke
Posted: Wed Feb 16, 2005 2:40 am
Guest
Jonathan Bartlett <johnnyb@eskimo.com> writes:

Quote:
That doesn't imply that the lowest level is the right place to *start*.

Here's why I think it's a great place to start:

* Machine language is very concrete....

Here's why I don't think the lowest level is a great place to start:

* Quantum mechanics takes a good deal of preparation, and even then
you're only just starting to get ready for solid-state physics.

Sarcasm aside, my point is that you have to choose *somewhere* in a
continuum of abstractions and levels; choosing to start at a low
level in programming means choosing to neglect something, and part
of what you're choosing to neglect is mathematical. Students have
considerable difficulty understanding how to abstract, and perhaps
we should start with that, and add implementation details later.
--
Jim Clarke -- Dept. of Computer Science, University of Toronto
http://www.cs.utoronto.ca/~clarke
 
Robert Redelmeier
Posted: Wed Feb 16, 2005 3:39 am
Guest
In alt.lang.asm Jim Clarke <clarke@cs.toronto.edu> wrote:
Quote:
My apologies; I was being careless, and had no intention of
offending assembly-language programmers. I was one myself for

No offense taken, I assure you. ALA is pretty much a
rowdy free-for-all. If you want civility, you have to
go to comp.lang.asm.x86 which is moderated.

-- Robert
 
 
Page 1 of 6    Goto page 1, 2, 3, 4, 5, 6  Next
All times are GMT
The time now is Mon Mar 22, 2010 3:07 pm