mirror of https://github.com/tinygo-org/tinygo.git
Browse Source
This is necessary to avoid a circular dependency between the device/avr and runtime/interrupts package in the next commit. It may be worth replacing existing calls like device/arm.Asm to device.Asm, to have a single place where these are defined.pull/1174/head
Ayke van Laethem
4 years ago
committed by
Jaden Weiss
2 changed files with 23 additions and 2 deletions
@ -0,0 +1,21 @@ |
|||
package device |
|||
|
|||
// Run the given assembly code. The code will be marked as having side effects,
|
|||
// as it doesn't produce output and thus would normally be eliminated by the
|
|||
// optimizer.
|
|||
func Asm(asm string) |
|||
|
|||
// Run the given inline assembly. The code will be marked as having side
|
|||
// effects, as it would otherwise be optimized away. The inline assembly string
|
|||
// recognizes template values in the form {name}, like so:
|
|||
//
|
|||
// arm.AsmFull(
|
|||
// "str {value}, {result}",
|
|||
// map[string]interface{}{
|
|||
// "value": 1
|
|||
// "result": &dest,
|
|||
// })
|
|||
//
|
|||
// You can use {} in the asm string (which expands to a register) to set the
|
|||
// return value.
|
|||
func AsmFull(asm string, regs map[string]interface{}) uintptr |
Loading…
Reference in new issue