new assembler syntax

This commit is contained in:
ceriel 1987-01-30 18:41:42 +00:00
parent 5e36fd3351
commit 1b09e55129
95 changed files with 484 additions and 8 deletions

View file

@ -1,4 +1,9 @@
.define Aar
.sect .text
.sect .rom
.sect .data
.sect .bss
.sect .text
! This subroutine gets the address of the array element

View file

@ -1,4 +1,9 @@
.define Addsub
.sect .text
.sect .rom
.sect .data
.sect .bss
.sect .text
! This subroutine is used by the fourbyte addition and subtraction
! routines.

View file

@ -1,4 +1,9 @@
.define Adi2
.sect .text
.sect .rom
.sect .data
.sect .bss
.sect .text
! This subroutine adds two twobyte integers.
! The first operand is on the top of the stack, the second operand

View file

@ -1,4 +1,9 @@
.define Adi4
.sect .text
.sect .rom
.sect .data
.sect .bss
.sect .text
! This subroutine adds two fourbyte integers, which are on the stack.
! The addresses are initiated by the subroutine Addsub.

View file

@ -1,4 +1,9 @@
.define And
.sect .text
.sect .rom
.sect .data
.sect .bss
.sect .text
! This subroutine performs the logical and on two groups of
! atmost 254 bytes. The number of bytes is in register Y.

View file

@ -1,4 +1,9 @@
.define Asp
.sect .text
.sect .rom
.sect .data
.sect .bss
.sect .text
! This subroutine adds an offset to the stackpointer,
! e.g. after the return from a procedurecall.

View file

@ -1,4 +1,9 @@
.define Blm, Blmnp
.sect .text
.sect .rom
.sect .data
.sect .bss
.sect .text
! This subroutine copies bytes from one place in memory to
! another. The source address is in registerpair AX and is stored

View file

@ -1,4 +1,9 @@
.define Cii
.sect .text
.sect .rom
.sect .data
.sect .bss
.sect .text
! This subroutine converts integers to integers.
! Convertions of integers with the same source size as destination

View file

@ -1,4 +1,9 @@
.define Cmi
.sect .text
.sect .rom
.sect .data
.sect .bss
.sect .text
! This subroutine compares on two integers.
! If T is pushed first and than S, the routine will return:

View file

@ -1,4 +1,9 @@
.define Cmi4
.sect .text
.sect .rom
.sect .data
.sect .bss
.sect .text
! This subroutine compares on fourbyte integers.
! If T is pushed first and than S, the routine will return:

View file

@ -1,4 +1,9 @@
.define Cms
.sect .text
.sect .rom
.sect .data
.sect .bss
.sect .text
! This subroutine compares two groups of bytes, bit for bit.
! The groups can consist of 2 or 4 bytes. This number is in

View file

@ -1,4 +1,9 @@
.define Cmu2
.sect .text
.sect .rom
.sect .data
.sect .bss
.sect .text
! This subroutine compares two unsigned twobyte integers.
! If T is the first pushed and than S, the routine will return:

View file

@ -1,4 +1,9 @@
.define Cmu4
.sect .text
.sect .rom
.sect .data
.sect .bss
.sect .text
! This subroutine compares two unsigned fourbyte integers.
! If T is first pushed and than S the routine will return:

View file

@ -1,4 +1,9 @@
.define Com
.sect .text
.sect .rom
.sect .data
.sect .bss
.sect .text
! This subroutine performs a one complement on
! a group of atmost 254 bytes (number in register Y).

View file

@ -1,4 +1,9 @@
.define Csa
.sect .text
.sect .rom
.sect .data
.sect .bss
.sect .text
! This subroutine performs the case jump by indexing.
! The zeropage locations ADDR, ADDR+1 contain the address of

View file

@ -1,4 +1,9 @@
.define Csb
.sect .text
.sect .rom
.sect .data
.sect .bss
.sect .text
! This subroutine performs the case jump by searching the table.
! The zeropage locations ADDR, ADDR+1 contain the address of the

View file

@ -2,12 +2,17 @@
.define ECONV,ESTACK
.define EHEAP,EODDZ,ECASE
.define EBADMON,EBADLIN,EBADGTO
.sect .text
.sect .rom
.sect .data
.sect .bss
.sect .text
! This file contains the global data used by the trap routine.
! DATA
.data
.sect .data
EARRAY:
.asciz "Array bound error\n\r"
ERANGE:

View file

@ -1,4 +1,9 @@
.define Div4
.sect .text
.sect .rom
.sect .data
.sect .bss
.sect .text
! This subroutine performs a signed divide on two fourbyte integers.
! For more detail see dvi.s

View file

@ -23,6 +23,11 @@
.define Cfu
.define Lfr8
.define Ret8
.sect .text
.sect .rom
.sect .data
.sect .bss
.sect .text
! Dummy floating point package for 6500
! every EM floating point instruction results in an

View file

@ -1,4 +1,9 @@
.define Dup
.sect .text
.sect .rom
.sect .data
.sect .bss
.sect .text
! This subroutine duplicate's the top n (in register Y) bytes.
! N is atmost 256.

View file

@ -1,4 +1,9 @@
.define Duv4
.sect .text
.sect .rom
.sect .data
.sect .bss
.sect .text
! This subroutine performs an unsigned division on two fourbyte
! unsigned integers.

View file

@ -1,4 +1,9 @@
.define Dvi2, Div, Duv
.sect .text
.sect .rom
.sect .data
.sect .bss
.sect .text
! The subroutine Dvi2 performs a signed division.
! Its operands are on the stack.

View file

@ -1,4 +1,9 @@
.define Dvi4
.sect .text
.sect .rom
.sect .data
.sect .bss
.sect .text
! This subroutine performs a fourbyte signed division.
! For more details see dvi.s

View file

@ -1,4 +1,9 @@
.define Dvu2
.sect .text
.sect .rom
.sect .data
.sect .bss
.sect .text
! This subroutine performs a twobyte unsigned division
! For more details see dvi.s.

View file

@ -1,4 +1,9 @@
.define Dvu4
.sect .text
.sect .rom
.sect .data
.sect .bss
.sect .text
! This subroutine performs an unsigned division on fourbyte
! integers. For more details see dvi.s

View file

@ -1,12 +1,17 @@
.define endtext, enddata, endbss, end
.sect .text
.sect .rom
.sect .data
.sect .bss
.sect .text
.text
.sect .text
endtext:
.align 2
.data
.sect .data
.align 2
enddata:
.bss
.sect .bss
.align 2
endbss:
end:

View file

@ -1,4 +1,9 @@
.define Exg
.sect .text
.sect .rom
.sect .data
.sect .bss
.sect .text
! This subroutine exchanges two groups of bytes on the top of the
! stack. The groups may consist of atmost 255 bytes.

View file

@ -1,4 +1,9 @@
.define Exg2
.sect .text
.sect .rom
.sect .data
.sect .bss
.sect .text
! This subroutine exchanges two words on top of the stack.
! The top word of the stack is really in the AX registerpair.

View file

@ -1,4 +1,9 @@
.define Gto
.sect .text
.sect .rom
.sect .data
.sect .bss
.sect .text
! This subroutine performs the non_local goto.
! The address of the descriptor is stored in zeropage locations

View file

@ -9,6 +9,12 @@
.define RETSIZE, TRAPVAL, STACK, BRANCH
.define start, Push, Pop, STACKTh, STACKTl
.define F_DUM
.sect .zero
.sect .text
.sect .rom
.sect .data
.sect .bss
.sect .text
! DEFINITIONS
@ -51,7 +57,7 @@ STACKTl = 0D0h
! Some zeropage declarations
.zero
.sect .zero
RES: .space 76 ! special for the operating system
@ -97,8 +103,8 @@ STACK: .space 1 ! contains the hardware stackpointer on
RESERVED: .space 112 ! used by the operating system
.sect .text
.base 0E02h ! where to start in the BBC micro
.text
! GENERAL PURPOSE ROUTINES
start:
@ -220,8 +226,8 @@ Pop:
rts
.data
.sect .data
PROGNAME: ! for initialising the programname pointer
.asciz "program"
.bss
.sect .bss
beginbss:

View file

@ -1,4 +1,9 @@
.define Indir
.sect .text
.sect .rom
.sect .data
.sect .bss
.sect .text
! This subroutine performs an indirect procedurecall.
! This must be done this way since the jump instruction

View file

@ -1,4 +1,9 @@
.define Inn
.sect .text
.sect .rom
.sect .data
.sect .bss
.sect .text
! This subroutine checks if a certain bit is set in a set
! of n bytes on top of the stack.

View file

@ -1,4 +1,9 @@
.define Ior
.sect .text
.sect .rom
.sect .data
.sect .bss
.sect .text
! This subroutine performs the logical inclusive or on two
! groups of bytes. The groups may consist of atmost 254 bytes.

View file

@ -1,4 +1,9 @@
.define Lar
.sect .text
.sect .rom
.sect .data
.sect .bss
.sect .text
! This subroutine performs the LAR instruction.
! For details see rapport IR-81.

View file

@ -1,4 +1,9 @@
.define Lcs
.sect .text
.sect .rom
.sect .data
.sect .bss
.sect .text
! This subroutine creates space for locals on procedure entry
! by lowering the stackpointer.

View file

@ -1,4 +1,9 @@
.define Ldi, Ldo
.sect .text
.sect .rom
.sect .data
.sect .bss
.sect .text
! The subroutine Ldi pushes a four byte object onto the stack.
! The address is in registerpair AX.

View file

@ -1,4 +1,9 @@
.define Locaddr
.sect .text
.sect .rom
.sect .data
.sect .bss
.sect .text
! This routine gets the address of a local which offset is to big.
! The offset is in registerpair AX.

View file

@ -1,4 +1,9 @@
.define Loi, Lext
.sect .text
.sect .rom
.sect .data
.sect .bss
.sect .text
! This subroutine performs an indirect load on a word of two bytes.
! Lext is used when the address is already in zeropage.

View file

@ -1,4 +1,9 @@
.define Loi1
.sect .text
.sect .rom
.sect .data
.sect .bss
.sect .text
! This routine loads a one byte object in registerpair AX.

View file

@ -1,4 +1,9 @@
.define Loil
.sect .text
.sect .rom
.sect .data
.sect .bss
.sect .text
! This subroutine pushes an object of size greater than four bytes
! onto the stack.

View file

@ -1,4 +1,9 @@
.define Lol
.sect .text
.sect .rom
.sect .data
.sect .bss
.sect .text
! This subroutine loads a local in registerpair AX which
! offset from the localbase is to big.

View file

@ -1,4 +1,9 @@
.define Los
.sect .text
.sect .rom
.sect .data
.sect .bss
.sect .text
! This subroutine perfoms the LOS instruction.
! For detail see rapport IR-81.

View file

@ -1,4 +1,9 @@
.define Lxa1
.sect .text
.sect .rom
.sect .data
.sect .bss
.sect .text
! This subroutine loads the address of AB zero static levels back.

View file

@ -1,4 +1,9 @@
.define Lxa2
.sect .text
.sect .rom
.sect .data
.sect .bss
.sect .text
! This subroutine load the address of AB n (255 >= n > 0) static levels
! back.

View file

@ -1,4 +1,9 @@
.define Lxl
.sect .text
.sect .rom
.sect .data
.sect .bss
.sect .text
! This subroutine loads LB n (255 => n > 0) static levels back.

View file

@ -1,4 +1,9 @@
.define Mli2, Mlinp, Mul
.sect .text
.sect .rom
.sect .data
.sect .bss
.sect .text
! The subroutine Mli2 multiplies two signed integers. The integers
! are popped from the stack.

View file

@ -1,4 +1,9 @@
.define Mli4
.sect .text
.sect .rom
.sect .data
.sect .bss
.sect .text
! This subroutine multiplies two signed fourbyte integers
! For more detail see mli.s

View file

@ -1,4 +1,9 @@
.define Mlu2
.sect .text
.sect .rom
.sect .data
.sect .bss
.sect .text
! This subroutine multiplies two unsigned fourbyte intergers.
! For more details see mli.s

View file

@ -1,4 +1,9 @@
.define Mlu4
.sect .text
.sect .rom
.sect .data
.sect .bss
.sect .text
! This subroutine multiplies two fourbyte unsigned integers.
! For more details see mli.s

View file

@ -1,4 +1,9 @@
.define Mon
.sect .text
.sect .rom
.sect .data
.sect .bss
.sect .text
! This subroutine performs some monitor calls.
! The exit call just resets the hardware_stackpointer so

View file

@ -1,4 +1,9 @@
.define Mul4
.sect .text
.sect .rom
.sect .data
.sect .bss
.sect .text
! This subroutine multiplies two fourbyte signed integers.
! For more details see mli.s

View file

@ -1,4 +1,9 @@
.define Ngi2
.sect .text
.sect .rom
.sect .data
.sect .bss
.sect .text
! This subroutine negates the integer in registerpair AX.
! The negation is a one's complement plus one.

View file

@ -1,4 +1,9 @@
.define Ngi4
.sect .text
.sect .rom
.sect .data
.sect .bss
.sect .text
! This subroutine takes a fourbyte interger and negates it.
! For more details see ngi2.s

View file

@ -1,4 +1,9 @@
.define Mprint
.sect .text
.sect .rom
.sect .data
.sect .bss
.sect .text
! This subroutine prints a zero terminated ascii string.
! The registerpair AX contains the start of the string.

View file

