实现如下:
program segment
main proc far
assume cs:program
start:
push ds
sub ax,ax
push ax
mov ax,1235h
mov bl,al
and bl,0f0h
and al,0fh
mov cl,ah
and cl,0fh
mov dl,ah
and dl,0f0h
ret
main endp
program ends
end
2.试说明下述指令中哪些需要加上PTR伪指令定义符: BVAL DB 10H,20HWVAL DW 1000H(
1)MOV AL,BVAL
(2)MOV DL,[BX]
(3)SUB [BX],2
(4)MOV CL,WVAL
(1)不需要加
(2)不需要加
(3)不需要加
(4)需要加,因为WVAL是用DW定义知为字类型的,是16位,道而CL是8位,
所以要将回WVAL强制转换为字节类型才能答传送给CL。
加后改为 MOV CL, BYTE PTR WVAL。