flat assembler
Message board for the users of flat assembler.

Index > DOS > Print ing a number

Goto page Previous  1, 2
Author
Thread Post new topic Reply to topic
typedef



Joined: 25 Jul 2010
Posts: 2913
Location: 0x77760000
typedef
Just4fasm wrote:
A person asked a question then you apesh people are often giving a lame moronic replies!!!. Exclamation Exclamation Exclamation
What is wrong with this person's question???!!! Sad
Quote:
Hello everyone. I tried searching for the answer to this in the forums but I couldn't seem to find anything.. I have a number in EAX that I'd like to print out. I've seen things in other forums about repeatedly dividing by 10 and printing digit by digit, but I was unsure if this is the way to do it in FASM. Thanks!

If you are were normal people with a real basic knowledge of asm and pc! then you are can give this proper answer to him! davetheant, you skipped what you looking for or you confused because of less knowledge! Yes you can! dividing by 10 and printing digit by digit, this is the way to do it in ANY ASM!!!.
I pity you assemblers, moderators! You are look like some kind of poorly programmed bot!. I know, you are a real humans! but you are natively have logic stupidity and lack of knowledge of real things!. Obviously, you are Black Homosapein Orangutang's supporters!. Black Orangutang can easily trick you and you are very close minded apes next to him!. Black Orangutang is half human and half animal! You know he is resident evil internationally United States of Apes!!!.

baldr!!! Mad NO C!!! Because it is all about ASM!!!!!!!.

Lamer! Mad there's no need 'print number' interrupt! if you point it a string printing because everything can be coded very easily!. And you can print cyrillic letters in DOS!. DOS is DOS! DOS doesn't cares about USA or International!!!. Idea

freecrac! Confused Only you have a human brain but sadly only 60%!!! rest of 40% ape!!!. DON'T SUPPORT microsoft!!! cos you often using crap MS-DOS 21h interrupts on very unusual things!!!. Exclamation

revolution!!! Evil or Very Mad MS-DOS stands for Money Swindle from Disk Operating System! Microsoft is stole moneys from DOS! that's why they stopped long time ago! since they can't steal anymore!. You merely knows about the MIGHTY DOS!!!. And you have lack of human brain!!! Your ape brain level is higher than your human brain level.

DOS is powerful than shit thief microsoft OSes!!!. Anything is possible on DOS!. Windows OS will be die! DOS is never ever dies!!!. DOS is the champion of the speed!. Cool


And you sir being? ... A worm?

Go back to your moms basement. People are busy here with other things therefore they have no time to explain something that's been discussed already several times. That's why they keep those linked posts for future references.
Post 29 Apr 2013, 19:09
View user's profile Send private message Reply with quote
Just4fasm



Joined: 20 May 2012
Posts: 60
Location: OuterSpace
Just4fasm
typedef worm!!! Stop lying!!! Stop pretending!!!.
Nigger!!! Where are those link posts for future references???!!! huh?!.
You are busy???!!! then why you are reading and replying with total ape answers?!!!.

Apes do you even know what you talking about?!!!.

Nigger apes!!! you have plenty of times that's why you are answering such a stupid ape answers!. Truth is you are simply don't know about things!!!. Ape instinct responding to humans!. Because apes do not have enough human brains!!!.
Post 30 Apr 2013, 19:35
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger Reply with quote
Just4fasm



Joined: 20 May 2012
Posts: 60
Location: OuterSpace
Just4fasm
AsmGuru62 wrote:
When this thread started -- I politely asked if the thread starter looked at any of posted links.
Still waiting for results.
Because I can write a small function for DOS, which will print the 16-bit integer.


AsmGuru62, poor you I can help you! I can make this your dream come true! 32-bit Cool
Post 30 Apr 2013, 19:45
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger Reply with quote
AsmGuru62



