home *** CD-ROM | disk | FTP | other *** search
- .model small, stdcall
- .186
- ;
- ; Sample assembly language DOS app using BCDASM routines
- ;
-
- include bcd.asi ; BCDASM interface
- include consolio.ash ; I/O prototypes
- .stack 0200h
-
- BCDSZ = 10
- BUFSZ = 256
- .data
- msghi db "Hello from BCDASM: ",0
- bnum dt 61728394506172839
- .data?
- buf db BUFSZ dup (?)
-
- .code
- begin: .startup
- ; STDCALL preserves SI and DI
- call WriteZStr, offset msghi
- lea si, [bnum]
- call bcdAdd, si, si, BCDSZ ; Add to self
- call bcdNeg, si, BCDSZ ; Reverse sign
- lea di, [buf] ; Convert BCD to Ascii
- call bcdFmt, di, BUFSZ, si, BCDSZ, \
- 32,-1,-1,-1, -1,-1,-1,-1
- call WriteZStr, di ; Output Ascii string
- call WriteNL
- mov ax, 4c00h
- int 21h
-
- END begin
-