本文整理汇总了Golang中code/google/com/p/rsc/c2go/liblink.Prog.Line方法的典型用法代码示例。如果您正苦于以下问题:Golang Prog.Line方法的具体用法?Golang Prog.Line怎么用?Golang Prog.Line使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类code/google/com/p/rsc/c2go/liblink.Prog
的用法示例。
在下文中一共展示了Prog.Line方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: Pconv
func Pconv(p *liblink.Prog) string {
var str string
var fp string
switch p.As {
case ADATA:
str = fmt.Sprintf("%.5d (%v)\t%v\t%v/%d,%v", p.Pc, p.Line(), Aconv(p.As), Dconv(p, 0, &p.From), p.From.Scale, Dconv(p, 0, &p.To))
case ATEXT:
if p.From.Scale != 0 {
str = fmt.Sprintf("%.5d (%v)\t%v\t%v,%d,%v", p.Pc, p.Line(), Aconv(p.As), Dconv(p, 0, &p.From), p.From.Scale, Dconv(p, fmtLong, &p.To))
break
}
str = fmt.Sprintf("%.5d (%v)\t%v\t%v,%v", p.Pc, p.Line(), Aconv(p.As), Dconv(p, 0, &p.From), Dconv(p, fmtLong, &p.To))
default:
str = fmt.Sprintf("%.5d (%v)\t%v\t%v,%v", p.Pc, p.Line(), Aconv(p.As), Dconv(p, 0, &p.From), Dconv(p, 0, &p.To))
break
}
fp += str
return fp
}
示例2: Pconv
func Pconv(p *liblink.Prog) string {
var str string
var sc string
var fp string
var a int
var s int
a = p.As
s = p.Scond
sc = extra[s&C_SCOND]
if s&C_SBIT != 0 {
sc += ".S"
}
if s&C_PBIT != 0 {
sc += ".P"
}
if s&C_WBIT != 0 {
sc += ".W"
}
if s&C_UBIT != 0 { /* ambiguous with FBIT */
sc += ".U"
}
if a == AMOVM {
if p.From.Typ == D_CONST {
str = fmt.Sprintf("%.5d (%v)\t%v%s\t%v,%v", p.Pc, p.Line(), Aconv(a), sc, RAconv(&p.From), Dconv(p, 0, &p.To))
} else if p.To.Typ == D_CONST {
str = fmt.Sprintf("%.5d (%v)\t%v%s\t%v,%v", p.Pc, p.Line(), Aconv(a), sc, Dconv(p, 0, &p.From), RAconv(&p.To))
} else {
str = fmt.Sprintf("%.5d (%v)\t%v%s\t%v,%v", p.Pc, p.Line(), Aconv(a), sc, Dconv(p, 0, &p.From), Dconv(p, 0, &p.To))
}
} else if a == ADATA {
str = fmt.Sprintf("%.5d (%v)\t%v\t%v/%d,%v", p.Pc, p.Line(), Aconv(a), Dconv(p, 0, &p.From), p.Reg, Dconv(p, 0, &p.To))
} else if p.As == ATEXT {
str = fmt.Sprintf("%.5d (%v)\t%v\t%v,%d,%v", p.Pc, p.Line(), Aconv(a), Dconv(p, 0, &p.From), p.Reg, Dconv(p, 0, &p.To))
} else if p.Reg == NREG {
str = fmt.Sprintf("%.5d (%v)\t%v%s\t%v,%v", p.Pc, p.Line(), Aconv(a), sc, Dconv(p, 0, &p.From), Dconv(p, 0, &p.To))
} else if p.From.Typ != D_FREG {
str = fmt.Sprintf("%.5d (%v)\t%v%s\t%v,R%d,%v", p.Pc, p.Line(), Aconv(a), sc, Dconv(p, 0, &p.From), p.Reg, Dconv(p, 0, &p.To))
} else {
str = fmt.Sprintf("%.5d (%v)\t%v%s\t%v,F%d,%v", p.Pc, p.Line(), Aconv(a), sc, Dconv(p, 0, &p.From), p.Reg, Dconv(p, 0, &p.To))
}
fp += str
return fp
}