Assembly language, as any programming language, is a result of arbitrary design decisions. Sometimes there can be a reason why a specific register is used as a interrupt call input register (optimization), but many times not, and you just have to take the interface (here int 10h
or int 21h
) as granted.
Related to your problem with several exclamation marks !!!!!!!!!!!
(I assume 11 exclamation marks), you have incorrect parameters in your int 10
interrupt call:
mov cx,11
According to Ralf Brown's Interrupt List, the parameters for mov ah,9
, int 10h
are the following:
INT 10 - VIDEO - WRITE CHARACTER AND ATTRIBUTE AT CURSOR POSITION
AH = 09h
AL = character to display
BH = page number (00h to number of pages - 1) (see #00010)
background color in 256-color graphics modes (ET4000)
BL = attribute (text mode) or color (graphics mode)
if bit 7 set in <256-color graphics mode, character is XOR'ed
onto screen
CX = number of times to write character
Return: nothing
Notes: all characters are displayed, including CR, LF, and BS
replication count in CX may produce an unpredictable result in graphics
modes if it is greater than the number of positions remaining in the
current row
With PhysTechSoft's PTS ROM-DOS the BH, BL, and CX values are ignored
on entry.
So, instead of mov cx,11
, it should be mov cx,1
.
And the second mov al, hello[si]
is redundant, because hello[si]
has already been loaded into al
at that time with the previous identical instruction. This doesn't affect the functioning of the code, however.
Edit: Added info on how to set and read the cursor location using int 10h
.
It seems that you also need to update the cursor location with mov ah,2
, int 10h
, using the following parameters:
INT 10 - VIDEO - SET CURSOR POSITION
AH = 02h
BH = page number
0-3 in modes 2&3
0-7 in modes 0&1
0 in graphics modes
DH = row (00h is top)
DL = column (00h is left)
Return: nothing
Possibly you may need need to read the current cursor position with mov ah,3
, int 10h
, using the following parameters:
INT 10 - VIDEO - GET CURSOR POSITION AND SIZE
AH = 03h
BH = page number
0-3 in modes 2&3
0-7 in modes 0&1
0 in graphics modes
Return: AX = 0000h (Phoenix BIOS)
CH = start scan line
CL = end scan line
DH = row (00h is top)
DL = column (00h is left)
Notes: a separate cursor is maintained for each of up to 8 display pages
many ROM BIOSes incorrectly return the default size for a color display
(start 06h, end 07h) when a monochrome display is attached
With PhysTechSoft's PTS ROM-DOS the BH value is ignored on entry.