4 Replies - 740 Views - Last Post: 12 September 2012 - 08:26 PM

#1 krosty4782  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 14
  • Joined: 12-June 11

Edit a file

Posted 12 September 2012 - 04:46 PM

Hello, im new to asm, and im trying to code some kind of notepad.
At the moment, my program create a file, and open a file.
Now i want to be able to edit the opened file. I ve thought in one option:
When i open the file, it shows it in the console, so one option is to give the user the option of modify the console text, and then, when i need to save the file, take all the text in screen and rewrite it over the original txt. I know how to give the user the option to modify text in console, but i don't know how to seek the pointer to begining of console, using interruption 21h 42h, i need a handle, it is possible to get the handle of the console and use seek to place pointer to 0 and then get all writed text?
What other option can i use ?
note: i don't want only to append text, i want to be able to modify and add text in any position.

Thanks

Is This A Good Question/Topic? 0
  • +

Replies To: Edit a file

#2 GunnerInc  Icon User is offline

  • "Hurry up and wait"
  • member icon




Reputation: 858
  • View blog
  • Posts: 2,277
  • Joined: 28-March 11

Re: Edit a file

Posted 12 September 2012 - 04:50 PM

Can I ask, why are you trying this using Interrupts/16bit DOS code? It would be much easier to do this with the Windows APIs and 32 bit code. Your really not going to get much help with outdated coding. Also, pick ONE forum and post to it instead of posting the same question EVERYWHERE on the net!
Was This Post Helpful? 0
  • +
  • -

#3 krosty4782  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 14
  • Joined: 12-June 11

Re: Edit a file

Posted 12 September 2012 - 06:33 PM

Because im just learning asm and using emu 86 for this. And im also using win 64 bits, so i thnik 32 bits code won't work. I try compiling for 64 bits, but i couldn't so, i decided to continue with emu86 till i know the basics.
I only posted this in other forum where im member, not everywhere on the net....
Was This Post Helpful? 0
  • +
  • -

#4 GunnerInc  Icon User is offline

  • "Hurry up and wait"
  • member icon




Reputation: 858
  • View blog
  • Posts: 2,277
  • Joined: 28-March 11

Re: Edit a file

Posted 12 September 2012 - 06:58 PM

Well, if you are just learning Assembly, it will be better for you to learn 32 bit or 64 bit code instead of 16bit code.

You can Assemble, Link, and run 32 bit apps on a 64 bit system, you however cannot run 16bit code without an emulator

32bit
Much easier to write GUIS
Much more memory
No worries about segments and the other stuff that will drive a newbie crazy

16bit
Old and dead
Not much memory available to you
segments
doesn't run on modern OSs without emulators.

Learn 32bit code, you will thank me later.
Was This Post Helpful? 0
  • +
  • -

#5 krosty4782  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 14
  • Joined: 12-June 11

Re: Edit a file

Posted 12 September 2012 - 08:26 PM

Okey. In university show us asm for 16 bit, cause we are studying how a cpu works, so we started with older proccesors.
Now i can run win32 programs with nasm.
I have a question, how can i set parameters flags ?
For example, i have:


push dword 0     ; MB_OK style
	push dword 0   ; First Param
	push dword szText   ; First Param
	push dword 0     ; HWND parent (NULL)
	call MessageBoxA


I want to set to utype also an icon, how can i add my flag 30 iconwarning, to the messagebox?
Thanks
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1