Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

F fshvmc,nb , ht 6hr

Answer:

1. It depends the program


2. NO it will not accepts the space and special characters as an input
3. ,
4. There are many key presses in the program

List of key presses

MOV     AH, 0                  ; get pressed key.


INT     16h
 
CMP     AL, 13                 ; 'RETURN' pressed?
JZ      exit
 
CMP     AL, 8                  ; 'BACKSPACE' pressed?
JNE     add_to_buffer
JCXZ    wait_for_key           ; nothing to remove!
DEC     CX
DEC     DI
PUTC    8                      ; backspace.
PUTC    ' '                    ; clear position.
PUTC    8                      ; backspace again.

5. This is the code that restore register


POP     SI     ; re-store registers...
6. CMP     DX, 1                  ; buffer too small?
JBE     empty_buffer           ;
7. It instruct to record the next character or string that is input into the command line
8. .
9. .
10. .

Essay

Emu8086.inc are macro procedure declarations and the macro prints a string that is a given as a
parameter , example of this is PRINTN ‘hello world!’. There are turn off the cursor, the turn on the
cursor, sets current cursor and position. There are also a procedure that gets the multi-digit SIGNED
number from the keyboard and stores the results in CX register. There are macro defines a procedure to
print a null terminated, a string at a current cursor position, receives address of strings in DS:SI.

The macro defines a procedure to print a null terminated, string at current cursor position.
The ZERO TERMINATED string should be defined just after the CALL. For example: CALL PTHIS
db 'Hello World!',
Address of string is stored in the Stack as return address. Procedure updates value in the Stack to make
return after string definition.

There are a macro defines a procedure to get a null terminated, string from user, the received string is
written to buffer at DS:DI, buffer size should be in DX. Procedure stops the input when 'Enter' is pressed.
There are macro defines procedure to clear the screen,(done by scrolling entire screen window)and set
cursor position to top of it: There are macro defines a procedure that prints out an unsigned number in AX
(not just a single digit) and allowed values from 0 to 65535 (0FFFFh).

wait_for_key can disrupt the program if it will remove that is why the wait_for_key used for this
program. I have no idea or suggestion in adding a program code in order to make it better

You might also like