I am not a troll, OK? I am not a troll. I have done nothing to you. I am not a troll. I have no history of being a troll. I am not a troll.obiwac wrote:Ok hes a troll.I'm not the most experienced with instructions like AND and OR.
How do I print an integer that is interpreted as hex?
-
- Member
- Posts: 80
- Joined: Wed Aug 09, 2017 7:37 am
Re: How do I print an integer that is interpreted as hex?
- BrightLight
- Member
- Posts: 901
- Joined: Sat Dec 27, 2014 9:11 am
- Location: Maadi, Cairo, Egypt
- Contact:
Re: How do I print an integer that is interpreted as hex?
I said it clearly enough. Imagine you're doing this in C without itoa(), printf() or any other standard functions. How would you do it? If you can't achieve that in C, then you can't do OS development. If you can do that in C, translate the code into assembly, looking up relevant instructions to do so.stevewoods1986 wrote:I don't want a puzzle. Fine, I'll figure it out.
Hint: Octacone already gave you the instructions you need.
You know your OS is advanced when you stop using the Intel programming guide as a reference.
Re: How do I print an integer that is interpreted as hex?
Hello,
You don't need to figure it out on your own. I even encouraged for you to take a close look at those answers and ask questions about it for clarity or sample code. How can we help someone that actively ignores the answers instead of asking questions?I don't want a puzzle. Fine, I'll figure it out.
OS Development Series | Wiki | os | ncc
char c[2]={"\x90\xC3"};int main(){void(*f)()=(void(__cdecl*)(void))(void*)&c;f();}
char c[2]={"\x90\xC3"};int main(){void(*f)()=(void(__cdecl*)(void))(void*)&c;f();}
Re: How do I print an integer that is interpreted as hex?
this must be a huge compliment for Steve.MichaelFarthing wrote: How long will everyone be fooled by this troll? Anyone who casually uses a word like nybble can't possibly be innocently making the sort of posts we see.
Steve is not a troll. Nor he is fooling the forum. He is just a very active noob @$$. Unfortunately, instead of directing his activity into hard and boring learning to achieve dreams come true, he is torturizing the forum. I guess School-Rea is especially vulnerable for this, since he tries to explain things in very details. And all that goes in vain, since Steve is not inclined to pay attention to advices.
Or maybe this is yet another "lickmynigga" incarnation, taking another approach for doing bad things?
Steve, stop it. It's embarrassing for you. Go learn. Assembly, Intel manuals, whatever.
Last edited by zaval on Thu Aug 17, 2017 1:15 pm, edited 1 time in total.
-
- Member
- Posts: 80
- Joined: Wed Aug 09, 2017 7:37 am
Re: How do I print an integer that is interpreted as hex?
neon wrote:Hello,You don't need to figure it out on your own. I even encouraged for you to take a close look at those answers and ask questions about it for clarity or sample code. How can we help someone that actively ignores the answers instead of asking questions?I don't want a puzzle. Fine, I'll figure it out.
Code: Select all
mov
Listen, I can do OS development. I have never been on such a (BLEEP)...ing negative forum. Everyone just complains.
-
- Member
- Posts: 80
- Joined: Wed Aug 09, 2017 7:37 am
Re: How do I print an integer that is interpreted as hex?
Racist, huh? Racism. I am not causing any torture here. His name is not School-Rea by the way. I don't want advice. Most advice from the Internet is bullying. I have already learned the hard way, OK? I am an experienced programmer. I haven't just been playing with HTML for 5 minutes.zaval wrote:this must be a huge compliment for Steve.MichaelFarthing wrote: How long will everyone be fooled by this troll? Anyone who casually uses a word like nybble can't possibly be innocently making the sort of posts we see.
Steve is not a troll. Nor he is fooling the forum. He is just a very active noob (BLEEP). Unfortunately, instead of directing his activity into hard and boring learning to achieve dreams come true, he is torturizing the forum. I guess School-Rea is especially vulnerable for this, since he tries to explain things in very details. And all that goes in vain, since Steve is not inclined to pay attention to advices.
Or maybe this is yet another "(BLEEP)" incarnation, taking another approach for doing bad things?
I haven't done any beginner mistakes, OK?
You have made this all happen. I carry my own weight. I get confused. I've (BLEEP)...ing done nothing wrong. I don't want to upset the community.
Last edited by stevewoods1986 on Thu Aug 17, 2017 1:21 pm, edited 1 time in total.
-
- Member
- Posts: 501
- Joined: Wed Jun 17, 2015 9:40 am
- Libera.chat IRC: glauxosdever
- Location: Athens, Greece
Re: How do I print an integer that is interpreted as hex?
Hi,
Seriously, Octacone provided a nice way of doing what you want. Why don't you simply try to figure that out?
Regards,
glauxosdever
Sorry. It's you that complained first...stevewoods1986 wrote:Everyone just complains.
Seriously, Octacone provided a nice way of doing what you want. Why don't you simply try to figure that out?
Regards,
glauxosdever
Re: How do I print an integer that is interpreted as hex?
The sad thing is that I found detailed answers to this question in about 30 seconds using Google. All this sillyness could be avoided simply by learning how to use a search engine.
-
- Member
- Posts: 80
- Joined: Wed Aug 09, 2017 7:37 am
Re: How do I print an integer that is interpreted as hex?
Me too. Stackoverflow has a question that has no complaining at all. I even have an account thereiansjack wrote:The sad thing is that I found detailed answers to this question in about 30 seconds using Google. All this sillyness could be avoided simply by learning how to use a search engine.
https://stackoverflow.com/users/8248254/steve-woods
I have actually helped. Want proof it's mine?
I don't use Stackoverflow for OS development. However, the behaviour (behavior) of members is great. Why can't any of you be like that?
I'll check out the instructions provided, OK?
- obiwac
- Member
- Posts: 149
- Joined: Fri Jan 27, 2017 12:15 pm
- Libera.chat IRC: obiwac
- Location: Belgium
Re: How do I print an integer that is interpreted as hex?
Then get the (BLEEP) outta here.stevewoods1986 wrote:Most advice from the Internet is bullying
I thought you didn't want code? As @neon said "In the previous thread you said you don't want code or sample code".stevewoods1986 wrote:Yep, mov is not really code. It's more of an instruction, huh?
Didn't know someone could be more arrogant than me.stevewoods1986 wrote:Listen, I can do OS development
About that...stevewoods1986 wrote:I haven't done any beginner mistakes, OK?
We were not even complaining at first. Only after you started bashing us as being unhelpful. And don't say that farthing post was starting the complaining, as this was based on your previous posts and you overall reputation.stevewoods1986 wrote:Stackoverflow has a question that has no complaining at all.
All in all, you are arrogant and contradict yourself in 95% of your posts.
I could go on for ages with these quotes, but I do think I have better things to do.
Last edited by obiwac on Thu Aug 17, 2017 1:34 pm, edited 1 time in total.
- BrightLight
- Member
- Posts: 901
- Joined: Sat Dec 27, 2014 9:11 am
- Location: Maadi, Cairo, Egypt
- Contact:
Re: How do I print an integer that is interpreted as hex?
In all my experience here, the members are generally very friendly and try to help when possible. Seriously, a bit of advice, and a few hints, and some work for you to figure out on your own. If you're doing OS development, you should be capable of doing much more than that.stevewoods1986 wrote:However, the behaviour (behavior) of members is great. Why can't any of you be like that?
Try to focus on the main issue, instead of doing things that'll hurt your reputation later, and reduce people's likeliness to reply to your threads.
You know your OS is advanced when you stop using the Intel programming guide as a reference.
-
- Member
- Posts: 80
- Joined: Wed Aug 09, 2017 7:37 am
Re: How do I print an integer that is interpreted as hex?
I don't know what to do. You just keep complaining about other things. You bully me because I don't use someone's code or another programming language. You give me links to stupid Japanese animated videos.obiwac wrote:Then get the (BLEEP) outta here.stevewoods1986 wrote:Most advice from the Internet is bullyingI thought you didn't want code? As @neon said "In the previous thread you said you don't want code or sample code".stevewoods1986 wrote:Yep, mov is not really code. It's more of an instruction, huh?Didn't know someone could be more arrogant than me.stevewoods1986 wrote:Listen, I can do OS developmentAbout that...stevewoods1986 wrote:I haven't done any beginner mistakes, OK?We were not even complaining at first. Only after you started bashing us as being unhelpful. And don't say that farthing post was starting the complaining, as this was based on your previous posts and you overall reputation.stevewoods1986 wrote:Stackoverflow has a question that has no complaining at all.
All in all, you are arrogant and contradict yourself in 95% of your posts.
I could go on for ages with these quotes, but I do think I have better things to do.
Fine, give me code. Give me code if that helps you. Just give me code. I don't care. Wouldn't that be better?
JAAman, the moderator viewing this forum, can you give me an answer please instead of accusing me of trolling?
How would I just get the first and second nybble? Get the first nybble, put it in register with 0. Then, I just have to compare 0-9.
For example, AL had 0x45. I want to compare the first (4) and second nybble (5), then print it.
Re: How do I print an integer that is interpreted as hex?
You must be mad.stevewoods1986 wrote: I am an experienced programmer.
stevewoods1986 wrote:I understand about bitwise logic, OK?
stevewoods1986 wrote:How would I just get the first and second nybble?
Last edited by dseller on Thu Aug 17, 2017 1:56 pm, edited 1 time in total.
My blog: http://www.rivencove.com/
- obiwac
- Member
- Posts: 149
- Joined: Fri Jan 27, 2017 12:15 pm
- Libera.chat IRC: obiwac
- Location: Belgium
Re: How do I print an integer that is interpreted as hex?
Although we are similar, Geri and I are not the same person. You mixing us up.stevewoods1986 wrote:I don't know what to do. You just keep complaining about other things. You bully me because I don't use someone's code or another programming language. You give me links to stupid Japanese animated videos.obiwac wrote:Then get the (BLEEP) outta here.stevewoods1986 wrote:Most advice from the Internet is bullyingI thought you didn't want code? As @neon said "In the previous thread you said you don't want code or sample code".stevewoods1986 wrote:Yep, mov is not really code. It's more of an instruction, huh?Didn't know someone could be more arrogant than me.stevewoods1986 wrote:Listen, I can do OS developmentAbout that...stevewoods1986 wrote:I haven't done any beginner mistakes, OK?We were not even complaining at first. Only after you started bashing us as being unhelpful. And don't say that farthing post was starting the complaining, as this was based on your previous posts and you overall reputation.stevewoods1986 wrote:Stackoverflow has a question that has no complaining at all.
All in all, you are arrogant and contradict yourself in 95% of your posts.
I could go on for ages with these quotes, but I do think I have better things to do.
Fine, give me code. Give me code if that helps you. Just give me code. I don't care. Wouldn't that be better?
JAAman, the moderator viewing this forum, can you give me an answer please instead of accusing me of trolling?
How would I just get the first and second nybble? Get the first nybble, put it in register with 0. Then, I just have to compare 0-9.
For example, AL had 0x45. I want to compare the first (4) and second nybble (5), then print it.
Re: How do I print an integer that is interpreted as hex?
Okay, here is an example on how to do it. This is not the only way, there are other ways of doing it.stevewoods1986 wrote:I don't know what I want. I need something that is not code, I don't want to use somebody else's code. I don't want anime links with witches. How to do it? Stop fighting... You are all mean to me... Okay give me code, OK? OK? I don't care just give me some code...whatever. I just want to learn it myself...
I can't provide you with any useful Assembly code (because I mostly code in C++) but here is a walk-through.
- Create an array (this will be used as an output object), make it hold 3 characters. 1st being used for the first digit, 2nd being used for the second digit, 3rd being used as a null terminator. (so you don't display any junk) (make sure your print function supports '\0')
- Create a second array, 16 characters in size. Make it equal "0123456789ABCDEF" (characters used for displaying hexadecimal values)
- Grab your first array (the output one), make its 0th element equal second_array[(number AND with 0xF0) --->> all shifted 4 bytes to the right];
- Grab your first array again, make its 1st element equal second_array[AND number with 0x0F];
- Print that array as a string.
- Profit!?
If you can't code this in Assembly, then you don't know Assembly. Take a step back, learn it and come back.
OS: Basic OS
About: 32 Bit Monolithic Kernel Written in C++ and Assembly, Custom FAT 32 Bootloader
About: 32 Bit Monolithic Kernel Written in C++ and Assembly, Custom FAT 32 Bootloader