flat assembler
Message board for the users of flat assembler.

Index > Linux > Using a 16bit mov doesn't work?

Author
Thread Post new topic Reply to topic
SoLo2



Joined: 09 Mar 2007
Posts: 14
SoLo2 09 Mar 2007, 03:57
Hello!

Here is some code that I
thought it would run, but
doesn't...


Code:
format ELF executable

        mov     bx,var

var     db      0xAB
    


It spits an error like

Code:
flat assembler  version 1.67.21  (16384 kilobytes memory)
test.fasm [3]:
        mov     bx,var
error: value out of range.
    



This would run in an old i8086,
why not in the i386 model?

Greetings,
soLo2[/code]
Post 09 Mar 2007, 03:57
View user's profile Send private message Visit poster's website Reply with quote
hidden



Joined: 14 Feb 2007
Posts: 49
hidden 09 Mar 2007, 04:36
It's 32bit address, it can't be placed in 16bit register.
Code:
format ELF executable

        mov     ebx,var

var     db      0xAB    
Post 09 Mar 2007, 04:36
View user's profile Send private message Reply with quote
SoLo2



Joined: 09 Mar 2007
Posts: 14
SoLo2 10 Mar 2007, 00:18
Hello!

Is there a way to program in 16bits mode?
For example, "real" mode.

Or in other words, if the original 8086
instructions, still available in the new CPUs,
are there and do run well... can I manage
to use a "mov bx,var" for example relative
to CS or DS, like in genuine i86?

Thanks!


~~~~~~*~~~~~~~~~~~~~~~~~~~~~~~
http://thebitsclub.tripod.com/
http://so_o2.tripod.com/delfin.html
http://so_o2.tripod.com/xmus.html
http://www.geocities.com/mud_gallery/index.html
Post 10 Mar 2007, 00:18
View user's profile Send private message Visit poster's website Reply with quote
hidden



Joined: 14 Feb 2007
Posts: 49
hidden 10 Mar 2007, 03:47
Code:
Is there a way to program in 16bits mode?
For example, "real" mode.    
You already in virtual mode, so to code in real mode you should load 16bit OS, boot without OS or use Virtual Machine(like VMWare or Virtual PC).

Code:
Or in other words, if the original 8086
instructions, still available in the new CPUs    
Yes

I'm not sure it there any way to code 16bit program for Linux.

In windows you can use 16bit emulated mode, it's like real mode, but limited.
Code:
format MZ

        mov     bx,var

var     db      0xAB    
Post 10 Mar 2007, 03:47
View user's profile Send private message Reply with quote
SoLo2



Joined: 09 Mar 2007
Posts: 14
SoLo2 10 Mar 2007, 16:49
I moved this topic to group "Main" as
it is system independent and more
dependent on fasm.

http://board.flatassembler.net/topic.php?p=54380#54380
Post 10 Mar 2007, 16:49
View user's profile Send private message Visit poster's website Reply with quote
rugxulo



Joined: 09 Aug 2005
Posts: 2341
Location: Usono (aka, USA)
rugxulo 13 Mar 2007, 08:48
hidden wrote:

I'm not sure it there any way to code 16bit program for Linux.


I don't do Linux (yet?), but here's what I know:



Quote:

(from Dev86src-0.16.17.tgz's readme):

I _strongly_ suggest you install the kernel patch or load the module
to allow transparent execution of elks executables. If you're using
a post 2.1.43 or 2.0.36 kernel the only module you need is the binfmt_misc
driver configured like this:

echo ':i86-elks:M::\x01\x03\x20\x00:\xff\xff\xff\x83:/usr/bin/elksemu:' \
> /proc/sys/fs/binfmt_misc/register

The elksemu executable must be stored in /usr/bin/elksemu or the above
line adjusted.

Previous versions need a special module or patch described in elksemu/README
(All the options need the elksemu executable installed correctly)


ELKS (Introduction) wrote:

The goal of the ELKS project is to create a Linux-like kernel for:


  • 8086 and 80286 class IBM Personal Computer compatible systems,
  • Palmtop Computers, such as the Psion SiBO (Sixteen Bit Organiser),
  • Single board microcomputers,
  • Virtual-8086 mode on 386+ CPUs
  • Embedded controller systems, and
  • Other old computers.

Post 13 Mar 2007, 08:48
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.