Author Topic: print char  (Read 6080 times)

Jaff

  • Guest
print char
« on: August 14, 2005, 11:31:18 AM »
How can i print char without "function" ah = 0x02 - int 0x21
and without whichever interrupt
ONLY interrupt relate Graphics Card...
???

Offline Frank Kotler

  • NASM Developer
  • Hero Member
  • *****
  • Posts: 2667
  • Country: us
Re: print char
« Reply #1 on: August 14, 2005, 01:48:54 PM »
mov si, msg
mov bx, 7
mov ah, 0Eh

print:
lodsb
or al, al
jz dunprintin
int 10h
jmp short print
dunprintin:
...
msg 'Hello, Jaff!', 0 : note: zero terminated!

Or:

mov si, msg
mov ah, 5  ; color
push es
push 0B800h
pop es
mov di, (10 * 80 + 30) * 2  ; row 10, column 30

top:
lodsb
or al, al
jz done
stosb   ; store char *and* color
jmp short top
done:
pop es
...

...if ya want to do it with no ints at all... There are other options. See Ralf Brown's Interrupt List - http://www.pobox.com/~ralf

Best,
Frank

Offline Frank Kotler

  • NASM Developer
  • Hero Member
  • *****
  • Posts: 2667
  • Country: us
Re: print char
« Reply #2 on: August 14, 2005, 02:35:41 PM »
Crap!

stosW ; store character and color

!!!

Sorry,
Frank

Jaff

  • Guest
Re: print char
« Reply #3 on: August 14, 2005, 02:59:45 PM »
THX