Hi! I am a very new to assembly.This question that im doing requires me to 1>clear the screen, 2>change color to ywllow on blue, set cursor position to row10,coloumn1, display a message asking the user to input a character("A" to "E" and display a message for invalid input. then use the input character(converted to number 1 to 5)as an index to the array of bit patterns corresponding to the letter entered the display the large letter in the form of spaces and '*' on the screen.I am only allowed to use NASM.Pleeeze Pleeeeze help. I did some garbage.
[ bits 16
org 0x100 ;offset 100h
jmp main ;junp to main program
str1: db 'Invalid Character!.Enter capital letters from A to E','$'
str2: db 'Enter a character please(A-E).','$'
str3: db 0x0a,0x0d,'$'
; clear the screen
;
clrscr:
mov ax,0600h ;service - scroll up the screen
mov bh,01Fh ;colour atrributes - yellow on blue
mov cx,0000 ;starting row:coloumn
mov dx,184Fh ;ending row:coloumn
int 10h ;bios system call
;
;set the cursor
;
setcursor:
mov ah,02 ;service - set cursor
mov bh,00 ;screen number 0
mov dx,0a01h ;row(10):coloumn(1)
int 10h ;bios system call
;
;Prompt for input
;
prompt:
mov ah,09 ;service - display string of characters
mov dx,str2 ;address of string to be output
int 21h ;display string
ret
;
;Read in a character from the keyboard
;Character is returned in AL
;
read_char:
mov ah,01 ;service - read character and echo to screen
int 21h ;read character from keyboard
ret
;
;Display line feed and carriage return
;
line_carr:
mov ah,09 ;service - display a string of characters
mov dx,str3 ;address of string to be output
int 21h; ;display the string
ret
;
;Display an error and ask for input
;
error1:
mov ah,09 ;service - display string of characters
mov dx,str1 ;address of string
int 21h ;
jmp main ;
;
;Terminate the program
;
exitprog:
int 20h;
;
;The main program
main:
call clrscr ;clear the screen
call setcursor ;set the cursor
call prompt ;prompt
call read_char ;get input from keyboard
label1:
cmp al,66h ;compare AL to Z
je exitprog ;if AL=Z terminate program
jmp label2 ;else jump to label2
label2:
cmp al,41h ;compare to A
jg label3 ;if >A go to label3
Jne error1 ;call error1
label3:
cmp al,45h ;compare AL to E
jl label4 ;if <E go to label4
jne error1 ;else call error1
label4:
int 20h ]
[ bits 16
org 0x100 ;offset 100h
jmp main ;junp to main program
str1: db 'Invalid Character!.Enter capital letters from A to E','$'
str2: db 'Enter a character please(A-E).','$'
str3: db 0x0a,0x0d,'$'
; clear the screen
;
clrscr:
mov ax,0600h ;service - scroll up the screen
mov bh,01Fh ;colour atrributes - yellow on blue
mov cx,0000 ;starting row:coloumn
mov dx,184Fh ;ending row:coloumn
int 10h ;bios system call
;
;set the cursor
;
setcursor:
mov ah,02 ;service - set cursor
mov bh,00 ;screen number 0
mov dx,0a01h ;row(10):coloumn(1)
int 10h ;bios system call
;
;Prompt for input
;
prompt:
mov ah,09 ;service - display string of characters
mov dx,str2 ;address of string to be output
int 21h ;display string
ret
;
;Read in a character from the keyboard
;Character is returned in AL
;
read_char:
mov ah,01 ;service - read character and echo to screen
int 21h ;read character from keyboard
ret
;
;Display line feed and carriage return
;
line_carr:
mov ah,09 ;service - display a string of characters
mov dx,str3 ;address of string to be output
int 21h; ;display the string
ret
;
;Display an error and ask for input
;
error1:
mov ah,09 ;service - display string of characters
mov dx,str1 ;address of string
int 21h ;
jmp main ;
;
;Terminate the program
;
exitprog:
int 20h;
;
;The main program
main:
call clrscr ;clear the screen
call setcursor ;set the cursor
call prompt ;prompt
call read_char ;get input from keyboard
label1:
cmp al,66h ;compare AL to Z
je exitprog ;if AL=Z terminate program
jmp label2 ;else jump to label2
label2:
cmp al,41h ;compare to A
jg label3 ;if >A go to label3
Jne error1 ;call error1
label3:
cmp al,45h ;compare AL to E
jl label4 ;if <E go to label4
jne error1 ;else call error1
label4:
int 20h ]