please dont rip this site

Language Meta-l Chnkaddr

 'This example requires VGA.
DIM addr AS LONG
DIM oset AS INTEGER
DIM shft AS INTEGER
DIM addrs(256)
DIM shfts(4)
shfts(0) = 1
shfts(1) = 4
shfts(2) = 8
shfts(3) = 64
SCREEN 12
COLOR 2
WIDTH 80, 60
FOR j% = 0 TO 255
        oset = j% MOD 4 'bottom 2 bits is the offset
       
        REM addr = j% ' if we don't play games we address 256 chunks (64k)
       
        shft = 2 ^ (oset * 2) 'offset shifted left 1 is the shift
        addr = j% * shft + oset + 1 'shift left bottom 2 bits * 2 times,
        ' add bottom 2 bits in again and increment

        REM shft = 2 ^ oset 'offset is the shift
        REM addr = (j% - oset) * shft + oset 'mast off bottom 2 bits,
        'shift left bottom 2 bits times and add in the bottom 2 bits.

        addrs(j%) = addr
        IF z% < addr THEN
                z% = addr
                END IF
       
        x% = (addr MOD 256) * 2
        y% = INT(addr / 256) * 2
        IF POINT(x%, y%) = 0 THEN
                COLOR 1
                PSET (x%, y%)
                END IF
        COLOR (POINT(x%, y%) + 1)
        LINE (x%, y%)-STEP(1, 1), , BF

        LOCATE (INT(j% / 16) + 7), ((j% MOD 16) * 5) + 1
        PRINT RIGHT$("0000" + HEX$(addr), 4)

        NEXT j%
FOR j% = 0 TO 255
        FOR k% = 0 TO 255
                IF addrs(j%) < addrs(k%) THEN
                        SWAP addrs(j%), addrs(k%)
                        END IF
                NEXT k%
        NEXT j%

FOR j% = 0 TO 255
        LOCATE (INT(j% / 8) + 24), ((j% MOD 8) * 9) + 1
        PRINT RIGHT$("0000" + HEX$(addrs(j%)), 4); addrs(j% + 1) - addrs(j%)
        NEXT j%
LOCATE 58
PRINT "MAX:", z%



file: /Techref/language/meta-l/chnkaddr.bas, 1KB, , updated: 1999/5/25 11:36, local time: 2017/10/23 06:45,
TOP NEW HELP FIND: 
54.198.143.210:LOG IN

 ©2017 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions?
Please DO link to this page! Digg it! / MAKE! / 

<A HREF="http://www.piclist.com/techref/language/meta-l/chnkaddr.bas"> language meta-l chnkaddr</A>

Did you find what you needed?

  PICList 2017 contributors:
o List host: MIT, Site host massmind.org, Top posters @20171023 RussellMc, Van Horn, David, James Cameron, Sean Breheny, IVP, alan.b.pearce, Neil, David C Brown, Bob Blick, Denny Esterline,
* Page Editors: James Newton, David Cary, and YOU!
* Roman Black of Black Robotics donates from sales of Linistep stepper controller kits.
* Ashley Roll of Digital Nemesis donates from sales of RCL-1 RS232 to TTL converters.
* Monthly Subscribers: Gregg Rew. on-going support is MOST appreciated!
* Contributors: Richard Seriani, Sr.
 

Welcome to www.piclist.com!

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

  .