[汇编] 将字符串里的一个'&'字符换成空格

时间:2023-03-09 16:07:55
[汇编] 将字符串里的一个'&'字符换成空格
 ; multi-segment executable file template.

 data segment
; add your data here!
pkey db "press any key...$"
STRING DB 'The date is FEB&03$'
ends stack segment
dw dup()
ends code segment
start:
; set segment registers:
mov ax, data
mov ds, ax
mov es, ax ; add your code here
mov cx,
mov si,-
mov al,'&' NEXT:
inc si
cmp al,STRING[si]
loopne NEXT
je FOUND
FOUND:
mov STRING[si],20H lea dx, STRING
mov ah,
int 21h ; output string at ds:dx ; wait for any key....
mov ah,
int 21h mov ax, 4c00h ; exit to operating system.
int 21h
ends end start ; set entry point and stop the assembler.