徐哲睿吧 关注:3贴子:33
  • 8回复贴,共1
data segment
num dw 1234h, 4321h, 3232h
max dw ?
data ends
code segment
main proc far
assume cs:code, ds:data
start:
mov bx, seg num
mov ds, bx
lea bx, num
mov ax, 0
mov cx, 3
compare:
cmp ax, [bx]
jnl
mov [bx], ax
dec cx
jnz compare
rotate:
mov cl, 4
rol bx, cl
mov al, bl
and al, 0fh
add al, 30h
cmp al, 3ah
js print
add al, 7h
print:
mov dl, al
mov ah, 2
int 21h
dec ch
jnz rotate
mov ax, 4c00h
int 21h
main endp
code ends
end start


1楼2019-04-02 14:52回复
    data segment
    array_in db 1,-2,3,-4,5,-6,7,-8,9,-10,-1,2,-3,4,-5,6,-7,8,-9,10
    positive db 20 dup(0)
    negative db 20 dup(0)
    data ends
    code segment
    assume ds:data, cs:code, es:code
    proc main far
    start:
    mov bx, seg array_in
    mov ds, bx
    mov es, bx
    lea bx, array_in
    lea si, positive
    lea di, negative
    mov cx, positive-array_in
    dec bx
    scan:
    inc bx
    mov al, [bx]
    test al, 0ffh
    jns to_p
    jmp to_n
    to_p:
    mov [si], al
    inc si
    loop scan
    jmp print
    to_n:
    mov [di], al
    inc di
    loop scan
    jmp print
    print:
    sub si, offset positive
    sub di, offset negative
    main endp
    code ends
    end start


    2楼2019-04-12 14:40
    回复
      2025-08-13 07:54:27
      广告
      不感兴趣
      开通SVIP免广告


      5楼2019-09-21 15:32
      回复


        6楼2019-09-21 15:33
        回复


          7楼2019-09-21 15:33
          回复


            8楼2019-09-21 15:33
            回复


              9楼2019-09-21 15:37
              回复


                10楼2019-09-21 15:37
                回复
                  2025-08-13 07:48:27
                  广告
                  不感兴趣
                  开通SVIP免广告


                  11楼2019-09-21 15:37
                  回复