Professional Documents
Culture Documents
Lecture#10
Lecture#10
Lecture#10
Lecture#10
Assembly Code Of The Decision
Structure
Suppose AX and BX contain signed numbers.
Write some code to put the biggest one in CX
Assembly Code
;If AX < 0
CMP AX, 0 ;AX < 0 ?
JNL END_IF ;no, exit
;then
NEG AX ;yes change sign
END_IF
INPUT THE STRING
.model small
.stack 100h
.code
mov ax, @data
mov ds , ax
mov ah,0Ah
int 21h
end
GET SYSTEM DATE AND TIME
// DATE:
.model small
.stack 100h
.code
mov ax, @data
mov ds, ax
mov ah, 2Ah;
int 21h ;
end
//TIME:
.model small
.stack 100h
.code
mov ax,@data
mov ds,ax
mov ah, 2Ch;
int 21h ;
end