From: billlanam AT california DOT com (Bill Lanam) Newsgroups: comp.os.msdos.djgpp Subject: Re: [Q] Inline assembler and mov instructions Date: Thu, 20 Feb 1997 00:36:06 GMT Message-ID: <330b9890.9518282@seashell.california.com> References: <856360718 DOT 728600 AT red DOT parallax DOT co DOT uk> NNTP-Posting-Host: 140.174.210.143 Lines: 21 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp On Wed, 19 Feb 97 13:58:43 GMT, johne AT parallax DOT co DOT uk (John Eccleston) wrote: >Hi All, > >I am trying to write some inline assembler to get the address of the >bios fonts, and I was trying to use MOV instructions like so: > > asm("movw %edx, %bh\n\t"); > >I use edx as in the extended syntax it is used to pass in a value, >but the BIOS call requires that the value be in bh. > Since you appear to be moving from a large register to a small one you can do asm ("mov %dl, %bh\n\t\t"); unless you are moving from the esi or edi registers in which case you can do asm ("mov %si, %bx\n\t\tmov %bl, %bh\n\t\t"); Bill Lanam