www.ChristianApelt.de
optimiert für Firefox
letzte Aktualisierung: 10.2016


I/O-Modul / Befehlssatz




Befehlssatz fĂĽr Variante mit 89C2051 / 89C4051 (2K / 4K Flash)



Bit = Bit-Position
Byte = Byte-Position
3Byte= Byte-Position auf das Low-Byte der 3Byte Variable [Byte_L, Byte_M, Byte_H]
O= OUTPUT Bit
M= MERKER Bit
I= INPUT Bit
D= DEBUG-INPUT Bit
X= Bit Variable
B= Byte Variable / Startbyte der 3Byte Variable
#= Bit, Byte oder 3Byte Konstante
*= Kennung fĂĽr Funktionsparameter-Name

CodeBefehlParameter Funktion Beschreibung
0x00 OUTPUT [X1 Bit],[O1 Bit] O1 = X1 Ausgang setzen
0x01 MERKER [X1 Bit],[M1 Bit] M1 = X1 Merker setzen
     
0x02 INIT1 [#1 Bit],[X1 Bit] X1 = #1 Bit Variable initialisieren
0x03 INIT8 [#1 Byte],[B1 Byte] B1 = #1 Byte Variable initialisieren
0x04 INIT24 [#1 3Byte],[B1 Byte] B1 = #1 3Byte Variable initialisieren
     
0x05 AND1 [X1 Bit],[X2 Bit],[X3 Bit] X3 = X1 and X2 AND Funktion für Bits
0x06 OR1 [X1 Bit],[X2 Bit],[X3 Bit] X3 = X1 or X2 OR Funktion für Bits
0x07 NOT1 [X1 Bit],[X2 Bit] X2 = not X1 NOT Funktion für Bits
0x08 XOR1 [X1 Bit],[X2 Bit],[X3 Bit] X3 = X1 xor X2 XOR Funktion für Bits
0x09 NAND1 [X1 Bit],[X2 Bit],[X3 Bit] X3 = X1 nand X2 NAND Funktion für Bits
0x0A NOR1 [X1 Bit],[X2 Bit],[X3 Bit] X3 = X1 nor X2 NOR Funktion für Bits
0x0B AND8 [B1 Byte],[B2 Byte],[B3 Byte] B3 = B1 and B2 AND Funktion für Bytes
0x0C OR8 [B1 Byte],[B2 Byte],[B3 Byte] B3 = B1 or B2 OR Funktion für Bytes
0x0D NOT8 [B1 Byte],[B2 Byte] B2 = not B1 NOT Funktion für Bytes
0x0E XOR8 [B1 Byte],[B2 Byte],[B3 Byte] B3 = B1 xor B2 XOR Funktion für Bytes
0x0F NAND8 [B1 Byte],[B2 Byte],[B3 Byte] B3 = B1 nand B2 NAND Funktion für Bytes
0x10 NOR8 [B1 Byte],[B2 Byte],[B3 Byte] B3 = B1 nor B2 NOR Funktion für Bytes
     
0x20 COUNTER24 [X1 Bit],[X2 Bit],[B1 3Byte],[X3 Bit] X1 = Reset
X2 = Enable
B1 = Zähler
X3 = Überlauf
24Bit Zähler mit Reset, Enable und Überlauf
0x21 CMP_K_8 [B1 Byte],[B2 Byte],[X1 Bit] B1 < B2
X1 = Output
8Bit Vergleicher (kleiner)
0x22 CMP_E_8 [B1 Byte],[B2 Byte],[X1 Bit] B1 = B2
X1 = Output
8Bit Vergleicher (gleich)
0x23 CMP_G_8 [B1 Byte],[B2 Byte],[X1 Bit] B1 > B2
X1 = Output
8Bit Vergleicher (größer)
0x24 CMP_K_24 [B1 3Byte],[B2 3Byte],[X1 Bit] B1 < B2
X1 = Output
24Bit Vergleicher (kleiner)
0x25 CMP_E_24 [B1 3Byte],[B2 3Byte],[X1 Bit] B1 = B2
X1 = Output
24Bit Vergleicher (gleich)
0x26 CMP_G_24 [B1 3Byte],[B2 3Byte],[X1 Bit] B1 > B2
X1 = Output
24Bit Vergleicher (größer)
0x27 TON_24 [X1 Bit],[B1 3Byte],[B2 3Byte],[X2 Bit] X1 = Enable
B1 = Zeitkonstante
B2 = interner Zähler
X2 = Output
Einschaltverzögerung
0x28 TOFF_24 [X1 Bit],[B1 3Byte],[B2 3Byte],[X2 Bit] X1 = Enable
B1 = Zeitkonstante
B2 = interner Zähler
X2 = Output
Ausschaltverzögerung
0x29 TPULS_24 [X1 Bit],[B1 3Byte],[B2 3Byte],[X2 Bit] X1 = Enable
B1 = Zeitkonstante
B2 = interner Zähler
X2 = Output
Pulsgeber
     
0x2E IMP_NF [X1 Bit],[X2 Bit],[X3 Bit] X1 = Input
X2 = interne Var.
X3 = Output
Negative Flanke erkennen
0x2F IMP_PF [X1 Bit],[X2 Bit],[X3 Bit] X1 = Input
X2 = interne Var.
X3 = Output
Positive Flanke erkennen
     
0x30 ADD_8 [B1 Byte],[B2 Byte],[B3 Byte] B3 = B1 + B2 Addition
0x31 SUB_8 [B1 Byte],[B2 Byte],[B3 Byte] B3 = B1 - B2 Subtraktion
0x32 MUL_8 [B1 Byte],[B2 Byte],[B3 Byte] B3 = B1 * B2 Multiplikation
(8Bit = 8Bit * 8Bit)
0x33 DIV_8 [B1 Byte],[B2 Byte],[B3 Byte] B3 = B1 / B2 Division
0x34 MOD_8 [B1 Byte],[B2 Byte],[B3 Byte] B3 = B1 % B2 Modulo
(Rest einer Division)
0x35 ADD_C [B1 Byte],[B2 Byte],[X1 Bit],[B3 Byte],[X2 Bit] B3/X2 = B1+B2+X1
X1 = Carry-IN
X2 = Carry-Out
Addition mit Carry
0x36 SUB_C [B1 Byte],[B2 Byte],[X1 Bit],[B3 Byte],[X2 Bit] B3/X2 = B1-B2-X1
X1 = Carry-IN
X2 = Carry-Out
Subtraktion mit Carry
0x37 MUL_16 [B1 Byte],[B2 Byte],[B3 Byte] B3 = B1 * B2 Multiplikation
(16Bit = 8Bit * 8Bit)
0x38 INC_8 [B1 Byte] B1 = B1 + 1 Incrementieren
0x39 DEC_8 [B1 Byte] B1 = B1 - 1 Decrementieren
0x3A RS_FF [X1 Bit],[X2 Bit],[X3 Bit] X1 = Set (Priorität)
X2 = Reset
X3 = Output
RS FlipFlop
0x3B UM_8 [X1 Bit],[B1 Byte],[B2 Byte],[B3 Byte] X1 = 0: B3 = B1
X1 = 1: B3 = B2
Auswahl 1 aus 2
     
0x3D TASK_ZEIT [B1 Byte] B1 = Taskzeit Taskzeit setzen
(B1 * 10ms)
0x3E INIT_END kein Parameter   Ende der Initialisierung
0x3F END kein Parameter   Ende des Programms