DA_32 EQU 4000h ; 32 位段
DA_LIMIT_4K EQU 8000h ; 粒度4K
DA_CR EQU 9Ah ; 存在的可执行可读代码段属性值
LABEL_DESC_FLAT_C: Descriptor 0, 0fffffh, DA_CR | DA_32 | DA_LIMIT_4K
编译后的错误是:
warning:byte data exceeds bounds
想不明白错哪了?
------解决方案--------------------
属性如下表
; Descriptor Type
; bit 6, byte 6, D/B
DATTR_32 EQU 0x4000 ; 32-bit Segment
DATTR_16 EQU 0x0000 ; 16-bit Segment
; bit 7, byte 6, G
DATTR_G4K EQU 0x8000 ; 4kB Granularity
DATTR_G1B EQU 0x0000 ; 1B
; bit 5,6, byte 5, DPL
DATTR_DPL0 EQU 0x00 ; DPL = 0
DATTR_DPL1 EQU 0x20 ; DPL = 1
DATTR_DPL2 EQU 0x40 ; DPL = 2
DATTR_DPL3 EQU 0x60 ; DPL = 3
; Data Segment Type
; bit 4, byte 5 = 1, S
; bit 0,1,2,3, byte 5, TYPE
DATTR_DRO EQU 0x10 ; Read Only Data Segment