-
Notifications
You must be signed in to change notification settings - Fork 0
/
number.asm
57 lines (32 loc) · 1.38 KB
/
number.asm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
;number.asm
;These are macros for use in Assembly Language Class.
;They are for integer and floating point input and output.
;They were written by Myron Berg at Dickinson State University
;4/1/99
extrn atoi:proc, itoa:proc, atof:proc, ftoa:proc
;+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
GetInteger macro number
;gets an integer and stores it in a double word sized variable
lea bx, number
call AtoI
endm
;+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
GetFloat macro number
;gets a floating point and stores it in a double word sized variable
lea bx, number
call atof
endm
;+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
DisplayFloat macro Number, places
;displays a floating point double word sized variable on the screen
lea bx, number
mov cx, places
call ftoa
endm
;+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
DisplayInteger macro number
;displays an double word sized variable on the screen
lea bx, number
call itoa
endm
;+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++