NFRED mcwiz and mcc

Mosinee Upgrade: Part of the GDR Package

Beta Version: 1.0

Date: Tuesday, January 07, 1997

Released Version 2.0

Wednesday, May 14, 1997

 

 

Get the latest Version: Software Utilities

The Following is a collection of software utilities you may find useful.


QNX 2.2 Software PCV 4.23

New version of mfpmd, grade, replaced by mcc, mcwiz, mcgdr, mggrade. Check
with Impact Field Support to see if this patch applies. This includes examples and a readme. You must have zoo to extract.

Newest mis manager built by Srini. containing configuration files. miscalc, miscalc.cfg, miscalccfg, misid.cfg, and mismgrYou must have zoo to extract it.

 

 

Prepared By: Ed Chapman

Contributor of Ideas:

Jean Guy Maltais, "Object Rate Changes"

Dan Larson, "Array Tags[]"

Srini Komandur "Local tags, REALA tags not defined as internal Bailey Tags"

Andre King "Station Tags Additions"

Edwin Chen "ANDC logic for manipulations"

 

 NFRED mcwiz and mcc

 

Introduction:

Project: Mosinee, Increase Quality, Increase Productivity, and adding Grade Change Capability.

With the Grade Change product as sold at Mosinee, the need to expand and define more controls over the old "mfpmod" and "mfpcomp". The new task and programs are "mcwiz"(MFP Config Wizard) and "mcc" (MFP Config Compiler). The final version for Mosinee will contain, "mcwiz", "mcc" and a new "gdr" program capable of doing writes from tags to gdr.xxx files. This document only describes, "mfpcomp" and "mfpmod" replacements.

 

Object Compiler

mcc [options] files ....

 

-d defines from makefile

-o optional object file name

-e optional error file name

-r runrate for object, note: #pragma runrate over-rides this

-l optional listing files

 

Object Wizard

mcwiz [options] object1 object2 object3 .....

 

 -b break point in hex for debugging

-p priority of mcwiz

-v verbose

-vv or -v -v pretty dam verbose

-s single step mode

 

Example of use:

mcwiz machinedir.mco mis.mco scanlogic.mco &

 

Semaphores

 

The overall concept of the MCWIZ( MFP CONFIGURATION WIZARD) is to run different wizard object at different rates.

 

Example: mdtag.obj may run at 5 seconds, and scan logic that test for breaks and send scanner offsheet may run at 1 second.

 

mcwiz mdcfg.mco scanlogic.mco &

 

Two different module, each with different runrates. All references, i.e. labels and symbols are local to each module with the exception of ATOMs. ATOMs are global, and cross modules for access; therefore these modules can be used as semaphores.

 

Lets say, you are doing something in object A, and you want to signal someone in object B.

 

#define SEMA1 100 // a good place to start semaphores is at 100, this leaves 0 through 99 as ATOMs for sigma etc.

  

moduleA.mcc

  gettagc | pv, mdsomething

ifx

atomadd, SEMA1 // tell some other module to do something

....

....

 moduleB.mcc

atomn, SEMA1

ifx

jsr,$dosomething // someone has set semaphore

atomreset, SEMA1 // always set to 0 and let someone else set.

..

mcwiz moduleA.mco moduleB.mco &

moduleB can now be signaled from moduleA.

 

Note: The value of ATOMN equals the number of time the semaphore was hit.

 

The recommendation is that all semaphores be set to 100 or above; leaving 0 through 99 as mis or misc. type atoms used for accumulations spreads and such.

  

Comments:

Commenting a line is done using //

Example:

gettag | pv, i23010p00e0000 // get the aplus current mode

 

 

Continue Line:

Lines that may need longer length than practical, with a normal editor, can be continued with a \

Example:

 

@tagarray TAGA i23010p00e0000, i23010p00e0001, i23010p00e0002 \

i23010p00e0003, i23010p00e0004

 

 

Changes:

The mcc programming languages is based on the old mfpmod code; making it easy to upgrade. The differences from the old mfpmod code are:

 

#define

#undefine

#ifdef, #elseif, #else, #endif

 

The use of wizmac.mcch making code listings more readable.

 

The use of indirection into ARRAYS or either TAG ARRAYS or LOCAL TAG ARRAYS.

 

The addition of REPDI, repeating instructions and the actual DI(Data Index) register. In general, any instruction which once did constant addressing can be done in addition to local constants indirection’s to REALA.

 

Example:

  IFGEC, IFLEC etc. where ‘C’ defines constant can now additionally be done as

 

@ConstTable REALA 1,2,3,4,5,10,20,30,40

 

ifgec,@ConstTable // default to [0]

 or

ifgec,@ConstTable,0 // force to [0]

 or

clrdi

ifgec,@ConstTable,di

 

The same is true with instruction which normally one address Bailey tags.

 

Example:

GETTAG, IFGE, IFGL where there is no ‘C’ i.e. meaning tag addressing

 

@TagTable TAGA i23010p00e0000, i23010p00e0001

 

gettag | pv, i23010p00e0000

ifge | pv,i23010p00e0001

 

or

gettag | pv, @TagTable

ifge | pv, @TagTable,1

 

or

clrdi

gettag | pv, @TagTable,di

incdi

ifge | pv, @TagTable,di

 

 

The next big changes are PUSH and POP... These are extremely powerful instructions, but with power comes danger. These instructions are not for the light hearted. For each PUSH, there must be 1 POP.

 

 

A good use of these PUSH/POP instructions might be a scan off sheet check.

 

Example:

 

#define OFFSHEET 1

 

@offsheetTag nop // save location, temp storage

 

$ScanOffSheetSub

pop, @offsheetTag

loadx,OFFSHEET

ife | pv, @offsheetTag

rtn // same do not sent again

settag | pv, @offsheetTag // send it off it was not

rtn

 

#define SCANNER1

 

#ifdef SCANNER1

@off1 TAGA i23010p00e0000

#endif

 

#ifdef SCANNER2

@off2 TAGA i23010p01e0000

#endif

 

#ifdef SCANNER3

@off3 TAGA i23010p02e0000

#endif

 

 

$main

gettag | pv, reelbreak

ifnx

skip, $main01

 

#ifdef SCANNER1

push, @off1

jsr,@ScanOffSheetSub

#endif

#ifdef SCANNER2

push, @off2

jsr,@ScanOffSheetSub

#endif

 

#ifdef SCANNER3

push, @off3

jsr,@ScanOffSheetSub

#endif

 

$main01

exit

  

Other changes include:

 

$main must be included; and it does not need to be the first instruction, mcwiz will find it.

Different wizard objects can be run at different rates, each doing different things. In the PUSH/POP example, a #pragma RUNRATE 3 can be added to the file and this example could simply run in a separate module doing just scanner off sheet checking for scanners..

DCB can be retrieved, this is an addition to the pv,sp, etc. This is because, there are certain situations where you do not care is a tag value is 0 or 1, you simply care if it changes.

The old settagc instruction no longer exists, replacement is loadx, constant then settag.

 

 Operand

Base 8 Opcode

ACOS

25

ACOSH

26

ADD

4

ADDC

8

ANDC

61

ASIN

19

ASINH

18

ATAN

23

ATANH

24

ATOMADD

46

ATOMMEAN

41

ATOMN

45

ATOMRESET

40

ATOMSTD

43

ATOMSUM

44

ATOMVAR

42

CLRDI

68

CLRX

69

COS

15

COSH

16

DECDI

