编程将AT89S51单片机内RAM40H单元和42H单元的单字节无符号数相乘,乘积放在外部储存器2000H开始的单元中

2024-12-15 21:07:16
推荐回答(3个)
回答1:

MOV A, 40H
MOV B, 42H
MUL AB

MOV DPTR, #2000H
MOVX @DPTR, A
INC DPTR
MOV A, B
MOVX @DPTR, A

SJMP $

END

回答2:

mov R0,40h
mov A,42h
mul A,R0
movx 2000H,A
movx 2001H,B

回答3:

int i,j,k;
int *pk;
i=A;
j=B;
K=i*j;
pk&=0xffff0000;
pk|=0x2000;
pk=k;