程序集将超过FF的值移动到字数组

时间:2017-03-31 16:13:03

标签: assembly tasm

我试图在文本中找到符号的频率。每当我将ax freq数组移动到高于ff的值时,该值就无法正确输入。

ff之前的arr图片(当ax为ff时):

Snapshot  https://i.stack.imgur.com/0EpUB.png

ff之后的arr图片(在wgen ax的另一个循环之后是100):

enter image description here  https://i.stack.imgur.com/hmMEk.png

我的assmbler在dosbox eumlutor /

中很有趣
proc ChkFreq
; get frequency list
;1. amount of characters in file
push bp
mov bp,sp
push ax
push cx
push dx
mov cx,[bp+4]
xor ax,ax
mov di,offset Freq
chk:
    xor bx,bx
    call FillBuffer
    mov bl,[Buffer]
    shl bx,1;not sure if this line is correct but it doesn't affect the problem
    add bx,di
    mov ax,[bx]
    inc ax
    mov [bx],ax
loop chk
pop dx
pop cx
pop ax
pop bp 
ret
endp ChkFreq

先谢谢Doron

0 个答案:

没有答案