I
I
Igor Prishchepa2013-12-27 09:35:26
assembler
Igor Prishchepa, 2013-12-27 09:35:26

How to raise 7,11,14,15 bits to 1, assembler (8086)?

In general, I sit and do not get it right. Here is the code:

stk segment 'stack'
Db 128 dup (?)
dan segment 'data'
maska1 dw 1100100010000000b
P dw ?
X dw -3
r db 1
dan ends
Cd segment 'code'
Assume cs:cd,ds:dan,ss:stk
start:
mov ax,dan
mov ds,ax
;---------
mov ax,x
cmp ax,-3
jg inv
cmp ax,-3
jl inv
;-----------
mov al,r
mov ah,3
imul ah ;ax=3r
mov bx,ax
mov al,1
mov ah,r
imul ah
add bx,ax
mov p,bx
jmp konec
;-----------вот дальше у меня заминка
inv:
mov cx,maska1
mov ax,x
cbw
 and ax,cx
mov x,ax 

;-----------
konec:
mov ah,4ch
int 21h
cd ends
end start

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
egor_nullptr, 2013-12-27
@Kind_pradatoR

and replace with or . and leaves the bits marked in the mask unchanged, resets the rest to zero, or sets the marked bits to 1 and leaves the rest unchanged.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question