can someone help me translate a little module, that I ported from SF:
- Code: Select all
Module RIFE
Public Const endprog As ushort=25
Const SIZE_ARRAY as ushort = 25
public Const cname(size_array) As String = { _
"Acne",_
"Addison Disease",_
"Adenoma",_
"Adenomatous Pol Coli",_
"Adenoviridae Infect.",_
"Adhesions, Pelvic",_
"Adie Syndrome",_
"Adiposis Dolorosa",_
"Adrenal Gland Disea.",_
"Adrenal Hyperplasia",_
"Adrenoleukodystrophy",_
"Afibrinogenemia",_
"Agnosia", _
"Aicardi Syndrome",_
"Alagille Syndrome",_
"Alexander Disease",_
"Alkalosis",_
"Alkaptonuria",_
"Alopecia",_
"Alpha 1 Antitrypsin",_
"Alpha Mannosidosis",_
"Alphavirus Infect. ",_
"Alzheimer Disease",_
"Amaurosis Fugax",_
"Amblyopia",_
}
Const STR_SIZE = SizeOf(cname) / SIZE_ARRAY
' get a name by index, uses 24 bit address...
public Function name(index As ushort) As String(STR_SIZE)
Dim addr As ulong
' get address + offset, then load 24 bit address...
addr = AddressOf(cname) ' address of constant string array
addr = addr + (index * STR_SIZE) ' add the offset
TBLPTRU = addr.Byte2
TBLPTRH = addr.Byte1
TBLPTRL = addr.Byte0
' now read the string...
FSR0 = AddressOf(result)
do
Asm
TBLRD *+
End Asm
POSTINC0 = TABLAT
loop Until TABLAT = 0 ' look for null terminator
TBLPTRU = 0 ' reset upper 8 bits!!...
End Function
End Module
The problem is the names TBLPTRx and FSR0, they are not declared.
How to modify this to suit the FIREWING compiler?
