Assembly procs avg和IsZugi没有';我不能在我的汇编代码中工作
非常感谢您对我的帮助,我已经完成了所有的更改,您可以在下面看到。然而,它却不起作用……:( 我可能做错了什么,你介意再挑一个吗? 谢谢你所做的一切 我忘了提到我创建了一些数组,如果它有任何不同。。。 ArrayA dw 9 dup(0) 阵列dw 9 dup(0) ArrayC dw 9 dup(0)Assembly procs avg和IsZugi没有';我不能在我的汇编代码中工作,assembly,Assembly,非常感谢您对我的帮助,我已经完成了所有的更改,您可以在下面看到。然而,它却不起作用……:( 我可能做错了什么,你介意再挑一个吗? 谢谢你所做的一切 我忘了提到我创建了一些数组,如果它有任何不同。。。 ArrayA dw 9 dup(0) 阵列dw 9 dup(0) ArrayC dw 9 dup(0) 程序第2部分 GoAgain:mov-ah,1;接收一个数字 int 21h 凸轮轴位置al,65;检查 jne TryNext 打电话给PrintA 果阿增益 TryNext:cmp al,6
程序第2部分
GoAgain:mov-ah,1;接收一个数字
int 21h
凸轮轴位置al,65;检查
jne TryNext
打电话给PrintA
果阿增益
TryNext:cmp al,66;检查是否为B
jne TryNext2
呼叫PrintB
果阿增益
TryNext2:cmp al,67;检查是否为C
jne TryNext3
呼叫PrintC
果阿增益
TryNext3:cmp al,69;检查是否为E
jne TryNext4
推偏计数器
打电话给IsZugi
果阿增益
TryNext4:cmp al,80;检查P
jne TryNext5
推偏计数器
打电话给IsZugi
果阿增益
TryNext5:cmp al,86
jne TryNext6
推偏计数器
呼叫平均值
果阿增益
TryNext6:cmp al,#
jne TryAgain
ret
TryAgain:mov dx,偏移信息2
mov-ah,9h
int 21h
果阿增益
ret
第二部分
打印程序
mov-dl,'a'
mov啊,2h
int 21h
mov-bx,0
再次:cmp[bx],0;检查索引是否为空
jne注释2
ret
注2:mov dl';打印空间
mov啊,2h
int 21h
mov ax,[word ptr bx]
添加铝,30小时
mov dl,al;打印号码
mov啊,2h
int 21h
inc bx;转到下一个索引
还是jmp
ret
印版
过程打印B
mov-dl,'b'
mov啊,2h
int 21h
莫夫bx,10
again2:cmp[bx],0;检查索引是否为空
jne注释2
ret
注3:mov dl';打印空间
mov啊,2h
int 21h
mov ax,[word ptr bx]
添加铝,30小时
mov dl,al;打印号码
mov啊,2h
int 21h
inc bx;转到下一个索引
还是jmp
ret
endp打印B
程序打印
mov-dl,'c'
mov啊,2h
int 21h
莫夫bx,20
again3:cmp[bx],0;检查索引是否为空
jne注释2
ret
注4:mov dl';打印空间
mov啊,2h
int 21h
mov ax,[word ptr bx]
添加铝,30小时
mov dl,al;打印号码
mov啊,2h
int 21h
inc bx;转到下一个索引
还是jmp
ret
endp PrintC
伊斯祖吉进程
pop[返回地址]
柜台
mov-dx,0
mov bx,0;开始
重做:mov ax,2;检查编号%2是否为0
mov-dx,0
mov cx,[bx];cx=编号
cmp cx,0;检查索引是否为null
接下来,读取所有数组
莫夫迪,阿克斯
移动ax,cx
mov cx,di
分区cx;编号/2
公司bx
cmp dx,0;检查编号%2是否为0
jne redo;转到下一个索引
inc[word ptr si];inc计数器
jmp重做
下一个:inc dx
cmp-dx,2
ja LastArray
mov bx,10;移动到第二个阵列
jmp重做
LastArray:cmp dx,3
我做完了
mov bx,29;移动到最后一个阵列
jmp重做
完成:mov dl,'P';打印P
mov啊,2h
int 21h
mov dl,,;打印空间
mov啊,2h
int 21h
mov al,[字节ptr si]
添加铝,30小时
mov dl,al;打印计数器
mov啊,2h
int 21h
mov-dl,'E';print-E
mov啊,2h
int 21h
mov dl,,;打印空间
mov啊,2h
int 21h
mov cl,[字节ptr si]
莫夫奇,9
副总经理
添加ch,30小时
mov dl,ch;打印9-计数器
int 21h
推送[返回地址]
ret
endp IsZugi
proc IsLegal
mov bx,0
pop [ReturnAddress]
pop ax ;receives the number
cmp ax, 8 ;checks if belongs to A
jb B
occupied?:
cmp [word ptr bx],0;occupied or not
je NotOccupied
inc bx
jmp occupied?
NotOccupied:
mov [bx],ax ;enters the number to it's place
jmp finish
B: cmp ax,6 ;checks if belongs to B
jb CC
add bx,10 ;moves to the next array
occupied2?: cmp [word ptr bx],0 ;checks if index occupied
je NotOccupied2
inc bx ;checks next index
jmp occupied2?
NotOccupied2: mov [bx],ax ;enters the value to it's array
jmp finish
CC: add bx,20 ;the beginning of the next array
occupied3?: cmp [word ptr bx],0 ;checks if empty
je NotOccupied3
inc bx ;checks next index
jmp occupied3?
NotOccupied3:
mov [bx],ax ;enters the value to it's array
finish: cmp ax,9 ;checks if legal
ja FalseExit ;if illegal exit
cmp ax,0 ;checks if legal
jl FalseExit ;if illegal exit
push 0 ;since we poped ax
push [ReturnAddress]
ret
endp IsLegal
proc avg
pop [ReturnAddress]
mov bx,0 ;first index
pop si ;si=sum
suming: mov ax,[word ptr si] ;it's impossible to do- mov [si],[bx] so...
add ax,[bx];sum+=bx
mov [word ptr si],ax
inc bx
cmp bx,29
jne suming
mov dx, offset message ;print avg
mov ah, 9h
int 21h
mov ax,[word ptr si]
mov [word ptr si],9
div ax
add al,30h
mov dl,al
mov ah,2
int 21h
push 0
push [ReturnAddress]
ret
endp avg
start:
jmp TrueStart
FalseExit: jmp exit
TrueStart: mov ax, @data
mov ds, ax
mov cx,9 ;loop*9
zloop: mov ah, 1 ;receives a number
int 21h
sub al,30h ;reveal the real number
mov ah,0 ;we only need al, however we can only push word
push ax ;pushes the number
call IsLegal
;loop zloop
push offset sum
call avg
push offset counter
;call IsZugi
;call PrintA
;call PrintB
;call PrintC
;call Part2
call Creative
ret
伊斯祖吉
普罗克伊斯莱格尔酒店
mov-bx,0
pop[返回地址]
弹出ax;接收号码
cmp ax,8;检查是否属于
jb B
有空吗
cmp[word ptr bx],0;是否已占用
我没有占用
公司bx
jmp有人吗?
未占用:
mov[bx],ax;将数字输入到它所在的位置
jmp整理
B:cmp ax,6;检查是否属于B
jb CC
添加bx,10;移动到下一个阵列
占用2?:cmp[word ptr bx],0;检查索引是否已占用
我没有占领2
inc bx;检查下一个索引
jmp占用2?
NotOccupied2:mov[bx],ax;将值输入到它的数组中
jmp整理
抄送:添加bx,20;下一个数组的开头
占用3?:cmp[字ptr bx],0;检查是否为空
我没有被占用3
inc bx;检查下一个索引
jmp占用了3?
不被占用3:
mov[bx],ax;将值输入其数组
完成:cmp ax,9;检查是否合法
ja错误退出;如果非法退出
cmp ax,0;检查是否合法
jl错误退出;如果非法退出
推0;因为我们用了斧头
推送[返回地址]
ret
恩德普岛
过程平均值
pop[返回地址]
mov bx,0;第一个索引
pop si;si=总和
苏明:mov ax,[word ptr si];这是不可能的-mov[si],[bx]所以。。。
加上ax,[bx];和+=bx
mov[字ptr si],ax
在里面
proc IsZugi
pop [ReturnAddress]
pop si;counter
TryNext3: cmp al,69 ;checks if E
jne TryNext4
push offset counter <<< add this
call IsZugi
jmp GoAgain
TryNext4: cmp al,80 ;checks if P
jne TryNext5
push offset counter <<< add this
call IsZugi
jmp GoAgain
TryNext5: cmp al,86
jne TryNext6
push offset counter <<< add this
call avg
jmp GoAgain
mov dx,0
mov bx,0;the beginning
redo: mov ax,2;to check if number%2=0
mov bx,0;the beginning
redo: mov ax,2;to check if number%2=0
mov dx,0
div cx;number/2
inc bx
cmp ah,0;to check if number%2=0