flat assembler
Message board for the users of flat assembler.
  
|  Index
      > Linux > Segments in Assembler | 
| Author | 
 | 
| vid 14 Mar 2006, 21:13 Code: mov es, name     | |||
|  14 Mar 2006, 21:13 | 
 | 
| Tomasz Grysztar 14 Mar 2006, 22:47 You perhaps forgot that there is no "mov segreg,imm" instruction, use "mov segreg,reg" instead. Like:
 Code: mov ax,name mov es,ax Alternatively: Code: push name pop es But why is this thread in Linux forum? | |||
|  14 Mar 2006, 22:47 | 
 | 
| vid 15 Mar 2006, 00:04 oh... | |||
|  15 Mar 2006, 00:04 | 
 | 
| flash 15 Mar 2006, 04:31 Thanks, Grysztar. I create this thread because need it for Linux AND DOS. Thanks again | |||
|  15 Mar 2006, 04:31 | 
 | 
| viki 14 Jul 2006, 08:12 But still it is not clear for me. Please look at this code
 Code: org 100h push ala pop ds mov ax,word ptr ala ret ala dw 5 the result is wrong because in this (mov ax,word ptr ala) instruction this ds ser register is used. And I and probably flash want to know how to get the correct ds if we loose it. It should be equal to cs? Sorry about my ignorance. | |||
|  14 Jul 2006, 08:12 | 
 | 
| UCM 14 Jul 2006, 15:37 Since you are creating a COM file, CS should be equal to DS, so:
 Code: org 100h push cs pop ds mov ax,word ptr ala ala dw 5 should be what you want. | |||
|  14 Jul 2006, 15:37 | 
 | 
| viki 15 Jul 2006, 06:52 thanks ucm | |||
|  15 Jul 2006, 06:52 | 
 | 
| < Last Thread | Next Thread > | 
| Forum Rules: 
 | 
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.