72

DECX

73

DIV

7

DIVC

11

EXEC

47

EXIT

50

EXP

14

FABS

37

GETSTAT

60

GETTAG

0

GETTAGC

1

IFE

48

IFEC

49

IFG

29

IFGC

33

IFGE

30

IFGEC

34

IFL

31

IFLC

35

IFLE

32

IFLEC

36

IFNC

59

IFNX

28

IFX

27

INCDI

70

INCX

71

JSR

51

LOADDI

65

LOADX

64

LOG

13

MUL

6

MULC

10

NOP

75

POP

74

PUSH

3

REALA

63

REPDI

67

RTN

52

RUNRATE

58

SETTAG

2

SIN

17

SINH

20

SKIP

38

SQR

12

STEP

76

STOREX

66

SUB

5

SUBC

9

TAGA

62

TAN

21

TANH

22

TIME

39

TIMET

57

 

Sub-Operand

Opcode

When Used

PV

0x0100

use with Bailey Tags

SP

0x0200

use with Bailey Tags

SPAN

0x0300

use with Bailey Tags

ZERO

0x0400

use with Bailey Tags

ALARMHI

0x0500

use with Bailey Tags

ALARMLO

0x0600

use with Bailey Tags

DCB

0x0700

use with Bailey Tags

AM

0x0800

use with Bailey Station Tags

CR

0x0900

use with Bailey Station Tags

SL

0x0A00

use with Bailey Station Tags

CS

0x0B00

use with Bailey Station Tags

SF

0x0C00

use with Bailey Station Tags

OT

0x0D00

use with Bailey Station Tags

ML

0x0E00

use with Bailey Station Tags

BP

0x0F00

use with Bailey Station Tags

 

Operation Codes

 

 ACOSH

Description:

This function provides for an operation on the 'X' register only; providing for no support to the tag data base:

 

// command line

ACOSH

Results:

X = ACOSH(X)

 

ACOS

Description:

This function provides for an operation on the 'X' register only; providing for no support to the tag data base:

 

// command line

ACOS

Results:

X = ACOS(X)

 

 ADD

Description:

 This function provides for an operation on the 'X' register from a tag. Either ALARMHI,, ALARMLO, PV, SP, SPAN, ZERO, DCB must be 'or' with the operand.

 // command line

ADD | PV, tagname

 

// other methods

 

@tag1 TAGA i23001p00e0000, i23001p0oe0002

ADD | PV, @tag1

 // or

ADD|PV,@tag1,0

 // or clrdi

ADD|PV,@tag1,di

 

 Results:

The result of the operation is left within 'X' without affecting the tag indicated by tagname.

 

X = tagname + X

 

 ADDC

Description:

This function provides for an operation on the 'X' register from a constant

// command line

ADDC, 23.0

 

// Other methods for adding

// other methods

 

@real1 REALA 1,2

ADDC, @real1

 // or

ADDC, @real1,0

 

// or clrdi

ADDC,@real1,di

Results:

The result of the operation is left within 'X'.

X = X + 23.0

 

 ANDC

Description:

This function provides for an operation on the 'X' register from a constant, if the follow is true the next instruction is done.

// command line

gettag | pv, i01005p00e0000

ANDC, 2

jsr, dosomething

Results:

The 'X' ius unchanged.

 

 

 ASIN

Description:

This function provides for an operation on the 'X' register only; providing for no support to the tag data base:

 

// command line

ASIN

 

Results:

X = ASIN(X)

 

 ASINH

Description:

 

This function provides for an operation on the 'X' register only; providing for no support to the tag data base:

 

// command line

ASINH

Results:

X = ASINH(X)

 

ATAN

Description:

This function provides for an operation on the 'X' register only; providing for no support to the tag data base:

// command line,

ATAN

 

Results:

X = ATAN(X)

 

 

 ATANH

Description:

This function provides for an operation on the 'X' register only; providing for no support to the tag data base:

// command line

ATANH

 

Results:

X = ATANH(X)

 

 COS

Description:

This function provides for an operation on the 'X' register only; providing for no support to the tag data base:

 

// command line,

COS

 

Results:

X = COS(X)

 

ATOMRESET

Description:

 

This function provides for an atomic operation. It functionality zeros N, XSUM, and XSUMSQ. If the ATOM defined is not present, the ATOM will be created.

 

// command line,

ATOMRESET, 1

 

Results:

ATOM #1 is build if not present already, N = 0, XSUM = 0, and XSUMSQ = 0.

  

 ATOMMEAN

Description:

 

This function provides for an atomic operation. It functionality XSUM / N If the ATOM defined is not present, the ATOM will be created.

 

 

// command line,

ATOMMEAN, 1

 

Results:

X = XSUM / N or ATOM #1

 

 ATOMVAR

Description:

 

This function provides for an atomic operation. It functionality provide the variation for points added If the ATOM defined is not present, the ATOM will be created.

 

// command line,

ATOMVAR, 1

Results:

X = SUM(X - XB) / N

 

ATOMSUM

Description:

 

This function provides for an atomic operation. It functionality XSUM If the ATOM defined is not present, the ATOM will be created.

 

// command line,

TIME

 

Results:

X = XSUM of ATOM 1

 

 

 ATOMN

Description:

 

This function provides for an atomic operation. It functionality N If the ATOM defined is not present, the ATOM will be created.

 

 

// command line,

ATOMN, 1

 

Results:

X = N for ATOM 1

 

 ATOMADD

Description:

 

This function provides for an atomic operation. It functionality adds a point to a given ATOM. If the ATOM defined is not present, the ATOM will be created.

 

// command line,

ATOMADD, 1

 

Results:

ATOM [1] = N = N + 1, XSUM = XSUM + X, XSUMSQ = XSUMSQ + (X * X)

 

 

ATOMSTD

Description:

 

 

This function provides for an atomic operation. It functionality 2 sigma value of an ATOM. If the ATOM defined is not present, the ATOM will be created.

 

// command line,

ATOMSTD, 1

 

Results:

X = 2 of ATOM [1]

CLRDI

Description:

 Clears the DI ( Data Index)

 // Command line

clrdi

Results:

DI set to 0, X is unchanged

 

 

CLRX

 

Description:

 

Clears the X register.

 

// Command line

clrx

 

Results:

X = 0, DI unchanged

 

 

 COS

Description:

 

This function provides for an operation on the 'X' register only; providing for no support to the tag data base:

 

// command line

COS

 

Results:

X = COS(X)

 

 COSH

Description:

 

This function provides for an operation on the 'X' register only; providing for no support to the tag data base:

 

; command line

COSH

 

Results:

X = COSH(X)

 

 DECDI

Description:

 

This function decrements DI.

 

// command line

DECDI

 

Results:

X is unchanged, DI = DI -1

 

DECX

Description:

 

This function decrements X.

 

// command line

DECX

 

Results:

DI is unchanged, X = X -1

 

 DIV

Description:

 

This function provides for an operation on the 'X' register from a tag. Either ALARMHI,, ALARMLO, PV, SP, SPAN, or ZERO must be 'or' with the operand.

 

 

// command line

DIV | PV, tagname

 

// other methods

 

@tag1 TAGA i23001p00e0000, i23001p0oe0002

DIV | PV, @tag1

 

// or

DIV|PV,@tag1,0

 

// or

clrdi

DIV|PV,@tag1,di

 

 

Results:

The result of the operation is left within 'X' without affecting the tag indicated by tagname.

X = X / tagname

 

 DIVC

Description:

 

This function provides for an operation on the 'X' register from a constant

 

 

// command line

DIVC, 23.0

 

 

// Other methods for adding

 

@readtemp REALA 0,1,2,3

 

DIVC, @readtemp // adds the first be default the [0] location

 

DIVC, @readtemp,0 // same as above

 

clrdi

divc, @readtemp,di // same as above

 

 

Results:

The result of the operation is left within 'X'.

 

X = X / 23.0

 

 EXP

Description:

 This function provides for an operation on the 'X' register only; providing for no support to the tag data base:

 // command line

EXP

 

Results:

X = EXP(X)

 

EXEC

Description:

 

This function provides for a direct exececution of an external program..

 

Example:

exec reel

  main(argc, char *argv[])

{

....

}

 

// command line,

EXEC, prog

 

Results:

X is unchanged

 

 

 EXIT

Description:

 

Exit or end of program script.:

 

// command line

EXIT

 

Results:

  

 FABS

Description:

 This function provides for an operation on the 'X' register only; providing for no support to the tag data base:

 

// command line

FABS

 

Results:

X = FABS(X)

 

 

 GETSTAT

Description:

 

This function provides for an operation on the 'X' register from a station tag.

 

// command line

 

getstat | AM, tag auto/manual

  getstat | CR, tag cast / ratio / normal

  getstat | SL, tag station level

  getstat | CS, tag Computer OK status

  getstat | SF, tag Stations fault status output.

  getstat | OT, tag Output. Tracking

  getstat | ML, tag Manaul Interlock

  getstat | BP, tag Bypass Mode

 

 

// command line options

 

getstat | am, dwtcontrol

 

// optional mode

 

@stattags TAGA dwtcontrol, moicontrol, refinercontrol

 

getstat | am, @stattags,0 // gets the first time in the tag array

 

// or

clrdi

getstat | am, @stattags,di // gets the first time in the tag array

 

 

Results:

The result of the operation is left within 'X'.

 

 

 GETTAG

Description:

 

This function provides for an operation on the 'X' register from a tag. Either ALARMHI,, ALARMLO, PV, SP, SPAN, DCB, or ZERO must be 'or' with the operand.

 

 

// command line

GETTAG | PV, tagname

 

// options methods

 

@tagtmp TAGA i23010p00e0000, i23010p00e0001, i23010p00e0002

gettag | pv, @tagtmp

// or

gettag | pv, @tagtmp,0

// or

clrdi

gettag | pv, @tagtmp,di

Results:

The result of the operation is left within 'X' without affecting the tag indicated by tagname.

 

X = tagname

 

 GETTAGC

Description:

This function provides for an operation on the 'X' register from a constant

 

// command line

GETTAGC, 23.0

 

 

// Optional methods

 

@constantTmp REALA 23, 24, 25

gettagc,@constantTmp

 

// or

gettagc,@constantTmp,0

// or

clrdi

gettag,@constantTmp,di

 

Results:

The result of the operation is left within 'X'.

 

X = 23.0

 

 IFE

Description:

 

This function provides for an operation on the 'X' register from a tag. Either ALARMHI,, ALARMLO, PV, SP, SPAN, DCB, or ZERO must be 'or'ed with the operand.

 

// command line

IFE | PV, tagname

 

@tagtmp TAGA i23010p00e0000, i23010p00e0001, i23010p00e0002

ife | pv, @tagtmp

 // or

ife | pv, @tagtmp,0

 

// or

clrdi

ife | pv, @tagtmp,di

 

 

Results:

The result of the operation if ('X' == tagname) the next script line is executed.

'X' and the tag are unchanged at the end of this operation.

Example:

IFE | ALARMHI, tagnamey

If the value of 'X' = tagnamey's alarm limit high, then the tagnamez is set to 0.0

 

 

IFEC

Description:

 This function provides for an operation on the 'X' register from a constant.

 // command line

IFEC, 100.0

 

// Optional methods

 

@constantTmp REALA 23, 24, 25

ifec,@constantTmp

 

// or

ifec,@constantTmp,0

// or

clrdi

ifec,@constantTmp,di

 

 

Results:

The result of the operation if ('X' == 100) the next script line is executed.

'X' and the tag are unchanged at the end of this operation.

 

Example:

IFEC, 100.0

JSR, dosomething

If the value of 'X' = 100.0, then the tagnamez is set to 0.0

 

 IFG

Description:

 

This function provides for an operation on the 'X' register from a tag. Either ALARMHI,, ALARMLO, PV, SP, SPAN, DCB, or ZERO must be 'or'ed with the operand.

 

 

// command line

IFG | PV, tagname

 

// Other methods,

see ife for addressing TAGA (tag array) indirection methods.

 

 

Results:

The result of the operation if ('X' > tagname) the next script line is executed.

 

'X' and the tag are unchanged at the end of this operation.

 

Example:

IFG | ALARMHI, tagnamey

If the value of 'X' > tagnamey's alarm limit high, then the tagnamez is set to 0.0

 

IFGC

Description:

 

This function provides for an operation on the 'X' register from a constant.

 

 

// command line

IFGC, 100.0

 

// Other methods,

see ifec for addressing REALA (real array) indirection methods.

Results:

The result of the operation if ('X' > 100) the next script line is executed.

'X' and the tag are unchanged at the end of this operation.

Example:

IFGC, 100.0

If the value of 'X' > 100.0, then the tagnamez is set to 0.0

 IFGE

Description:

 

This function provides for an operation on the 'X' register from a tag. Either ALARMHI,, ALARMLO, PV, SP, SPAN, DCB, or ZERO must be 'or'ed with the operand.

 

 

// command line

IFGE | PV, tagname

 

// Other methods,

see ife for addressing TAGA (tag array) indirection methods.

 Results:

The result of the operation if ('X' >= tagname) the next script line is executed.

'X' and the tag are unchanged at the end of this operation.

 

Example:

IFGE | ALARMHI, tagnamey

If the value of 'X' >= tagnamey's alarm limit high, then the tagnamez is set to 0.0

 

 IFGEC

Description:

 

This function provides for an operation on the 'X' register from a constant.

 

 

// command line

IFGEC, 100.0

 

// Other methods,

see ifec for addressing REALA (real array) indirection methods.

  Results:

The result of the operation if ('X' >= 100) the next script line is executed.

'X' and the tag are unchanged at the end of this operation.

Example:

IFGEC, 100.0

If the value of 'X' >= 100.0, then the tagnamez is set to 0.0

 

 IFL

Description:

 

This function provides for an operation on the 'X' register from a tag. Either ALARMHI,, ALARMLO, PV, SP, SPAN, DCB, or ZERO must be 'or'ed with the operand.

// command line

IFL | PV, tagname

 

// Other methods,

see ife for addressing TAGA (tag array) indirection methods.

 

Results:

The result of the operation if ('X' < tagname) the next script line is executed.

'X' and the tag are unchanged at the end of this operation.

Example:

IFL | ALARMHI, tagnamey

If the value of 'X' < tagnamey's alarm limit high, then the tagnamez is set to 0.0

 

 

 IFLC

Description:

 

This function provides for an operation on the 'X' register from a constant.

 

// command line,

IFLC, 100.0

 

// Other methods,

see ifec for addressing REALA (real array) indirection methods.

 

Results:

The result of the operation if ('X' < 100) the next script line is executed.

'X' and the tag are unchanged at the end of this operation.

Example:

IFLC, 100.0

If the value of 'X' < 100.0, then the tagnamez is set to 0.0

 

 IFLE

Description:

 This function provides for an operation on the 'X' register from a tag. Either ALARMHI,, ALARMLO, PV, SP, SPAN, DCB, or ZERO must be 'or'ed with the operand.

 

// command line

IFLE | PV, tagname

 

// Other methods,

see ife for addressing TAGA (tag array) indirection methods.

 

Results:

The result of the operation if ('X' <= tagname) the next script line is executed.

  'X' and the tag are unchanged at the end of this operation.

 

Example:

IFLE | ALARMHI, tagnamey

If the value of 'X' <= tagnamey's alarm limit high, then the tagnamez is set to 0.0

 

 

 IFLEC

Description:

 This function provides for an operation on the 'X' register from a constant.

 // command line

IFLEC, 100.0

 // Other methods,

see ifec for addressing REALA (real array) indirection methods.

 Results:

The result of the operation if ('X' <= 100) the next script line is executed.

'X' and the tag are unchanged at the end of this operation.

 

Example:

IFLEC, 100.0

If the value of 'X' <= 100.0, then the tagnamez is set to 0.0

 

IFNX

Description:

 This function provides for an operation on the 'X' register. If the value of X <= 0.0, next instruction is executed.

 

// command line

IFX

Results:

IFNX

If the value of 'X' <= 0.0 , then the tagnamez is set to 0.0

'X' and the tag are unchanged at the end of this operation.

 

 IFX

Description:

This function provides for an operation on the 'X' register. If the value of X > 0.0, next instruction is executed.

 

; command line

IFX

Results:

If the value of 'X' > 0.0 , then the tagnamez is set to 0.0

'X' and the tag are unchanged at the end of this operation.

 

 

 

 INCDI

Description:

 This instruction increments the di ( data index) register..

 

// command line

INCDI

 

Results:

Xis unchanged, DI = DI + 1

 

 

 INCX

Description:

 This instruction increments the X ( data ) register..

 // command line

INCX

Results:

X = X + 1, DI is unchanged

 

 

 JSR

Description:

 Jump to a subroutine.. This instrucion save the current address + 1, then jumps to a sub-routine until a RTN os detected, the address save is returns and execution begins again.

 

// command line

jsr, $is_scanner_scanning

ifx

// do something

 

Results:

program counter save until rtn

 

 

 LOADDI

Description:

 Loads the DI register to a define constant.

 

// command line

#define TEN 10

loaddi, TEN

 

Results:

X is unchanged, DI = results.

 

 LOADX

Description:

 Loads the X register to a define constant.

 

// command line

#define TEN 10

loadx, TEN

  loadx,@some_real_array

loadx,@some_real_array,di

 

Results:

DI is unchanged, X = results.

 

 

 LOG

Description:

 This function provides for an operation on the 'X' register only; providing for no support to the tag data base:

  

// command line

LOG

 

 MUL

Description:

 

This function provides for an operation on the 'X' register from a tag. Either ALARMHI,, ALARMLO, PV, SP, SPAN, DCB, or ZERO must be 'or'ed with the operand.

 

// command line

MUL | PV, tagname

 

// other methods

 

@tag1 TAGA i23001p00e0000, i23001p0oe0002

MUL | PV, @tag1

 

// or

MUL, PV,@tag1,0

 

// or clrdi

MUL|PV,@tag1,di

 

 

Results:

The result of the operation is left within 'X' without affecting the tag indicated by tagname.

 

x = x * tagname

 

 MULC

Description:

 This function provides for an operation on the 'X' register from a constant

 // command line

MULC, 23.0

// other methods

 

@real1 TAGA 1,2

MULC, @real1

 

// or

MULC, @real1,0

 

// or clrdi

MULC,@real1,di

 

Results:

The result of the operation is left within 'X'.

 

X = X * 23.0

 

Results:

X = X * 23.0

 

 NOP

Description:

 No operation. Normally use as a dummy location so the either address or data operation codes can be written.

 

// command line

 

@dum1 NOP 0

 

Example:

@dumtag1 TAGA i23010p00e0000

@dumtag2 TAGA i23010p01e0000

@dumtag3 TAGA i23010p03e0000

 

push, @dumtag1

jsr, $offsheet

push, @dumtag2

jsr, $offsheet

push, @dumtag2

jsr, $offsheet

....

...

 

$offsheet

@dum1 NOP

pop, @dum1

loadx,1

settag | pv, @dum1

rtn

 

 

 POP

Description:

 This instruction pop a level of indirection to a specific location,

 

See NOP for for how to use.

 

 

Results:

X = unchanged, DI is unchanged

 

 

 PUSH

Description:

 

This instruction pushes a level of indirection of a specific location,

 

See NOP for for how to use.

 

 

Results:

X = unchanged, DI is unchanged

 

 

 REALA

Description:

 This instruction specific locations as real number arrays. The are specific to the script module, not internal tags. These are to save internal tags; and eliminate needs for the data base administrator to do simple logic local to mcc.

 

// Command line

 

@reeldummy REALA 0,0,0,0,0,0,0,0,0,0,0,0 // 12 real dummy

 Examples:

loadx, 10

storex,@realdummy // save to first location

  storex,@realdummy,0 // save to first location

  clrdi

storex,@realdummy,di // save to first location

  storex,@realdummy,1 // save to second location

  clrdi

incdi

storex,@realdummy,di // save to second location

 Results:

X = unchanged, DI is unchanged

 

 

 REPDI

Description:

This instruction provides for a repeat of next instruction(s).

Example:

@tjauto TAGA i01005p00e0000, i01005p00e0001, i01005p00e0002, i01005p00e0003, \

i01005p00e0004, i01005p00e0005, i01005p00e0006, i01005p00e0007, \

i01005p00e0008, i01005p00e0009, i01005p00e0010, i01005p00e0011, \

i01005p00e0012, i01005p00e0013, i01005p00e0014, i01005p00e0015, \

i01005p00e0016, i01005p00e0017, i01005p00e0018, i01005p00e0019

 

#define TWOINSTRUCT 2

#define TJMAXZONES 20

#define AUTO 0

#define MANAUL 1

 

  loadx, MANUAL

jsr, $setall_tjet

...

 

$setall_tjet

clrdi

repdi,TWOINSTRUCT, TJMAXZONES

settag | pv, @tjauto,di // first instruction

incdi // second instruction

rtn

 

 

 RTN

Description:

 This function restores the program address to prior to a jsr instructions. Return from subroutine.

 

// command line

rtn

 

Results:

 

 RUNRATE

Description:

 This function provides for an operation on the 'X' register to a tag. This function places the time, in seconds, since the last time this scipt was run.

 

 

// command line

RUNRATE

 

Results:

X = second since that last time this script was run, IE the cycle time of this program.

 

 

SETTAG

Description:

 

This function provides for an operation on the 'X' register to a tag. Either ALARMHI,, ALARMLO, PV, SP, SPAN, or ZERO must be 'or'ed with the operand.

 

// command line

SETTAG | PV, tagname

 

 // see REPDI for indirection use of settag.

 

Results:

The result of the operation is left within 'X' and the tag indicated by tagname.

tagname = X

 

 

SIN

Description:

 This function provides for an operation on the 'X' register only; providing for no support to the tag data base:

  

// command line,

SIN

Results:

X = SIN(X)

 

 SINH

Description:

 

This function provides for an operation on the 'X' register only; providing for no support to the tag data base:

 

 

// command line,

SINH

 

Results:

X = SINH(X)

 

 SKIP

Description:

 

Jump to a specific location.

 

// command line,

SKIP, $lable

 

Results:

X is unchanged.

 

SQR

Description:

 This function provides for an operation on the 'X' register only; providing for no support to the tag data base:

 

// command line,

SQR

Results:

X = SQR(X) x = square root of x

 

STEP

Description:

 This function places the mcwiz progam into the debug mode at a specific loaction. This is use only in the debug mode only.

  

// command line,

STEP

 

Results:

X = unchanged, DI = unchanged

 

 SUB

Description:

 This function provides for an operation on the 'X' register from a tag. Either ALARMHI,, ALARMLO, PV, SP, SPAN, DCB, or ZERO must be 'or'ed with the operand.

 

// command line

SUB | PV, tagname

 

// other methods

 

@tag1 TAGA i23001p00e0000, i23001p0oe0002

SUB | PV, @tag1

 // or

SUB|PV,@tag1,0

 // or clrdi

SUB|PV,@tag1,di

 Results:

The result of the operation is left within 'X' without affecting the tag indicated by tagname.

x = x - tagname

 

 SUBC

Description:

 This function provides for an operation on the 'X' register from a constant

 

// command line

SUBC, 23.0

 

// other methods

 

@real1 REALA 1,2

SUBCC, @real1

 

// or

SUBC, @real1,0

 

// or clrdi

SUBC,@real1,di

 

Results:

The result of the operation is left within 'X'.

X = X - 23.0

 

 TAN

Description:

 This function provides for an operation on the 'X' register only; providing for no support to the tag data base:

  // command line,

TAN

 

Results:

X = TAN(X)

 

 TANH

Description:

 This function provides for an operation on the 'X' register only; providing for no support to the tag data base:

 

// command line,

TANH

 

Results:

X = TANH(X)

 

TIME

Description:

 This function provides for an operation of time for 'X' register only; providing for no support to the tag data base:

 

// command line,

TIME

 

Results:

X = TIME units are in military local time 0000 through 2359

 

  TIMET

Description:

This function provides for an operation of time for 'X' register only; providing for no support to the tag data base: Get the long value or struct time_t, local time; casts to float; store the result into the X register.

 

This function is useful when computing the local time or difference in time.

 

// command line,

TIMET

 

Results:

X = (float)time(NULL)

 

 

 

Primitives and Macros

 Standard Macros

 

#define

#ifdef

#ifndef

#else

#elseif

#endif

#undef

 

#pragma runrate

 

Where run rate for the object is given in seconds.

 

Standard Include:

wizmacs.mcch

 

#ifndef _IFMAC_MCCH

#define _IFMAC_MCCH

#define ifx== IFE|PV

#define if!x IFNX

#define ifx> IFG|PV

#define ifx>= IFGE|PV

#define ifx< IFL|PV

#define ifx<= IFLE|PV

#define ifx==c IFEC

#define ifx!=c IFNC

#define ifx>=c IFGEC

#define ifx>c IFGC

#define ifx<=c IFLEC

#define ifx<c IFLC

#define x= LOADX

#define di= LOADDI

#define x}} STOREX

#define x<< GETTAG|PV

#define x>> SETTAG|PV

#endif

  

The above macros, if include wizmacs.mcch, allow the user to apply a more readable form of logic operation.

  

The following shows an example of using the actual wizmac.mcch macro files. It will be included within the testit.mco object script.

wiztest.mcc

 

#include "wizmacs.mcch"

 

$wiztest

x<<, i23010p00e0000 // test the wizmacs macros.....

ifx==c, 1 // if scanner target is not offsheet

skip, $wizcon1

x=, 1

x>>, i23010p00e0000

$wizcon1

rtn

testit.mcch

 

#ifndef TESTIT_MCCH

#define TESTIT_MCCH

// test out defines

 

#define ONE_SECOND 1

#define FIVE_SECONDS 5

#define TEN_SECONDS 10

 

#define SCAN1

#define OFFSHEET 1

#define ONSHEET 3

 

// #define SCAN2

// #define SCAN3

#endif

 

testit.mcc

 

//-------------------------------------------------------

// test out include

 

#include "wizmacs.mcch"

#include "testit.mcch"

 

//-------------------------------------------------------

// test runrate this object at 1 second interval

#pragma runrate ONE_SECOND

 

//-------------------------------------------------------

// test out to see if atoms still work

#define MDSPREADMOI 1

#define RANDOM1 1

#define RANDOM2 2

#define RANDOM3 3

#define RANDOM4 4

 

$atomtest

ATOMRESET, MDSPREADMOI

LOADX,RANDOM1

ATOMADD, MDSPREADMOI

LOADX,RANDOM2

ATOMADD, MDSPREADMOI

LOADX,RANDOM3

ATOMADD, MDSPREADMOI

ATOMVAR, MDSPREADMOI

settag | pv, reeldummy1

ATOMMEAN, MDSPREADMOI

settag | pv, reeldummy2

ATOMSTD, MDSPREADMOI

settag | pv, reeldummy3

ATOMSUM, MDSPREADMOI

settag | pv, reeldummy4

ATOMN, MDSPREADMOI

settag | pv, reeldummy5

ATOMRESET, MDSPREADMOI

rtn

 

//-------------------------------------------------------

// test out get tags

// this function tests out the get dcb to see if

// scanner 1 has done a complete scan... if the

// scan counter has changed...

#define SCAN1EOS i23001p00e0027

$newscan

@realscanDCB REALA 1

gettag | dcb, SCAN1EOS

ifec, @realscanDCB

skip, @newscan1

storex,@realscanDCB

loadx,1

rtn

@newscan1

clrx

rtn

 

 

// test tag array.........

// sets all therma jet zones to manual

#define TWOINSTRUCT 2

#define TJMAXZONE 10

// example of arrary tags

@tjauto TAGA \

i01005p00e0000, i01005p00e0001,i01005p00e0002, i01005p00e0003, \

i01005p00e0004, i01005p00e0005,i01005p00e0006, i01005p00e0007, \

i01005p00e0008, i01005p00e0009

 

$tjautomanul

clrdi

// example of repeating a number of instructions for a number of times

repdi, TWOINSTRUCT, TJMAXZONE

// example of setting a tag based on di and array of tags

settag | pv, @tjauto, di // instruction 1st

incdi // instruction 2ndw

rtn

 

$set_tj_to_man

loadx,1

jsr,$tjautomanul

rtn

 

$set_tj_to_auto

clrx

jsr,$tjautomanul

rtn

 

//-------------------------------------------------------

// test of pop and push of instructions....

// this can be used to reference levels of indirections

// in sub routines and also to actually chnage instructions

// is necessary....

 

$offsheet

@scantarget NOP // holds the tag for the target mode

// sample of one level of indirection using pop and push

pop,@scantarget

gettag | sp, @scantarget

ifec, OFFSHEET

rtn

loadx,OFFSHEET

settag | sp, @scantarget

settag | sp, i23010p00e0000

rtn

 

#ifdef SCAN1

#define SCAN1MODE i23010p00e0000

@scan1off TAGA SCAN1MODE

#endif

 

#ifdef SCAN2

#define SCAN2MODE i23010p01e0000

@scan1off TAGA SCAN2MODE

#endif

 

#ifdef SCAN3

#define SCAN1MODE i23010p02e0000

@scan1off TAGA SCAN3MODE

