Problem with NASM????
Posted: Fri Feb 28, 2003 7:11 pm
Hello,
I am trying to setup my TSS descriptor with the following code:
;**** SYSTEM TSS
align 16
tssTable: ; SS:ESP0 not set yet
times 112 db 0
;*********
And in the gdtTable located further on I have:
nullDesc:
dw 0, 0, 0, 0 ; dummy
dw 0, 0, 0, 0 ; unused
kernelCode:
dw 0xFFFF ; 4Gb limit (low 4 nibbles)
dw 0 ; base address = 0
dw 0x9A00 ; code read/exec, DPL=0
dw 0x00CF ; big granularity, 5th nibble of limit
kernelData:
dw 0xFFFF ; 4Gb limit (low 4 nibbles)
dw 0 ; base address = 0
dw 0x9200 ; data read/write, DPL=0
dw 0x00CF ; big granularity, 5th nibble of limit
tssDescriptor:
dw 0x0070
; Limit of 112 bytes
dw tssTable & 0xFFFF
; Base
dw ((tssTable & 0x00FF0000) >> 16) + 0x8B00
; Base byte 2 in LSByte, flags in MSByte
dw (tssTable & 0xFF000000) >> 16
; Byte 6=0, byte 7=MSB of base >>24 <<8
When I try and compile Nasm generates the following error msg:
bootstrap.asm:254: error: `&' operator may only be applied to scalar values
bootstrap.asm:255: error: `&' operator may only be applied to scalar values
bootstrap.asm:256: error: `&' operator may only be applied to scalar values
so basically, nasm is complaining about the expression dw tssTable & 0xFFFF
Why???????????
PS If someone who runs this site has time could they please make the message box wider, code comments often overflow onto the next line. Other than that, this site is brilliant.
I am trying to setup my TSS descriptor with the following code:
;**** SYSTEM TSS
align 16
tssTable: ; SS:ESP0 not set yet
times 112 db 0
;*********
And in the gdtTable located further on I have:
nullDesc:
dw 0, 0, 0, 0 ; dummy
dw 0, 0, 0, 0 ; unused
kernelCode:
dw 0xFFFF ; 4Gb limit (low 4 nibbles)
dw 0 ; base address = 0
dw 0x9A00 ; code read/exec, DPL=0
dw 0x00CF ; big granularity, 5th nibble of limit
kernelData:
dw 0xFFFF ; 4Gb limit (low 4 nibbles)
dw 0 ; base address = 0
dw 0x9200 ; data read/write, DPL=0
dw 0x00CF ; big granularity, 5th nibble of limit
tssDescriptor:
dw 0x0070
; Limit of 112 bytes
dw tssTable & 0xFFFF
; Base
dw ((tssTable & 0x00FF0000) >> 16) + 0x8B00
; Base byte 2 in LSByte, flags in MSByte
dw (tssTable & 0xFF000000) >> 16
; Byte 6=0, byte 7=MSB of base >>24 <<8
When I try and compile Nasm generates the following error msg:
bootstrap.asm:254: error: `&' operator may only be applied to scalar values
bootstrap.asm:255: error: `&' operator may only be applied to scalar values
bootstrap.asm:256: error: `&' operator may only be applied to scalar values
so basically, nasm is complaining about the expression dw tssTable & 0xFFFF
Why???????????
PS If someone who runs this site has time could they please make the message box wider, code comments often overflow onto the next line. Other than that, this site is brilliant.