Message board for the users of flat assembler.
> Main > is ds:dx disallowed in 16 bit?
lazer1 19 Jun 2006, 15:45
the following code fragment doesnt compile:
use16 cmp [ds:dx],byte 0
with error message:
error: reserved word used as symbol
whereas this one does compile:
use16 cmp [ds:bx], byte 0
also [ds:ax] and [ds:cx] dont compile
however [ds:di] and [ds:si] both do compile,
does more recent 16 bit real x86 not recognise [ds:dx] , [ds:ax], [ds:cx]?
|19 Jun 2006, 15:45||
LocoDelAssembly 19 Jun 2006, 16:20
Actually there is no addressing mode that supports [dx], [ax], [cx] even if you use use32 (but you can use [edx], [eax], [ecx]). Anyway it's a little strange the error that FASM reports, I think it should be "Invalid addressing mode" or something similar
|19 Jun 2006, 16:20||
lazer1 19 Jun 2006, 17:49
you are right, I tried it just now and use16 accepts [ds:eax] and
[ds:ecx] and [ds:edx],
however as all my code runs beyond the first 64K of memory
16 bit real will freeze up if any of the upper 16 bits of eax, ecx, edx, ebx
at the moment I often do things like:
org 20000h use16 .... mov ebx,xyz call f xyz dd 0 f: mov [ds:bx],10 ret
here mov [ds:ebx] will freeze up the machine
if ds is 0 and eg ebx==21234h
so instead I have ds==2000h and ebx would need to
simply because it can only deal with 16 bit offsets even though
it is a long way from even 1MB,
|19 Jun 2006, 17:49||
vid 20 Jun 2006, 08:38
yes, unless you enable flat-real mode, all offsets must be below 10000h. Search board for "flat real mode" and "unreal mode"
|20 Jun 2006, 08:38||
< Last Thread | Next Thread >
Copyright © 1999-2023, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.
Website powered by rwasa.