Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- start: in "" => r_x
- loadI 0 => r_i
- loadI @alength => r_len
- for: cmp_LT r_i,r_len => r_cmp
- cbr r_cmp -> body,end
- body: i2i r_i => r_a // compute address of a[i]
- multI r_a,4 => r_a // multiply by size of int
- addI r_a,@a => r_a // add a's base offset
- loadAO r_arp,r_a => r_ai // r_ai <- a[i]
- cmp_EQ r_ai,r_x => r_cmp
- cbr r_cmp -> end,jump
- jump: addI r_i,1 => r_i
- jumpI -> for
- end: out "Index: ",r_i
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement