nasm这是什么错误啊?
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
DATTR_DROA EQU 0x11 ; Read Only Data Segment (Accessed)
DATTR_DRW EQU 0x12 ; Read/Write Data Segment
DATTR_DRWA EQU 0x13 ; Read/Write Data Segment (Accessed)
DATTR_ROED EQU 0x14 ; Read Only Data Segment, Expand-down
DATTR_ROEDA EQU 0x15 ; Read Only Data Segment, Expand-down (Accessed)
DATTR_RWED EQU 0x16 ; Read/Write Data Segment, Expand-down
DATTR_RWEDA EQU 0x17 ; Read/Write Data Segment, Expand-down (Accessed)
DATTR_CEO EQU 0x18 ; Execute Only Code Segment
DATTR_CEOA EQU 0x19 ; Execute Only Code Segment (Accessed)
DATTR_CER EQU 0x1A ; Execute/Read Code Segment
DATTR_CERA EQU 0x1B ; Execute/Read Code Segment (Accessed)
DATTR_CEOC EQU 0x1C ; Execute Only Conforming Code Segment
DATTR_CEOCA EQU 0x1D ; Execute Only Conforming Code Segment (Accessed)
DATTR_CERC EQU 0x1E ; Execute/Read Conforming Code Segment
DATTR_CERCA EQU 0x1F ; Execute/Read Conforming Code Segment (Accessed)
; System Segment Type
; bit 4, byte 5 = 0, S
; bit 0,1,2,3, byte 5 TYPE
DATTR_286TSS EQU 0x01 ; Available 286 TSS
DATTR_LDT EQU 0x02 ; LDT
DATTR_286TSSB EQU 0x03 ; Busy 286 TSS
DATTR_286CGate EQU 0x04 ; 286 Call Gate
DATTR_TaskGate EQU 0x05 ; Task Gate
DATTR_286IGate EQU 0x06 ; 286 Interrupt Gate
DATTR_286TGate EQU 0x07 ; 286 Trap Gate
DATTR_386TSS EQU 0x09 ; Available 386 TSS
DATTR_386CGateB EQU 0x0B ; Busy 386 Call Gate
DATTR_386CGate EQU 0x0C ; 386 Call Gate
DATTR_386IGate EQU 0x0E ; 386 Interrupt Gate
DATTR_386TGate EQU 0x0F ; 386 Trap Gate
;Present
; bit 7, byte 5, P
DATTR_PR EQU 0x80 ; Present
DATTR_NP EQU 0x00 ; Not Present