/var/www/restricted/ssh/stm32/www/stm32circle/ STM CircleOS forum / Primer2 and evostm32 / 8L info

Username:     
Password:     
             

Forum

# 1   2011-03-09 20:23:19 Primer2 and evostm32 / 8L info

nrousselca
Member
Registered: 2009-07-24
Posts: 13

Primer2 and evostm32 / 8L info

Hi,
We have many STM8L assembler code aplication  build with (ST Visual Developper assembler/linker). I just wonder if there is any tutorial/skelton avaliable on how they can be ported  to STM8Primer CircleOS.

Regards
N.r.

Offline

 

# 2   2011-03-10 07:37:03 Primer2 and evostm32 / 8L info

Bruno
Software Engineer
From: Montbonnot, France
Registered: 2007-07-11
Posts: 13
Website

Re: Primer2 and evostm32 / 8L info

Hi,

You can install the Raisonance RKit-STM8, which offers 32KB of code size after free registration.
You don't need assembly (C is fine there too) but you can refer to assembly examples that are available from the "Examples" directory.

Best Regards,


-- Bruno Richard, Ph.D.

Offline

 

# 3   2011-03-10 14:02:29 Primer2 and evostm32 / 8L info

nrousselca
Member
Registered: 2009-07-24
Posts: 13

Re: Primer2 and evostm32 / 8L info

I allready searched this "Example" directory with no result.
Would you be kind enough to give me a more specific searching path to the assembler examples.

Thanks and best regards
N.R.

Offline

 

# 4   2011-03-11 09:08:09 Primer2 and evostm32 / 8L info

Bruno
Software Engineer
From: Montbonnot, France
Registered: 2007-07-11
Posts: 13
Website

Re: Primer2 and evostm32 / 8L info

Hi,

You can find a complete
application written in assembler in the ST7/STM8 Assembler manual (MASTM8.pdf) document.

However, the example is for ST7 only. Here is an example that shows how to make the equvalent in STM8 mode; the example includes vectors definition, reset etc, but does not do anything useful.

Code:

;-----------------------------------------------------------------------------
; MASTM8 example. This assembler application just performs a basic loop.
; It is used as an example to show how to use the Raisonance assembler to
; create an application.
;
; 2011/03/11 Bruno Richard
;       Created this basic example.
;-----------------------------------------------------------------------------

$(MODESTM8)                             ; We are assembling STM8 code, not ST7

        ; Let's define an executable code segment, named CSTART
        CSTART  SEGMENT CODE INSECTION0
        RSEG    CSTART

;-----------------------------------------------------------------------------
; Startup routine.
;-----------------------------------------------------------------------------

        PUBLIC  main
main:
        INCW    X                       ; Increment the X register (for example)
        ; ... Place your application code here
        JP      main

;-----------------------------------------------------------------------------
; Interrupt vector table.
;-----------------------------------------------------------------------------

        CSEG    AT 08000h               ; Interrupt vectors start at 8000h

        ; The reset vector is at address 08000h
        DB      082h                    ; 082h is a pseudo-opcode for JPF
        DB      HIGH24(main)
        DB      HIGH(main)
        DB      LOW(main)

END

Note that this is given as an example, but it is much more efficient to write STM8 applications in C rather than assembler.

Also the CircleOS applications must be in C, it is not possible (or relevant?) to write them in assembler.

Best Regards,


-- Bruno Richard, Ph.D.

Offline

 

Board footer