Love this site? Hate it? Leave us some comments.
*/
*/

View \POWER2.ASM

Magic Assembler (v1.10)

Submitted By: Unknown
Rating: starstarstarhalf star (Rate It)


; +-------------------------------------------------------+ ;
; | Sample power program for use with the Magic Assembler | ;
; +-------------------------------------------------------+ ;
false  equ     00
true    equ     01
nodigit equ     0080
nopower equ     00c0
       
        xor     al,al
        mov     di,offset(a)
        mov     cx,nodigit
@1      stosb
        loop    @1
        mov     byte[offset(a)],01
        mov     cx,nopower
@2      push    cx
        mov     si,offset(a)
        mov     di,offset(a)
        mov     cx,nodigit
@4      push    cx
        lodsb
        add     al,al
        stosb
        pop     cx
        loop    @4
        mov     si,offset(a)
        mov     di,offset(a)
        mov     cx,nodigit
@3      push    cx
        lodsb
        cmp     al,0a
        jb      @9
        sub     al,0a
        inc     byte [si]
@9      stosb
        pop     cx
        loop    @3
        pop     cx
        loop    @2
        std
        mov     si,offset(a)+nodigit
        dec     si
        mov     cx,nodigit
@5      lodsb
        add     al,30
        cmp     display,false
        je      @6
@8      mov     ah,0e
        mov     bx,0007
        int     10
        jmps    @7
@6      cmp     al,30
        je      @7
        mov     display,true
        jmps    @8
@7      loop    @5
        int     20

display db      false
-
a       ds      nodigit

corner
© 1996-2008 CommunityHeaven LLC. All rights reserved. Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
North American business development: Nicolai Wadstrom. Publisher: Lars Hagelin.
Resource Listings