home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / os / msdos / programm / 10543 < prev    next >
Encoding:
Text File  |  1992-11-12  |  1.2 KB  |  34 lines

  1. Newsgroups: comp.os.msdos.programmer
  2. Path: sparky!uunet!spool.mu.edu!uwm.edu!rpi!psinntp!psinntp!newstand.syr.edu!erc.cat.syr.edu!dmeltzer
  3. From: dmeltzer@erc.cat.syr.edu (David Meltzer)
  4. Subject: Re: 386 Assembler Question - Easy one...
  5. Message-ID: <1992Nov11.230733.4638@newstand.syr.edu>
  6. Organization: Electronic Resource Center, Syracuse
  7. References: <1992Nov9.162931.1@camins.camosun.bc.ca> <1992Nov11.114831.6643@ufhx1.ufh.ac.za>
  8. Date: Wed, 11 Nov 92 23:07:33 EST
  9. Lines: 23
  10.  
  11. In article <1992Nov11.114831.6643@ufhx1.ufh.ac.za> cssjs2@ufhx1.ufh.ac.za (Mr I Scheepers) writes:
  12. >In <1992Nov9.162931.1@camins.camosun.bc.ca> morley@camins.camosun.bc.ca writes:
  13. >>In 386 assembler I need to fill an extended register with 4 copies
  14. >>of the same byte.  Right now I'm using the following:
  15. >
  16. >>   mov  al,VALUE
  17. >>   mov  ah,VALUE
  18. >>   shl  eax,16
  19. >>   mov  al,VALUE
  20. >>   mov  ah,VALUE
  21. >
  22. >>I'm curious... is there a better/faster way to stuff the register?
  23. >
  24. >How about:
  25. >    mov al,VALUE
  26. >    mov ah,al
  27. >    mov eax,ax
  28. Wouldnt't that last line move the 16-bit value of AX register to the 32-bit
  29. EAX register, like doing a mov ax,al?  Unfortunately there is no way to
  30. access the high 16-bits of EAX directly as such, like a EHAX (which would
  31. invariably lead to a EHAL <sigh>).
  32. David Meltzer
  33.