Results 1 to 3 of 3
  1. #1
    Member
    Join Date
    Mar 2009
    Posts
    3
    Points
    0

    Question Why would my program assemble differently?

    I had an old computer that was used for only one specific task. It used programs written by myself in assembly language and run in DOS. (I know, this is ancient). This computer was connected to a custom test fixture and communicated via the printer port (LPT1). This setup had been operating perfectly for over 10 years. The other day, the computer died and could not be revived. I brought in another older computer and expected that it could do the same job, possible faster. It would not run correctly. Extensive troubleshooting revealed that three lines in the code were responsible. In the first computer, every program contained these lines at the start of the program:
    port equ 378h
    status equ port+1
    control equ port+2
    When these three lines were written as:
    port equ 378h
    status equ (port+1)
    control equ (port+2)
    the program ran correctly.
    I can't understand why the addition of the parenthesis would correct the situation. Without the parenthesis, the addresses of the "status" and "control" values were the same as the "port" address. That is, the "+1" and "+2" characters were ignored.
    I am using TASM to assemble the programs. The TASM programs were installed on the second machine presumably from the same source as the first machine. I am at a loss the explain this dilemma.
    Alan

  2. #2
    Member
    Join Date
    May 2009
    Posts
    4
    Points
    0

    Default

    What's the date stamp on your version of DOS on the new system? Is it the same as the old PC? Have you considered the version of your TASM compiler? Is it the same as the compiler used to build the program used on the old system?

    Just a few thoughts...

    later
    wader
    Last edited by wader; 05-04-2009 at 11:42 PM.

  3. #3
    Moderator Forum Moderator arraknid's Avatar
    Join Date
    Dec 2006
    Location
    France
    Posts
    6,151
    Points
    1293
    Blog Entries
    4

    Default

    It's a very long time since I worked with assembly code and all is pretty much forgotten, but, for some reason, the parenthesis thing seemed familiar, though can't be sure. Something to do with legal and illegal indirection, maybe? Or maybe not!

    I was looking around for a discussion forum more suitable for you problem, but they are now a bit thin on the ground or abandoned some years ago. This one looks as though there are still people contributing, so it may be worth posting the question there.

    Good luck.