.define .sar
.define .lar
.define .aar
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
!register usage:
! a0 : descriptor address
! d0 : index
! a1 : base address
- .text
+ .sect .text
.aar:
move.l (sp)+,d2 ! return address
move.l (sp)+,a0
.define .cii
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
- .text
+ .sect .text
.cii:
move.l (sp)+,a0 ! return address
move (sp)+,d0 ! destination size
.define .cmi, .cmi_
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
! NUM == 4
! result in d1
- .text
+ .sect .text
.cmi:
.cmi_:
move.l (sp)+,a0
.define .cmp
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
- .text
+ .sect .text
.cmp:
move.l (sp)+,a0 ! return address
move.l #1,d1
.define .cms
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
! d0 contains set size
- .text
+ .sect .text
.cms:
move.l (sp)+,d2 ! return address
move.l sp,a0
.define .cmu
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
! d0 : # bytes of 1 block
- .text
+ .sect .text
.cmu:
move.l (sp)+,d2 ! reta
move.l sp,a0 ! top block
.define .csa
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
- .text
+ .sect .text
.csa:
move.l (sp)+,a0 ! case descriptor
move (sp)+,d0 ! index
.define .csb
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
- .text
+ .sect .text
.csb:
move.l (sp)+,a0 ! case descriptor
move (sp)+,d0 ! index
.define .ciu
.define .cui
.define .cuu
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
- .text
+ .sect .text
.ciu:
.cui:
.cuu:
.define .cfi,.cif,.cfu,.cuf,.cff
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
- .text
+ .sect .text
! this is a dummy float conversion routine
.cfi:
.define .diagnos
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
space = 040
del = 0177
- .text
+ .sect .text
.diagnos:
move.w hol0,-(sp)
- move.l hol0+FILN_AD,d2
+ move.l hol0+4,d2
beq 1f
move.l d2,a0
move.l #40,d0
move.l #unknwn,d2
bra 2b
- .data
+ .sect .data
fmt: .asciz "%s, line %d: "
unknwn: .asciz "unknown file"
.align 2
.define .dvi
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
! signed long divide
- .text
+ .sect .text
.dvi:
move.l (sp)+,a0 ! return address
move.l (sp)+,d0
.define .dvu
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
! unsigned long divide
! register usage:
! d1 dividend
! exit : d1 quotient
! d2 remainder
- .text
+ .sect .text
.dvu:
move.l (sp)+,a1 ! return address
move.l (sp)+,d0
.define endtext,enddata,endbss,_etext,_edata,_end
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
+.sect .end ! only for declaration of _end and endbss.
- .text
- .align 2
+ .sect .text
endtext:
_etext:
- .data
- .align 2
+ .sect .data
enddata:
_edata:
- .bss
- .align 2
-endbss:
+ .sect .end
_end:
+endbss:
.define .exg
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
! d0 : exchange size in bytes
- .text
+ .sect .text
.exg:
move.l (sp)+,d2 ! return address
move.l sp,a1
.define .fat
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
- .text
+ .sect .text
.fat:
jsr .trp
jmp EXIT
--- /dev/null
+.define .cmf8, .cif8, .dvf8, .adf8, .ngf8, .mlf8, .fif8, .fef8, .cff4
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
+
+.sect .text
+.cmf8:
+.cif8:
+.dvf8:
+.adf8:
+.ngf8:
+.mlf8:
+.fif8:
+.fef8:
+.cff4:
+ move.w #EILLINS,-(sp)
+ jmp .fat
.define .gto
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
.extern .gto
.gto:
etaba:
move.l d2,a1
jmp (a1) ! return
-.data
-savd0: .long 0
-savd1: .long 0
-.text
+.sect .data
+savd0: .data4 0
+savd1: .data4 0
+.sect .text
.define .inn
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
! d0 : set size in bytes
! d1 : bitnumber
- .text
+ .sect .text
.inn:
move.l (sp)+,d2 ! return address
move.w (sp)+,d1
.define .los
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
! d0 : # bytes
! a0 : source address
- .text
+ .sect .text
.los:
move.l (sp)+,a1
move.w (sp)+,d0
.define .lpb
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
.extern .lpb
.lpb:
! convert local to argument base
.define .lxa
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
.extern .lxa
.lxa:
! #levels (>= 0) on stack
.define .lxl
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
.extern .lxl
.lxl:
! #levels on stack (> 0)
.define .mli
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
- .text
+ .sect .text
.mli:
move.l (sp)+,a0
move.l (sp)+,d1
.define .mlu
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
! entry : d0 multiplicand
! d1 multiplier
! exit : d0 high order result
! d1 low order result
- .text
+ .sect .text
.mlu:
move.l (sp)+,a1
move.l (sp)+,d1
.define .mon
- .text
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
+ .sect .text
.mon:
move.l (sp)+,a0
pea fmt
add #6,sp
jmp EXIT
- .data
+ .sect .data
fmt: .asciz "system call %d not implemented"
.align 2
.define .nop
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
- .text
+ .sect .text
.nop:
move.w hol0,-(sp)
pea fmt
add #6,sp
rts
- .data
+ .sect .data
fmt: .asciz "test %d\n"
.align 2
.define _printn
.define _printf
-.text
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
+.sect .text
_putchar:
move.w #1,-(sp)
pea 7(sp)
rts
_printf:
link a6,#-12
-.data
+.sect .data
_12:
- .short 28786
- .short 26990
- .short 29798
- .short 11875
- .short 0
-.text
+ .data2 28786
+ .data2 26990
+ .data2 29798
+ .data2 11875
+ .data2 0
+.sect .text
pea 8+4(a6)
move.l (sp)+,-6(a6)
I004:
rts
_printn:
link a6,#-2
-.data
+.sect .data
_15:
- .short 12337
- .short 12851
- .short 13365
- .short 13879
- .short 14393
- .short 0
-.text
+ .data2 12337
+ .data2 12851
+ .data2 13365
+ .data2 13879
+ .data2 14393
+ .data2 0
+.sect .text
move.w 8+0(a6),-(sp)
move.w #10,-(sp)
move.w (sp)+,d0
.define .rck
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
- .text
+ .sect .text
.rck:
move.l (sp)+,a1
move.l (sp)+,a0 ! descriptor address
.define .ret
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
- .text
+ .sect .text
.ret:
beq 3f
cmp #2,d0
.define .set
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
! d0 : setsize in bytes
! d1 : bitnumber
- .text
+ .sect .text
.set:
move.l (sp)+,a0
move.w (sp)+,d1
.define .strhp
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
- .text
+ .sect .text
.strhp:
move.l (sp)+,a0
move.l (sp)+,d0 ! heap pointer
.define .sig
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
- .text
+ .sect .text
.sig:
move.l (sp)+,a0
move.l (sp)+,a1 ! trap pc
.define .sts
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
! d0 : # bytes
! a0 : destination address
- .text
+ .sect .text
.sts:
move.l (sp)+,a1
move.w (sp)+,d0
.define .trp
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
- .text
+ .sect .text
.trp:
move.l (sp)+,a1 ! return address
move.w (sp)+,d0 ! error number
jsr .diagnos
jmp EXIT
- .data
-.rettrp: .long 0
+ .sect .data
+.rettrp: .data4 0
fmt: .asciz "trap %d called\n"
.align 2
-.define CERASE,CKILL,CSTOP,CSTART
.define .lino,.filn
-
-.define F_DUM,EXIT
-
+.define EXIT
.define begtext,begdata,begbss
.define EARRAY,ERANGE,ESET,EIDIVZ,EHEAP,EILLINS,ECASE,EBADGTO
.define hol0,.reghp,.limhp,.trpim,.trppc
-.define LINO_AD,FILN_AD
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
-! EM runtime start-off for the Bleasdale 68000 system
-CERASE = 010
-CKILL = 030
-CSTART = 021
-CSTOP = 023
-F_DUM = 0
+! EM runtime start-off for the Bleasdale 68000 system
LINO_AD = 0
ECASE = 20
EBADGTO = 27
-.base 0x20000
- .text
+ .sect .text
begtext:
! Bleasdale puts the argument and environment vectors
! themselves on top of the stack, instead of POINTERS
! envp pointer.
add.l #2,sp !convert argc from 4-byte to 2-byte
- pea endbss
- jsr _brk
- add.l #4,sp
jsr _m_a_i_n
add #010,sp
EXIT:
jsr __exit
- .data
+ .sect .data
begdata:
hol0:
.lino:
- .short 0,0 ! lino
+ .data2 0,0 ! lino
.filn:
- .long 0 ! filn
+ .data4 0 ! filn
.reghp:
- .long endbss
+ .data4 endbss
.limhp:
- .long endbss
+ .data4 endbss
.trppc:
- .long 0
+ .data4 0
.trpim:
- .short 0
+ .data2 0
- .bss
-begbss:
+ .sect .bss
+begbss: !initialization is not needed because ALL entries are in zero space!