-
-
Notifications
You must be signed in to change notification settings - Fork 1k
doc:AsmFull examples are outdated and cause compilation errors #5004
Copy link
Copy link
Closed
Labels
docsDocumentation neededDocumentation needed
Description
The documentation for device.AsmFull contains outdated examples that use pointer operands, which were removed in TinyGo 0.23. Following the documented examples results in compilation errors.
package main
import "device"
func main() {
var dest int32
device.AsmFull("str {value}, {result}", map[string]interface{}{
"value": 1,
"result": &dest, // This line causes the error
})
}$ tinygo build -target=esp32-coreboard-v2 test.go
test.go:7:16: support for pointer operands was dropped in TinyGo 0.23so i think this comment need update,like follow
// 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(
// "st {value}, {result}",
// map[string]interface{}{
// "value": 1
// "result": uintptr(unsafe.Pointer(&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{}) uintptrReactions are currently unavailable
Metadata
Metadata
Assignees
Labels
docsDocumentation neededDocumentation needed