func (p *Parser) registerExtension(a *obj.Addr, name string, prefix rune) {
	if prefix != 0 {
		p.errorf("prefix %c not allowed for shifted register: $%s", prefix, name)
	}

	reg, ok := p.registerReference(name)
	if !ok {
		p.errorf("unexpected %s in register extension", name)
		return
	}

	isIndex := false
	num := int16(0)
	isAmount := true // Amount is zero by default
	ext := ""
	if p.peek() == lex.LSH {
		// (Rn)(Rm<<2), the shifted offset register.
		ext = "LSL"
	} else {
		// (Rn)(Rm.UXTW<1), the extended offset register.
		// Rm.UXTW<<3, the extended register.
		p.get('.')
		tok := p.next()
		ext = tok.String()
	}
	if p.peek() == lex.LSH {
		// parses left shift amount applied after extension: <<Amount
		p.get(lex.LSH)
		tok := p.get(scanner.Int)
		amount, err := strconv.ParseInt(tok.String(), 10, 16)
		if err != nil {
			p.errorf("parsing left shift amount: %s", err)
		}
		num = int16(amount)
	} else if p.peek() == '[' {
		// parses an element: [Index]
		p.get('[')
		tok := p.get(scanner.Int)
		index, err := strconv.ParseInt(tok.String(), 10, 16)
		p.get(']')
		if err != nil {
			p.errorf("parsing element index: %s", err)
		}
		isIndex = true
		isAmount = false
		num = int16(index)
	}

	switch p.arch.Family {
	case sys.ARM64:
		err := arch.ARM64RegisterExtension(a, ext, reg, num, isAmount, isIndex)
		if err != nil {
			p.errorf(err.Error())
		}
	default:
		p.errorf("register extension not supported on this architecture")
	}
}
// registerExtension parses a register with extension or arrangement.
// There is known to be a register (current token) and an extension operator (peeked token).
registerExtension parses a register with extension or arrangement.
There is known to be a register (current token) and an extension operator (peeked token).
// registerExtension parses a register with extension or arrangement . // There is known to be a register ( current token ) and an extension operator ( peeked token ) .
func (p *Parser) registerExtension(a *obj.Addr, name string, prefix rune) {
	if prefix != 0 {
		p.errorf("prefix %c not allowed for shifted register: $%s", prefix, name)
	}
	reg, ok := p.registerReference(name)
	if !ok {
		p.errorf("unexpected %s in register extension", name)
		return
	}
	isIndex := false
	num := int16(0)
	isAmount := true 
	ext := ""
	if p.peek() == lex.LSH {
		ext = "LSL"
	} else {
		p.get('.')
		tok := p.next()
		ext = tok.String()
	}
	if p.peek() == lex.LSH {
		p.get(lex.LSH)
		tok := p.get(scanner.Int)
		amount, err := strconv.ParseInt(tok.String(), 10, 16)
		if err != nil {
			p.errorf("parsing left shift amount: %s", err)
		}
		num = int16(amount)
	} else if p.peek() == '[' {
		p.get('[')
		tok := p.get(scanner.Int)
		index, err := strconv.ParseInt(tok.String(), 10, 16)
		p.get(']')
		if err != nil {
			p.errorf("parsing element index: %s", err)
		}
		isIndex = true
		isAmount = false
		num = int16(index)
	}
	switch p.arch.Family {
	case sys.ARM64:
		err := arch.ARM64RegisterExtension(a, ext, reg, num, isAmount, isIndex)
		if err != nil {
			p.errorf(err.Error())
		}
	default:
		p.errorf("register extension not supported on this architecture")
	}
}
func ( p * Parser ) registerExtension ( a * obj . Addr , name string , prefix rune ) { if prefix != 0 { p . errorf ( " " , prefix , name ) } reg , ok := p . registerReference ( name ) if ! ok { p . errorf ( " " , name ) return } isIndex := false num := int16 ( 0 ) isAmount := true ext := " " if p . peek ( ) == lex . LSH { ext = " " } else { p . get ( '.' ) tok := p . next ( ) ext = tok . String ( ) } if p . peek ( ) == lex . LSH { p . get ( lex . LSH ) tok := p . get ( scanner . Int ) amount , err := strconv . ParseInt ( tok . String ( ) , 10 , 16 ) if err != nil { p . errorf ( " " , err ) } num = int16 ( amount ) } else if p . peek ( ) == '[' { p . get ( '[' ) tok := p . get ( scanner . Int ) index , err := strconv . ParseInt ( tok . String ( ) , 10 , 16 ) p . get ( ']' ) if err != nil { p . errorf ( " " , err ) } isIndex = true isAmount = false num = int16 ( index ) } switch p . arch . Family { case sys . ARM64 : err := arch . ARM64RegisterExtension ( a , ext , reg , num , isAmount , isIndex ) if err != nil { p . errorf ( err . Error ( ) ) } default : p . errorf ( " " ) } }
registerExtension parses a register with extension or arrangement.
registerExtension parses a register with extension or arrangement .
// Amount is zero by default // (Rn)(Rm<<2), the shifted offset register. // (Rn)(Rm.UXTW<1), the extended offset register. // Rm.UXTW<<3, the extended register. // parses left shift amount applied after extension: <<Amount // parses an element: [Index]