Results 1 to 4 of 4

Thread: Peek and Poke?

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Feb 2000
    Posts
    22
    Is there a way to perform low level memory functions in basic? Is it the peek and poke commands that I saw somewhere?
    May the source be with you

  2. #2
    Member
    Join Date
    Aug 2000
    Location
    USA
    Posts
    32

    Yes, it is.

    Use the PEEK function to read a byte from memory, and POKE to set one. To set the Data Segment (DS), use DEF SEG

    Example:

    Code:
    DIM I AS LONG, CL AS INTEGER
    
    SCREEN 13  'VGA mode 19:  320x200 256 color
    
    DEF SEG = &HA000 'Point to VGA memory
    
    FOR CL = 1 TO 15
      FOR I = 0 TO 63999
        POKE I, CL  'Set each pixel ...
      NEXT I
    NEXT CL
    
    DEF SEG 'Restore the default
    Yeah. That should work ...
    -Koralt

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Feb 2000
    Posts
    22
    Thanks for the help.
    OB1
    May the source be with you

  4. #4
    Fanatic Member
    Join Date
    Feb 2000
    Location
    Japan
    Posts
    840

    Thumbs up

    or get powerbasic and use pointers which are quicker.
    Paul Dwyer
    Network Engineer
    Aussie In Tokyo

    Using Powerbasic 6 & VB6 SP4 (Please also add your VB Version to your signature!)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width