OSDev.org

The Place to Start for Operating System Developers
It is currently Fri Mar 29, 2024 6:12 am

All times are UTC - 6 hours




Post new topic This topic is locked, you cannot edit posts or make further replies.  [ 37 posts ]  Go to page Previous  1, 2, 3  Next
Author Message
 Post subject: Re: How do I print an integer that is interpreted as hex?
PostPosted: Thu Aug 17, 2017 1:04 pm 
Offline
Member
Member

Joined: Wed Aug 09, 2017 7:37 am
Posts: 80
obiwac wrote:
Quote:
I'm not the most experienced with instructions like AND and OR.


Ok hes a troll.


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.


Top
 Profile  
 
 Post subject: Re: How do I print an integer that is interpreted as hex?
PostPosted: Thu Aug 17, 2017 1:05 pm 
Offline
Member
Member
User avatar

Joined: Sat Dec 27, 2014 9:11 am
Posts: 901
Location: Maadi, Cairo, Egypt
stevewoods1986 wrote:
I don't want a puzzle. Fine, I'll figure it out.

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.

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.


Top
 Profile  
 
 Post subject: Re: How do I print an integer that is interpreted as hex?
PostPosted: Thu Aug 17, 2017 1:09 pm 
Offline
Member
Member
User avatar

Joined: Sun Feb 18, 2007 7:28 pm
Posts: 1564
Hello,
Quote:
I don't want a puzzle. Fine, I'll figure it out.
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?

_________________
OS Development Series | Wiki | os | ncc
char c[2]={"\x90\xC3"};int main(){void(*f)()=(void(__cdecl*)(void))(void*)&c;f();}


Top
 Profile  
 
 Post subject: Re: How do I print an integer that is interpreted as hex?
PostPosted: Thu Aug 17, 2017 1:12 pm 
Offline
Member
Member
User avatar

Joined: Fri Feb 17, 2017 4:01 pm
Posts: 641
Location: Ukraine, Bachmut
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.

this must be a huge compliment for Steve.

Steve is not a troll. Nor he is fooling the forum. He is just a very active noob @$$. :lol: 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.

_________________
ANT - NT-like OS for x64 and arm64.
efify - UEFI for a couple of boards (mips and arm). suspended due to lost of all the target park boards (russians destroyed our town).


Last edited by zaval on Thu Aug 17, 2017 1:15 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: How do I print an integer that is interpreted as hex?
PostPosted: Thu Aug 17, 2017 1:14 pm 
Offline
Member
Member

Joined: Wed Aug 09, 2017 7:37 am
Posts: 80
neon wrote:
Hello,
Quote:
I don't want a puzzle. Fine, I'll figure it out.
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?


Code:
mov


Yep, mov is not really code. It's more of an instruction, huh?

Listen, I can do OS development. I have never been on such a (BLEEP)...ing negative forum. Everyone just complains.


Top
 Profile  
 
 Post subject: Re: How do I print an integer that is interpreted as hex?
PostPosted: Thu Aug 17, 2017 1:17 pm 
Offline
Member
Member

Joined: Wed Aug 09, 2017 7:37 am
Posts: 80
zaval wrote:
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.

this must be a huge compliment for Steve.

Steve is not a troll. Nor he is fooling the forum. He is just a very active noob (BLEEP). :lol: 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?


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.

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.

Top
 Profile  
 
 Post subject: Re: How do I print an integer that is interpreted as hex?
PostPosted: Thu Aug 17, 2017 1:19 pm 
Offline
Member
Member

Joined: Wed Jun 17, 2015 9:40 am
Posts: 501
Location: Athens, Greece
Hi,


stevewoods1986 wrote:
Everyone just complains.
Sorry. It's you that complained first...

Seriously, Octacone provided a nice way of doing what you want. Why don't you simply try to figure that out?


Regards,
glauxosdever


Top
 Profile  
 
 Post subject: Re: How do I print an integer that is interpreted as hex?
PostPosted: Thu Aug 17, 2017 1:21 pm 
Offline
Member
Member
User avatar

Joined: Sat Mar 31, 2012 3:07 am
Posts: 4591
Location: Chichester, UK
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.


Top
 Profile  
 
 Post subject: Re: How do I print an integer that is interpreted as hex?
PostPosted: Thu Aug 17, 2017 1:26 pm 
Offline
Member
Member

Joined: Wed Aug 09, 2017 7:37 am
Posts: 80
iansjack 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.


Me too. Stackoverflow has a question that has no complaining at all. I even have an account there :)
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?


