Feedback on my python framework I'm building.

R

Roy Smith

Steven D'Aprano said:
Remember using PEEK and POKE commands with BASIC back in
1978? Pretty much impossible in Python.

But, trivial to implement as an extension :)
 
D

Dave Angel

But, trivial to implement as an extension :)
PEEK and POKE were intended to be used with memory mapped devices.
Simplest example is the 6502 chip, which had no I/O bus -- it was all
memory mapped. Want to change baud rate? poke a byte somewhere.

These days, the only device I can think of that's usually memory mapped
is the video. And few programs talk to it that way.

Now, INP and OUT (or various similar names) were for doing port I/o.
But I suspect that modern systems aren't going to let you do much of
that either.
 
M

MRAB

PEEK and POKE were intended to be used with memory mapped devices.
Simplest example is the 6502 chip, which had no I/O bus -- it was all
memory mapped. Want to change baud rate? poke a byte somewhere.

These days, the only device I can think of that's usually memory mapped
is the video. And few programs talk to it that way.

Now, INP and OUT (or various similar names) were for doing port I/o.
But I suspect that modern systems aren't going to let you do much of
that either.
It depends on the CPU. Some have specialised instructions for I/O,
others don't.
 
R

Roel Schroeven

MRAB schreef:
It depends on the CPU. Some have specialised instructions for I/O,
others don't.

I think Roy Smith meant that the OS on modern systems generally prevents
direct access from user space to either memory mapped I/O or port mapped
I/O. Embedded systems might allow direct access, but AFAIK Python
doesn't run on those.

Best regards,
Roel

--
"Too often we hold fast to the cliches of our forebears. We subject all
facts to a prefabricated set of interpretations. Too often we enjoy the
comfort of opinion without the discomfort of thought."
-- John F Kennedy

(e-mail address removed)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top