Variablen in einem Tiny unter Bascom

Gast #149758
Lesenswert?

ja, ich hab das schonmal versucht mit dem $tiny und es hat nicht
funktioniert... in den Samples von Bascom ist allerdings für den 1200er
auch das $tiny verwendet... funktioniert bei mir leider genausowenig!
Gast #149760
Lesenswert?

das Problem ist, dass Bascom die Variablen in den SRam speicher, wobei
die meißten Tinys keinen SRam haben... also muss man Bascom sagen, dass
es sich um einen Tiny handelt, damit es die Variablen anders speichert!
Gast #149761
Lesenswert?

Aus der Bascom (1.11.7.3)-Dokumentation:
(auf das unten angehängte Beispiel achten)


$Tiny

Instruct the compiler to generate initialize code without setting up
the stacks.

Remarks

The tiny11 for example is a powerful chip. It only does not have SRAM.
BASCOM depends on SRAM for the hardware stack and software stack.

When you like to program in ASM you can use BASCOM with the $TINY
directive.

Some BASCOM statements will also already work but the biggest part will
not work.

BASCOM will support a subset of the BASCOM statements and function to
be used with the chips without SRAM. There will be a special tiny.lib
that will use little registers and will have at most a 3 level deep
call since tiny chips do have a 3 level deep hardware stack that may be
used for calls.

Note that the generated code is not yet optimized for the tiny parts.
The $tiny directive is just a start of the tiny parts implementation!

No support is available for this feature until the tiny.lib is
implemented.




  $tiny
  dim X AS iram BYTE, y AS iram BYTE
  X = 1 : Y = 2 : X = x + y


Zitat aus einer Mail aus der Bascom-Mailingliste:

  You can do some things with tiny's with bascom.
  1) You need a $tiny directive.
  2) Only byte operations are supported - no words, longs or singles.
  3) Calls/gosubs only 3 deep - hardware stack.
  4) Only single maths operations per line.
  5) Not all the comands will work, some conditional branches
     (if/then) don't work as expected.
Gast #149762
Lesenswert?

ja, das obige aus der Bascom Hilfe kenn ich schon... hab auch alles so
angewendet!

Bei dem Zitat kommt mir der Punkt 5 seltsam vor... wie soll ich
Überprüfungen auf nen bestimmten Wert meiner Byte-Variablen machen,
wenn nicht mit if???
Gast #149766
Lesenswert?

mhh... wäre ne Idee... Ich würde es zwar ne verstehen warum das geht und
if nicht, aber ich werds mal probieren, wenn ich wieder aus dem Urlaub
da bin!

Ich glaube, das wird jetzt erstmal der letzte Post sein, eh ich in den
Winterurlaub starte!
Erstmal danke für eure Hilfe!

Antwort schreiben

Bitte melde dich an, um einen Beitrag zu schreiben.

oder

Mit Google-Account einloggen

Die Registrierung ist kostenlos und dauert nur eine Minute.

Jetzt registrieren