getbyte.s

来自「开放源码实时操作系统源码.」· S 代码 · 共 47 行

S
47
字号
# 05/08/2000 Michael Temari <Michael@TemWare.Com>
# GETBYTE/PUTBYTE for MINIX
! sections

.sect .text; .sect .rom; .sect .data; .sect .bss

#include "/usr/src/kernel/protect.h"

.extern	_GETBYTE_FP
.extern	_PUTBYTE_FP
.extern	_RMW_FP

.sect .bss
.sect .text

        .align  16
_GETBYTE_FP:
	mov	bx,ds
        mov	ecx, 0x17
        mov	ds, cx
        mov	edx,4(esp)              ! offset
        sub	ax, ax
        movb	al,(edx)                ! byte to get
        mov	ds,bx
        ret

        .align  16
_PUTBYTE_FP:
	mov	bx,ds
        mov	ecx, 0x17
        mov	ds, cx
        mov	eax,4(esp)              ! offset
        mov	edx,4+4(esp)            ! data byte
        movb	(eax),dl                ! byte to store
        mov	ds,bx
        ret

        .align  16
_RMW_FP:
        mov	bx,ds
        mov	ecx, 0x17
        mov	ds, cx
        mov	eax,4(esp)              ! offset
        orb	(eax),cl                ! byte to store
        mov	ds,bx
        ret

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?