File size: 324 Bytes
a2a15a2
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
10 REM "Elementary malloc demo"
20 REM ""
100 PRINT "Allocate 16 bytes of memory with identifier 1"
110 M=MALLOC(1, 16)
120 PRINT "Address of memory segment", M
200 PRINT "Storing data"
210 FOR I=0 TO 15
220 POKE M+I, I*2 
230 NEXT I 
300 PRINT "Retrieving data"
310 FOR I=0 TO 15
320 PRINT I, PEEK(M+I)
330 NEXT I 
400 END