flat assembler
Message board for the users of flat assembler.

Index > MenuetOS > Looking for the first argument (argv[1])

Author
Thread Post new topic Reply to topic
Cristian



Joined: 30 Dec 2025
Posts: 3
Cristian 31 Dec 2025, 11:32
I'm practicing with the terminal (I'm not pro). I want to get the argument then the name of the program but first I get the path. How can I skip the path and get only the first argument (argv[1])?

Path is located in Param + 8 + 18
Code:
/FD/1/> CMD_E64 123
    

Output:
Code:
Example terminal application
Current path: /FD/1/
Type a few letters and press enter
/FD/1/ 123
    


Assuming that the path is only /FD/1/ then the argument should be in Param+33 but if the path was longer than this, then you would have to calculate it manually. Could you give me some light?
Post 31 Dec 2025, 11:32
View user's profile Send private message Reply with quote
Ville



Joined: 17 Jun 2003
Posts: 326
Ville 31 Dec 2025, 21:20
Parameter beginnings need to be calculated manually. For GUI programs you can enter strings with textboxes (textbox.asm).
Post 31 Dec 2025, 21:20
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.