Top
 Profile  
 
 Post subject: Re: How do I print an integer that is interpreted as hex?
PostPosted: Thu Aug 17, 2017 1:31 pm 
Offline
Member
Member
User avatar

Joined: Fri Jan 27, 2017 12:15 pm
Posts: 149
Location: Belgium
stevewoods1986 wrote:
Most advice from the Internet is bullying

Then get the (BLEEP) outta here.
stevewoods1986 wrote:
Yep, mov is not really code. It's more of an instruction, huh?

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:
Listen, I can do OS development

:? Didn't know someone could be more arrogant than me.
stevewoods1986 wrote:
I haven't done any beginner mistakes, OK?

About that...
stevewoods1986 wrote:
Stackoverflow has a question that has no complaining at all.

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.

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.

_________________
AQUA OS: https://obiwac.wordpress.com/aqua-os/


Last edited by obiwac on Thu Aug 17, 2017 1:34 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: How do I print an integer that is interpreted as hex?
PostPosted: Thu Aug 17, 2017 1:32 pm 
Offline
Member
Member
User avatar

Joined: Sat Dec 27, 2014 9:11 am
Posts: 901
Location: Maadi, Cairo, Egypt
stevewoods1986 wrote:
However, the behaviour (behavior) of members is great. Why can't any of you be like that?

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.

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.


Top
 Profile  
 
 Post subject: Re: How do I print an integer that is interpreted as hex?
PostPosted: Thu Aug 17, 2017 1:44 pm 
Offline
Member
Member

Joined: Wed Aug 09, 2017 7:37 am
Posts: 80
obiwac wrote:
stevewoods1986 wrote:
Most advice from the Internet is bullying

Then get the (BLEEP) outta here.
stevewoods1986 wrote:
Yep, mov is not really code. It's more of an instruction, huh?

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:
Listen, I can do OS development

:? Didn't know someone could be more arrogant than me.
stevewoods1986 wrote:
I haven't done any beginner mistakes, OK?

About that...
stevewoods1986 wrote:
Stackoverflow has a question that has no complaining at all.

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.

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.


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.

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.


Top
 Profile  
 
 Post subject: Re: How do I print an integer that is interpreted as hex?
PostPosted: Thu Aug 17, 2017 1:55 pm 
Offline
Member
Member

Joined: Thu Jul 03, 2014 5:18 am
Posts: 84
Location: The Netherlands
stevewoods1986 wrote:
I am an experienced programmer.

You must be mad.
stevewoods1986 wrote:
I understand about bitwise logic, OK?

stevewoods1986 wrote:
How would I just get the first and second nybble?

_________________
My blog: http://www.rivencove.com/


Last edited by dseller on Thu Aug 17, 2017 1:56 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: How do I print an integer that is interpreted as hex?
PostPosted: Thu Aug 17, 2017 1:56 pm 
Offline
Member
Member
User avatar

Joined: Fri Jan 27, 2017 12:15 pm
Posts: 149
Location: Belgium
stevewoods1986 wrote:
obiwac wrote:
stevewoods1986 wrote:
Most advice from the Internet is bullying

Then get the (BLEEP) outta here.
stevewoods1986 wrote:
Yep, mov is not really code. It's more of an instruction, huh?

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:
Listen, I can do OS development

:? Didn't know someone could be more arrogant than me.
stevewoods1986 wrote:
I haven't done any beginner mistakes, OK?

About that...
stevewoods1986 wrote:
Stackoverflow has a question that has no complaining at all.

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.

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.


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.

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.


Although we are similar, Geri and I are not the same person. You mixing us up.

_________________
AQUA OS: https://obiwac.wordpress.com/aqua-os/


Top
 Profile  
 
 Post subject: Re: How do I print an integer that is interpreted as hex?
PostPosted: Thu Aug 17, 2017 2:13 pm 
Offline
Member
Member
User avatar

Joined: Fri Aug 07, 2015 6:13 am
Posts: 1134
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...


Okay, here is an example on how to do it. This is not the only way, there are other ways of doing it.
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 don't understand what these logical ANDs and shifts do, read my first reply again.
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


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic This topic is locked, you cannot edit posts or make further replies.  [ 37 posts ]  Go to page Previous  1, 2, 3  Next

All times are UTC - 6 hours


Who is online

Users browsing this forum: Bing [Bot], DotBot [Bot], ErenJaeger, Kamal123, Majestic-12 [Bot], MichaelPetch and 144 guests


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 post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group