You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following macro causes problems when called more than once. The second call's .data supersedes the first and in the final program "lemon" is printed twice.
.macro print_string(%str).datavar: .string %str.text li a7 4 la a0 var ecall.end_macro.text print_string("apple") print_string("lemon")
RARS solves this problem by adding a _M{#} suffix to the .data definitions inside of macros, so that the macros above would define var_M0 and var_M1 respectively. This counter is global, if a different macro call also defines var, it'll call it var_M2.
The text was updated successfully, but these errors were encountered:
The following macro causes problems when called more than once. The second call's .data supersedes the first and in the final program "lemon" is printed twice.
RARS solves this problem by adding a _M{#} suffix to the .data definitions inside of macros, so that the macros above would define var_M0 and var_M1 respectively. This counter is global, if a different macro call also defines var, it'll call it var_M2.
The text was updated successfully, but these errors were encountered: