Re: HLA v1.86 is now available
- From: nospam@xxxxxxxxxxxx (Spam Killer)
- Date: Thu, 27 Jul 2006 20:36:13 GMT
On 26 Jul 2006 11:28:58 -0700, "randyhyde@xxxxxxxxxxxxx" wrote:
...Open TAOCP, Vol.2, Section 4.4, p. 321. There is a description how to
you're just sick (like Rene). We'll leave it at that.
As for the argument for making students write their own routines, just
keep in mind that every minute they spend writing an integer to string
conversion routine is one minute they aren't spending learning machine
instructions and other true assembly stuff.
write such a routine.
If a student is told to read that page, and write a routine in x86 asm
based on it, he will probably come up with something close to that:
;;
Calling sequence: call 'gpl32.dec2mem'
Entry conditions: EAX = Integer to add to string, EDI -> string.
Exit conditions: Integer converted to ASCII and added to string.
;;
align 16
subrt dec2mem:
push eax ebx ecx edx
; Extract leading digit.
mov ebx 1_000_000_000
xor edx edx | div ebx
or al 030 | mov b$edi al
; Other digits go into eax with the radix point at the left.
mov eax ebx, ebx (-9)
div eax
; Multiply out the other digits and add them to string.
S1: mul d${d$ 10} | or dl 030 | mov b$edi+10+ebx dl
inc ebx | js S1
; Add a space and adjust string pointer.
mov b$edi+10 ' ' | add edi 11
pop edx ecx ebx eax
ret
ends dec2mem
You dare to call Herbert sick, but it's you who needs a doctor,
because only someone very sick can believe that a student would have
learned nothing about machine instructions after doing that!
--
wfz
.
- Follow-Ups:
- Re: HLA v1.86 is now available
- From: randyhyde@xxxxxxxxxxxxx
- Re: HLA v1.86 is now available
- From: randyhyde@xxxxxxxxxxxxx
- Re: HLA v1.86 is now available
- References:
- Re: HLA v1.86 is now available
- From: Charles A. Crayne
- Re: HLA v1.86 is now available
- From: Howard Kaikow
- Re: HLA v1.86 is now available
- From: Frank Kotler
- Re: HLA v1.86 is now available
- From: Betov
- Re: HLA v1.86 is now available
- From: Betov
- Re: HLA v1.86 is now available
- From: Frank Kotler
- Re: HLA v1.86 is now available
- From: Betov
- Re: HLA v1.86 is now available
- From: Frank Kotler
- Re: HLA v1.86 is now available
- From: Betov
- Re: HLA v1.86 is now available
- From: Frank Kotler
- Re: HLA v1.86 is now available
- From: sevagK
- Re: HLA v1.86 is now available
- From: rhyde
- Re: HLA v1.86 is now available
- From: Herbert Kleebauer
- Re: HLA v1.86 is now available
- From: randyhyde@xxxxxxxxxxxxx
- Re: HLA v1.86 is now available
- Prev by Date: Re: To Frank
- Next by Date: Re: To Frank
- Previous by thread: Re: HLA v1.86 is now available
- Next by thread: Re: HLA v1.86 is now available
- Index(es):
Relevant Pages
|