Joined: 28 Jan 2004
Posts: 1418
Location: Toronto, Canada
AsmGuru62
Smile
I wanted to know if thread starter found the information needed and
if not -- I was willing to help out by writing a simple DOS code for printing a number.
Post 30 Apr 2013, 20:08
View user's profile Send private message Send e-mail Reply with quote
Just4fasm



Joined: 20 May 2012
Posts: 60
Location: OuterSpace
Just4fasm
Here! your dreams become true!.
It's all my hard work and efforts! I wrote this routines quite few years ago! When I was almost nothing knew about the x86 CPUs!
I did it all alone write 100% mine! nobody's support involved! with no internet source and no reference! everything was so dark!. All based on electronics!.
Code:
Convert_32bit_decimal:
pusha
mov eax,[Count_32bit]
mov bx,Dec32_temp+9
mov cx,10
get_deci32:
xor edx,edx
push cx
mov ecx,10
div ecx
pop cx
add dl,30h
mov [bx],dl
dec bx
loop get_deci32
call Print_32bit_dec
popa
ret

Print_32bit_dec:
mov si,Dec32_temp
mov cx,10
Prin_deci32:
mov ah,0eh
mov al,[si]
cmp [Zero_d],1
je Prn_all_chr
cmp cl,[Show_zero_value]                ;Zero 1-8
jle Prn_all_chr
cmp al,'0'
je Zero
mov [Zero_d],1
Prn_all_chr:
int 10h
jmp Print_zero_space
Zero:
cmp [First_Last],1
jne Print_zero_space
mov al,' '
int 10h
Print_zero_space:
inc si
loop Prin_deci32
mov [Zero_d],0
ret

Dec32_temp db '0000000000 '
Temp_value32bit dw 0
Count_32bit dd 0
Zero_d db 0
Show_zero_value db 1            ; 1-9
First_Last db 0

Hex_Value_Prn_32b:
pusha
rol eax,8
push eax
call Hex_Value_Prn
pop eax
rol eax,8
push eax
call Hex_Value_Prn
pop eax
rol eax,8
push eax
call Hex_Value_Prn
pop eax
rol eax,8
call Hex_Value_Prn
call ASCII_Space
popa
ret

Hex_Value_Prn:
pusha
mov dl,al
mov cx,2
Hex_Prn:
ror dl,4
mov al,dl
and al,00001111b 
call Print_Hex
loop Hex_Prn
mov al,20h
int 10h
popa
ret

Print_Hex:
mov bx,Hex_Symbol
xlatb
mov ah,0eh
int 10h
ret

Hex_Symbol db '0123456789ABCDEF'    
Example: Print numbers
Code:
Org 100h
mov [Count_32bit],12345678 ;Print numbers
call Convert_32bit_decimal
mov ah,1
int 16h
int 20h ;Return to OS

Example: Print out HEX
Org 100h
mov EAX,0abcd1234h ;
call Hex_Value_Prn_32b
mov ah,1
int 16h
int 20h    
You can use these call routines!. Now it's all yours! I'm proudly glad to help WORLD!. First time you got full, clean, effective, precise free sources!!!. Nobody gives you!. Only me helped out the world!. Cool Very Happy

edit by revolution: Added code tags
Post 30 Apr 2013, 21:14
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger Reply with quote
Just4fasm



Joined: 20 May 2012
Posts: 60
Location: OuterSpace
Just4fasm
AsmGuru62 wrote:
Smile
I wanted to know if thread starter found the information needed and
if not -- I was willing to help out by writing a simple DOS code for printing a number.

Idea Now you can. Cool

_________________
Assembly language is machine instruction so don't make fake assembly languages other than actual CPU instruction code!.
Fuck stupid Microsoft! for faking instruction codes!!!.
Post 30 Apr 2013, 21:15
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger Reply with quote
Just4fasm



Joined: 20 May 2012
Posts: 60
Location: OuterSpace
Just4fasm
davetheant, AsmGuru62 you two and others! No more cries! No more waitings!. No more delusions!. No more beggings from evil freak apes!.
You got now Angel!!!.
Post 30 Apr 2013, 21:21
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger Reply with quote
AsmGuru62



