qf/in.asm

30 lines
408 B
NASM
Raw Normal View History

2019-10-26 18:12:25 +00:00
cs push \ copy code segment to data segment
ds pop
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
:> moredigits
dx pop
dl 48 # add
ax &h0200 # mov
2019-10-22 03:38:30 +00:00
&h21 int
bx dec
moredigits jne
2019-10-22 03:38:30 +00:00
0 .EXIT
cx 11 # mov