30 likes | 128 Views
Renaming registers. With the Gas style assemblers, you can rename registers to aid in readability. The . req directive can be used to create an alias for a register. Syntax: name . req register_name @ creates an alias for register_name called name Examples:
E N D
Renaming registers With the Gas style assemblers, you can rename registers to aid in readability. The .req directive can be used to create an alias for a register. Syntax: name .reqregister_name @ creates an alias for register_name called name Examples: pixels .req r0 width .req r1 height .req r2 mul pixels, width, height
Undefining a register alias Similarly, the unreq directive can be used to undefinea register alias which was previously defined using the reqdirective. Syntax: .unreq name @ creates an alias for register_name called name Note: If name is undefined, an error occurs Examples: .unreq pixels .unreq width .unreq height