Qbasicnews.com

Full Version: OUT and POKE
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
What's the difference between POKE and OUT (besides the fact that POKE requires DEF SEG and is therefore more flexible)?
PEEK and POKE mess with data in memory. INP and OUT take in and send out data to and fro hardware ports.
Quote:(besides the fact that POKE requires DEF SEG and is therefore more flexible)?

POKE requires DEF SEG because memory is stored in 4 byte addresses, each consisting of a segment and an offset. To save time with the arguments, POKE only accepts one argument, which is the offset. The current segment is defined by DEF SEG.

OUT doesn't need DEF SEG or any other definer, simply because a port value always is integer.
The reason you don't need DEF SEG (or some equivalent thing) with OUT is simply because port numbers are numbered sequentially. Memory addresses, at least in real mode, aren't. That's why you need DEF SEG with POKE--to tell it where to start sequentially numbering offsets from.
Glenn what are you doing here! Did u migrate here as i have?
It seems that you have been around for quite some time now! :oops:
I think it was more of a spreading out than a migration. (Hmmmm. It might be an infiltration.)
Quote:Glenn what are you doing here! Did u migrate here as i have?

He was a saint there. He is god here. :*)

Actually, we just pirated him....

Land ahooy!!!!
Smile
I too am spreading my wings. I am now on qb45.org, qbasic.com, tek-tips.com, qbasicnews.com. 8)