Help! Could somebody give me an assembly program showing the base addresses of LPT1, LPT2, and LPT3 of the computer using MASM (MIcrosoft Assembly Program).... Please, i really need it.
I already have a turbo C++ version of it, but I need the assembly program asap. Please help! Help! :confused: :confused:
Posted on 2004-02-06 07:14:47 by ktin
Can you try and give me the C++ version and i'll take a look into it for you.
Posted on 2004-03-25 17:32:03 by Black iCE
I not think that masm is = to that ... or is? :P

Have a nice day.
Posted on 2004-03-27 11:27:33 by rea
ktin, you should know that in Win2k, XP and later you don't have direct access to the LPT port.

From what I read on sites, you can get the port address this way:

mov dx,40h ; we'll want to set DS = 40h
mov ds,dx ; setting a new value to DS is done only via a register
movzx eax,word ptr DS:[0008] ; read from address 8
mov dx,cs ; get the previous value of DS (CS usually has the same value as DS)
mov ds,dx ; again, set DS using a register

; now ax contains that address

I use Win2k, so this code crashes - but I hope it'll work for you - I guess you're an Win98 user :)

Btw, MASM stands for Macro Assembler, masm is not originally developed by Microsoft - they just bought it from some small group of good coders ;)
I bless those coders for giving us, asm coders, such power and ease of coding ;)
Posted on 2005-02-09 09:05:06 by Ultrano