Das Konstrukt data = portv wird vom Compiler nicht akzeptiert.
portv.0 alias porta.0 ist die Definition eines HW-Pins.
Dass vom Compiler portv.0 als Namensdefinition akzeptiert wird, heisst nicht, dass der Namens-Teil PortV für sich allein eine Funktion erhält, nämlich quasi ein Zusammenfassung auf ein Byte.
Ich schlage vor die Zuweisung mit einer SUB zu erledigen:
Folgender Code-Schnipsel funktioniert zumindest im Simulator
Code:
$Regfile "M128def.dat"
portv.0 alias porta.0
portv.1 alias porta.4
portv.2 alias portb.3
portv.3 alias portb.4
portv.4 alias portb.5
portv.5 alias portb.6
portv.6 alias portd.6
portv.7 alias portd.7
Dim b1 as Byte
Declare Sub SetPortV (bPort as Byte)
Config PortA = Output
Config PortB = Output
Config PortC = Output
Config PortD = Output
b1 = &HFF
SetPortV b1
b1 = 0
SetPortV b1
end
Sub SetPortV (bPort as Byte)
portV.0 = bPort.0
PortV.1 = bPort.1
PortV.2 = bPort.2
PortV.3 = bPort.3
PortV.4 = bPort.4
PortV.5 = bPort.5
PortV.6 = bPort.6
PortV.7 = bPort.7
end sub
Lesezeichen