INT 10h / AH = 13h - write string.
input:
AL = write mode:
    bit 0: update cursor after writing;
    bit 1: string contains attributes.
BH = page number.
BL = attribute if string contains only characters (bit 1 of AL is zero).
CX = number of characters in string (attributes are not counted).
DL,DH = column, row at which to start writing.
ES:BP points to string to be printed.
-----------------------------------------------------
Bit color table:
Character attribute is 8 bit value, low 4 bits set foreground color, high 4 bits set background color. Background blinking not supported.
HEX    BIN        COLOR
0      0000      black
1      0001      blue
2      0010      green
3      0011      cyan
4      0100      red
5      0101      magenta
6      0110      brown
7      0111      light gray
8      1000      dark gray
9      1001      light blue
A      1010      light green
B      1011      light cyan
C      1100      light red
D      1101      light magenta
E      1110      yellow
F      1111      white

Example of INT 10h
INT 10h Using    ;; INT10h.asm
INT 10h Using    ;; Test the using of INT 10h
INT 10h Using    ;; BpLoveGcy
INT 10h Using    ;; 2006-11-24
INT 10h Using    ;; compile
INT 10h Using    ;; nasm INT10h.asm -o INT10h.com
INT 10h Using    ;; run the INT10h.com in DOS
INT 10h Using    segment .data
INT 10h Using    Message    db    "Hello, INT 10h! Great, I can use it!"
INT 10h Using        
INT 10h Using    segment .text
INT 10h Using    org    0100h
INT 10h Using    mov    ax,    cs
INT 10h Using    mov    ds,    ax
INT 10h Using    mov    es,    ax    
INT 10h Using    call    PrintMessage
INT 10h Using    
INT 10h UsingPrintMessage:
INT 10h Using    ;points to string ES:BP points to string to be printed
INT 10h Using    mov    ax,    Message 
INT 10h Using    mov    bp,    ax    
INT 10h Using
INT 10h Using    ;number of characters in string
INT 10h Using    mov    cx,    40
INT 10h Using    
INT 10h Using    ;; Init registers for INT 10h 
INT 10h Using    ;; Set AH=13h
INT 10h Using    mov    ah,    13h
INT 10h Using    ;; Set AL=01h
INT 10h Using    mov    al,    01h
INT 10h Using    ;; Set character attributes
INT 10h Using    ;; 09h    light blue
INT 10h Using    mov    bl,    09h
INT 10h Using    ;; Init print start location
INT 10h Using    ;; page number=0
INT 10h Using    mov    bh,    00h
INT 10h Using    ;; column=2,row=5
INT 10h Using    mov    dl,    02h
INT 10h Using    mov    dh,    05h
INT 10h Using    
INT 10h Using    int     10h
INT 10h Using    ret

相关文章:

  • 2021-11-13
  • 2021-12-05
  • 2022-12-23
  • 2021-11-09
  • 2022-03-05
  • 2021-11-17
  • 2021-06-08
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-08-01
  • 2021-11-10
  • 2021-10-21
  • 2021-08-08
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案