1 Replies - 805 Views - Last Post: 13 May 2016 - 10:03 PM

#1 tehlalo   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 13-May 16

how to copy the content of dx to compare with future value of dx?

Posted 13 May 2016 - 10:01 PM

how to copy the content of dx to compare with future value of dx?

createCipherTXT PROC
   mov si, offset outfile               ;trying to copy the name of a file "CIPHER.TXT"
   cmp dx, si                           ;trying to compare the value of dx ("CIPHER.TXT OR PLAIN.TXT")
   je DecipherTXT                           ;If dx value = to CHIPER.TXT will change the name of the output file to DECIPHER.TXT
   CipherTXT:                               ; if not output file will reamain "CIPHER.TXT"
       mov dx, offset outfile           ; pass a reference to the output file name
       jmp CreateFile
   DecipherTXT:
       mov dx, offset outfiledecrypt
   CreateFile:
       mov cx, 0                        ; do not specify any file attributes
       mov ah, 3ch                    ; function: create or truncate file
       int 21h                           ; call DOS
   jc createCipherTXTFail           ; display message and quit if error
   mov outHandle, ax               ; store output file handle
   ret
   createCipherTXTFail:
       mov dx, offset fcf
       call ShowErrorAndExit  
createCipherTXT ENDP


Is This A Good Question/Topic? 0
  • +

Replies To: how to copy the content of dx to compare with future value of dx?

#2 macosxnerd101   User is offline

  • Games, Graphs, and Auctions
  • member icon




Reputation: 12657
  • View blog
  • Posts: 45,831
  • Joined: 27-December 08

Re: how to copy the content of dx to compare with future value of dx?

Posted 13 May 2016 - 10:03 PM

Moved to Assembly. Please post Assembly questions in the correct forum, not the Other Languages forum.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1