@ -1,4 +1,9 @@
.define Printhex
.sect .text
.sect .rom
.sect .data
.sect .bss
.sect .text
! This subroutine print the contents of register A to the screen
! in hexadecimal form.

View file

@ -1,4 +1,9 @@
.define Printstack
.sect .text
.sect .rom
.sect .data
.sect .bss
.sect .text
! This a special subroutine which prints some things to the
! monitorscreen for debugging.

View file

@ -1,4 +1,9 @@
.define Pro
.sect .text
.sect .rom
.sect .data
.sect .bss
.sect .text
! This routine is called at the entry of a procedure.
! It saves the localbase of the invoking procedure, and sets the

View file

@ -1,4 +1,9 @@
.define Mread
.sect .text
.sect .rom
.sect .data
.sect .bss
.sect .text
! This subroutine reads characters from the standard input.
! It ignores the filedes.

View file

@ -1,4 +1,9 @@
.define Ret
.sect .text
.sect .rom
.sect .data
.sect .bss
.sect .text
! This subroutine stores the returnvalue in the return area.
! This area is in zeropage.

View file

@ -1,4 +1,9 @@
.define Rmi2
.sect .text
.sect .rom
.sect .data
.sect .bss
.sect .text
! This subroutine returns the remainder of a twobyte signed division.
! The sign of the result is as specified in the emtest.

View file

@ -1,4 +1,9 @@
.define Rmi4
.sect .text
.sect .rom
.sect .data
.sect .bss
.sect .text
! This subroutine returns the remainder of a fourbyte division.

View file

@ -1,4 +1,9 @@
.define Rmu2
.sect .text
.sect .rom
.sect .data
.sect .bss
.sect .text
! This subroutine returns the remainder of an twobyte unsigned
! integer division.

View file

@ -1,4 +1,9 @@
.define Rmu4
.sect .text
.sect .rom
.sect .data
.sect .bss
.sect .text
! This subroutine returns the remainder of a fourbyte unsigned
! division.

View file

@ -1,4 +1,9 @@
.define Rol
.sect .text
.sect .rom
.sect .data
.sect .bss
.sect .text
! This subroutine rotates left an integer n times
! N is in register X.

View file

@ -1,4 +1,9 @@
.define Rol4
.sect .text
.sect .rom
.sect .data
.sect .bss
.sect .text
! This subroutine rotates left a fourbyte integer n times.
! N is in register X.

View file

@ -1,4 +1,9 @@
.define Ror
.sect .text
.sect .rom
.sect .data
.sect .bss
.sect .text
! This subroutine rotates right a integer twobyte word.
! The number of rotates is in X.

View file

@ -1,4 +1,9 @@
.define Ror4
.sect .text
.sect .rom
.sect .data
.sect .bss
.sect .text
! This subroutine rotates right a fourbyte word.
! The number of rotates is in X.

View file

@ -1,4 +1,9 @@
.define Rtt
.sect .text
.sect .rom
.sect .data
.sect .bss
.sect .text
! This subroutine performs the return from trap.

View file

@ -1,4 +1,9 @@
.define Sar
.sect .text
.sect .rom
.sect .data
.sect .bss
.sect .text
! This subroutine performs the SAR instruction.
! For details see rapport IR-81.

View file

@ -1,4 +1,9 @@
.define Sbi2
.sect .text
.sect .rom
.sect .data
.sect .bss
.sect .text
! This subroutine subtracts two twobyte signed integers
! and returnes the result in registerpair AX.

View file

@ -1,4 +1,9 @@
.define Sbi4
.sect .text
.sect .rom
.sect .data
.sect .bss
.sect .text
! This subroutine subtracts two fourbyte signed integers.

View file

@ -1,4 +1,9 @@
.define Sdi, Sdo
.sect .text
.sect .rom
.sect .data
.sect .bss
.sect .text
! The subroutine Sdi takes a fourbyte word and stores it
! at the address in registerpair AX.

View file

@ -1,4 +1,9 @@
.define Set
.sect .text
.sect .rom
.sect .data
.sect .bss
.sect .text
! This subroutine creates a set of n (n <= 256) bytes.
! In this set a certain bit, which number is in registerpair AX,

View file

@ -1,4 +1,9 @@
.define Sli2
.sect .text
.sect .rom
.sect .data
.sect .bss
.sect .text
! This subroutine shifts a signed or unsigned interger to the
! left n times.

View file

@ -1,4 +1,9 @@
.define Sli4
.sect .text
.sect .rom
.sect .data
.sect .bss
.sect .text
! This subroutine shift a signed or unsigned fourbyte integer
! n times left. N is in register X.

View file

@ -1,4 +1,9 @@
.define Sri2, Sru2
.sect .text
.sect .rom
.sect .data
.sect .bss
.sect .text
! The subroutine Sri2 shifts a signed integer n times right.
! In the case of a negative integer there is signextension.

View file

@ -1,4 +1,9 @@
.define Sri4, Sru4
.sect .text
.sect .rom
.sect .data
.sect .bss
.sect .text
! The subroutine Sri4 shifts a signed fourbyte integer to the
! right n times

View file

@ -1,4 +1,9 @@
.define Sti, Sext, Stii
.sect .text
.sect .rom
.sect .data
.sect .bss
.sect .text
! The subroutine Sti stores an twobyte word at the address which
! is in registerpair AX.

View file

@ -1,4 +1,9 @@
.define Sti1
.sect .text
.sect .rom
.sect .data
.sect .bss
.sect .text
! This subroutine stores an onebyte wordfractional at the address
! which is in registerpair AX.

View file

@ -1,4 +1,9 @@
.define Stil
.sect .text
.sect .rom
.sect .data
.sect .bss
.sect .text
! This subroutine stores indirect a block of bytes if
! the number of bytes is greater than four.

View file

@ -1,4 +1,9 @@
.define Stl
.sect .text
.sect .rom
.sect .data
.sect .bss
.sect .text
! This subroutine performs the storage of a local which offset
! is to big.

View file

@ -1,4 +1,9 @@
.define Sts
.sect .text
.sect .rom
.sect .data
.sect .bss
.sect .text
! This subroutine stores indirect a number of bytes.
! The number of bytes is in the registerpair AX.

View file

@ -1,4 +1,9 @@
.define Teq
.sect .text
.sect .rom
.sect .data
.sect .bss
.sect .text
! This subroutine test if the value in registerpair AX is zero
! or nonzero.

View file

@ -1,4 +1,9 @@
.define Test2
.sect .text
.sect .rom
.sect .data
.sect .bss
.sect .text
! This subroutine tests if the value on top of the stack is 2.
! It is used if the size is on top of the stack.

View file

@ -1,4 +1,9 @@
.define TestFFh
.sect .text
.sect .rom
.sect .data
.sect .bss
.sect .text
! This subroutine tests if the value on top of the stack is <= 256.
! It is used if the istruction argument is on top of the stack.

View file

@ -1,4 +1,9 @@
.define Tge
.sect .text
.sect .rom
.sect .data
.sect .bss
.sect .text
! This subroutine test if the value in registerpair AX is
! greater than or equal to zero.

View file

@ -1,4 +1,9 @@
.define Tgt
.sect .text
.sect .rom
.sect .data
.sect .bss
.sect .text
! This subroutine tests if the value in registerpair AX is
! greater than zero.

View file

@ -1,4 +1,9 @@
.define Tle
.sect .text
.sect .rom
.sect .data
.sect .bss
.sect .text
! This subroutine tests if the value in registerpair AX is
! less than or equal to zero.

View file

@ -1,4 +1,9 @@
.define Tlt
.sect .text
.sect .rom
.sect .data
.sect .bss
.sect .text
! This subroutine tests if the value in registerpair AX is
! less than zero.

View file

@ -1,4 +1,9 @@
.define Tne
.sect .text
.sect .rom
.sect .data
.sect .bss
.sect .text
! This subroutine tests if the value in registerpair AX is
! not equal to zero.

View file

@ -1,4 +1,9 @@
.define Trap
.sect .text
.sect .rom
.sect .data
.sect .bss
.sect .text
! This subroutine performs the trap instruction.

View file

@ -1,4 +1,9 @@
.define Mwrite
.sect .text
.sect .rom
.sect .data
.sect .bss
.sect .text
! This subroutine performs the monitor call write.
! Writing is always done to standardoutput.

View file

@ -1,4 +1,9 @@
.define Xor
.sect .text
.sect .rom
.sect .data
.sect .bss
.sect .text
! This subroutine performs the exclusive or on two groups of bytes.
! The groups consists of atmost 254 bytes.

View file

@ -1,4 +1,9 @@
.define Zer
.sect .text
.sect .rom
.sect .data
.sect .bss
.sect .text
! This subroutine puts n (n <=256) zero bytes on top of
! the stack.

View file

@ -1,4 +1,9 @@
.define Zrl, Zro
.sect .text
.sect .rom
.sect .data
.sect .bss
.sect .text
! The subroutine Zrl makes a local zero which offset is to big.
! The offset of the local is in registerpair AX.