flat assembler
Message board for the users of flat assembler.

Index > Windows > send printer control code to port LPT1 or C system("STA

Author
Thread Post new topic Reply to topic
sleepsleep



Joined: 05 Oct 2006
Posts: 12778
Location: ˛                             ⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣Posts: 0010456
sleepsleep 25 Mar 2009, 23:02
hi,
Cool life sucks at this moment, need to settle this problem.

how to send control code to LPT1 port? in windows xp home
is using userport.sys the easiest way to accomplish this task?

i saw an application on internet, it is called SendStr.exe, it could perform like userport.sys except without much hassle. consider.

Quote:

SendStr ver. 1.1 32 bit version
(C)Copyright by Jim Chapman, 2002

syntax: SendStr x y [z] [z] [z]........
Where x can be 1 for lpt1, 2 for lpt2, 3 for com1, or 4 for com2.
And y represents the decimal representation of ascii characters
to be sent to the output port.
[z] represents optional additional ascii characters.
NOTE: y & z parameters must be numerical values corresponding to
either ascii control or printable characters.
Two parameters are required, the output port and at least 1 ascii string.
Parameters need only be seperated by a space, as in:

SendStr 1 12

to send a form feed to a printer on LPT1.


one of the idea is to use c language system("sendstr 1 12 66 77 88 99 00") in my project. but how is system() in fasm??

thanks in advance. Rolling Eyes
Post 25 Mar 2009, 23:02
View user's profile Send private message Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4624
Location: Argentina
LocoDelAssembly 26 Mar 2009, 00:10
sleepsleep, actually you don't need any driver since direct I/O is not really needed, check this serial port example: http://board.flatassembler.net/topic.php?t=6459
As you can see in the last post I couldn't find my code that used LPT port and unfortunately I still can't...
Post 26 Mar 2009, 00:10
View user's profile Send private message Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4624
Location: Argentina
LocoDelAssembly 26 Mar 2009, 00:14
And here you have the system function example:
Code:
format pe console
include 'win32ax.inc'

  cinvoke system, "cmd.exe"
  invoke  ExitProcess, 0

align 4 ; Just to be safe
data import 
  library kernel32, 'kernel32.dll',\
          msvcrt,'msvcrt.dll'

  import kernel32,\
         ExitProcess, 'ExitProcess'

  import msvcrt,\
         printf, 'printf',\
         system, 'system'
end data    
Post 26 Mar 2009, 00:14
View user's profile Send private message Reply with quote
sleepsleep



Joined: 05 Oct 2006
Posts: 12778
Location: ˛                             ⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣Posts: 0010456
sleepsleep 26 Mar 2009, 16:42
cool, thanks locodelassembly Smile

i just completed the patch program needed by my client... wat a great relief Smile .... thanks for ur cinvoke system,"notepad.exe" Razz Razz
Post 26 Mar 2009, 16:42
View user's profile Send private message 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.