changed printf name: removed underscore
This commit is contained in:
parent
ce81b47935
commit
013ccf9149
3 changed files with 13 additions and 10 deletions
|
@ -29,3 +29,5 @@ pr:
|
||||||
|
|
||||||
trpstr.s: trpstr.c strscript
|
trpstr.s: trpstr.c strscript
|
||||||
sh strscript
|
sh strscript
|
||||||
|
|
||||||
|
distr: trpstr.s
|
||||||
|
|
|
@ -19,6 +19,7 @@ ECASE=20
|
||||||
move.l (a0,d0.l*4), d1 ! jump address
|
move.l (a0,d0.l*4), d1 ! jump address
|
||||||
beq 1f
|
beq 1f
|
||||||
move.l d1,a1
|
move.l d1,a1
|
||||||
|
jmp (a1)
|
||||||
1:
|
1:
|
||||||
move.l a1, d0
|
move.l a1, d0
|
||||||
beq 2f
|
beq 2f
|
||||||
|
|
|
@ -28,10 +28,10 @@ del = 0177
|
||||||
2:
|
2:
|
||||||
move.l d2, -(sp)
|
move.l d2, -(sp)
|
||||||
pea (fmt)
|
pea (fmt)
|
||||||
jsr (_printf)
|
jsr (printf)
|
||||||
lea (12, sp), sp
|
lea (12, sp), sp
|
||||||
movem.l (sp)+, d0/d1/d2/a0
|
movem.l (sp)+, d0/d1/d2/a0
|
||||||
jmp (_printf)
|
jmp (printf)
|
||||||
rts
|
rts
|
||||||
|
|
||||||
1:
|
1:
|
||||||
|
@ -39,9 +39,9 @@ del = 0177
|
||||||
bra 2b
|
bra 2b
|
||||||
|
|
||||||
.sect .bss
|
.sect .bss
|
||||||
_getal:
|
getal:
|
||||||
.space 12
|
.space 12
|
||||||
_char:
|
char:
|
||||||
.space 1
|
.space 1
|
||||||
.align 4
|
.align 4
|
||||||
.sect .data
|
.sect .data
|
||||||
|
@ -49,7 +49,7 @@ hexs:
|
||||||
.ascii "0123456789abcdef"
|
.ascii "0123456789abcdef"
|
||||||
.align 4
|
.align 4
|
||||||
.sect .text
|
.sect .text
|
||||||
_printf:
|
printf:
|
||||||
movem.l d0/d1/d2/a0/a1/a2/a3/a4/a5/a6, -(sp)
|
movem.l d0/d1/d2/a0/a1/a2/a3/a4/a5/a6, -(sp)
|
||||||
lea (44, sp), a6 ! a6 <- address of arguments
|
lea (44, sp), a6 ! a6 <- address of arguments
|
||||||
move.l (a6)+, a5 ! a5 <- address of format
|
move.l (a6)+, a5 ! a5 <- address of format
|
||||||
|
@ -58,7 +58,7 @@ next: move.b (a5)+, d0
|
||||||
cmp.b #'%', d0
|
cmp.b #'%', d0
|
||||||
beq procnt
|
beq procnt
|
||||||
put: move.l d0, -(sp)
|
put: move.l d0, -(sp)
|
||||||
jsr (_putchar) ! long argument on stack
|
jsr (putchar) ! long argument on stack
|
||||||
tst.l (sp)+
|
tst.l (sp)+
|
||||||
bra next
|
bra next
|
||||||
|
|
||||||
|
@ -78,12 +78,12 @@ string: move.l (a6)+, a2 ! a2 <- address of string
|
||||||
sloop: move.b (a2)+, d0
|
sloop: move.b (a2)+, d0
|
||||||
beq next
|
beq next
|
||||||
move.l d0, -(sp)
|
move.l d0, -(sp)
|
||||||
jsr (_putchar) ! long argument on stack
|
jsr (putchar) ! long argument on stack
|
||||||
tst.l (sp)+
|
tst.l (sp)+
|
||||||
bra sloop
|
bra sloop
|
||||||
|
|
||||||
digit: move.l (a6)+, d1 ! d1 <- integer
|
digit: move.l (a6)+, d1 ! d1 <- integer
|
||||||
move.l #_getal+12, a2 ! a2 <- ptr to last part of buf
|
move.l #getal+12, a2 ! a2 <- ptr to last part of buf
|
||||||
clr.b -(a2) ! stringterminator
|
clr.b -(a2) ! stringterminator
|
||||||
1: divul.l #10, d2:d1 ! d1 <- qotient; d2 <- remainder
|
1: divul.l #10, d2:d1 ! d1 <- qotient; d2 <- remainder
|
||||||
add.l #'0', d2
|
add.l #'0', d2
|
||||||
|
@ -93,7 +93,7 @@ digit: move.l (a6)+, d1 ! d1 <- integer
|
||||||
bra sloop ! print digitstring.
|
bra sloop ! print digitstring.
|
||||||
|
|
||||||
hex: move.l (a6)+, d1 ! d1 <- integer
|
hex: move.l (a6)+, d1 ! d1 <- integer
|
||||||
move.l #_getal+12, a2 ! a2 <- ptr to last part of buf
|
move.l #getal+12, a2 ! a2 <- ptr to last part of buf
|
||||||
clr.b -(a2) ! stringterminator
|
clr.b -(a2) ! stringterminator
|
||||||
move.l #7, d2 ! loop control
|
move.l #7, d2 ! loop control
|
||||||
1: move.l d1, d0
|
1: move.l d1, d0
|
||||||
|
@ -108,7 +108,7 @@ out:
|
||||||
rts
|
rts
|
||||||
|
|
||||||
|
|
||||||
_putchar:
|
putchar:
|
||||||
move.l #1, -(sp)
|
move.l #1, -(sp)
|
||||||
pea (11,sp)
|
pea (11,sp)
|
||||||
move.l #1, -(sp)
|
move.l #1, -(sp)
|
||||||
|
|
Loading…
Add table
Reference in a new issue