Search found 103 matches

by gray
Fri May 10, 2019 11:43 am
Forum: Astrobe for ARM Cortex-M0, M3, M4 and M7
Topic: Adjustable Buffers, Number and Sizes
Replies: 2
Views: 18829

Adjustable Buffers, Number and Sizes

I have several library modules that are basically application-independent, apart from the number of buffers and the buffer sizes. Arrays are easy and well performing data structures for buffers, but they are of a fixed size. For maintenance reasons, I would prefer to configure these library modules ...
by gray
Sat May 04, 2019 3:49 am
Forum: Astrobe for ARM Cortex-M0, M3, M4 and M7
Topic: Type Test Inconsistency?
Replies: 5
Views: 27223

Re: Type Test Inconsistency?

Assume P2 is implemented in another module, say implementing T and its extensions (my actual use case); the code is perfectly valid with a qualident as case variable. Now a module client calls P2 "wrongly", and P2 fails silently. But the test-case should execute correctly with an IS type test. PROCE...
by gray
Fri May 03, 2019 1:17 pm
Forum: Astrobe for ARM Cortex-M0, M3, M4 and M7
Topic: Type Test Inconsistency?
Replies: 5
Views: 27223

Type Test Inconsistency?

From real-world code, distilled down to a test case: MODULE M; IMPORT Main, Out; TYPE T = RECORD i: INTEGER END; T1 = RECORD(T) k: INTEGER END; R = RECORD t: T1 END; P = POINTER TO R; VAR p: P; PROCEDURE P2(VAR t: T); BEGIN t.i := 13; Out.String("T"); Out.Ln; CASE t OF T1: t.k := 4; Out.String("T1")...
by gray
Tue Apr 30, 2019 5:53 am
Forum: Astrobe for ARM Cortex-M0, M3, M4 and M7
Topic: 7.0.1 Fixes
Replies: 1
Views: 16750

7.0.1 Fixes

Type tests on expressions (e.g. array elements and individual fields of records) are handled correctly in IS expressions. Type tests using CASE statements can only be performed on (qualified) identifiers, not expressions. 1) Does this apply to all type tests, or only in leaf procedures? 2) Is deref...
by gray
Sat Apr 27, 2019 1:25 pm
Forum: Astrobe for ARM Cortex-M0, M3, M4 and M7
Topic: Assignment to Pointer-referenced Variable
Replies: 3
Views: 21343

Re: Assignment to Pointer-referenced Variable

Then again...

Code: Select all

MODULE M;
  IMPORT Main, Out;
    
  TYPE
    P = POINTER TO T;
    T = RECORD
      i: INTEGER 
    END;

  VAR
    p: P;
    t: T;

BEGIN
  t.i := 13;
  p^ := t;
  Out.Int(p.i, 0); Out.Ln;
  p.i := 4;
  Out.Int(p.i, 0); Out.Ln
END M.
... compiles and executes (prints 13 and 4).
by gray
Sat Apr 27, 2019 11:06 am
Forum: Astrobe for ARM Cortex-M0, M3, M4 and M7
Topic: Assignment to Pointer-referenced Variable
Replies: 3
Views: 21343

Assignment to Pointer-referenced Variable

Code: Select all

MODULE M;
  TYPE
    P = POINTER TO T;
    T = RECORD END;

  VAR
    p: P;
    t: T;

BEGIN
  p^ := t
END M.
Is here NEW(p) executed before the assignment?
by gray
Tue Apr 16, 2019 3:26 am
Forum: Astrobe for ARM Cortex-M0, M3, M4 and M7
Topic: Disabling Interrupts
Replies: 1
Views: 16313

Disabling Interrupts

First, let me thank you for your patience answering my barrage of questions. Highly appreciated! Here's the next... How "atomic" is SYSTEM.PUT as regards interference by interrupts? In particular: (* irqICER, irqISER, irqSCBit: the ICER, ISER and bit (a SET) corresponding to the interrupt *) PROCEDU...
by gray
Tue Apr 16, 2019 12:35 am
Forum: Astrobe for ARM Cortex-M0, M3, M4 and M7
Topic: Type Extensions Across Modules
Replies: 5
Views: 26536

Re: Type Extensions Across Modules

A programmer is able to extend any type exported from a module with or without access to the source code. Without the source code of M1 you would have no knowledge of the existence of i. If the author of M1 determines that T1.i is private then he can make any change he likes to T1 (remove i, change...
by gray
Mon Apr 15, 2019 2:47 am
Forum: Astrobe for ARM Cortex-M0, M3, M4 and M7
Topic: Overhead of Record Parameters
Replies: 1
Views: 16239

Overhead of Record Parameters

MODULE M10; TYPE P = POINTER TO R; R = RECORD END; VAR p: P; r: R; PROCEDURE P1(r: R); END P1; PROCEDURE P2(VAR r: R); END P2; PROCEDURE P3(p: P); END P3; BEGIN P1(r); P2(r); P3(p) END M10. What are the differences in the overhead when calling the procedures? I would assume they are minimal, in par...
by gray
Mon Apr 15, 2019 2:30 am
Forum: Astrobe for ARM Cortex-M0, M3, M4 and M7
Topic: Extended Type Formal VAR Parameters
Replies: 5
Views: 23450

Re: Extended Type Formal VAR Parameters

MODULE M8; TYPE T1 = RECORD i: INTEGER END; T2 = RECORD(T1) k: INTEGER END; VAR t1: T1; t2: T2; PROCEDURE P1(VAR t: T1); VAR t1: T1; BEGIN t1.i := 17; t := t1 END P1; BEGIN t2 := t1; (* illegal *) t2.i := 13; t2.k := 4; P1(t2); (* t2.i = 17, t2.k = 4 *) END M8. The t2 := t1 assignment is illegal, a...