www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/02/06/10:57:00

Message-Id: <199702061539.PAA01484@mx2.rmplc.co.uk>
From: "Liam" <marl AT rmplc DOT co DOT uk>
To: <djgpp AT delorie DOT com>
Subject: printing numbers with NASM
Date: Thu, 6 Feb 1997 15:33:50 -0000
MIME-Version: 1.0

At the moment i'm trying to learn some assembly so I can improve the
proformance
of my programs. I'm not quite sure of how you print numbers.
This is a program I'v written, nothing great, its surposed to print
the DOS version number

[BITS 16]
[ORG 0X100]

	jmp	_main

dos	db	0,0,10,13,36

_main:	mov	ah,30h		; get dos version
	int 	21h

	mov	di,dos
	mov	[di],ax		; move version into dos buffer
	
	mov	ah,09h		; display dos version
	mov	dx,dos
	int 	21h
		
	mov 	ax,4c00h	; exit to dos
	int 	21h

It kinda works, it prints the ascii character of my dos version, a bell(7).
How would you get it to print the number?
Cheers
Liam

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019