[Oberon] PO2013 - Real time measurement

Paul Reed paulreed at paddedcell.com
Thu Apr 11 12:39:00 CEST 2019


> Thank you, offtopic slightly, just toying with `gpasm'.

Worry not, I'll bring it back by using Oberon:  :)

(My.Picl)
MODULE My;

BEGIN
   !~S.5; !~S.6; A := 0; B := 0;
   !S.5; A := 0; B := 0; !~S.5
END My.

Edit.Open Tomas.Picl   (select MODULE)
PICL.Compile @    PICL.Decode


(Log output PICL.Compile @)
PICL  8.8.2014
PIC compiling My
     8

(Log output PICL.Decode)
    0 00001283 BCF    5   3
    1 00001303 BCF    6   3
    2 00000185 CLRF   1   5
    3 00000186 CLRF   1   6
    4 00001683 BSF    5   3
    5 00000185 CLRF   1   5
    6 00000186 CLRF   1   6
    7 00001283 BCF    5   3


So translating that into gpasm I get no errors if I tell the assembler 
we are in bank 0 on entry (confirmed in the datasheet section 2.2.2, 
table 2.1):

         include "p16f818.inc"

         banksel 0

Init            bcf     STATUS, RP0     ;bank0, default on poweron???
                 bcf     STATUS, RP1
                 clrf    PORTA           ;all of porta low
                 clrf    PORTB           ;all of portb low

                 bsf     STATUS, RP0     ;change to bank1
                 clrf    TRISA           ;all of porta outputs
                 clrf    TRISB           ;all of portb outputs
                 bcf     STATUS, RP0     ;back to bank0

         end

and use the correct processor on the command line:

$ gpasm -p pic16f818 my.asm
$

HTH
Paul


More information about the Oberon mailing list