- •Table of Contents
- •Index
- •Keyword Reference
- •Installation
- •Installation of BASCOM
- •BASCOM IDE
- •Running BASCOM-AVR
- •File New
- •File Close
- •File Save
- •File Save As
- •File Print Preview
- •File Print
- •File Exit
- •View PinOut
- •View PDF viewer
- •View Error Panel
- •Edit Undo
- •Edit Redo
- •Edit Cut
- •Edit Copy
- •Edit Paste
- •Edit Find
- •Edit Find Next
- •Edit Replace
- •Edit Goto
- •Edit Toggle Bookmark
- •Edit Goto Bookmark
- •Edit Indent Block
- •Edit Unindent Block
- •Edit Remark Block
- •Program Compile
- •Program Syntax Check
- •Program Show Result
- •Program Simulate
- •Program Send to Chip
- •Tools Terminal Emulator
- •Tools LCD Designer
- •Tools LIB Manager
- •Tools Graphic Converter
- •Tools Stack Analyzer
- •Tools Plugin Manager
- •Tools Batch Compile
- •Options Compiler
- •Options Compiler Chip
- •Options Compiler Output
- •Options Compiler Communication
- •Options Compiler I2C, SPI, 1WIRE
- •Options Compiler LCD
- •Options Communication
- •Options Environment
- •Options Simulator
- •Options Programmer
- •Supported Programmers
- •ISP programmer
- •PG302 programmer
- •Sample Electronics cable programmer
- •KITSRUS Programmer
- •MCS Universal Interface Programmer
- •STK500 Programmer
- •Lawicel BootLoader
- •AVR ISP Programmer
- •USB-ISP Programmer
- •MCS Bootloader
- •Options Monitor
- •Options Printer
- •Window Cascade
- •Window Tile
- •Window Arrange Icons
- •Window Minimize All
- •Help About
- •Help Index
- •Help MCS Forum
- •Help MCS Shop
- •Help Support
- •Help Knowledge Base
- •Help Credits
- •BASCOM Editor Keys
- •Program Development Order
- •PlugIns
- •Font Editor
- •PinOut
- •BASCOM HARDWARE
- •Additional Hardware
- •AVR Internal Hardware
- •AVR Internal Registers
- •AVR Internal Hardware TIMER0
- •AVR Internal Hardware TIMER1
- •AVR Internal Hardware Watchdog timer
- •AVR Internal Hardware Port B
- •AVR Internal Hardware Port D
- •Adding XRAM
- •Attaching an LCD Display
- •Memory usage
- •Using the 1 WIRE protocol
- •Using the SPI protocol
- •Power Up
- •Chips
- •ATtiny22
- •ATtiny13
- •ATtiny15
- •ATtiny25
- •ATtiny45
- •ATtiny85
- •ATtiny26
- •ATtiny2313
- •ATMEGA8
- •ATMEGA16
- •ATMEGA32
- •ATMEGA48
- •ATMEGA88
- •ATMEGA168
- •ATMEGA64
- •ATMEGA103
- •ATMEGA128
- •ATMEGA161
- •ATMEGA162
- •ATMEGA163
- •ATMEGA165
- •ATMEGA169
- •ATMEGA323
- •ATMEGA603
- •ATMEGA8515
- •ATMEGA8535
- •BASCOM Language Fundamentals
- •Changes compared to BASCOM-8051
- •Language Fundamentals
- •Mixing ASM and BASIC
- •Assembler mnemonics
- •Reserved Words
- •Error Codes
- •Newbie problems
- •Tips and tricks
- •ASCII chart
- •BASCOM Language Reference
- •$BAUD
- •$BAUD1
- •$BOOT
- •$CRYSTAL
- •$DATA
- •$DEFAULT
- •$EEPLEAVE
- •$EEPROM
- •$EEPROMHEX
- •$EXTERNAL
- •$FRAMESIZE
- •$HWSTACK
- •$INCLUDE
- •$INITMICRO
- •$LCDPUTCTRL
- •$LCDPUTDATA
- •$LCDRS
- •$LCDVFO
- •$LOADER
- •$LOADERSIZE
- •$NOCOMP
- •$NOINIT
- •$NORAMCLEAR
- •$PROG
- •$PROGRAMMER
- •$REGFILE
- •$ROMSTART
- •$SERIALINPUT
- •$SERIALINPUT1
- •$SERIALINPUT2LCD
- •$SERIALOUTPUT
- •$SERIALOUTPUT1
- •$SWSTACK
- •$TIMEOUT
- •$TINY
- •$WAITSTATE
- •$XRAMSIZE
- •$XRAMSTART
- •1WIRECOUNT
- •1WRESET
- •1WREAD
- •1WSEARCHFIRST
- •1WSEARCHNEXT
- •1WVERIFY
- •1WWRITE
- •ACOS
- •ALIAS
- •ASIN
- •BASE64DEC
- •BASE64ENC
- •BAUD
- •BAUD1
- •BINVAL
- •BIN2GRAY
- •BITWAIT
- •BITS
- •BLOAD
- •BSAVE
- •BUFSPACE
- •BYVAL
- •CALL
- •CHECKSUM
- •CIRCLE
- •CLEAR
- •CLOCKDIVISION
- •CLOSE
- •CLOSESOCKET
- •CONFIG
- •CONFIG 1WIRE
- •CONFIG ACI
- •CONFIG ADC
- •CONFIG ATEMU
- •CONFIG BCCARD
- •CONFIG CLOCK
- •CONFIG CLOCKDIV
- •CONFIG COM1
- •CONFIG COM2
- •CONFIG COMx
- •CONFIG DATE
- •CONFIG DCF77
- •CONFIG DEBOUNCE
- •CONFIG I2CDELAY
- •CONFIG I2CSLAVE
- •CONFIG INPUT
- •CONFIG INTx
- •CONFIG GRAPHLCD
- •CONFIG KBD
- •CONFIG KEYBOARD
- •CONFIG LCD
- •CONFIG LCDBUS
- •CONFIG LCDMODE
- •CONFIG LCDPIN
- •CONFIG PORT
- •CONFIG PRINT
- •CONFIG PRINTBIN
- •CONFIG PS2EMU
- •CONFIG RC5
- •CONFIG SDA
- •CONFIG SCL
- •CONFIG SERIALIN
- •CONFIG SERIALIN1
- •CONFIG SERIALOUT
- •CONFIG SERIALOUT1
- •CONFIG SINGLE
- •CONFIG SPI
- •CONFIG SERVOS
- •CONFIG TCPIP
- •CONFIG TIMER0
- •CONFIG TIMER1
- •CONFIG TIMER2
- •CONFIG TWI
- •CONFIG TWISLAVE
- •CONFIG WAITSUART
- •CONFIG WATCHDOG
- •CONFIG X10
- •CONFIG XRAM
- •CONST
- •COSH
- •COUNTER0 and COUNTER1
- •CPEEK
- •CPEEKH
- •CRYSTAL
- •CURSOR
- •DATA
- •DAYOFWEEK
- •DAYOFYEAR
- •DATE$
- •DATE
- •DEBUG
- •DEBOUNCE
- •DECR
- •DECLARE FUNCTION
- •DECLARE SUB
- •DEFxxx
- •DEFLCDCHAR
- •DELAY
- •DISABLE
- •DISKFREE
- •DISKSIZE
- •DISPLAY
- •DO-LOOP
- •DriveCheck
- •DriveGetIdentity
- •DriveInit
- •DriveReset
- •DriveReadSector
- •DriveWriteSector
- •DTMFOUT
- •ECHO
- •ELSE
- •ENABLE
- •ENCODER
- •EXIT
- •FILEATTR
- •FILEDATE
- •FILEDATETIME
- •FILELEN
- •FILETIME
- •FLUSH
- •FORMAT
- •FOR-NEXT
- •FOURTHLINE
- •FRAC
- •FREEFILE
- •FUSING
- •GETADC
- •GETATKBD
- •GETATKBDRAW
- •GETDSTIP
- •GETDSTPORT
- •GETKBD
- •GETRC
- •GETRC5
- •GETTCPREGS
- •GETSOCKET
- •GLCDCMD
- •GLCDDATA
- •GOSUB
- •GOTO
- •GRAY2BIN
- •HEXVAL
- •HIGH
- •HIGHW
- •HOME
- •I2CINIT
- •I2CRECEIVE
- •I2CSEND
- •I2START,I2CSTOP, I2CRBYTE, I2CWBYTE
- •IDLE
- •IF-THEN-ELSE-END IF
- •INCR
- •INITFILESYSTEM
- •INITLCD
- •INKEY
- •INPUTBIN
- •INPUTHEX
- •INPUT
- •INSTR
- •ISCHARWAITING
- •KILL
- •LCASE
- •LCDAT
- •LCDCONTRAST
- •LEFT
- •LINE
- •LINE INPUT
- •LTRIM
- •LOAD
- •LOADADR
- •LOADLABEL
- •LOADWORDADR
- •LOCAL
- •LOCATE
- •LOOKDOWN
- •LOOKUP
- •LOOKUPSTR
- •LOWERLINE
- •MAKEBCD
- •MAKEINT
- •MAKEDEC
- •MAKETCP
- •MEMCOPY
- •NBITS
- •ON INTERRUPT
- •ON VALUE
- •OPEN
- •PEEK
- •POKE
- •POPALL
- •POWER
- •POWERDOWN
- •POWERSAVE
- •PRINTBIN
- •PSET
- •PS2MOUSEXY
- •PULSEIN
- •PULSEOUT
- •PUSHALL
- •RC5SEND
- •RC5SENDEXT
- •RC6SEND
- •READ
- •READEEPROM
- •READMAGCARD
- •RESET
- •RESTORE
- •RETURN
- •RIGHT
- •ROTATE
- •ROUND
- •RTRIM
- •SECELAPSED
- •SECOFDAY
- •SEEK
- •SELECT-CASE-END SELECT
- •SETFONT
- •SETTCP
- •SETTCPREGS
- •SENDSCAN
- •SENDSCANKBD
- •SERIN
- •SEROUT
- •SETIPPROTOCOL
- •SHIFT
- •SHIFTCURSOR
- •SHIFTIN
- •SHIFTOUT
- •SHIFTLCD
- •SHOWPIC
- •SHOWPICE
- •SINH
- •SOCKETCONNECT
- •SOCKETLISTEN
- •SOCKETSTAT
- •SONYSEND
- •SOUND
- •SPACE
- •SPIIN
- •SPIINIT
- •SPIMOVE
- •SPIOUT
- •SPLIT
- •START
- •STCHECK
- •STOP
- •STRING
- •SYSSEC
- •SYSSECELAPSED
- •SYSDAY
- •SWAP
- •TCPCHECKSUM
- •TCPREAD
- •TCPWRITE
- •TCPWRITESTR
- •TANH
- •THIRDLINE
- •TIME$
- •TIME
- •TOGGLE
- •TRIM
- •UCASE
- •UDPREAD
- •UDPWRITE
- •UDPWRITESTR
- •UPPERLINE
- •VARPTR
- •VERSION
- •WAIT
- •WAITKEY
- •WAITMS
- •WAITUS
- •WHILE-WEND
- •WRITE
- •WRITEEEPROM
- •X10DETECT
- •X10SEND
- •#IF ELSE ENDIF
- •International Resellers
- •International Resellers
- •ASM Libraries
- •EXTENDED I2C
- •MCSBYTE
- •MCSBYTEINT
- •TCPIP
- •LCD4BUSY
- •GLCD
- •GLCDSED
- •LCD-EPSON
- •AVR-DOS File System
- •CF Card
- •Compact FlashCard Driver
- •Elektor CF-Interface
- •XRAM CF-Interface for simulation
- •New CF-Card Drivers
- •Floating Point
- •FP_TRIG
- •DOUBLE
- •I2C SLAVE
- •I2CSLAVE
- •I2C TWI Slave
- •SPISLAVE
- •DATE TIME
- •EUROTIMEDATE
- •DATETIME
- •PS2-AT Mouse and Keyboard Emulation
- •AT_EMULATOR
- •PS2MOUSE_EMULATOR
- •BCCARD
- •BCCARD
- •BCDEF
- •BCCALL
- •BCRESET
- •Tools
- •LCD RGB-8 Converter
© MCS Electronics, 1995-2007
BCCARD
BCCARD
BCCARD.LIB is a commercial addon library that is available separately from MCS Electronics.
With the BCCARD library you can interface with the BasicCards from www.basiccard.com
BasicCards are also available from MCS Electronics
A BasicCard is a smart card that can be programmed in BASIC.
The chip on the card looks like this :
To interface it you need a smart card connector.
In the provided example the connections are made as following:
Smart Card PIN |
Connect to |
C1 |
+5 Volt |
C2 |
PORTD.4 , RESET |
C3 |
PIN 4 of 2313 , CLOCK |
C5 |
GND |
C7 |
PORTD.5 , I/O |
|
|
The microprocessor must be clocked with a 3579545 crystal since that is the frequency the Smart Card is working on. The output clock of the microprocessor is connected to the clock pin of the Smart card.
Some global variables are needed by the library. They are dimensioned automatic by the compiler when you use the CONFIG BCCARD statement.
page -759-
© MCS Electronics, 1995-2007
These variables are:
_Bc_pcb : a byte needed by the communication protocol.
Sw1 and SW2 : both bytes that correspondent to the BasicCard variables SW1 and SW2
The following statements are especially for the BasicCard:
CONFIG BCCARD to init the library
BCRESET to reset the card
BCDEF to define your function in the card
BCCALL to call the function in the card
Encryption is not supported by the library yet.
BCDEF
Action
Defines a subroutine name and it’s parameters in BASCOM so it can be called in the BasicCard.
Syntax
BCDEF name([param1 , paramn])
Remarks
name
Param1
The name of the procedure. It may be different than the name of the procedure in the BasicCard but it is advised to use the same names.
Optional you might want to pass parameters. For each parameter you pass, you must specify the data type. Supported data types are byte, Integer, Word, Long, Single and String
This statements uses BCCARD.LIB, a library that is available separately fromMCS Electronics.
BCDEF Calc(string)
Would define a name ‘Calc’ with one string parameter.
When you use strings, it must be the last parameter passed.
BCDEF name(byte,string)
BCDEF does not generate any code. It only informs the compiler about the data types of the passed parameters.
See Also
page -760-
© MCS Electronics, 1995-2007
CONFIG BCCARD , BCCALL , BCRESET
Partial Example
Bcdef Calc(string)
BCCALL
Action
Calls a subroutine or procedure in the BasicCard.
Syntax
BCCALL name( nad , cla, ins, p1, p2 [param1 , paramn])
Remarks
name
The name of the procedure to all in the BasicCard. It must be defined first with BCDEF. The name used with BCDEF and BCCALL do not need to be the same as the procedure in the BasicCard but it is advised to use the same names.
NAD |
Node address byte. The BasicCard responds to ao al node address |
|
values. Use 0 for default. |
CLA |
Class byte. First byte of two byte CLA-INS command. Must match |
|
the value in the BasicCard procedure. |
INS |
Instruction byte. Second byte of two byte CLA-INS command. Must |
|
match the value in the BasicCard procedure. |
P1 |
Parameter 1 of CLA–INS header. |
P2 |
Parameter 2 of CLA-INS header |
This statements uses BCCARD.LIB, a library that is available separately fromMCS Electronics.
When in your BasicCard basic program you use: 'test of passing parameters
Command &hf6 &h01 ParamTest( b as byte, w as integer,l as long) b=b+1
w=w+1
l=l+1
end command
You need to use &HF6 for CLA and 1 for INS when you call the program:
Bccall Paramtest(0 , &HF6 , 1 , 0 , 0 , B , W , L)
^ NAD
^CLA
^INS
page -761-
© MCS Electronics, 1995-2007
^P1
^P2
When you use BCCALL, the NAD, CLA, INS, P1 and P2 are sent to the BasicCard. The parameter values are also sent to the BasicCard. The BasicCard will execute the command defined with CLA and INS and will return the result in SW1 and SW2.
The parameter values altered by the BasicCard are also sent by the BasicCard.
You can not sent constant values. Only variables may be sent. This because a constant can not be changed.
See Also
CONFIG BCCARD , BCDEF , BCRESET
Example
'------------------------------------------------------------------------------
'BCCARD.BAS
'This AN shows how to use the BasicCard from Zeitcontrol
'www.basiccard.com
'------------------------------------------------------------------------------
'connections:
'C1 = +5V
'C2 = PORTD.4 - RESET
' C3 = PIN 4 - CLOCK
'C5 = GND
'C7 = PORTD.5 - I/O
' /-------------------------------- |
|
|
\ |
' | |
C1 C5 |
|
| |
' | |
|
| |
|
' | |
C2 C6 |
|
| |
' | |
C3 C7 |
|
| |
' | |
C4 C8 |
|
| |
' | |
|
|
| |
' \-------------------------------- |
|
|
/ |
' |
|
|
|
' |
|
|
|
'----------- |
|
configure the pins we use ------------ |
|
Config Bccard = D ,Io= 5,Reset= 4 |
|||
' |
|
^ |
^PORTD.4 |
' |
|
PORTD.5 |
|
' |
|
^--------------------- |
PORTD |
'Load the sample calc.bas into the basiccard
'Now define the procedure in BASCOM
'We pass a string and also receive a string
Bcdef Calc(string)
'We need to dim the following variables
'SW1 and SW2 are returned by the BasicCard 'BC_PCB must be set to 0 before you start a session
'Our program uses a string to pass the data so DIM it
Dim SAs String* 15
'Baudrate might be changed $baud = 9600
' Crystal used must be 3579545 since it is connected to the Card too $crystal= 3579545
page -762-
© MCS Electronics, 1995-2007
'Perform an ATR
Bcreset
'Now we call the procedure in the BasicCard
'bccall funcname(ad,cla,ins,p1,p2,PRM as TYPE,PRM as TYPE)
S = "1+1+3" |
' we want to calculate the result of this expression |
Bccall Calc(0 ,&H20 ,1,0,0,S) |
|
' |
^---variabletopassthatholdstheexpression |
'^-------P2
'^-----------P1
'^---------------INS
'^--------------------CLA
'^--------------------------NAD
'For info about NAD, CLA, INS, P1 and P2 see your BasicCard manual 'if an error occurs ERR is set
' The BCCALL returns also the variables SW1 and SW2 Print"Result of calc : ";S
Print"SW1 = ";Hex(sw1)
Print"SW2 = ";Hex(sw2)
'Print Hex(_bc_pcb) ' for test you can see that it toggles between 0 and 40 Print"Error :";Err
'You can call this or another function again in this session
S = "2+2"
Bccall Calc(0 ,&H20 ,1,0,0,S) Print"Result of calc : ";S
Print"SW1 = ";Hex(sw1)
Print"SW2 = ";Hex(sw2)
'Print Hex(_bc_pcb) ' for test you can see that it toggles between 0 and 40 Print"Error :";Err
'perform another ATR
Bcreset
Input"expression ",S
Bccall Calc(0 ,&H20 ,1,0,0,S) Print"Answer : ";S
'----and now perform an ATR as a function
Dim Buf(25)As Byte,IAs Byte
Buf(1)= Bcreset()
For I= 1To 25
PrintI;" ";Hex(buf(i))
Next
'typical returns: 'TS = 3B
'T0 = EF 'TB1 = 00 'TC1 = FF
'TD1 = 81 T=1 indication
'TD2 = 31 TA3,TB3 follow T=1 indicator
'TA3 = 50 or 20 IFSC ,50 =Compact Card, 20 = Enhanced Card 'TB3 = 45 BWT blocl waiting time
'T1 -Tk = 42 61 73 69 63 43 61 72 64 20 5A 43 31 32 33 00 00 ' B a s i c C a r d Z C 1 2 3
'and another test
'define the procedure in the BasicCard program
Bcdef Paramtest(byte,Word ,Long )
'dim some variables
Dim BAs Byte, W As Word ,LAs Long
'assign the variables
B = 1: W = &H1234 :L= &H12345678
Bccall Paramtest(0 ,&HF6 ,1,0,0,B, W ,L) PrintHex(sw1);Spc(3);Hex(sw2)
'and see that the variables are changed by the BasicCard ! Print B;Spc(3);Hex(w);" ";Hex(l)
page -763-
© MCS Electronics, 1995-2007
'try the echotest command Bcdef Echotest(byte)
Bccall Echotest(0 ,&HC0 ,&H14 ,1,0,B)
Print B |
'end program |
End |
Rem BasicCard Sample Source Code
Rem ------------------------------------------------------------------
Rem Copyright (C) 1997-2001 ZeitControl GmbH
Rem You have a royalty-free right to use, modify, reproduce and Rem distribute the Sample Application Files (and/or any modified Rem version) in any way you find useful, provided that you agree Rem that ZeitControl GmbH has no warranty, obligations or liability Rem for any Sample Application Files.
Rem ------------------------------------------------------------------
#Include CALCKEYS.BAS
Declare ApplicationID = "BasicCard Mini-Calculator"
Rem This BasicCard program contains recursive procedure calls, so the Rem compiler will allocate all available RAM to the P-Code stack unless Rem otherwise advised. This slows execution, because all strings have to Rem be allocated from EEPROM. So we specify a stack size here:
#Stack 120
'Calculator Command (CLA = &H20, INS = &H01)
'Input: an ASCII expression involving integers, and these operators:
'* / % + - & ^ |
'
'(Parentheses are also allowed.)
'Output: the value of the expression, in ASCII.
'P1 = 0: all numbers are decimal
'P1 <> 0: all numbers are hex
'Constants
Const SyntaxError = &H81
Const ParenthesisMismatch = &H82
Const InvalidNumber = &H83
Const BadOperator = &H84
' Forward references
Declare Function EvaluateExpression (S$, Precedence) As Long Declare Function EvaluateTerm (S$) As Long
Declare Sub Error (Code@)
'test for passing a string
Command &H20 &H01 Calculator (S$)
Private X As Long
S$ = Trim$ (S$)
page -764-
© MCS Electronics, 1995-2007
X = EvaluateExpression (S$, 0)
If Len (Trim$ (S$)) <> 0 Then Call Error (SyntaxError) If P1 = 0 Then S$ = Str$ (X) : Else S$ = Hex$ (X)
End Command
'test of passing parameters
Command &hf6 &h01 ParamTest( b as byte, w as integer,l as long) b=b+1
w=w+1
l=l+1
end command
Function EvaluateExpression (S$, Precedence) As Long
EvaluateExpression = EvaluateTerm (S$)
Do
S$ = LTrim$ (S$)
If Len (S$) = 0 Then Exit Function
Select Case S$(1)
Case "*"
If Precedence > 5 Then Exit Function
S$ = Mid$ (S$, 2)
EvaluateExpression = EvaluateExpression * _
EvaluateExpression (S$, 6)
Case "/"
If Precedence > 5 Then Exit Function
S$ = Mid$ (S$, 2)
EvaluateExpression = EvaluateExpression / _
EvaluateExpression (S$, 6)
Case "%"
If Precedence > 5 Then Exit Function
S$ = Mid$ (S$, 2)
EvaluateExpression = EvaluateExpression Mod _
EvaluateExpression (S$, 6)
Case "+"
If Precedence > 4 Then Exit Function
S$ = Mid$ (S$, 2)
EvaluateExpression = EvaluateExpression + _
EvaluateExpression (S$, 5)
Case "-"
If Precedence > 4 Then Exit Function
S$ = Mid$ (S$, 2)
EvaluateExpression = EvaluateExpression - _
EvaluateExpression (S$, 5)
Case "&"
If Precedence > 3 Then Exit Function
S$ = Mid$ (S$, 2)
EvaluateExpression = EvaluateExpression And _
EvaluateExpression (S$, 4)
Case "^"
If Precedence > 2 Then Exit Function
S$ = Mid$ (S$, 2)
page -765-
© MCS Electronics, 1995-2007
EvaluateExpression = EvaluateExpression Xor _
EvaluateExpression (S$, 3)
Case "|"
If Precedence > 1 Then Exit Function
S$ = Mid$ (S$, 2)
EvaluateExpression = EvaluateExpression Or _
EvaluateExpression (S$, 2)
Case Else
Exit Function
End Select
Loop
End Function
Function EvaluateTerm (S$) As Long
Do |
' Ignore unary plus |
S$ = LTrim$ (S$)
If Len (S$) = 0 Then Call Error (SyntaxError) If S$(1) <> "+" Then Exit Do
S$ = Mid$ (S$, 2) Loop
If S$(1) = "(" Then ' Expression in parentheses S$ = Mid$ (S$, 2)
EvaluateTerm = EvaluateExpression (S$, 0) S$ = LTrim$ (S$)
If S$(1) <> ")" Then Call Error (ParenthesisMismatch) S$ = Mid$ (S$, 2)
Exit Function
ElseIf S$(1) = "-" Then ' Unary minus
S$ = Mid$ (S$, 2)
EvaluateTerm = -EvaluateTerm (S$)
Exit Function
Else |
' Must be a number |
If P1 = 0 Then |
' If decimal |
EvaluateTerm = Val& (S$, L@)
Else
EvaluateTerm = ValH (S$, L@)
End If
If L@ = 0 Then Call Error (InvalidNumber)
S$ = Mid$ (S$, L@ + 1)
End If
End Function
Sub Error (Code@)
SW1 = &H64
SW2 = Code@
Exit
End Sub
page -766-