Joined: 28 Jan 2004
Posts: 1418
Location: Toronto, Canada
AsmGuru62
Good code, but it is too long.
It is possible to print a simple decimal number in much less instructions.
Post 01 May 2013, 10:24
View user's profile Send private message Send e-mail Reply with quote
Just4fasm



Joined: 20 May 2012
Posts: 60
Location: OuterSpace
Just4fasm
AsmGuru62 wrote:
Good code, but it is too long.
It is possible to print a simple decimal number in much less instructions.

Less is possible but much is not possible!. Cool

_________________
Assembly language is machine instruction so don't make fake assembly languages other than actual CPU instruction code!.
Fuck stupid Microsoft! for faking instruction codes!!!.
Post 01 May 2013, 19:06
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger Reply with quote
Just4fasm



Joined: 20 May 2012
Posts: 60
Location: OuterSpace
Just4fasm
Super Small, Super Short!
Super Simplified version!

Convert_&_Print_32bit_decimal:
mov bx,Dec32_temp+9
mov cx,10
get_deci32:
xor edx,edx
push cx
mov ecx,10
div ecx
pop cx
add dl,30h
mov [bx],dl
dec bx
loop get_deci32
mov si,Dec32_temp
mov cx,10
mov ah,0eh
Prin_deci32:
lodsb
int 10h
loop Prin_deci32
ret

Dec32_temp db '0000000000 '

_________________
Assembly language is machine instruction so don't make fake assembly languages other than actual CPU instruction code!.
Fuck stupid Microsoft! for faking instruction codes!!!.
Post 01 May 2013, 19:58
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger Reply with quote
AsmGuru62



Joined: 28 Jan 2004
Posts: 1418
Location: Toronto, Canada
AsmGuru62
That is better code.
I also posted some code here (all debugged):
http://board.flatassembler.net/topic.php?t=15386
Post 02 May 2013, 23:30
View user's profile Send private message Send e-mail Reply with quote
Just4fasm



Joined: 20 May 2012
Posts: 60
Location: OuterSpace
Just4fasm
AsmGuru62 wrote:
That is better code.
I also posted some code here (all debugged):
http://board.flatassembler.net/topic.php?t=15386

I'm glad now you are tremendous years after able to write own EAX to ASCII.
Cool

_________________
Assembly language is machine instruction so don't make fake assembly languages other than actual CPU instruction code!.
Fuck stupid Microsoft! for faking instruction codes!!!.
Post 03 May 2013, 17:46
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger Reply with quote
Just4fasm



Joined: 20 May 2012
Posts: 60
Location: OuterSpace
Just4fasm
Here, if you need Print or Convert Signed 32bit decimal value!


Print_Signed_32bit_decimal:
cmp eax,7FFFFFFFh
jna Signed_Ok
xor eax,80000000h
push eax
mov ah,0eh
mov al,2dh
int 10h
pop eax
Signed_Ok:
call Convert_and_Print_32bit_decimal
ret



These call routines are! highly sophisticated! top professional high tech electronics asm codes! The most effective and top hardware speed master asm codes! and work on any OSs even without OS can work on any computers!.
All codes are 100% mine based on my superbly high experiences!!!. You are forever will be appreciates!.


Last edited by Just4fasm on 05 May 2013, 03:55; edited 1 time in total
Post 03 May 2013, 18:42
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger Reply with quote
baldr



Joined: 19 Mar 2008
Posts: 1651
baldr
Just4fasm,

Should we bow to you only once, or once per usage of your perfect routine, or even once per value converted? All hail to the Experienced One (a.k.a. Just4fasm)! Wink
Post 03 May 2013, 19:04
View user's profile Send private message Reply with quote
MHajduk