#endif

$all_scan_off

#ifdef SCAN1

push,@scan1off

jsr, $offsheet

#endif

#ifdef SCAN2

push,@scan2off

jsr, $offsheet

#endif

#ifdef SCAN3

push,@scan3off

jsr, $offsheet

#endif

rtn

//-------------------------------------------------------

// test out internal-internal tags, these are called

// nfred tags... they are tags or ordinals

// which only reside within this module and are not

// bailey internal analog or digital...

//

//

@dwtlav1 REALA 1,10,2,20,3,30

 

$dwtlav

gettag | pv, i23001p00e0000 // get basis wt last avg...

storex,@dwtlav1 // save it into the 0 index of real array

gettag | pv, i23001p00e0002 // get moist last avg...

storex, @dwtlav1,1 // save it into the 1 index of real array

// make a dry wt....

// show em how to direct address a constant

divc,100 // scale to percent

mulc, @dwtlav1 // mult bw

mulc, -1 // make neg

// show em how to effective address of constant

addc, @dwtlav1 // add to basis wt

storex, @dwtlav1, 2 // save it to @dwtlav1 index 2

rtn

 

//-------------------------------------------------------

// effective addressing

#define _REELDUM1 reeldummy3

 

@dumtags TAGA reeldummy1, reeldummy2, reeldummy3, reeldummy4

 $effective

loadx,1

settag | pv, @dumtags // save a 1 to the first address

settag | pv, reeldummy2 // or we could do it like this

settag | pv,_REELDUM1 // or we could do this one like this

settag | pv,@dumtags,3 // or like this @dumtags[2]

clrdi

clrx

repdi, 2, 4

add | pv,@dumtags,di

incdi

settag | pv, @dumtags, 3 // set the last one

// now check a condition

gettag | pv, @dumtags // get the first one

ifge |pv , @dumtags,3 // if it is >= last one which it should not be

nop

  ifle |pv , @dumtags,3 // if it is <= last one which it should be

nop

rtn

 

//-------------------------------------------------------

// Example: see if we just had a break;

//

 

#define SHEETBREAK misbreak

@breaksig REALA -1

 

$hasSheetJustBreak

gettag | dcb, SHEETBREAK

ifec, @breaksig // has the dcb changed

skip, $hasChanged

clrx

rtn

$hasChanged

storex,@breaksig // save the dcb

gettag | pv, SHEETBREAK // if sheet break it will return 1

// otherwize it will return 0, just as if

// dcb has not changed

rtn

  

//-------------------------------------------------------

// test $main as not being placed at the begining...

// binding should find this at this location....

//

 

// Example: Of #ifdefs

 

#ifdef SCAN1

#define SYSTEM_HAS_SCANNER

#endif

 

#ifdef SCAN2

#ifndef SYSTEM_HAS_SCANNER

#define SYSTEM_HAS_SCANNER

#endif

#endif

 

#ifdef SCAN3

#ifndef SYSTEM_HAS_SCANNER

#define SYSTEM_HAS_SCANNER

#endif

#endif

 

 

$main

#ifdef SYSTEM_HAS_SCANNER

jsr, $all_scan_off // test send all scanners offsheet

#endif

jsr, $set_tj_to_man // set all tj zones to manual

jsr, $set_tj_to_auto // set all tj zones to auto

jsr, $newscan // test new scan

ifx

nop // don't really skip if previous

jsr,$dwtlav // test dwtlav....

jsr,$atomtest // test the old atoms...

jsr,$effective // throw some fancy effective addressing of tags

 

#ifdef SYSTEM_HAS_SCANNER

jsr,$hasSheetJustBreak // has sheet just broke....

ifec, 1

jsr, $all_scan_off // send all scanners offsheet

jsr,$wiztest

 #endif

exit

 

Makefile

 

HEADERS= testit.mcch wizmacs.mcch makefile

 

SRCBASE= testit

PROG1= $(SRCBASE).mco

SRC1= testit.mcc

SRC2= wiztest.mcc

 

all: $(PROG1)

 debug: $(PROG1)

mcwiz -s $(PROG1)

 run: $(PROG1)

mcwiz $(PROG1) &

 

kill:

slay mcwiz

 

 $(PROG1) : $(SRC1) $(SRC2) $(HEADERS)

mcc -l $(SRCBASE).lst $(SRC1) $(SRC2)

cat $(SRCBASE).lst

 

testit.lst

 

0128 = instructions

006CH = @main

0001 = runrate in seconds

First Pass Complete

00020 0000 0028H 1 00000, 00, 0001H, 0000H, 0000H, 0000H 1.000000 ATOMRESET, MDSPREADMOI

00021 0001 0040H 1 00000, 00, 0001H, 0000H, 0000H, 0000H 1.000000 LOADX,RANDOM1

00022 0002 002EH 1 00000, 00, 0001H, 0000H, 0000H, 0000H 1.000000 ATOMADD, MDSPREADMOI

00023 0003 0040H 1 00000, 00, 0002H, 0000H, 0000H, 0000H 2.000000 LOADX,RANDOM2

00024 0004 002EH 1 00000, 00, 0001H, 0000H, 0000H, 0000H 1.000000 ATOMADD, MDSPREADMOI

00025 0005 0040H 1 00000, 00, 0003H, 0000H, 0000H, 0000H 3.000000 LOADX,RANDOM3

00026 0006 002EH 1 00000, 00, 0001H, 0000H, 0000H, 0000H 1.000000 ATOMADD, MDSPREADMOI

00027 0007 002AH 1 00000, 00, 0001H, 0000H, 0000H, 0000H 1.000000 ATOMVAR, MDSPREADMOI

00028 0008 0102H 1 01214, 32, 0000H, 0000H, 0000H, 0000H 0.000000 settag | pv, reeldummy1

00029 0009 0029H 1 00000, 00, 0001H, 0000H, 0000H, 0000H 1.000000 ATOMMEAN, MDSPREADMOI

00030 000A 0102H 1 01215, 32, 0000H, 0000H, 0000H, 0000H 0.000000 settag | pv, reeldummy2

00031 000B 002BH 1 00000, 00, 0001H, 0000H, 0000H, 0000H 1.000000 ATOMSTD, MDSPREADMOI

00032 000C 0102H 1 01216, 32, 0000H, 0000H, 0000H, 0000H 0.000000 settag | pv, reeldummy3

00033 000D 002CH 1 00000, 00, 0001H, 0000H, 0000H, 0000H 1.000000 ATOMSUM, MDSPREADMOI

00034 000E 0102H 1 01217, 32, 0000H, 0000H, 0000H, 0000H 0.000000 settag | pv, reeldummy4

00035 000F 002DH 1 00000, 00, 0001H, 0000H, 0000H, 0000H 1.000000 ATOMN, MDSPREADMOI

00036 0010 0102H 1 01218, 32, 0000H, 0000H, 0000H, 0000H 0.000000 settag | pv, reeldummy5

00037 0011 0028H 1 00000, 00, 0001H, 0000H, 0000H, 0000H 1.000000 ATOMRESET, MDSPREADMOI

00038 0012 0034H 0 00000, 00, 0000H, 0000H, 0000H, 0000H 0.000000 rtn

00047 0013 003FH 0 @realscanDCB REALA 1

0013 -------- 00000, 00, 0000H, 0000H, 0000H, 0000H 1.000000 --------

00048 0014 0700H 1 00290, 32, 0000H, 0000H, 0000H, 0000H 0.000000 gettag | dcb, SCAN1EOS

