em_print.s
来自「MINIX系统源码」· S 代码 · 共 48 行
S
48 行
.sect .text; .sect .rom; .sect .data; .sect .bss
.sect .text
.define printc,printd,prints
! argument in eax
! uses ebx
prints:
xchg eax,ebx
1:
movb al,(ebx)
inc ebx
testb al,al
jz 2f
call printc
jmp 1b
2:
ret
! argument in eax
! uses ecx and edx
printd:
xor edx,edx
mov ecx,10
div ecx
test eax,eax
jz 1f
push edx
call printd
pop edx
1:
xchg eax,edx
addb al,'0'
! argument in eax
printc:
push eax
mov ebx,esp
mov eax,1
push eax
push ebx
push eax
call __write
pop ebx
pop ebx
pop ebx
pop ebx
ret
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?