Joined: 30 Mar 2006
Posts: 6038
Location: Poland
MHajduk
baldr wrote:
Should we bow to you only once, or once per usage of your perfect routine, or even once per value converted?
"Жёлтые штаны - два раза «Ку»!" Wink
Post 03 May 2013, 19:54
View user's profile Send private message Visit poster's website Reply with quote
nop



Joined: 01 Sep 2008
Posts: 165
Location: right here left there
nop
bugfix for just4fasm superbly high experiences code in accounting app

Code:
Print_Signed_32bit_decimal:
cmp eax,80000000h
jna Signed_Ok
neg eax
push eax
;mov ah,0eh
;mov al,2dh
mov ax,0e28h
int 10h
pop eax
call Convert_and_Print_32bit_decimal
mov ax,0e29h
int 10h
ret
Signed_Ok:
call Convert_and_Print_32bit_decimal
ret 
    

and maybe the red color will be needed Wink
Post 04 May 2013, 09:09
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17641
Location: In your JS exploiting you and your system
revolution
Just4fasm wrote:
Here, if you need Print or Convert Signed 32bit decimal value!


Print_Signed_32bit_decimal:
cmp eax,80000000h
jna Signed_Ok
neg eax
push eax
mov ah,0eh
mov al,2dh
int 10h
pop eax
Signed_Ok:
call Convert_and_Print_32bit_decimal
ret
What happens when you print 0x80000000? Should it put a negative symbol or not? Must be a bug. I'm glad that even people with "superbly high experiences" can also make mistakes and fail to test corner cases properly. There is hope for me yet.
Just4fasm wrote:
These call routines are! highly sophisticated! top professional high tech electronics asm codes! The most effective and top hardware speed master asm codes! and work on any OSs even without OS can work on any computers!.
All codes are 100% mine based on my superbly high experiences!!!. You are forever will be appreciates!.
Awesome. I wasn't aware that "int 10h" would also work on the ARM systems and/or under Windows or Linux. Thanks for giving us the benefit of your superbly high experiences[sic].
Post 04 May 2013, 09:39
View user's profile Send private message Visit poster's website Reply with quote
Just4fasm



Joined: 20 May 2012
Posts: 60
Location: OuterSpace
Just4fasm
revolution wrote:

What happens when you print 0x80000000? Should it put a negative symbol or not?

Neither in math! In cpu logic 80000000h is negative number! if you want a negative symbol , put 7FFFFFFFh!.


Quote:

Must be a bug. I'm glad that even people with "superbly high experiences" can also make mistakes and fail to test corner cases properly. There is hope for me yet.

There is no hope for you if you always being a moron!!!. Try to fix your head bugs!!!.

nop wrote:

bugfix for just4fasm superbly high experiences code in accounting app

Not for me!. It's yourself only!!!.
Yeah you read "superbly high experiences, code" !!!. That means no need to bugfix!!!.

revolution wrote:

Awesome. I wasn't aware that "int 10h" would also work on the ARM systems and/or under Windows or Linux. Thanks for giving us the benefit of your superbly high experiences[sic].


It seems you've no idea what is exactly "int 10h"?!!!.
Do I have to explain everything???!!! for Assembler coders???!!!. Or you are all jungle monkeys???!!!.

Due to all brainless idiots and nigger apes!. You are not 2 year old monkeys! you are extremely old apes!.


For all! It's a very simple obvious instruction!. How to do use these call routines! For other other than 16bit-OS or x86 CPU!.

On ARM CPU convert it x86 to ARM! It's so simple even a 5 year old human child can easily convert!.
Warning: if you are monkey, ape!!! Then you apes can not convert!. Apes doesn't have a human brain!!!.

On x86 based! Windows or Linux or Other similar OSs! you just a slight change the display interface codes for your OS requirements!. Even without the change of display interface codes! can simply work with real-mode!.
Post 04 May 2013, 20:18
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  
Goto page Previous  1, 2

< 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 cannot attach files in this forum
You can download files in this forum


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

Website powered by rwasa.