•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the Assembly section within the Software Development category of DaniWeb, a massive community of 391,682 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,188 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Assembly advertiser:
Views: 553 | Replies: 5 | Solved
![]() |
That sounds like a reasonable approach.
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
Do not PM me for help; You'll be ignored, or told to learn to read.
Do not ask me if I'm muslim - I'm not. Nor do I care about yours or anyone else's mysticism. Religion is a matrix, take the RED PILL.
Do not PM me for help; You'll be ignored, or told to learn to read.
Do not ask me if I'm muslim - I'm not. Nor do I care about yours or anyone else's mysticism. Religion is a matrix, take the RED PILL.
Well you use 'divide by 10' and 'modulo 10' to extract each digit from the number, then add '0' to the result to get a printable character.
123 / 10 = 12
123 % 10 = 3
Take the 3, add '0' to it to get '3'
The only minor problem being that it gives you the digits in reverse order, but that shouldn't be that hard to solve.
123 / 10 = 12
123 % 10 = 3
Take the 3, add '0' to it to get '3'
The only minor problem being that it gives you the digits in reverse order, but that shouldn't be that hard to solve.
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
Do not PM me for help; You'll be ignored, or told to learn to read.
Do not ask me if I'm muslim - I'm not. Nor do I care about yours or anyone else's mysticism. Religion is a matrix, take the RED PILL.
Do not PM me for help; You'll be ignored, or told to learn to read.
Do not ask me if I'm muslim - I'm not. Nor do I care about yours or anyone else's mysticism. Religion is a matrix, take the RED PILL.
•
•
Join Date: May 2008
Posts: 3
Reputation:
Rep Power: 0
Solved Threads: 0
Jeah in other words pul it all on Stack
I used somthing simmilar:
First it writes message, then prints counter. Hers the code hope it helps someone, cheers
Print|Count proc far
push si
push ax
mov dx,offset message1
mov ah,09
int 21h
mov bx,10
mov si,2
mov ah,0
mov al,counter
Base10:
mov dx,0 ; zero devide
div bx
add dx,48
mov rez1+[si],dl;
dec si
cmp ax,0
jne Base10
mov dx,offset rez1
mov ah,09
int 21h
pop ax
pop si
ret
ispisbrojaca endp
I used somthing simmilar:First it writes message, then prints counter. Hers the code hope it helps someone, cheers
Print|Count proc far
push si
push ax
mov dx,offset message1
mov ah,09
int 21h
mov bx,10
mov si,2
mov ah,0
mov al,counter
Base10:
mov dx,0 ; zero devide
div bx
add dx,48
mov rez1+[si],dl;
dec si
cmp ax,0
jne Base10
mov dx,offset rez1
mov ah,09
int 21h
pop ax
pop si
ret
ispisbrojaca endp
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
•
•
•
•
DaniWeb Assembly Marketplace
Similar Threads
- problem comparing strings (PHP)
- Assembly language comparing strings (Assembly)
- comparing strings (C++)
- Error comparing strings from arrays (PHP)
- comparing strings (C++)
- Comparing Strings in C# (C#)
- comparing two strings with linear search.. (Java)
Other Threads in the Assembly Forum
- Previous Thread: segment register?
- Next Thread: Registers problem



Linear Mode