1# Copyright (c) 2021-2022 Huawei Device Co., Ltd. 2# Licensed under the Apache License, Version 2.0 (the "License"); 3# you may not use this file except in compliance with the License. 4# You may obtain a copy of the License at 5# 6# http://www.apache.org/licenses/LICENSE-2.0 7# 8# Unless required by applicable law or agreed to in writing, software 9# distributed under the License is distributed on an "AS IS" BASIS, 10# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11# See the License for the specific language governing permissions and 12# limitations under the License. 13 14.record panda.String <external> 15 16.function i32 main() { 17 movi v0, 0x0 18 movi v1, 0x5 19 newarr v2, v1, i32[] 20 movi v3, 0x3 21 lda v3 22 starr v2, v0 23 movi v4, 0x1 24 movi v5, 0x4 25 lda v5 26 starr v2, v4 27 movi v4, 0x2 28 lda v1 29 starr v2, v4 30 ldai 0x6 31 starr v2, v3 32 ldai 0x7 33 starr v2, v5 34 mov v3, v0 35 jump_label_1: lda v3 36 jge v1, jump_label_0 37 lda v3 38 ldarr v2 39 add2 v0 40 sta v4 41 lda v3 42 addi 0x1 43 sta v0 44 mov v3, v0 45 mov v0, v4 46 jmp jump_label_1 47 jump_label_0: lda v0 48 addi -25 49 jeqz label_2 50 ldai 2 51 return 52label_2: 53 movi v0, 2 54 newarr v1, v0, panda.String[] 55 lda.str "asdf\n" 56 movi v3, 0 57 starr.obj v1, v3 58 lda.str "zxcv\n" 59 movi v3, 1 60 starr.obj v1, v3 61 ldai 0 62 ldarr.obj v1 63 sta.obj v1 64 lda.str "asdf\n" 65 jeq.obj v1, label_3 66 ldai 3 67 return 68label_3: 69 ldai 0 70 return 71} 72