File |
Description |
pyastra |
Pyastra's console front-end |
tree2tree.py | Tree optimizer |
tree2asm.py | Converter from tree to assembler |
regs16f877.py |
PIC 16F877 default namespace
(register names, bit names; all in CAPS). Generated by inc2py.py script. |
p16f877.py |
PIC 16F877 specific built-ins.
Is imported by Pyastra in all files (when compiling for this
microcontroller). Includes microcontroller-specific functions like
multiplication, division, power, etc) |
a=5
is coded into the following:_a equ 0x37 ;bank -1First it reserves memory in bank-independent part (that bank -1 notes), then it puts the constant in the work register W, then it checks weather it's zero (see below) and the last thing it puts the value into the corresponding memory cell.
movlw 0x5
movwf stack0
movwf _a
if
),
it "runs" the expression and checks the Z bit of STATUS register. For
example, codeif a:will produce the following code:
a=0
movf _a, wFirst line puts the value of register _a into W register (as if we wrote in that line simply "a" without if). Then it checks Z bit. If it's cleared, then W register is true (not equals to zero). That means that the body should be run. Otherwise it jumps to label0. The body is simple: to clear register a.
btfsc STATUS, Z
goto label0
clrf _a
label0
label%iwhere
%i
is an unique number (decimal integer).