AMR 循环赋值

本文通过两个具体的ARM汇编语言示例,展示了如何使用循环结构进行累加运算。首先介绍了简单的循环累加过程,随后进一步增加了复杂度,演示了子程序调用的方式实现循环,并在每次循环中更新两个寄存器的值。


循序渐进 来点稍微复杂一点的 

比如C语言中的 

for(int i=0;i<10;i++)

a+a+i;

类似操作

mov r1,#1

mov r0,#0;

for_start

        cmp r0,#10

        bcs stop

       add r1,r1,r0

       add r0,r0,r1

      b  for_start


stop

      b .

end


到了这里 我们在深度复杂化

mov r0,#1

mov r2,#10

bl for_start

mov r2,#4

bl for_start

b stop

for_start

    mov r0,#0

    mov r1,#0

for_loop

    cmp r0,r2

    bcs for_end

    add r1,r1,r0

    add r1,r1,r0

    b for_loop

for_end

   mov pc,lr

stop

   b .

end


今天就到这 有空再写






with open(fr'{outpath}\AMR_GetInitialLots_HE.txt', 'r', encoding='utf-8') as file: list = [] for ind,i in enumerate(file): # print(i) # extract title if ind <= 6 : if ind == 2: temp = i.replace("'", "").split(' ') title = temp[2:-1] title.append(temp[-1][:-1]) print(title) else: continue else: if len(i) <= 1: break else: res = i.split("' '") ls = [] for ind,item in enumerate(res): try: if ind == 0: # 'Lotid ls.append(item[1:]) elif ind == len(res)-1: # CurrentLocationFlag'/n ls.append(item[:-3]) else: ls.append(item) except: print(fr'Error lot info: {res}') # record_list.append([fr'Error lot info: {res}']) # pd.DataFrame(record_list).to_csv(fr'{outpath}\record_{start_time_str}.csv') # pd.DataFrame(record_list).to_csv(fr'{outpath}\record.csv') list.append(ls) list2 = pd.DataFrame(list).drop_duplicates() list2.columns = title list2.to_csv(fr'{outpath}\HE_scheduling_initial.csv', header=True, index=False) 错误: D:\#\python\PythonProject\venv\Scripts\python.exe D:\#\python\python\更改\HE_scheduling1.py Job Start: 2025-12-17 16:08:11.828166 Load pkl: 0:00:00.070998 \\B1apfrtd08\APFHOME\bin.win64\V9.4.0\status_tool -timeout 60 10.232.9.128 20066 dlis Station AAA Category AMR/DIFF Report AMR_WhatNext_Common_GetInitialLots_HE > D:\#\python\HE\AMR_GetInitialLots_HE.txt Load initial: 0:00:01.392007 Traceback (most recent call last): File "D:\#\python\python\更改\HE_scheduling1.py", line 540, in <module> list2.columns = title NameError: name 'title' is not defined. Did you mean: 'file'? 上面是这段的代码,这个错误怎么改?
12-18
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值