*** empty log message ***
This commit is contained in:
parent
a067d1bc0d
commit
729774d6f8
2 changed files with 23 additions and 21 deletions
|
@ -12,26 +12,25 @@
|
||||||
! a1 : base address
|
! a1 : base address
|
||||||
.sect .text
|
.sect .text
|
||||||
.aar:
|
.aar:
|
||||||
move.l (sp)+,d2 ! return address
|
move.l 4(sp),a0 ! descriptor address
|
||||||
move.l (sp)+,a0 ! descriptor address
|
move.l 8(sp),d0 ! index
|
||||||
move.l (sp)+,d0 ! index
|
move.l 12(sp),a1 ! base address
|
||||||
move.l (sp)+,a1 ! base address
|
|
||||||
sub.l (a0),d0 ! index - lower bound : relative index
|
sub.l (a0),d0 ! index - lower bound : relative index
|
||||||
move.l 8(a0),-(sp) ! # bytes / element
|
move.l 8(a0),-(sp) ! # bytes / element
|
||||||
move.l d0,-(sp)
|
move.l d0,-(sp)
|
||||||
jsr .mlu
|
jsr .mlu
|
||||||
add.l d1,a1 ! address of element
|
add.l d1,a1 ! address of element
|
||||||
|
move.l (sp)+,a0 ! return address
|
||||||
|
add.l #12,sp ! pop arguments
|
||||||
move.l a1,-(sp) ! returned on stack
|
move.l a1,-(sp) ! returned on stack
|
||||||
move.l d2,-(sp)
|
jmp (a0)
|
||||||
rts
|
|
||||||
|
|
||||||
.lar:
|
.lar:
|
||||||
! register usage: like .aar
|
! register usage: like .aar
|
||||||
|
|
||||||
move.l (sp)+,d2 ! return address
|
move.l 4(sp),a0
|
||||||
move.l (sp)+,a0
|
move.l 8(sp),d0
|
||||||
move.l (sp)+,d0
|
move.l 12(sp),a1
|
||||||
move.l (sp)+,a1
|
|
||||||
sub.l (a0),d0
|
sub.l (a0),d0
|
||||||
move.l d0,-(sp)
|
move.l d0,-(sp)
|
||||||
move.l 8(a0),d0
|
move.l 8(a0),d0
|
||||||
|
@ -39,6 +38,8 @@
|
||||||
jsr .mlu
|
jsr .mlu
|
||||||
add.l d1,a1 ! address of element
|
add.l d1,a1 ! address of element
|
||||||
add.l 8(a0),a1 ! a1++ because of predecrement
|
add.l 8(a0),a1 ! a1++ because of predecrement
|
||||||
|
move.l (sp)+,a0 ! return address
|
||||||
|
add.l #12,sp ! pop parameters
|
||||||
clr.l d1 !?nodig?
|
clr.l d1 !?nodig?
|
||||||
asr #1,d0
|
asr #1,d0
|
||||||
bne 3f
|
bne 3f
|
||||||
|
@ -57,23 +58,22 @@
|
||||||
move.l -(a1),-(sp) ! 4n byte element (n = 1,2,...)
|
move.l -(a1),-(sp) ! 4n byte element (n = 1,2,...)
|
||||||
dbf d0,1b
|
dbf d0,1b
|
||||||
5:
|
5:
|
||||||
move.l d2,-(sp)
|
jmp (a0)
|
||||||
rts
|
|
||||||
|
|
||||||
|
|
||||||
.sar:
|
.sar:
|
||||||
!register usage: same as lar
|
!register usage: same as lar
|
||||||
|
|
||||||
move.l (sp)+,d2
|
move.l 4(sp),a0
|
||||||
move.l (sp)+,a0
|
move.l 8(sp),d0
|
||||||
move.l (sp)+,d0
|
move.l 12(sp),a1
|
||||||
move.l (sp)+,a1
|
|
||||||
sub.l (a0),d0
|
sub.l (a0),d0
|
||||||
move.l d0,-(sp)
|
move.l d0,-(sp)
|
||||||
move.l 8(a0),d0 ! # bytes / element
|
move.l 8(a0),d0 ! # bytes / element
|
||||||
move.l d0,-(sp)
|
move.l d0,-(sp)
|
||||||
jsr .mlu
|
jsr .mlu
|
||||||
add.l d1,a1
|
add.l d1,a1
|
||||||
|
move.l (sp)+,a0 ! return address
|
||||||
|
add.l #12,sp ! pop parameters
|
||||||
clr.l d1 !?nodig?
|
clr.l d1 !?nodig?
|
||||||
asr #1,d0
|
asr #1,d0
|
||||||
bne 3f
|
bne 3f
|
||||||
|
@ -92,7 +92,6 @@
|
||||||
move.l (sp)+,(a1)+ ! 4n byte element (n = 1,2,...)
|
move.l (sp)+,(a1)+ ! 4n byte element (n = 1,2,...)
|
||||||
dbf d0,1b
|
dbf d0,1b
|
||||||
4:
|
4:
|
||||||
move.l d2,-(sp)
|
jmp (a0)
|
||||||
rts
|
|
||||||
|
|
||||||
.align 2
|
.align 2
|
||||||
|
|
|
@ -1,11 +1,14 @@
|
||||||
.sect .text;.sect .rom;.sect .data;.sect .bss
|
|
||||||
.define _printn
|
.define _printn
|
||||||
.define _printf
|
.define _printf
|
||||||
.extern _printf
|
.extern _printf
|
||||||
|
.sect .text;.sect .rom;.sect .data;.sect .bss
|
||||||
.sect .text
|
.sect .text
|
||||||
_putchar:
|
_putchar:
|
||||||
move.l #1,-(sp)
|
move.l #1,-(sp)
|
||||||
pea 9(sp)
|
lea 8(sp),a0
|
||||||
|
move.l 8(sp),d0
|
||||||
|
move.b d0,(a0)
|
||||||
|
move.l a0,-(sp)
|
||||||
move.l #1,-(sp)
|
move.l #1,-(sp)
|
||||||
jsr _write
|
jsr _write
|
||||||
add.l #12,sp
|
add.l #12,sp
|
||||||
|
|
Loading…
Add table
Reference in a new issue