LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 02-09-2008, 06:00 AM   #1
vargadanis
Member
 
Registered: Sep 2006
Posts: 248

Rep: Reputation: 30
Effective memory addressing problem (NASM)


Hi

I have a code like this:

Code:
segment .data
msg db 'Why u dont work?', 0
msg_len db $-msg
And I would like to write each byte of the msg to certain memory locations one by one.
Eg:
The first byte og the msg (containing the hex for W ASCII) would go to 0xb800:0x00
and the second to 0xb800:0x02
and so on...
How do I do that?

I tried this:
mov ax, [msg] but the value of ax was NULL.
Tried this:
mov ax, [msg:0x00] nothing... What am I doing wrong?
 
Old 02-09-2008, 06:54 AM   #2
v12z
LQ Newbie
 
Registered: Feb 2008
Distribution: Ubuntu
Posts: 1

Rep: Reputation: 0
Try setting up DS segment

Do you programming for DOS?
May you don't setup your segment resisters?
 
Old 02-09-2008, 08:26 AM   #3
vargadanis
Member
 
Registered: Sep 2006
Posts: 248

Original Poster
Rep: Reputation: 30
nope.. I go for boot sector
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Examples about Logical,Linear and Physical address in Linux Memory Addressing muralis Linux - Kernel 5 08-04-2007 08:18 PM
Newbie kernel internals memory addressing Midraga Linux - Kernel 5 04-04-2007 09:07 PM
Addressing 36-bits of memory from single process using Xeon processor clustopher Slackware 1 02-24-2005 10:37 AM
Problem with IP Addressing orko Linux - Networking 3 01-14-2005 03:54 PM
NASM problem ChimpFace9000 Programming 0 07-28-2001 01:42 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 06:39 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration