Professional Documents
Culture Documents
LAB 8 Solution
LAB 8 Solution
LAB 8 Solution
model tiny
.data
inp1 db 'Mritunjay$' ; The name with a '$' terminator
colmstr db 4Eh ; Starting from column 78 (4Eh in hex is 78 in decimal)
cnt db 09h ; The length of the name (9 characters)
.code
.startup
next_char:
; Set cursor position
mov ah, 02h
mov bh, 00h ; Page number
INT 10h ; Set cursor position
.exit
end
.model tiny ; Set memory model to tiny (code and data in one segment)
.386 ; Target 80386 processor
; WRITING CHAR
WRITE1:
PUSH CX ; Save count value on the stack
; CHANGING VERTICES
; Increment the input string pointer, column position,
; and decrement the length counter
INC SI
INC WORD PTR[DI]
DEC CL
JNZ WRITE1 ; Repeat for all characters in the input string
END1:
MOV AH, 07H
INT 21h
CMP AL, "%"
JNZ END1
; TERMINATE PROGRAM
TERM:
MOV AH, 4CH ; Exit function
INT 21H
write1:
push cx ; Pushes the value of CX register onto the stack