30 likes | 156 Views
Learn how to rename registers for better readability in Gas style assemblers. Use req and unreq directives to manage register aliases easily. Get syntax examples for creating and undefining aliases.
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