From: "Dark Angel" Newsgroups: comp.os.msdos.djgpp Subject: _farpokeb Function Date: 13 May 1998 00:51:33 GMT Organization: Dark Angel Soft Lines: 40 Message-ID: <01bd7e00$9a643480$cafd41c2@default> NNTP-Posting-Host: 194.65.253.202 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk I tried to convert the function _farpokeb to asm, but it didn't work(there are things i don't understand) (i looked at the header file sys/farptr.h: __asm__volatile ("movw %w0, %%fs\n" -What is the fs register? -Why move the selector to fs? ".byte 0x64 \n" -What is this? .byte 0x64? can someone tell me? -why don't the 0x64 as an $ sign, like all the other constants what does it do? "movb %b1, (%k2)") -what is the address of %k2? the funtion in asm i created looked like this movw selector(%ebp), %fs movb color(%ebp), %al movl offset(%ebp), %ebx .byte 0x64 movb %al, (%ebx) This code some times work, another times don't. I know there is no problem when passing the parameters (selector, color, offset). can someone tell me what is wrong? Another question: What is the correspondent instruction in AT&T asm for "include" of intel (to include an external file)?. Yet, another question: When i get the selector with _dpmi_segment_to_descriptor(0xa000) is it always the same or it can change? can i get it once, and then use the value as a constant? Wait, i got another one! How do i declare a global variable in AT&T asm? Thank's, Jorge Lima, from Dark Angel Soft