Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

-how do i write a small piece of code that display the character in Al if and on

ID: 3773127 • Letter: #

Question

-how do i write a small piece of code that display the character in Al if and only if it is an uppercase letter in assembly language? -how do i write a small piece of code that display the character in Al if and only if it is a letter.-how do u write a small piece of code that display the character in Al if and only if it a digit.-how do i write a small piece of code which reads a string from a keyboard and then returns the number of lowercase character contained in the string.-difference between assembly language and a higher level language.

Explanation / Answer

Below is the code that display the character in Al if and only if it is an uppercase letter in assembly language:

.MODEL SMALL

.STACK 100H

.DATA

PROMPT DB 'The Upper Case Letters from A to Z are : $'

.CODE

MAIN PROC

MOV AX, @DATA                ; initialize DS

MOV DS, AX

LEA DX, PROMPT               ; load and print PROMPT

MOV AH, 9

INT 21H

MOV CX, 26                   ; initialize CX

MOV AH, 2                    ; set output function

MOV DL, 65                   ; set DL with A

@LOOP:                       ; loop start

INT 21H                    ; print character

INC DL                     ; increment DL to next ASCII character

DEC CX                     ; decrement CX

JNZ @LOOP                    ; jump to label @LOOP if CXis 0

MOV AH, 4CH                  ; return control to DOS

INT 21H

MAIN ENDP

END MAIN

Below is the code that display the character in Al if and only if it is a letter:

Below is the difference between Assembly Language and High Level Language:

Assembly Language

High Level Language

Although Assembly level languages are not easy to understand they are relatively easier as compared to machine level languages.

High level languages are easily understandable.

The programs that are developed in high level language are portable.

The programs written in this language are not portable and the debugging process is also not very easy.

In case of high level languages debugging of the code is easy and the program written is not machine dependent.

The programs developed in assembly language are thoroughly machine dependent.

Assembly Language

High Level Language

Although Assembly level languages are not easy to understand they are relatively easier as compared to machine level languages.

High level languages are easily understandable.

The programs that are developed in high level language are portable.

The programs written in this language are not portable and the debugging process is also not very easy.

In case of high level languages debugging of the code is easy and the program written is not machine dependent.

The programs developed in assembly language are thoroughly machine dependent.