00049 0015 0031H 2 00000, 00, 0013H, 0000H, 0000H, 0000H 0.000000 ifec, @realscanDCB

00050 0016 0026H 0 00000, 00, 001AH, 0000H, 0000H, 0000H 0.000000 skip, @newscan1

00051 0017 0042H 2 00000, 00, 0013H, 0000H, 0000H, 0000H 0.000000 storex,@realscanDCB

00052 0018 0040H 1 00000, 00, 0001H, 0000H, 0000H, 0000H 1.000000 loadx,1

00053 0019 0034H 0 00000, 00, 0000H, 0000H, 0000H, 0000H 0.000000 rtn

00055 001A 0045H 0 00000, 00, 0000H, 0000H, 0000H, 0000H 0.000000 clrx

00056 001B 0034H 0 00000, 00, 0000H, 0000H, 0000H, 0000H 0.000000 rtn

00067 001C 003EH 0 @tjauto TAGA i01005p00e0000, i01005p00e0001,i01005p00e0002, i01005p00e0003, i01005p00e0004, i01005p00e0005,i01005p00e0006, i01005p00e0007, i01005p00e0008, i01005p00e0009

001C -------- 00873, 33, 0000H, 0000H, 0000H, 0000H 0.000000 --------

001D -------- 00874, 33, 0000H, 0000H, 0000H, 0000H 0.000000 --------

001E -------- 00875, 33, 0000H, 0000H, 0000H, 0000H 0.000000 --------

001F -------- 00876, 33, 0000H, 0000H, 0000H, 0000H 0.000000 --------

0020 -------- 00877, 33, 0000H, 0000H, 0000H, 0000H 0.000000 --------

0021 -------- 00878, 33, 0000H, 0000H, 0000H, 0000H 0.000000 --------

0022 -------- 00879, 33, 0000H, 0000H, 0000H, 0000H 0.000000 --------

0023 -------- 00880, 33, 0000H, 0000H, 0000H, 0000H 0.000000 --------

0024 -------- 00881, 33, 0000H, 0000H, 0000H, 0000H 0.000000 --------

0025 -------- 00882, 33, 0000H, 0000H, 0000H, 0000H 0.000000 --------

00070 0026 0044H 0 00000, 00, 0000H, 0000H, 0000H, 0000H 0.000000 clrdi

00072 0027 0043H 1 00000, 00, 0002H, 000AH, 0000H, 0000H 0.000000 repdi, TWOINSTRUCT, TJMAXZONE

00074 0028 0102H 3 00000, 00, 001CH, 0000H, 0000H, 0000H 0.000000 settag | pv, @tjauto, di // instruction 1st

00075 0029 0046H 0 00000, 00, 0000H, 0000H, 0000H, 0000H 0.000000 incdi // instruction 2ndw

00076 002A 0034H 0 00000, 00, 0000H, 0000H, 0000H, 0000H 0.000000 rtn

00079 002B 0040H 1 00000, 00, 0001H, 0000H, 0000H, 0000H 1.000000 loadx,1

00080 002C 0033H 0 00000, 00, 0026H, 0000H, 0000H, 0000H 0.000000 jsr,$tjautomanul

00081 002D 0034H 0 00000, 00, 0000H, 0000H, 0000H, 0000H 0.000000 rtn

00084 002E 0045H 0 00000, 00, 0000H, 0000H, 0000H, 0000H 0.000000 clrx

00085 002F 0033H 0 00000, 00, 0026H, 0000H, 0000H, 0000H 0.000000 jsr,$tjautomanul

00086 0030 0034H 0 00000, 00, 0000H, 0000H, 0000H, 0000H 0.000000 rtn

00095 0031 004BH 0 00000, 00, 0000H, 0000H, 0000H, 0000H 0.000000 @scantarget NOP // holds the tag for the target mode

00097 0032 004AH 0 00000, 00, 0031H, 0000H, 0000H, 0000H 0.000000 pop,@scantarget

00098 0033 0200H 2 00000, 00, 0031H, 0000H, 0000H, 0000H 0.000000 gettag | sp, @scantarget

00099 0034 0031H 1 00000, 00, 0001H, 0000H, 0000H, 0000H 1.000000 ifec, OFFSHEET

00100 0035 0034H 0 00000, 00, 0000H, 0000H, 0000H, 0000H 0.000000 rtn

00101 0036 0040H 1 00000, 00, 0001H, 0000H, 0000H, 0000H 1.000000 loadx,OFFSHEET

00102 0037 0202H 2 00000, 00, 0031H, 0000H, 0000H, 0000H 0.000000 settag | sp, @scantarget

00103 0038 0202H 1 00457, 32, 0000H, 0000H, 0000H, 0000H 0.000000 settag | sp, i23010p00e0000

00104 0039 0034H 0 00000, 00, 0000H, 0000H, 0000H, 0000H 0.000000 rtn

00108 003A 003EH 0 @scan1off TAGA SCAN1MODE

003A -------- 00457, 32, 0000H, 0000H, 0000H, 0000H 0.000000 --------

00123 003B 0003H 0 00000, 00, 003AH, 0000H, 0000H, 0000H 0.000000 push,@scan1off

00124 003C 0033H 0 00000, 00, 0031H, 0000H, 0000H, 0000H 0.000000 jsr, $offsheet

00134 003D 0034H 0 00000, 00, 0000H, 0000H, 0000H, 0000H 0.000000 rtn

00143 003E 003FH 0 @dwtlav1 REALA 1,10,2,20,3,30

003E -------- 00000, 00, 0000H, 0000H, 0000H, 0000H 1.000000 --------

003F -------- 00000, 00, 0000H, 0000H, 0000H, 0000H 10.000000 --------

0040 -------- 00000, 00, 0000H, 0000H, 0000H, 0000H 2.000000 --------

0041 -------- 00000, 00, 0000H, 0000H, 0000H, 0000H 20.000000 --------

0042 -------- 00000, 00, 0000H, 0000H, 0000H, 0000H 3.000000 --------

0043 -------- 00000, 00, 0000H, 0000H, 0000H, 0000H 30.000000 --------

00146 0044 0100H 1 00263, 32, 0000H, 0000H, 0000H, 0000H 0.000000 gettag | pv, i23001p00e0000 // get basis wt last avg...

00147 0045 0042H 2 00000, 00, 003EH, 0000H, 0000H, 0000H 0.000000 storex,@dwtlav1 // save it into the 0 index of real array

00148 0046 0100H 1 00265, 32, 0000H, 0000H, 0000H, 0000H 0.000000 gettag | pv, i23001p00e0002 // get moist last avg...

 00149 0047 0042H 2 00000, 00, 003EH, 0001H, 0000H, 0000H 0.000000 storex, @dwtlav1,1 // save it into the 1 index of real array

 00152 0048 000BH 1 00000, 00, 0064H, 0000H, 0000H, 0000H 100.000000 divc,100 // scale to percent

 00153 0049 000AH 2 00000, 00, 003EH, 0000H, 0000H, 0000H 0.000000 mulc, @dwtlav1 // mult bw

 00154 004A 000AH 1 00000, 00, FFFFH, 0000H, 0000H, 0000H -1.000000 mulc, -1 // make neg

 00156 004B 0008H 2 00000, 00, 003EH, 0000H, 0000H, 0000H 0.000000 addc, @dwtlav1 // add to basis wt

 00157 004C 0042H 2 00000, 00, 003EH, 0002H, 0000H, 0000H 0.000000 storex, @dwtlav1, 2 // save it to @dwtlav1 index 2

 00158 004D 0034H 0 00000, 00, 0000H, 0000H, 0000H, 0000H 0.000000 rtn

