如何在特定列打印多行的整个字符串?
How do I print a whole string with multiple lines at a specific column?
这是我的代码:
data segment
letter_a db ' __ _ ',10,13
db ' / _` | ',10,13
db '| (_| | ',10,13
db ' \__,_| ',10,13
db ' '
opening_end db 0
pointer db 10
ends
stack segment
dw 128 dup(0)
ends
code segment
start:
mov ax, data
mov ds, ax
mov es, ax
call print_opening
; wait for any key....
mov ah, 1
int 21h
call print_opening
; wait for any key....
mov ah, 1
int 21h
mov ax, 4c00h ; exit to operating system.
int 21h
ends
proc print_opening
pusha
mov al, 1
mov bh, 0
mov bl, 3
; I calculate length
lea cx, opening_end
lea dx, letter_a
sub cx, dx
mov dh, 3 ; row
mov dl, [pointer] ; col
lea bp, letter_a
mov ah, 13h
int 10h
mov ah, 8
int 21h
add [pointer], 10
popa
ret
endp print_opening
end start
问题是它只从我选择的列中字符串的第一行开始,然后返回到零列。有什么办法可以随时缩进整个字符串吗?
我希望能够在我的代码中更改它,而不仅仅是在数据段中设置缩进。
我真的希望这是可能的。提前致谢!
数据行中的换行和回车 return 是没有用的,因为需要循环才能完成此操作。
letter_a db ' __ _ '
db ' / _` | '
db '| (_| | '
db ' \__,_| '
db ' '
opening_end db 0
pointer db 10
循环将在读取 opening_end.
处的终止 0 后立即结束
mov cx, 8 ; Every row has 8 characters
mov dh, 3 ; row on the screen to start
mov dl, [pointer] ; col on the screen is fixed
lea bp, letter_a
Again:
mov bx, 0003h ; display page 0 and attribute 03h
mov ax, 1301h ; function 13h and write mode 1
int 10h
add bp, cx ; To next line in the data
inc dh ; To next row on the screen
cmp [es:bp], ch ; CH=0
jne Again
这是我的代码:
data segment
letter_a db ' __ _ ',10,13
db ' / _` | ',10,13
db '| (_| | ',10,13
db ' \__,_| ',10,13
db ' '
opening_end db 0
pointer db 10
ends
stack segment
dw 128 dup(0)
ends
code segment
start:
mov ax, data
mov ds, ax
mov es, ax
call print_opening
; wait for any key....
mov ah, 1
int 21h
call print_opening
; wait for any key....
mov ah, 1
int 21h
mov ax, 4c00h ; exit to operating system.
int 21h
ends
proc print_opening
pusha
mov al, 1
mov bh, 0
mov bl, 3
; I calculate length
lea cx, opening_end
lea dx, letter_a
sub cx, dx
mov dh, 3 ; row
mov dl, [pointer] ; col
lea bp, letter_a
mov ah, 13h
int 10h
mov ah, 8
int 21h
add [pointer], 10
popa
ret
endp print_opening
end start
问题是它只从我选择的列中字符串的第一行开始,然后返回到零列。有什么办法可以随时缩进整个字符串吗?
我希望能够在我的代码中更改它,而不仅仅是在数据段中设置缩进。
我真的希望这是可能的。提前致谢!
数据行中的换行和回车 return 是没有用的,因为需要循环才能完成此操作。
letter_a db ' __ _ '
db ' / _` | '
db '| (_| | '
db ' \__,_| '
db ' '
opening_end db 0
pointer db 10
循环将在读取 opening_end.
处的终止 0 后立即结束 mov cx, 8 ; Every row has 8 characters
mov dh, 3 ; row on the screen to start
mov dl, [pointer] ; col on the screen is fixed
lea bp, letter_a
Again:
mov bx, 0003h ; display page 0 and attribute 03h
mov ax, 1301h ; function 13h and write mode 1
int 10h
add bp, cx ; To next line in the data
inc dh ; To next row on the screen
cmp [es:bp], ch ; CH=0
jne Again