'-------------------------------------------------------- ' Copyright 1997 MCS Electronics ' demonstration of new future : XRAM support 'THIS ONLY WORKS FOR microcontrollers which can address 'external RAM memory such as the 8031,8032 etc '-------------------------------------------------------- $romstart = &H8000 'ROM enable address located at 0 $ramstart = &H8000 'RAM enable address located at 0 $ramsize = &H1000 '4KB RAM chip '$large 'use this option when error 148 occurs Dim Bx As Xram Byte , B1 As Xram Byte , A As Xram Byte'specify XRAM so it will be located in external RAM space Dim Cx As Xram Integer Dim Wx As Xram Word Dim S As Xram String * 10 Declare Sub Test(a As Xram Byte , B1 As Xram Byte)'declare the subs 'The external variables can be used as "normal" variables S = "123" Bx = Val(s) + Val(s) : Print Bx Bx = 50 : Cx = 1000 Wx = Bx * Cx Print Wx Call Test(1 , B1) 'call sub with parameters Print B1 Test 1 , B1 'call without CALL statement Print B1 End 'end your code with the subprograms 'note that the same variables must be used as the declared ones 'also note that variables are global Sub Test(a As Xram Byte , B1 As Xram Byte)'start sub Print A ; " " ; B1 'print passed variables B1 = 3 End Sub