00165 004E 003EH 0 @dumtags TAGA reeldummy1, reeldummy2, reeldummy3, reeldummy4

004E -------- 01214, 32, 0000H, 0000H, 0000H, 0000H 0.000000 --------

004F -------- 01215, 32, 0000H, 0000H, 0000H, 0000H 0.000000 --------

0050 -------- 01216, 32, 0000H, 0000H, 0000H, 0000H 0.000000 --------

0051 -------- 01217, 32, 0000H, 0000H, 0000H, 0000H 0.000000 --------

00168 0052 0040H 1 00000, 00, 0001H, 0000H, 0000H, 0000H 1.000000 loadx,1

00169 0053 0102H 2 00000, 00, 004EH, 0000H, 0000H, 0000H 0.000000 settag | pv, @dumtags // save a 1 to the first address

 00170 0054 0102H 1 01215, 32, 0000H, 0000H, 0000H, 0000H 0.000000 settag | pv, reeldummy2 // or we could do it like this

 00171 0055 0102H 1 01216, 32, 0000H, 0000H, 0000H, 0000H 0.000000 settag | pv,_REELDUM1 // or we could do this one like this

 00172 0056 0102H 2 00000, 00, 004EH, 0003H, 0000H, 0000H 0.000000 settag | pv,@dumtags,3 // or like this @dumtags[2]

 00173 0057 0044H 0 00000, 00, 0000H, 0000H, 0000H, 0000H 0.000000 clrdi

00174 0058 0045H 0 00000, 00, 0000H, 0000H, 0000H, 0000H 0.000000 clrx

00175 0059 0043H 1 00000, 00, 0002H, 0004H, 0000H, 0000H 0.000000 repdi, 2, 4

00176 005A 0104H 3 00000, 00, 004EH, 0000H, 0000H, 0000H 0.000000 add | pv,@dumtags,di

00177 005B 0046H 0 00000, 00, 0000H, 0000H, 0000H, 0000H 0.000000 incdi

00178 005C 0102H 2 00000, 00, 004EH, 0003H, 0000H, 0000H 0.000000 settag | pv, @dumtags, 3 // set the last one

 00180 005D 0100H 2 00000, 00, 004EH, 0000H, 0000H, 0000H 0.000000 gettag | pv, @dumtags // get the first one

 00181 005E 011EH 2 00000, 00, 004EH, 0003H, 0000H, 0000H 0.000000 ifge |pv , @dumtags,3 // if it is >= last one which it should not be

 00182 005F 004BH 0 00000, 00, 0000H, 0000H, 0000H, 0000H 0.000000 nop

00184 0060 0120H 2 00000, 00, 004EH, 0003H, 0000H, 0000H 0.000000 ifle |pv , @dumtags,3 // if it is <= last one which it should be

 00185 0061 004BH 0 00000, 00, 0000H, 0000H, 0000H, 0000H 0.000000 nop

00186 0062 0034H 0 00000, 00, 0000H, 0000H, 0000H, 0000H 0.000000 rtn

00194 0063 003FH 0 @breaksig REALA -1

0063 -------- 00000, 00, 0000H, 0000H, 0000H, 0000H -1.000000 --------

00197 0064 0700H 1 00001, 33, 0000H, 0000H, 0000H, 0000H 0.000000 gettag | dcb, SHEETBREAK

00198 0065 0031H 2 00000, 00, 0063H, 0000H, 0000H, 0000H 0.000000 ifec, @breaksig // has the dcb changed

 00199 0066 0026H 0 00000, 00, 0069H, 0000H, 0000H, 0000H 0.000000 skip, $hasChanged

00200 0067 0045H 0 00000, 00, 0000H, 0000H, 0000H, 0000H 0.000000 clrx

00201 0068 0034H 0 00000, 00, 0000H, 0000H, 0000H, 0000H 0.000000 rtn

00203 0069 0042H 2 00000, 00, 0063H, 0000H, 0000H, 0000H 0.000000 storex,@breaksig // save the dcb

 00204 006A 0100H 1 00001, 33, 0000H, 0000H, 0000H, 0000H 0.000000 gettag | pv, SHEETBREAK // if sheet break it will return 1

 00207 006B 0034H 0 00000, 00, 0000H, 0000H, 0000H, 0000H 0.000000 rtn

00236 006C 0033H 0 00000, 00, 003BH, 0000H, 0000H, 0000H 0.000000 jsr, $all_scan_off // test send all scanners offsheet

 00238 006D 0033H 0 00000, 00, 002BH, 0000H, 0000H, 0000H 0.000000 jsr, $set_tj_to_man // set all tj zones to manual

 00239 006E 0033H 0 00000, 00, 002EH, 0000H, 0000H, 0000H 0.000000 jsr, $set_tj_to_auto // set all tj zones to auto

 00240 006F 0033H 0 00000, 00, 0013H, 0000H, 0000H, 0000H 0.000000 jsr, $newscan // test new scan

 00241 0070 001BH 0 00000, 00, 0000H, 0000H, 0000H, 0000H 0.000000 ifx

00242 0071 004BH 0 00000, 00, 0000H, 0000H, 0000H, 0000H 0.000000 nop // don't really skip if previous

 00243 0072 0033H 0 00000, 00, 0044H, 0000H, 0000H, 0000H 0.000000 jsr,$dwtlav // test dwtlav....

 00244 0073 0033H 0 00000, 00, 0000H, 0000H, 0000H, 0000H 0.000000 jsr,$atomtest // test the old atoms...

 00245 0074 0033H 0 00000, 00, 0052H, 0000H, 0000H, 0000H 0.000000 jsr,$effective // throw some fancy effective addressing of tags

 00248 0075 0033H 0 00000, 00, 0064H, 0000H, 0000H, 0000H 0.000000 jsr,$hasSheetJustBreak // has sheet just broke....

 00249 0076 0031H 1 00000, 00, 0001H, 0000H, 0000H, 0000H 1.000000 ifec, 1

00250 0077 0033H 0 00000, 00, 003BH, 0000H, 0000H, 0000H 0.000000 jsr, $all_scan_off // send all scanners offsheet

 00251 0078 0033H 0 00000, 00, 007AH, 0000H, 0000H, 0000H 0.000000 jsr,$wiztest

00254 0079 0032H 0 00000, 00, 0000H, 0000H, 0000H, 0000H 0.000000 exit

00004 007A 0100H 1 00457, 32, 0000H, 0000H, 0000H, 0000H 0.000000 x<<,i23010p00e0000 // test the wizmacs macros.....

 00005 007B 0031H 1 00000, 00, 0001H, 0000H, 0000H, 0000H 1.000000 ifx==c,1 // if scanner target is not offsheet

 00006 007C 0026H 0 00000, 00, 007FH, 0000H, 0000H, 0000H 0.000000 skip,$wizcon1

00007 007D 0040H 1 00000, 00, 0001H, 0000H, 0000H, 0000H 1.000000 x=,1

00008 007E 0102H 1 00457, 32, 0000H, 0000H, 0000H, 0000H 0.000000 x>>,i23010p00e0000

00010 007F 0034H 0 00000, 00, 0000H, 0000H, 0000H, 0000H 0.000000 rtn