2019-10-26 18:12:25 +00:00
|
|
|
cs push \ copy code segment to data segment
|
|
|
|
ds pop
|
2019-10-20 05:05:26 +00:00
|
|
|
|
2019-11-16 20:55:39 +00:00
|
|
|
ax 0 # mov
|
|
|
|
\ print number
|
|
|
|
\ in: ax = number
|
|
|
|
\ clobbers: ax, bx, cx, dx
|
|
|
|
cx 10 # mov
|
|
|
|
bx bx xor
|
|
|
|
|
|
|
|
:> moredigits
|
|
|
|
bx inc
|
|
|
|
dx dx xor
|
|
|
|
cx div
|
|
|
|
dx push
|
|
|
|
ax 0 # cmp
|
|
|
|
moredigits jne
|
2019-10-20 18:53:53 +00:00
|
|
|
|
2019-11-16 20:55:39 +00:00
|
|
|
:> moredigits
|
|
|
|
dx pop
|
|
|
|
dl 48 # add
|
|
|
|
ax &h0200 # mov
|
2019-10-22 03:38:30 +00:00
|
|
|
&h21 int
|
2019-11-16 20:55:39 +00:00
|
|
|
bx dec
|
|
|
|
moredigits jne
|
2019-10-22 03:38:30 +00:00
|
|
|
|
|
|
|
0 .EXIT
|
|
|
|
|
2019-11-16 20:55:39 +00:00
|
|
|
cx 11 # mov
|