Log in
Register
Home
Forums
New posts
Search forums
What's new
Featured content
New posts
New profile posts
Latest activity
News
Members
Current visitors
New profile posts
Search profile posts
Features
Log in
Register
What's new
Search
Search titles only
By:
Search titles only
By:
New posts
Search forums
Menu
Install the app
Install
Reply to thread
Home
Forums
Off Topic
The Basement
Copyright, Patent, General Intellectual Property Discussion (Branch from M32 Thread)
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Message
<blockquote data-quote="Ron Kimball" data-source="post: 115309" data-attributes="member: 405"><p>Re: New Midas M32 Console</p><p></p><p>There's lots of PD code for those around - most DSP chip makers have them for free. When I was at Intel the next group over was doing stuff like that in ARM assembler, also stuff like an MP3 decoder - I forget what else.</p><p></p><p>Hmm, it was a couple years back I wrote the OS I'm using right now on an ARM M0 (Nuvoton part) , here's the only "assembler" in it for those interested - the actual task switch code:</p><p></p><p>static __asm void RTOS_Switch(uint32_t **oldsp, uint32_t *newsp)</p><p>{</p><p>// "C" routines do not expect subroutines to preserve R0-R4, R12</p><p>// M0 cannot "push" R8+</p><p></p><p> MOV R2, SP</p><p> SUBS R2, #CONTEXTSIZE*4 </p><p> STR R2, [R0]</p><p> MOV R12, R1</p><p></p><p> MOV R0, R8</p><p> MOV R1, R9</p><p> MOV R2, R10</p><p> MOV R3, R11</p><p></p><p> PUSH {R0-R7, LR}</p><p> </p><p> MOV SP, R12</p><p></p><p> POP {R0-R7}</p><p></p><p> MOV R8, R0</p><p> MOV R9, R1</p><p> MOV R10, R2</p><p> MOV R11, R3</p><p></p><p> POP {PC}</p><p>}</p><p></p><p>Easy Peasy :razz:</p></blockquote><p></p>
[QUOTE="Ron Kimball, post: 115309, member: 405"] Re: New Midas M32 Console There's lots of PD code for those around - most DSP chip makers have them for free. When I was at Intel the next group over was doing stuff like that in ARM assembler, also stuff like an MP3 decoder - I forget what else. Hmm, it was a couple years back I wrote the OS I'm using right now on an ARM M0 (Nuvoton part) , here's the only "assembler" in it for those interested - the actual task switch code: static __asm void RTOS_Switch(uint32_t **oldsp, uint32_t *newsp) { // "C" routines do not expect subroutines to preserve R0-R4, R12 // M0 cannot "push" R8+ MOV R2, SP SUBS R2, #CONTEXTSIZE*4 STR R2, [R0] MOV R12, R1 MOV R0, R8 MOV R1, R9 MOV R2, R10 MOV R3, R11 PUSH {R0-R7, LR} MOV SP, R12 POP {R0-R7} MOV R8, R0 MOV R9, R1 MOV R10, R2 MOV R11, R3 POP {PC} } Easy Peasy :razz: [/QUOTE]
Insert quotes…
Verification
Post reply
Home
Forums
Off Topic
The Basement
Copyright, Patent, General Intellectual Property Discussion (Branch from M32 Thread)
Top
Bottom
Sign-up
or
log in
to join the discussion today!