Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
• ability to design and conduct experiments, as well as to analyze and interpret data
• ability to use techniques, skills, and modern engineering tools necessary for
engineering practice.
Instruction:
Program control transfer instructions change or modify the flow of a program.
UNCONDITIONAL JUMPS
The basic instruction that transfers control to another point in the program is
JMP.
JMP INSTRUCTION
Syntax:
JMP label
Jump is usually an indication of a change in program counter that is not
directly related to the current program counter and is often free of distance limits from the
current program counter.
CMP Instruction
The CMP instruction performs an implied subtraction of a source
operand from a destination operand. Neither operand is modified:
Syntax:
CMP <destination>, <source>
Flags: the CMP instruction changes the overflow, sign , zero, carry, auxiliary
carry, and parity flags according to the destination operand would have had if the SUB
instruction were used.
Directives:
Which tell the assembler to perform specific action, such as define a data item.
An assembly language supports a number of statements that enable you to control
the way in which a source program assembles and list.
6.5 Materials/Equipment
Figure 1. Title
6.7 Procedure/s
• Write the following program using SK’s notepad or any of your text editor using the
(initialactivity6.asm)
.model small
.code
org 100h
start: jmp main
msg1 db "Enter a number:$"
msg2 db "Equal to 5$"
msg3 db "More than 5$"
msg4 db "Less than 5$"
newline db 0ah, 0dh, 24h
main:
mov ah, 09
lea dx, msg1
int 21h
mov ah, 01
int 21h
mov bl, al
call down
equaltofive:
mov ah, 09
lea dx, msg2
int 21h
jmp exit
morethanfive:
mov ah, 09
lea dx, msg3
int 21h
jmp exit
lessthanfive:
mov ah, 09
lea dx, msg4
int 21h
exit:
int 20h
down proc
mov ah, 09
lea dx, newline
int 21h
ret
down endp
end start
• Does the expected output appear? Attached the picture of the output.
Challenge Activity
• Create a program that input a character and display if it is a small letters, capital
letters or if it is special/numeric character..
Activity No.: 6
Student Name (LN, FN MI) Castillo, Juan Signature:
Carlo Q.
• Given the sample output coming from your instructor, write down and compile the
required program that will provide the expected sample output using expt6.asm as
the filename.
Activity Code
.model small
.code
org 100h
msg2 db "Capital$"
main:
mov ah, 09
int 21h
mov ah, 01
int 21h
mov bl, al
call down
jE Capital
jG TestMore
jL NumericSpecial
Capital:
mov ah, 09
int 21h
jmp exit
SmallLetter:
mov ah, 09
jmp exit
TestMore:
jE equaltoA
jG Testmore1
jL equaltoA
Testmore1:
jE SmallLetter
jG Testmore2
jL NumericSpecial
Testmore2:
jE SmallLetter
jG NumericSpecial
jL SmallLetter
NumericSpecial:
mov ah, 09
int 21h
exit:
int 20h
down proc
mov ah, 09
int 21h
ret
down endp
end star
Screenshots:
6.8.2 Observations
________________________________________________________________________
________________________________________________________________________
________________________________________________________________________
________________________________________________________________________
6.8.3 Conclusion/s
Total Score