实验9
assume cs:codesg,ds:datasg,ss:tabledatasg segment
db 'welcome to masm!'
db 02h,24h,71h
datasg ends
table segment
dw 8 dup(0)
table ends
codesg segment
start: mov ax,datasg
mov ds,ax
mov ax,table
mov ss,ax
mov sp,10h
mov ax,0b872h
mov bp,0
mov cx,3
s0:push cx
push ax
mov es,ax
mov si,1
mov di,0
mov bx,0
mov cx,16
s1:mov al,ds:
mov es:,al
mov al,ds:
mov es:,al
inc bx
add di,2
add si,2
loop s1
pop ax
pop cx
add ax,0ah
inc bp
loop s0
mov ax,4c00h
int 21h
codesg ends
end start
字符串ACCSII码和字符串颜色属性
可分别存于ax寄存器的低位和高位,再一次性写入显存
assume cs:code,ds:data
data segment
db 'welcome to masm!'
db 02H,24H,71H
data ends
code segment
start:mov ax,data
mov ds,ax
mov bx,0
mov ax,0B800H
mov es,ax
mov si,6e0H
mov cx,16
s:mov al,
mov ah,ds:
mov es:,ax
mov ah,ds:
mov es:,ax
mov ah,ds:
mov es:,ax
inc bx
add si,2
loop s
mov ax,4c00H
int 21H
code ends
end start
本帖最后由 sbx 于 2020-2-11 16:29 编辑
assume cs:code,ds:data,ss:stack
data segment
db 'welcome to masm!'
db 02H,24H,71H
data ends
stack segment
dw 8 dup(0)
stack ends
code segment
start :mov ax,data
mov ds,ax
mov ax,stack
mov ss,ax
mov sp,10H
mov ax,0b872H
mov si,0
mov cx,3
s0:push cx
push ax
mov es,ax
mov bx,0
mov di,0
mov cx,16
s1:mov al,
mov ah,ds:
mov es:,ax
inc bx
add di,2
loop s1
inc si
pop ax
add ax,0AH
mov es,ax
pop cx
loop s0
mov ax,4c00H
int 21H
code ends
end start
页:
[1]