views:

699

answers:

4
mov al,10
add al,15

How do I print the value of 'al'?

+1  A: 

Call WinAPI function (if u are developing win-application)

Roman
+2  A: 

Assembly language has no direct means of printing anything. Your assembler may or may not come with a library that supplies such a facility, otherwise you have to write it yourself, and it will be quite a complex function. You also have to decide where to print things - in a window, on the printer? In assembler, none of this is done for you.

anon
+4  A: 

Have you tried int 21h service 2? DL is the character to print.

mov dl,'A' ; print 'A'
mov ah,2
int 21h

To print the integer value, you'll have to write a loop to decompose the integer to individual characters. If you're okay with printing the value in hex, this is pretty trivial.

If you can't rely on DOS services, you might also be able to use the BIOS int 10h with AL set to 0Eh or 0Ah.

mrkj
A: 

You might have some luck calling the Win32 API's MessageBoxA, although whether Win16 supports that particular method is for someone else to answer.

Rushyo