Re: [go-nuts] Re: implementing macro in plan 9 assembly

2021-04-09 Thread JX Zhang
Go does can define functions in a plan9 style assembly file. I have a question about how to compile a plan9 style asm file to an ELF .o object? 在2020年10月20日星期二 UTC+8 上午1:12:45 写道: > Have a look at https://golang.org/doc/asm > and examples are always a good source of inspiration. For example > h

Re: [go-nuts] Re: implementing macro in plan 9 assembly

2020-10-19 Thread Diego Joss
Have a look at https://golang.org/doc/asm and examples are always a good source of inspiration. For example https://golang.org/src/math/dim.go at line 35 defines the prototype for function Max, which is implemented in assembly in https://golang.org/src/math/dim_amd64.s -- Diego On Fri, 16 Oct 202

Re: [go-nuts] Re: implementing macro in plan 9 assembly

2020-10-16 Thread saurav deshpande
okay, Thank you On Friday, October 16, 2020 at 6:06:34 PM UTC+5:30 iko...@gmail.com wrote: > I think you can use nasm assembly through inline ASM in cgo indirectly... > Go supports writing .s-files written in Go's internal assembly format, > which should be much faster than cgo to compile and

Re: [go-nuts] Re: implementing macro in plan 9 assembly

2020-10-16 Thread Joop Kiefte
I think you can use nasm assembly through inline ASM in cgo indirectly... Go supports writing .s-files written in Go's internal assembly format, which should be much faster than cgo to compile and is probably preferable, but needs a bit of learning. [Joop Kiefte - Chat @ Spike](https://spikeno

Re: [go-nuts] Re: implementing macro in plan 9 assembly

2020-10-16 Thread saurav deshpande
So, is it possible to define functions declared in go and defined in nasm assembly? If yes then can you please share an example. Thank you On Friday, October 16, 2020 at 5:39:33 PM UTC+5:30 iko...@gmail.com wrote: > I don't know how this should actually be done, but remember that the Go > asse

Re: [go-nuts] Re: implementing macro in plan 9 assembly

2020-10-16 Thread Joop Kiefte
I don't know how this should actually be done, but remember that the Go assembly is not actually Plan 9 assembly, it's an abstraction by itself, meant for internal use first and foremost. [Joop Kiefte - Chat @ Spike](https://spikenow.com/r/a/?ref=spike-organic-signature&_ts=q9y39) [q9y39] O

[go-nuts] Re: implementing macro in plan 9 assembly

2020-10-16 Thread saurav deshpande
Thank you for the reply. I do not understand, actually I am trying to define the fuctions in plan9 assembly whoes declaration is done in a go file. I want to use macro like the macro in nasm, but couldn't understand how to do it. It would be very helpful if you could give an example. Thank you.

[go-nuts] Re: implementing macro in plan 9 assembly

2020-10-15 Thread Anthony Martin
saurav deshpande once said: > How to implement macro in plan9 assembly? I read the documentation of > plan9 assembly but could not find it. Is there any alternative for > macro in plan9? Assembly language source files are preprocessed just like C source. The familiar #define and #include directiv