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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

trying to print a series of charac to the printer using INT 17H

Status
Not open for further replies.

asmnovice

Programmer
Jun 28, 2001
6
0
0
US
I get L2001. "Unresolved external symbol _mainCRTStartup".
and my program won't link even though I get no errors or warning from the compile.
the program :

mysegment para 'DATA
message BYTE 'programming in assembly is fast'
mydata ends
mycode para "code'
mov bx,00h
mov dx,00H
mov ah,01H
int 17H
again: mov al,messa[[bx] cmp al,'t'
je thas_all
mov ah,00H
int 17H
inc bx
jmp again
thas_all: Mov ax,ax
prntchar endp
mycode endp
end

if int 17H is wrong to print a character to the , can you tell me another way to write a char to the printer? I know how to write to the screen ok. but I would like to write to the printer insread.
 
Hi there,

int 17h is a bios interrupt and only run in dos (aka windows 95, windows 98)

First you have to initialize printer port,

mov ah, 01 ; initializes port
mov dx, 00 ; LPT1
int 17h
test ah, 1 ; time out expired?
jnz error
.
.

To print a character
mov ah, 0h,
mov al, OCh ; your character goes here
mov dx, 00h ; LPT1
int 17h
test ah, 1 ; time out?
.
.

are you compiling these program in DOS?

regards,

Rick



 
hi Rick,
this is asymnovice thanking you for the answer to how to print a character to the printer. I ran you program and it would not link. It said I "had an unresolved external symbol namly _mainCRTSstartup.". This was the same error I got before. Your program assembled with no errors or warning.
I am using Windows ME wirh a disk for MASM611 Assembly language that I got from Kip Irving through his book from miami published by printice Hall. that supposed to work wih Windows and is has worked for me in the past. Can you offer any reason fot it not linking? The following program was used:
mov bx,00H
mov dx,00H
mov ah,01H
int 17H
test ah,1
jnz thas_all
mov ah,00H
again: mov al,message [bx]
cmp al,($)
je thas_all
mov dx,00H
int 17H
test ah,1
jnz thas_all
inc bx
jmp again
thas_all: mov ax,ax
prntchar endp
mycode ends
end.
My message was defined as para 'DATA';'programming in assembly langage is fast$and then mydata ends


 
try the following compiler directives

.MODEL SMALL
.CODE

< your code>

.DATA

message ...

regards,

Rick
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top