Re: [Tutor] Bit-level field extraction

2006-05-17 Thread S W Collier
On Tuesday 16 May 2006 22:41, Alan Gauld wrote:
> > Heh, you and me both.  I cut my teeth on IBM System/370
> > assembler. Last
> > time I had a job where I actually did programming as part of it,
> > it was
> > System/390 machine code.  That's right, machine code, not
> > assembler; I'd
> > directly type my hexadecimal programs into low storage at the
> > operator's
> > console.
>
> Hah, if you haven't bootstrapped a VAX using the toggle switches on
> the front panel you ain't a real progammer ;-)
>
> Actually one of our local Universities still starts their computer
> science
> courses by teaching students how to do that, before moving them
> onto machine code, assembler, C and finally Java(*). It's like an
> historical tour
> of computing/programming. The machine code is done on little hex
> keypads with pocket calculator style printout rools! Its only when
> they
> get to C that they get to use a PC!
>
> (*) Actually they get to choose from several languages in their 4th
> (final)
> year, including Lisp and Prolog(both), Haskell and PL/SQL...
> They consistently produce very good graduates, so it seems to work.
>
> Alan G

You chaps are making me nostalgic; days of the 8080A/Z80/F8/6800 when 
I built my first computer. In those days 2K of memory was considered 
large for a personal computer.
 Stan.

___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Bit-level field extraction

2006-05-16 Thread S W Collier
On Tuesday 16 May 2006 16:01, Alan Gauld wrote:
> Terry,
>
> Your approach is fine. Personally however I'd just have defined
> some constants and done a direct bitwise and - this is the
> approach used in the stat module:
>
> VMASK = 0x14  # 00011000
> VER00 = 0x00
> VER01 = 0x04
> VER10 = 0x10
> VER11 = 0x14
>
> version = byte & VMASK
> if version == VER00: #do something
> elif version == VER01: # do another

> Alan Gauld

Whoops, a typo I think. VMASK = 0x18  #00011000
  orVMASK = 0x14  #00010100
 Stan

___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


[Tutor] Database topic now fixed

2006-05-14 Thread S W Collier
Alan,
Does that mean you will soon fix the tutor.tgz :-)
Thanks for all the hard work you put into this.
Stan.

___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor