0% found this document useful (0 votes)
16 views3 pages

Comparchlabact2 KD

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views3 pages

Comparchlabact2 KD

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 3

.

model small
.stack 10

.data
prompt db "INPUT:$"
prompt2 db "GAY LINGO:$"
input db 100 dup('$')
output db 100 dup('$')
newline db 0Dh, 0Ah, '$'

.code
START:
mov ax, @data
mov ds, ax

; Set Top Black Background Rectangle


mov ah, 6
mov al, 0
mov bh, 0Ah
mov cx, 0
mov dx, 184fh
int 10h

; Set Top Blue Background Rectangle


mov ah, 6
mov al, 0
mov bh, 1Eh
mov cx, 0001h
mov dx, 054Eh
int 10h

; Set Top Yellow Background Rectangle


mov ax, 1003h
mov bl, 00
int 10h
mov ah, 6
mov al, 0
mov bh, 0E2h
mov cx, 0103h
mov dx, 044Ch
int 10h

; Set Bottom Blue Background Rectangle


mov ah, 6
mov al, 0
mov bh, 1Eh
mov cx, 0C01h
mov dx, 114Eh
int 10h

; Set Bottom Yellow Background Rectangle


mov ax, 1003h
mov bl, 00
int 10h
mov ah, 6
mov al, 0
mov bh, 0E2h
mov cx, 0D03h
mov dx, 104Ch
int 10h

; Set cursor for "INPUT:" label


mov ah, 2
mov bh, 0
mov dh, 3
mov dl, 5
int 10h

; Display "INPUT:" label


mov ah, 09h
mov dx, offset prompt
int 21h

; Input string
mov bx, offset input
mov cx, 0

input_loop:
mov ah, 1
int 21h
cmp al, 13
je display_reverse
mov [bx], al
inc bx
inc cx
jmp input_loop

display_reverse:
; Display a newline before "GAY LINGO:"
mov ah, 09h
mov dx, offset newline
int 21h

; Set cursor for "GAY LINGO:" label


mov ah, 2
mov bh, 0
mov dh, 15
mov dl, 5
int 10h

; Display "GAY LINGO:" label


mov ah, 09h
mov dx, offset prompt2
int 21h

; Reverse and display the input string


dec bx
mov si, cx

reverse_loop:
mov dl, [bx]
mov ah, 02h
int 21h
dec bx
dec cx
cmp cx, 0
jne reverse_loop
mov ax, 4C00h
int 21h

end START

You might also like