# Copyright (c) 2021-2022 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. .record panda.String .function i32 main() { movi v0, 0x0 movi v1, 0x5 newarr v2, v1, i32[] movi v3, 0x3 lda v3 starr v2, v0 movi v4, 0x1 movi v5, 0x4 lda v5 starr v2, v4 movi v4, 0x2 lda v1 starr v2, v4 ldai 0x6 starr v2, v3 ldai 0x7 starr v2, v5 mov v3, v0 jump_label_1: lda v3 jge v1, jump_label_0 lda v3 ldarr v2 add2 v0 sta v4 lda v3 addi 0x1 sta v0 mov v3, v0 mov v0, v4 jmp jump_label_1 jump_label_0: lda v0 addi -25 jeqz label_2 ldai 2 return label_2: movi v0, 2 newarr v1, v0, panda.String[] lda.str "asdf\n" movi v3, 0 starr.obj v1, v3 lda.str "zxcv\n" movi v3, 1 starr.obj v1, v3 ldai 0 ldarr.obj v1 sta.obj v1 lda.str "asdf\n" jeq.obj v1, label_3 ldai 3 return label_3: ldai 0 return }