汇编之字符串反转
reverse_string.asm:
asm
jmp near start
string db 'abcdefghijklmnopqrstuvwxyz'
start:
mov ax, 0x07C0
mov ds, ax
mov ax, 0xB800
mov es, ax
xor bx, bx
mov si, string
xor di, di
mov cx, start - string
push_string:
xor ax, ax
mov al, [si + bx]
push ax
inc bx
loop push_string
mov cx, bx
show_string:
pop ax
mov [es:di], al
inc di
mov [es:di], 0x07
inc di
loop show_string
jmp $
times 510 - ($ - $$) db 0
dw 0xAA55

