LinuxQuestions.org
Help answer threads with 0 replies.
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 11-11-2010, 01:20 AM   #1
PhillipHuang
Member
 
Registered: Aug 2006
Location: Shen Zhen
Distribution: Ubuntu 22.04
Posts: 199

Rep: Reputation: 33
can not edit B800:0000 in pure dos


Hello folks,

I write the below sample program named "h1.asm"?
Code:
assume cs:code

code segment
        mov ax,0B800H
        mov ds,ax
        mov bx,0

        mov byte ptr ds:[bx],'a'
        inc bx

        mov byte ptr ds:[bx],02

code ends

end
1. In Windows platform +MASM 5.0, run "command" and use "debug.exe" to see what would happen. As step by step check, I see B800:000 is not modified as expected.
2. In Ubuntu 10.04 + dosemu 1.4.0.1, run the program in two ways:
a. If exec dosemu in command line as "$dosemu -dumb", yes, it's in shell mode. and then use debug to check, "B800:0000" can be modified as expected.
Code:
"Welcome to dosemu 1.4.0.1!"
 D:\masm>debug h1.exe
-r
AX=0000  BX=0000  CX=000F  DX=0000  SP=0000  BP=0000  SI=0000  DI=0000
DS=07D2  ES=07D2  SS=07E2  CS=07E2  IP=0000   NV UP DI PL NZ NA PO NC
07E2:0000 B800B8        MOV     AX,B800
-d b800:0000
B800:0000  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
B800:0010  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
B800:0020  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
B800:0030  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
B800:0040  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
B800:0050  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
B800:0060  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
B800:0070  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
-t
AX=B800  BX=0000  CX=000F  DX=0000  SP=0000  BP=0000  SI=0000  DI=0000
DS=07D2  ES=07D2  SS=07E2  CS=07E2  IP=0003   NV UP DI PL NZ NA PO NC
07E2:0003 8ED8          MOV     DS,AX
-t
AX=B800  BX=0000  CX=000F  DX=0000  SP=0000  BP=0000  SI=0000  DI=0000
DS=B800  ES=07D2  SS=07E2  CS=07E2  IP=0005   NV UP DI PL NZ NA PO NC
07E2:0005 BB0000        MOV     BX,0000
-t
AX=B800  BX=0000  CX=000F  DX=0000  SP=0000  BP=0000  SI=0000  DI=0000
DS=B800  ES=07D2  SS=07E2  CS=07E2  IP=0008   NV UP DI PL NZ NA PO NC
07E2:0008 C60761        MOV     BYTE PTR [BX],61                     DS:0000=00
-t
AX=B800  BX=0000  CX=000F  DX=0000  SP=0000  BP=0000  SI=0000  DI=0000
DS=B800  ES=07D2  SS=07E2  CS=07E2  IP=000B   NV UP DI PL NZ NA PO NC
07E2:000B 43            INC     BX
-t
AX=B800  BX=0001  CX=000F  DX=0000  SP=0000  BP=0000  SI=0000  DI=0000
DS=B800  ES=07D2  SS=07E2  CS=07E2  IP=000C   NV UP DI PL NZ NA PO NC
07E2:000C C60702        MOV     BYTE PTR [BX],02                     DS:0001=00
-t
AX=B800  BX=0001  CX=000F  DX=0000  SP=0000  BP=0000  SI=0000  DI=0000
DS=B800  ES=07D2  SS=07E2  CS=07E2  IP=000F   NV UP DI PL NZ NA PO NC
07E2:000F 158B46        ADC     AX,468B
-d b800:0000
B800:0000  61 02 00 00 00 00 00 00-00 00 00 00 00 00 00 00   a...............
B800:0010  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
B800:0020  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
B800:0030  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
B800:0040  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
B800:0050  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
B800:0060  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
B800:0070  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
-


b. If exec dosemu in command line as "$dosemu", and run the program again, the symptom is as same as 1.(pls see attachment picture).

3. In Windows, I replace "mov ax,0B800H" to "mov ax,2000H" and try again, it would be edited well. So I wonder if it is coursed by "B800" segment address.

