CLP 02.2 Course Title: Microprocessors & Microcontrollers Lab
CLP 02.2 Course Title: Microprocessors & Microcontrollers Lab
CLP 02.2 Course Title: Microprocessors & Microcontrollers Lab
2
Course Title: Microprocessors &
Microcontrollers Lab
Course Code: CSE 304
Submitted by:
Name: SHAKILISLAM
ID: 191902016
Batch & Section: 191
Department of CSE
Green University of Bangladesh
Submitted to:
Md. Sultanul Islam Ovi
Lecturer
Department of CSE
Green University of Bangladesh
1
Class Work
TASK 01
Problem
Solution
ORG 100h
.DATA
PROMPT_1 DB 'Enter Integer Numbers: ', '$'
PROMPT_2 DB 0Dh, 0Ah, 'NUMBER IS ODD Digits: ', '$'
PROMPT_3 DB 0Dh, 0Ah, 'NUMBER IS EVEN Digits: ', '$'
ARRAY DB 10 DUP(0)
.CODE
MAIN PROC
MOV AX, @DATA
MOV DS, AX
MOV AH, 9
LEA DX, PROMPT_1
INT 21H
INPUTS:
MOV AH, 1
INT 21h
MOV AH, 2
MOV DX, ' '
INT 21h
LOOP INPUTS
CALL Odd_Numbers
CALL Even_Numbers
MAIN ENDP
Odd_Numbers PROC
MOV AH, 9
LEA DX, PROMPT_2
2
INT 21H
MOV CX, 1
LEA SI, ARRAY
Loop_1:
XOR AX, AX
MOV AL, [SI]
SUB AL, 48
CMP AH, 1
JE Print1
JL noPrint1
Print1:
MOV AH, 2
MOV DX, [SI]
INT 21h
noPrint1:
INC SI
LOOP Loop_1
Odd_Numbers ENDP
Even_Numbers PROC
MOV AH, 9
LEA DX, PROMPT_3
INT 21H
MOV CX, 6
LEA SI, ARRAY
Loop_2:
XOR AX, AX
MOV AL, [SI]
SUB AL, 48
3
CMP AH, 0
JE Print2
JG noPrint2
Print2:
MOV AH, 2
MOV DX, [SI]
INT 21h
noPrint2:
INC SI
LOOP Loop_2
Even_Numbers ENDP
END MAIN
RET
Screenshot
TASK 2.
.MODEL SMALL
.STACK 100H
.DATA
4
PROMPT DB 'The 256 ASCII Characters are : $'
.CODE
MAIN PROC
MOV AX, @DATA ; initialize DS
MOV DS, AX
SCREENSHOT:
5
4.
DB Mean "db" (data byte) to allocate some space, and fill it with a string.
Output: The output of the assembler program is the object deck, a machine language
translation of the source program
oah is for line feed (moves to next output line) & odh is for carriage return. $ : It’s the
‘$’, which in most languages is just a dollar sign. But for whatever crazy reason, CP/M
used ‘$’ as a string terminator for messages printed with that API.