Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

no output from code

Status
Not open for further replies.

xlav

Technical User
Oct 23, 2003
223
JM
The following code when assembled gives no output on console. Copied code from inet. Seek help to correct code error.

-> Under 'Addressing Memory', 'source code or here'.


CODE:

%OUT-------------------------------------------------------------------------
%OUT Written by Ferdi Smit for use with the "ASM Tutorial Part 2" -
%OUT-------------------------------------------------------------------------
; To compile: TASM examp2.asm -
; TLINK examp2.obj -
;----------------------------------------------------------------------------
.model small
.stack 10
.data

value_one db 0
value_two dw 0
value_three db 0
value_four db "everybody","$"

value_five db 3 dup ("!")

video_segment dw 0B800h

.code

_main proc
mov ax,seg value_one
mov ds,ax

mov es,[video_segment]

mov [value_one],"H"
mov byte ptr [value_two],"e"
mov byte ptr [value_two + 1],"l"
mov byte ptr [value_three],"l"
mov byte ptr [value_three + 1],"o"
mov word ptr [value_three + 2],2020h

lea di,value_four
inc byte ptr [di]
;----------------------
xor di,di
lea si,value_one
mov cx,19
mov ah,07h
cld
print_loop:
lodsb
stosw
loop print_loop
;----------------------

mov ax,0C07h
int 21h

mov ax,4c00h
int 21h
_main endp
end _main

-x
 
Hey,

The thing is that this code writes output to video memory directly, that doesn´t work under Windows Nt, 2000, xp platform, not even in console mode. Boot from an old dos diskette and your code will run just fine,

regards,

Rick
 
I tried to boot from a 3.5" floppy boot disk. Could not boot because of Norton Ghost software on my system which says 'only 1 drive cannot clone locally'. (got console screen with A:>GHOST).
Is this what you meant by booting from an old dos diskette?

-x
 
I downloaded DOS 6.22 boot disk from this link,


Double clicked file and was told by a 'batch assistant' message box to 'insert floppy to write'. Inserted 3.5" floppy and got 'error message box' saying 'current image format is not supported by the disk drive'. Got final message box saying 'batch stopped: no target'.

-x
 
Hi x,


You probably need something like rawrite.exe, which is an utility that writes to a floppy directly from a binary file, (it is used to create bootable diskettes from different os), you can download it from
A nice Dos version I always recommend is Dr. Dos 7.0x, you can download it from if you need additional information there is plenty documentation in
Hope this helps,

Rick
 
Thanks. Will check the info.

-x
 
I downloaded rawrite onto my floppy drive. Tried to boot with the floppy and got the error,

'NTLDR is missing
Press any key to restart'

In the BIOS floppy is the first boot device.

The DrDOS 7.0x download has a total of 11 files to be downloaded. How do I make the diskettes with the program makedisk.exe that is downloaded?

-x

 
Use diskcopy like

DISKCOPY DISK01.144 A:

the lite version is ldisk01.144 and requires 3 diskettes
ldisk01.144, ldisk02.144 and ldisk03.144

you can use that one if you prefer


regards,

Rick
 
Downloaded the disk files and also mkdskzip.exe file to my C drive. Entered- 'DISKCOPY DISK01.144 A:'
Get error- 'invalid parameter DISK01.144'.
Also entered- 'makedisk' and get 'error' message box saying- 'cannot find makedisk.ini control file. This file must exist in the same directory as makedisk.exe.'

-x
 
Got diskcopy to work. I was leaving out the folder containing the downloaded disk files from the file path. Copied disks 01 and 02 to floppies. When try to copy disks 03 to 05 get - 'Error opening or creating disk file'. Downloaded another copy of disk03.144 and still get the error. I'm wondering what could be wrong.

-x
 
A DOS box in WinXP does permit all normal DOS 16-bit operations including writing to screen memory directly, and all the old-fashioned DOS interrupts. I've tried it, it really does...
 
I'm using win2kpro. Got all the files copied by changing the DISKCOPY command. Original command was C:\>DR-DOS703\DISKCOPY disk03.144 A: At C:\> I entered cd DR-DOS703. Got C:\DR-DOS703>. Then I entered the diskcopy command. SO final command is C:\DR-DOS703>DISKCOPY disk03.144 A:

-x
 
Just one comment: the original code assumes you're using DOS with a text mode screen. Although by default that should be the situation, even in an original DOS-only computer, if it had a VGA card, this is a dangerous assumption. A previous program might well have left it in a graphics mode, where the screen starts at 0A000h, not 0B800h, and works in pixels, not letters. DOS doesn't care, and works fine in graphics modes or text. The character outputs via interrupts work fine in either - it's only direct screen writes where you need to be in the right mode.

Now I'm not sure what Win2K does, but I have a feeling WinXP sometimes goes for a graphics screen when handling dos boxes. It might be an idea to set the appropriate mode explicitly rather than trust to good luck.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top