All above make me confused, would you give me any suggestion?

Thanks in advanced,

Phillip
Attached Thumbnails
Click image for larger version

Name:	dosemu_pure_dos.png
Views:	23
Size:	17.9 KB
ID:	5163  

Last edited by PhillipHuang; 11-11-2010 at 01:33 AM.
 
Old 11-11-2010, 02:48 AM   #2
PhillipHuang
Member
 
Registered: Aug 2006
Location: Shen Zhen
Distribution: Ubuntu 22.04
Posts: 199

Original Poster
Rep: Reputation: 33
Update by myself.

I try to run the program directly in dos mode,
Code:
D:\masm>h1.exe
'a' is display!

Perhaps it is caused by debug.exe(16bit mode)?
 
Old 11-11-2010, 12:30 PM   #3
resetreset
Senior Member
 
Registered: Mar 2008
Location: Cyberspace
Distribution: Dynebolic, Ubuntu 10.10
Posts: 1,340

Rep: Reputation: 62
Sorry, but your English leaves me wondering as to what you want, could you try a *bit* harder?
You're trying to write to the video buffer in text mode, right? Well, according to your 2nd post, you've succeeded...? If not, then what are exactly are you trying to DO?
 
Old 11-11-2010, 07:03 PM   #4
PhillipHuang
Member
 
Registered: Aug 2006
Location: Shen Zhen
Distribution: Ubuntu 22.04
Posts: 199

Original Poster
Rep: Reputation: 33
Hi resetreset, thanks for your reply. My question is, when run the program in "debug" mode, I can not write the expected data into video buffer "B8000-BFFFF". While I can get success by run the program in command line directly(After run as command line, and use debug to check later, the video buffer data is modified as expected).
 
Old 11-15-2010, 08:02 AM   #5
resetreset
Senior Member
 
Registered: Mar 2008
Location: Cyberspace
Distribution: Dynebolic, Ubuntu 10.10
Posts: 1,340

Rep: Reputation: 62
Oh,.... I would rather suspect that Debug takes OVER the whole screen, so that a write to video RAM would be pointless. Exactly HOW it does it, I don't know, it's been a while since I dabbled in stuff like this - this *should* teach you about the perils of using Microsoft software
If you're talking about using debug to SINGLE-STEP through a program, well, I think it's virtually impossible to keep your "a" on screen while it does so - the amount of stuff that happens is probably just too much.
May I ask what you're dabbling IN, that you want to do all this stuff, in this day and age?
If you're interested in old school gfx programming, may I take this opportunity to tell you and hopefully recruit you into the demoscene? :
en.wikipedia.org/wiki/Demoscene

Tell me what you thought of it, I'd love to make a new friend with similar interests as mine
 
Old 11-15-2010, 07:44 PM   #6
PhillipHuang
Member
 
Registered: Aug 2006
Location: Shen Zhen
Distribution: Ubuntu 22.04
Posts: 199

Original Poster
Rep: Reputation: 33
Hello resetreset,

I google for my question, and think that it is caused by "debug.exe" would keep current environment so that it will not display 'a' as expect while run it directly in command line can do. My favor is Perl. Though Assemble language is old, I study it in order to know computer system deeply, what happened in underlying system. Thanks for your kindly introduction, Demoscene is very cool! I will try to draw some in future days,

Phillip
 
  


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
In DOS fdisk, format, sys, copy files, edit autoexec - In linux? by hand? pentalive Linux - General 19 10-16-2013 08:53 AM
Oops 0000 eneville Linux - Kernel 0 09-26-2006 07:33 AM
Executing Perl under Dos /Creating an executable for DOS alix123 Programming 1 02-15-2006 04:07 AM
VI alternative similar to dos edit.com? jedimastermopar Linux - Newbie 5 07-28-2004 03:03 PM
invalid operand 0000 x2000koh Linux - General 3 07-03-2003 08:50 AM

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

All times are GMT -5. The time now is 01:58 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