answersLogoWhite

0


Best Answer

INT 21h / AH= 3Ch - create or truncate file.

entry:

CX = file attributes: mov cx, 0 ; normal - no attributes. mov cx, 1 ; read-only. mov cx, 2 ; hidden. mov cx, 4 ; system mov cx, 7 ; hidden, system and read-only! mov cx, 16 ; archive

DS:DX -> ASCIZ filename.

returns:

CF clear if successful, AX = file handle.

CF set on error AX = error code.

note: if specified file exists it is deleted without a warning.

example: org 100h mov ah, 3ch mov cx, 0 mov dx, offset filename mov ah, 3ch int 21h jc err mov handle, ax jmp k filename db "myfile.txt", 0 handle dw ? err: ; .... k: ret

User Avatar

Wiki User

11y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How to truncate file in assembly programming?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

How do you empty a file using C programming?

That depends on the type of file and what you mean by "empty". Generally, fopen() called on an existing file, with the "w" option instead of the "a" option will truncate the file to zero length. To delete a file completely is a different process. Function truncate is your friend.


Assembly level programming?

Yes.


What is a sentence for the word truncate?

my brother can truncate my computer


Programming language for assemblers?

Is called Assembly.


Elements of assembly language programming What is A simple assembly scheme pass structure of assembler design of two pass assemblers a single pass assemblers what is macros?

what are the elements of assembly language programming?


What are the features of batch file programming?

Batch file programming is dos based programming you have to use dos commands .It is very good to perform some repetitive task in computer programming is easy you should only know the dos commands.


What feature of assembly language is required to build a two pass assembler?

In order to build a two pass assembler a assembly programming language should support macro processing, file inclusion. Its definition should be independent of any particular hardware or operating system.


What programming languages are operating systems written in?

C and Assembly.


Can you use commit statement after truncate?

You can use COMMIT any time, but it is not necessary after TRUNCATE TABLE.


What does the word 'truncate' mean?

Truncate has many meanings depending on how it is used in a sentence. If it is used as a verb, truncate means to shorten something. If used as an adjective it means it stopped suddenly.


What are the example of low-level programming language?

It are machine code and Assembly.


How would you use truncate in a sentence?

She had to truncate her story, so that it would fit into the five minute session.