Exer16.asm - Title Chapt 9 Ex 16 Writelong_signed Procedure...

This preview shows page 1 - 2 out of 2 pages.

Title Chapt 9, Ex 16: Writelong_signed Procedure ; This procedure writes a 16-bit unsigned binary integer ; to standard output. Input parameters: AX = value, BX = radix. ; Last update: 4/7/98 .model small .stack 100h .386 BUFSIZE = 32 .data buffer db BUFSIZE dup(' '),0 ; buffer to hold chars xtable db '0123456789ABCDEF' ; translate table sign db '?' .code include LIBRARY.INC main proc mov ax,@data mov ds,ax mov eax,+40961234 mov ebx,10 call Writelong_signed call Crlf mov eax,-40961234 mov ebx,10 call Writelong_signed call Crlf mov eax,7FFFFFFFh ; largest possible: +2,147,483,647 mov ebx,10 call Writelong_signed call Crlf mov eax,80000000h ; smallest possible: -2,147,483,648 mov ebx,10 call Writelong_signed call Crlf mov ax,4c00h int 21h main endp Writelong_signed proc pushad ; save 32-bit registers mov di,offset buffer ; (don't use PUSHA)
Image of page 1

Subscribe to view the full document.

Image of page 2
  • Fall '18
  • Patel M
  • Division, Numerical digit, Numeral system

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern