26 lines
1.9 KiB
Plaintext
26 lines
1.9 KiB
Plaintext
36 35 34 33 32 31 00000008'010E0000' 0000 1 result: .ascid "123456" ;output buffer
|
|
0000 000E 2 retlen: .word 0 ;$fao_s bytes written
|
|
4C 55 21 00000018'010E0000' 0010 3 format: .ascid "!UL" ;unsigned decimal
|
|
001B 4
|
|
0000 001B 5 .entry bab,0
|
|
55 D4 001D 6 clrl r5 ;result
|
|
001F 7 10$:
|
|
55 D6 001F 8 incl r5
|
|
56 00 55 55 7A 0021 9 emul r5,r5,#0,r6 ;mulr.rl, muld.rl, add.rl, prod.wq
|
|
51 50 56 000F4240 8F 7B 0026 10 ediv #1000000,r6,r0,r1 ;divr.rl, divd.rq, quo.wl, rem.wl
|
|
51 00041D80 8F D1 002F 11 cmpl #269696,r1
|
|
E7 12 0036 12 bneq 10$ ;not equal - try next
|
|
0038 13
|
|
0038 14 $fao_s - ;convert integer to text
|
|
0038 15 ctrstr = format, -
|
|
0038 16 outlen = retlen, -
|
|
0038 17 outbuf = result, -
|
|
0038 18 p1 = r5
|
|
B1 AF C1 AF B0 004A 19 movw retlen, result ;adjust length
|
|
AE AF 7F 004F 20 pushaq result
|
|
00000000'GF 01 FB 0052 21 calls #1, g^lib$put_output
|
|
04 0059 22 ret
|
|
005A 23 .end bab
|
|
$ run bab
|
|
25264
|