User`s manual
mikroBASIC
- Basic Compiler for Microchip PIC microcontrollers
MikroElektronika:
Development
tools
-
Books
-
Compilers
mikroBASIC
making it simple...
53
sub function mask(dim byref num as byte) as byte
' This function returns code for digit
select case num
' for common cathode 7 seg. display.
case 0 result = $3F
case 1 result = $06
' Note that the value of result is not
case 2 result = $5B
' initialized for values greater than 9
case 3 result = $4F
case 4 result = $66
case 5 result = $6D
case 6 result = $7D
case 7 result = $07
case 8 result = $7F
case 9 result = $6f
end select
' case end
end sub
making it simple...
Example
Nested procedures
or functions calls
are limited to 8
for PIC16 series,
and to 31 for PIC18
Number of allowed
nested calls will be
decremented by 1 if
you use interrupt
procedure and 1 more
if you use *, div, mod
Compiler will report
stack overflow error
if you exceed the
allowed number of
nested calls
Procedure or
Function
Procedure or
Function
Procedure or
Function