📄 macro.inc
字号:
;
;THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
;ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
;THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
;PARTICULAR PURPOSE.
;Copyright (c) 1995-2000 Microsoft Corporation
;
;Module Name: macro.inc
;
;Abstract: Boot loader assembly support code.
;
;Functions:
;
;Notes:
;
FLAT_STACK_SIZE EQU 3FFCh ; This should match BIB file.
FLAT_STACK_START EQU FLAT_STACK_SIZE ;
ROM_OFFSET EQU 0FFF60000H ; This supports running out of ROM
; initially, until the image is
; copied to RAM. Must correspond
; to BIB ROMOFFSET value.
;---------------------------------------------
; MACROS
;---------------------------------------------
; x86 instruction prefix macros
;---------------------------------------------
OpPrefix MACRO
db 66h
ENDM
AddrPrefix MACRO
db 67h
ENDM
; Function call macros
;---------------------------------------------
NoMemCall MACRO function
mov ebp, OFFSET @F + ROM_OFFSET
jmp function
@@:
nop
ENDM
;---------------------------------------------
NoMemRet MACRO
mov eax, ebp
jmp eax
ENDM
; Serial routines
;---------------------------------------------
WriteChar MACRO char
mov dh, 003h
mov dl, 0fdh
@@:
in al, dx
test al, 20h
je short @B
mov dl, 0f8h
mov al, char
out dx, al
ENDM
;---------------------------------------------
WriteVal MACRO val
ror val, 4
mov ah, val
and ah, 0fh
cmp ah, 9
jng short @F
add ah, 7
@@:
add ah, '0'
WriteChar ah
ror val, 4
mov ah, val
and ah, 0fh
cmp ah, 9
jng short @F
add ah, 7
@@:
add ah, '0'
WriteChar ah
ENDM
;---------------------------------------------
WriteHex_EBX MACRO
bswap ebx
WriteChar '0'
WriteChar 'x'
WriteVal bl
WriteVal bh
bswap ebx
WriteVal bh
WriteVal bl
ENDM
;---------------------------------------------
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -