1. 首页 > 科技

请问一下,如下汇编语言的程序具体有哪些问题?

请问一下,如下汇编语言的程序具体有哪些问题?

几个汇编语言的问题

1.MOV CL,20H[BX][SI];结果(CL)=(DS:[BX+SI+20H])=(091DH:0056H)=(09226H)=0F6H

2.MOV [BP][DI],CX];结果是将CX的值5678H存入内存(SS:[BP+DI])=(1E4AH:0056H)=(1E4F6H)中,即结果是(1E4F6H)=5678H

3.LEA BX,20H[BX][SI]);结果是将内存偏移地址[BX+SI+20H]=0056H送给BX,即结果(BX)=0056H

MOV AX,2[BX];结果是(AX)=(DS:[BX+2])=(091DH:0058H)=(09228H)=1E40H

4.LDS SI,[BX][DI];结果是将内存双字单元(DS:[BX+DI])=(091DH:0056H)=(09226H)中的内容分别送给SI和DS,即结果为(SI)=00F6H,(DS)=1E40H

MOV [SI],BX;结果是将BX值0024H送给内存单元(DS:[SI])=(1E40H:00F6H)=(1E4F6H)中

即最终结果为(1E4F6H)=0024H

5.XCHG CX,32H[BX];结果是将CX的值5678H和内存单元(DS:[BX+32H])=(091DH:0056)=(09226H)中的内容00F6H互换,互换后结果为(CX)=00F6H,(09226H)=5678H

XCHG 20H[BX][SI],AX;结果是将AX的值1234H与内存单元(DS:[BX+SI+20H])=(091DH:0056H)=(09226H)中的内容5678H互换,互换后结果为(AX)=5678H,(09226H)=1234H

汇编编程问题

1

DATA SEGMENT;

HH DB'PLEASE INPUT NUMBERS!'

STR1 DB 0DH,0AH,'$'

DATA ENDS

STACK SEGMENT STACK

DW 100 DUP(?)

STACK ENDS

CODE SEGMENT

ASSUME CS:CODE,SS:STACK,DS:DATA

START: MOV AX,DATA

MOV DS,AX

MOV DX,OFFSET HH

MOV AH,09H

INT 21H

MOV AH,01H

INT 21H

MOV DL,AL

MOV AH,0AH

INT 21H

MOV AH,4CH

INT 21H

CODE ENDS

END START

汇编编程问题

assume cs:code,ds:data,ss:stack

data segment

da1 db 5,?,0,0,0,0,0

data ends

stack segment stack

dw 10 dup (0)

stack ends

code segment

start:

mov ax,data

mov ds,ax

lea dx,da1

mov ah,0ah

int 21h

lea bx,da1+2

mov si,0

goon:

cmp si,3

ja over1

mov al,[bx+si]

cmp al,'A'

jnb other1

sub al,30h

jmp over2

other1:

cmp al,'a'

jnb other2

sub al,'A'

add al,10

jmp over2

other2:

sub al,'a'

add al,10

over2:

mov [bx+si],al

inc si

jmp goon

over1:

mov dh,[bx]

mov cl,4

sal dh,cl

add dh,[bx+1]

mov dl,[bx+2]

sal dl,cl

add dl,[bx+3]

mov ax,4c00h

int 21h

code ends

end start

一个汇编程序的问题

左移一位相当于乘以2,右移一位相当于除以2