Miscellaneous



Variables
 
 
Integer% -32768..+32767
floats will be truncated (not rounded) if used for integer arguments
Float -1E100..+1E100 (exclusive), 12 digits
String$ must be sized in declaration, size 1..255
Field[%|$] up to 16 fields for one record may be defined via CREATE/OPEN (max. len. altogether: 255 - no. of fields)
m0-m9 calculator variables (no declaration, keep values after end of program)

Important note:
Mind that any (partial) expression with only integers will result an integer even if stored in a float!
e.g. a%=5 :b%=3
x=a%/b% 1.0
x=flt(a%)/b% 1.66666666667
x=a%/b%*1.0 1.0
x=a%*1.0/b% 1.66666666667

Back to top


Useful Addresses
 
$180,$181 UDG Declaration (see below)
$69,$6A Horizontal scroll delay counter (default: 4)
$6B,$6C Vertical scroll delay counter (default: 10)
$77 Keyboard auto-repeat delay (default: 15)
$78 Keyboard auto-repeat counter (default: 0)
$7C Auto-switch-off flag (default: none-zero)
$20CB,$20CC system counter (incremented every 50 millisecs)
$20CD,$20CE default number of secs to auto-switch-off (default: 300)
$A4 buzzer mute flag (default: zero)
$74 key buffer count (max. 16)
$73 key buffer offset (should be set to 0 before pasting into buffer)
$20B0-$20BF keybuffer
$20C5-$29CA system clock (year,month,day,hour,minute,second)

Note: A comprehensive list of system adresses can be found in Jaap's Machine Code Tutor.

Back to top


Defining a User Defined Graphic (UDG)

UDGs (they'd better be called User Defined Characters) are defined with the UDG command on the LZ or the replacement procedure which is also documented at UDG. Up to 8 characters (CHR$(0)..CHR$(7)) may be defined.

 See the example below to find out how to calculate the parameters:

 

16

8

4

2

1

row
sum
p1%
         
= 6
p2%
         
= 9
p3%
         
= 9
p4%
         
= 12
p5%
         
= 8
p6%
         
= 24
p7%
         
= 31
p8%
         
= 0
Back to top


Tips & Tricks
  Back to top