Variablen in einem Tiny unter Bascom

Gast #149758
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
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
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
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
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

Eine eigene Frage? Dieser Thread ist über 21 Jahre alt. Stell sie in einem eigenen Thread – dort lesen mehr Leute mit, und sie wird öfter und schneller beantwortet.

Neuen Thread starten

Eine Lösung, Ergänzung oder Rückmeldung zu diesem Thread? Dann antworte hier.

Formatierung
  • [c]C-Code[/c]
  • [code]Code in anderen Sprachen, ASCII-Zeichnungen[/code]
  • [math]Formel in LaTeX-Syntax[/math]
  • [[Titel]] – Link zu einem Artikel
  • Verweis auf einen anderen Beitrag: Rechtsklick auf dessen Beitrags-ID (#8078628), „Adresse kopieren“, in den Text einfügen

Mehr zur Formatierung

Längeren Sourcecode als Anhang, nicht in den Text. JPG nur für Fotos und Scans; Zeichnungen und Screenshots als PNG oder GIF. Siehe Bildformate.

Schon registriert? Anmelden

Wird nicht angezeigt. Wir schicken dir einen Link; sobald du damit bestätigst, erscheint dein Beitrag.

Mit dem Abschicken legst du einen kostenlosen Account an und erkennst die Nutzungsbedingungen und die Datenschutzerklärung an.