21,459
社区成员
发帖
与我相关
我的任务
分享
org 100h
section .text
xchg ax, bp;why?
mov dx, msg
int 21h
ret
msg db "Hello, World!$"
;nasm hello.asm -o hello.com
org 100h
section .text
xchg ax, bp;why?
call display_hex_16
mov dx, msg
int 21h
ret
msg db "Hello, World!$"
display_hex_16:
push ax
rol ax,8
call display_hex_8
rol ax,8
call display_hex_8
pop ax
ret
display_hex_8:
pusha
mov bl,al
mov cx,2
@bb:
mov al,bl
rol al,4
mov bl,al
and al,0fh
cmp al,9
jbe @nn
add al,7
@nn:
add al,30h
call display_char
loop @bb
popa
ret
display_char:
pusha
mov dl,al
mov ah,2
int 21h
popa
ret