Lumousoft
  • Home
  • Products
  • Support
    • FAQs
    • Learning
  • About Us
  • Contact Us
  • Products & Consulting

    • PIC

    • Splitwasher Basic
    • Splitwasher Premium
    • ARM

    • Under Development
    • CONSULTING

    • Embedded project
    • Others
  • What's News

  • Lumousoft Inc. is specializing in graphic language design for embedded system. It has own compiler which is suitable for graphic and RTOS. Lumousoft graphic language is 100% module-based language even its library is built in module without the interaction of other language.
  • Free Download

  • Lumousoft Splitwasher 2018 for PIC
  • And More

  • Why Lumousoft
  • Learning Center
  • FAQs
  • About Us
  • Contact Us
  • Send us message

  • Tel: (519) 746-7178

  • Email: info@lumousoft.com

Assembly language implemented in lumousoft graphic language

Since assembly language is flexible and efficient, the assembly language is still found application in embedded field. Usually assembly language is embedded in other language. Lumousoft graphic language allows assembly language to be embedded in block environment.

1. Assembly language operand — Variable

Assembly language operand can be variable defined in the module including array, pointer. But these variables used in assembly language must be those variables that have known address through static analysis. The unhandled variable looks like a[i], *p, where p=&x+i; variable “ a ” is array variable and “ i ” is a variable, “ p ” is pointer variable; in other words, theses unhandled variable can only be handled by indirect address. The variable that assembly language instruction can handle should have known address after static analysis. The variable can be array, pointer, and regular variable except bit variable. Because Assembly instruction only handle single- byte variable, if the variable is composed of more than one byte, only the first byte can be handled by assembly instruction. To solve one-byte problem, we can implement pointer to handle all bytes.

As for memory bank, the Lumousoft graphic compiler will use trace analyzer to analyze the variable that assembly instruction handle, and automatically inserts bank setup code if necessary.

The variable used by assembly language can be performed memory optimization.

2. Key words — “asm ” and “label”

In order to distinguish assembly language in lumousoft graphic language, the assembly instruction is prepended a key word “asm”. If “asm” does not stay before the assembly instruction, the IDE will automatically prepend “asm”.

Label is another key word used in assembly language, which is to indicate that address of program memory and can be used for instruction “goto” or “call”. The label must be followed by a label name. this label name is treated as a constant variable in compiler, we call the label name as label variable. Therefore we can use label variable to perform some special calculation. Because the value of label constant variable is known after program memory allocation in the later stage of compilation, it must be careful to use these label constant variables.

By the way, the assembly instruction “goto” or “call” might destroy the construction of software, it highly recommend not to use.

To facilitate program, the block dialog lists all assembly instructions as shown in Fig.1.

3. Example code

Fig.1 shows the graphic codes, the variable “a ” has a data type of short; pa is a pointer variable with short data type. In the graphic code, there is not codes to set memory bank, but in assembly codes which are obtained by compilation, in line 37 and 42 are there memory bank setting codes, That is because the compilter can automatically inserts bank setting code to ensure program correct.

graphic code

Fig.1 graphic code and block dialog

assembly codes

Fig.2 Assembly codes

Conclusion

Lumousft graphic language allows assembly codes to be embedded in block diagram and keep variable consistency.

©Lumousoft Inc. 2013 - 2018.   

Links

Elektronik Forum EEWeb : EEWEb Germany is an online community for electronics and electrical engineers and hobbyist. It offers electrical engineering and electronics forum. It also has electrical and electronic design articles, and resources in the area of RF design, analog design, embedded design, PCB design, test and measure.

Power Electronics News: Power Electronics News offers electrical engineering news focused on Power and Power solutions. Up to date solutions and products featuring the latest innovations in power solutions.

PCBWeb : A free CAD application for designing and manufacturing electronics hardware.