🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: be.comp.programming
Article #16631

Re: NASM Assembly query, can anyone help me ?

#16631
From: Rudi Breedenraedt
Date: Mon, 17 Apr 2000 00:00
33 lines
1885 bytes
Hi John,

>                I am trying to teach myself some assembly language at the
>moment and I have been set a problem.  I am using Netwide assembler for
>intel x86's.  The problem I have been given is to subtract two numbers
>between 0-99 and display the answer.  If you can help me solve this problem
>then reply pronto.

Be aware that this is not a 'simple problem'. Converting string
representations of values (in decimal notation) and vice-versa is a small
program on it's own. Why don't you start with a program that just translates
the value of a register (i.e. AX) into it's decimal representation as a
string. Once you have that, you'll have most of your solution, since
substracting values between 0 and 99 (or -32000 to +32000) is not taking
more than:

    SUB AX,BX

(and for larger numbers working in 16-bit mode, you'll just need to know how
flag bits are modified by the SUB instruction and how to handle with this.)

Kind regards

Rudi Breedenraedt


--
===============================================
United Programmers Club VZW
http://upc.webhostme.com/
http://www.upc.be/
upc@POBoxes.com
===============================================
Technical Details
Message-ID: <8ddnb7$40c$1@rivage.news.be.easynet.net>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <955461558.6514.0.nnrp-13.c1edf464@news.demon.co.uk>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: fcea4,be7985b0a2087398
X-Google-Attributes: gidfcea4,public
From: "Rudi Breedenraedt" <r.b@POBoxes.com>
Subject: Re: NASM Assembly query, can anyone help me ?
Date: 2000/04/17
Message-ID: <8ddnb7$40c$1@rivage.news.be.easynet.net>
X-Deja-AN: 612023068
References: <955461558.6514.0.nnrp-13.c1edf464@news.demon.co.uk>
X-MimeOLE: Produced By Microsoft MimeOLE V4.72.2106.4
X-Complaints-To: abuse@easynet.be
X-Trace: rivage.news.be.easynet.net 955932839 4108 212.100.172.105 (17 Apr 2000 00:53:59 GMT)
Organization: [ posted via Easynet Belgium ]
NNTP-Posting-Date: 17 Apr 2000 00:53:59 GMT
Newsgroups: be.comp.programming