flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
ManOfSteel 22 Dec 2010, 22:07
Use GetDlgItemText on your editbox's ID. It will store the data in the buffer you pass it. When you're done precessing the data (in the buffer), use MessageBox to display it. Couldn't get any easier.
I have no idea what you mean by "seperate the string char by char" though. |
|||
![]() |
|
vicky 22 Dec 2010, 22:15
ok, the english i use maybe isn't perfect
![]() Like: v i c k y Thanks for reply ![]() |
|||
![]() |
|
ManOfSteel 22 Dec 2010, 23:54
So you just want to put every input character on its own line?
Use 2 buffers: the first will be used by GetDlgItemText to store the input data and the second will receive the final data and will be displayed by MessageBox. You read 1 character from buf1, put it in buf2, insert CR/LF bytes (13, 10) in buf2, move to the next position in buf1 and repeat until NULL is reached in buf1. You can do that using either mov and inc instructions or string manipulation instructions lods* and stos*. The latter are highly recommended. Don't forget to zero-terminate buf2 and make sure you avoid buffer overflows. |
|||
![]() |
|
revolution 23 Dec 2010, 00:26
vicky: Are you sure you want to ask this in the Windows section? Your other thread has DOS code so I wonder if you really wanted DOS advice instead.
|
|||
![]() |
|
vicky 23 Dec 2010, 11:54
I really don't know what should i do. I don't have an idea about FASM. It's our instructor's surprise to us. So i don't know what to do, trying to learn. And i have only one day to learn too. So that's like a torture for me
![]() |
|||
![]() |
|
ManOfSteel 23 Dec 2010, 12:09
You could start by telling us exactly what OS you are supposed to run code on.
You're posting in the Windows forum and you have DOS code in another thread. fasm writes *nix ELFs too. So which one is it? Or is the OS-dependent interface unimportant and all that matters is the algorithm? If we write the code for you and you don't understand it, how are you going to answer the instructor tomorrow when s/he asks you why you did "this" that way or asks you to modify the code to do something else or differently? Last edited by ManOfSteel on 23 Dec 2010, 12:25; edited 2 times in total |
|||
![]() |
|
JohnFound 23 Dec 2010, 12:21
vicky wrote: It's our instructor's surprise to us. Interesting, what is this school where FASM is studied? |
|||
![]() |
|
vicky 23 Dec 2010, 12:40
Ok i wrote the code and works in FASM now but our instructor wanted that our code should work in 32 bit windows OS. So is it ok?
Code: org 100h macro print_new_line { mov dl, 13 mov ah, 02 int 21h mov dl, 10 mov ah, 02 int 21h } mov dx, msg1 mov ah, 09 int 21h ; input the string: mov dx, s1 mov ah, 0ah int 21h mov di,dx ; get actual string size: xor cx, cx mov cl,[di+1] print_new_line print_char: mov dl, [di+2] mov ah, 2 int 21h print_new_line inc di loop print_char ; wait for any key... mov ax, 0 int 16h ret msg1 db "ENTER THE STRING: $" s1 db 100,?, 100 dup(' ') |
|||
![]() |
|
ctl3d32 23 Dec 2010, 14:37
Hi,
Here it is. See attatched files. Hope it helps. Thanks, ctl3d32
Last edited by ctl3d32 on 24 Dec 2010, 21:45; edited 1 time in total |
|||||||||||
![]() |
|
vicky 23 Dec 2010, 18:08
Wow, that's really good, thank you. but it's so much good
![]() I tried to put it in the code but it gave error. How can i do that? Thanks a lot again ![]() |
|||
![]() |
|
bitshifter 23 Dec 2010, 19:05
When designing algorithms, forget about the target OS or the language or anything else.
Design the algorithm on paper, without any idea of what it will run on. Then choose the instructions and API to suit the target lastly. If you cant design the algorithm on paper, it is a waste of time trying to implement it with code. Just some advice, have fun ![]() |
|||
![]() |
|
ctl3d32 23 Dec 2010, 19:49
vicky wrote: Wow, that's really good, thank you. but it's so much good You can download the resource editor at http://www.oby.ro/rad_asm/ named ResEd. Open the .rc file with it. Make any changes you want than compile it using GoRC, downloadable at http://www.godevtool.com/#rc to make the .res file. The last line of the source code shows how to include the resource file into the source code. Thanks Last edited by ctl3d32 on 23 Dec 2010, 22:21; edited 1 time in total |
|||
![]() |
|
vicky 23 Dec 2010, 20:48
ok thanks, i'll take a look
![]() |
|||
![]() |
|
revolution 24 Dec 2010, 04:16
vicky: You had better hope that your instructor doesn't do a web search and find this thread. Hehe, that might be embarrassing for you.
![]() |
|||
![]() |
|
vicky 24 Dec 2010, 09:42
revolution: I think that it would be embarrasing for him. He gave such a stupid project that we'll never use, waste of time for us. If i need it in the future i'll eat my word ofcourse, but i don't think so
![]() I don't even know how to use FASM, and everybody uses this way in my class. So if i would try for it with my own effort that would be worse than others, and i'll take bad grades with my own effort. So thanks everyone, helped me ![]() |
|||
![]() |
|
vicky 24 Dec 2010, 09:47
And maybe i won't send the vicky.rar file to him, maybe i'll send the code that i tried to suit to FASM. But i don't know how can i change it to win32. I'm still trying to do it too.
|
|||
![]() |
|
ctl3d32 25 Dec 2010, 01:48
File Updated
|
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.