if
((ax>bx && (bx < cx or ax<ax))
Var1=3
else
Ax=Var3
write code in assembly code
DATA SEGMENT
a DW 1
b DW 5
c DW 3
VAR1 DW 0
VAR3 DW 7
DATA ENDS
code segment
start:
; set segment registers:
mov ax, data
mov ds, ax
MOV ES,AX
mov ax, a
mov bx, b
mov cx, c
CMP AX,BX ; AX > BX ?
JLE L_ELSE ; AX <= BX
CMP BX,CX
JL L_IF
CMP AX,CX
JL L_IF
L_ELSE:
MOV AX,VAR3
JMP _QUIT
L_IF:
MOV VAR1,3
_QUIT:
MOV AH,1 ; Waiting for a key press
INT 16H
mov ah, 4ch
int 21h ; exit
end start
Comments
Leave a comment