Changes from Nigel Hall

This commit is contained in:
ceriel 1988-08-19 17:05:03 +00:00
parent f3a780ecec
commit 7f5dfa7bb2
18 changed files with 88 additions and 88 deletions

View file

@ -1,94 +1,94 @@
libem_s.a libem_s.a
adi.s
adi4.s adi4.s
cmi.s
cmi4.s
sbi4.s
addsub.s
cmu4.s
dum_float.s
dvi4.s
dvu4.s
lar.s
lol.s
los.s
loil.s
loi1.s
loi.s
mli4.s
mlu.s
mlu4.s
mul4.s
mon.s
write.s
printstack.s
printhex.s
rmi.s
rmi4.s
div4.s
rmu.s
dvi.s
rmu4.s
duv4.s
ngi4.s
rtt.s
ret.s
sar.s
aar.s
adi.s
sbi.s
mli.s
ngi.s
set.s
zer.s
stl.s
sts.s
sdl.s
sti.s
stil.s
blm.s
sti1.s
test2.s
testFFh.s
trap.s
ldi.s
data.s
print.s
zri.s
locaddr.s
and.s and.s
asp.s asp.s
cii.s cii.s
cmi.s
cmi4.s
cms.s cms.s
cmu.s cmu.s
cmu4.s
com.s com.s
csa.s csa.s
csb.s csb.s
dup.s dup.s
dvi.s
dvi4.s
dvu.s dvu.s
dvu4.s
exg.s exg.s
exg2.s exg2.s
gto.s gto.s
indir.s indir.s
inn.s inn.s
ior.s ior.s
lar.s
lcs.s lcs.s
loi.s
loi1.s
loil.s
lol.s
los.s
lxa1.s lxa1.s
lxa2.s lxa2.s
lxl.s lxl.s
mli4.s
mlu.s
mlu4.s
mon.s
mul4.s
ngi4.s
printstack.s
printhex.s
pro.s pro.s
read.s read.s
ret.s
rmi.s
rmi4.s
div4.s
rmu.s
rmu4.s
duv4.s
rol.s rol.s
rol4.s rol4.s
ror.s ror.s
ror4.s ror4.s
rtt.s
sar.s
mli.s
ngi.s
sbi4.s
addsub.s
sdl.s
set.s
sli.s sli.s
sli4.s sli4.s
sri.s sri.s
sri4.s sri4.s
sti.s
sti1.s
stil.s
blm.s
stl.s
sts.s
teq.s teq.s
test2.s
testFFh.s
tge.s tge.s
tgt.s tgt.s
tle.s tle.s
tlt.s tlt.s
tne.s tne.s
dum_float.s
trap.s
ldi.s
print.s
write.s
xor.s xor.s
zer.s
zri.s
locaddr.s
data.s
aar.s
sbi.s

View file

@ -26,7 +26,7 @@ Addsub:
sta ADDR+3 ! address of first operand (highbyte) sta ADDR+3 ! address of first operand (highbyte)
sta SP+1 sta SP+1
ldy #0 ldy #0
ldx #0FCh ! do it 4 times ldx #0x0FC ! do it 4 times
rts rts

View file

@ -30,7 +30,7 @@ Cii:
lda #0 ! no sign extension here lda #0 ! no sign extension here
tax tax
beq 2f beq 2f
1: lda #0FFh ! sign extension here 1: lda #0x0FF ! sign extension here
tax tax
2: jsr Push ! push twobyte integer 2: jsr Push ! push twobyte integer
pla pla

View file

@ -15,7 +15,7 @@
Cmi: Cmi:
jsr Sbi2 ! subtract operands (T - S) jsr Sbi2 ! subtract operands (T - S)
bpl 1f ! S >= T bpl 1f ! S >= T
lda #0FFh ! S < T lda #0x0FF ! S < T
tax ! AX becomes -1 tax ! AX becomes -1
rts rts
1: beq 2f 1: beq 2f

View file

@ -20,7 +20,7 @@ Cmi4:
jsr Pop ! get result (lowbyte+2, lowbyte+3) jsr Pop ! get result (lowbyte+2, lowbyte+3)
tay ! test lowbyte+3 tay ! test lowbyte+3
bpl 1f ! S >= T bpl 1f ! S >= T
lda #0FFh ! S < T lda #0x0FF ! S < T
tax ! AX becomes -1 tax ! AX becomes -1
rts rts
1: cmp #0 ! test lowbyte+3 on zero 1: cmp #0 ! test lowbyte+3 on zero

View file

@ -21,7 +21,7 @@ Cmu2:
4: lda #0 ! S > T 4: lda #0 ! S > T
ldx #1 ldx #1
rts rts
1: lda #0FFh ! S < T 1: lda #0xFF ! S < T
tax tax
rts rts
2: cpx EXG 2: cpx EXG

View file

@ -43,7 +43,7 @@ Cmu4:
2: lda #0 ! S > T 2: lda #0 ! S > T
ldx #1 ldx #1
rts rts
3: lda #0FFh ! S < T 3: lda #0x0FF ! S < T
tax tax
rts rts

View file

@ -17,7 +17,7 @@ Com:
sta ADDR ! address (lowbyte) of first byte sta ADDR ! address (lowbyte) of first byte
1: dey 1: dey
lda (ADDR),y lda (ADDR),y
eor #0FFh ! one complement eor #0x0FF ! one complement
sta (ADDR),y sta (ADDR),y
tya tya
bne 1b ! do it n times bne 1b ! do it n times

View file

@ -21,11 +21,11 @@
! The next three definitions are special for the ! The next three definitions are special for the
! BBC microcomputer ! BBC microcomputer
WRCH = 0FFEEh ! This subroutine writes the character in WRCH = 0x0FFEE ! This subroutine writes the character in
! register A to the screen ! register A to the screen
RDCH = 0FFE0h ! This subroutine returns a character in RDCH = 0x0FFE0 ! This subroutine returns a character in
! register A from the current input stream ! register A from the current input stream
OSBYTE = 0FFF4h ! This subroutine performs miscelaneous OSBYTE = 0x0FFF4 ! This subroutine performs miscelaneous
! operating system calls ! operating system calls
F_DUM = 0 ! Dummy floating point constant F_DUM = 0 ! Dummy floating point constant
@ -47,13 +47,13 @@ Ecase = 20
Ebadmon = 25 Ebadmon = 25
Ebadlin = 26 Ebadlin = 26
Ebadgto = 27 Ebadgto = 27
MON = 78D0h MON = 0x78D0
BASE = 240 ! This is the offset from the localbase BASE = 240 ! This is the offset from the localbase
! for the second localbase ! for the second localbase
STACKTh = 78h ! This is the top of the stack STACKTh = 0x78 ! This is the top of the stack
STACKTl = 0D0h STACKTl = 0x0D0
! Some zeropage declarations ! Some zeropage declarations
@ -104,7 +104,7 @@ STACK: .space 1 ! contains the hardware stackpointer on
RESERVED: .space 112 ! used by the operating system RESERVED: .space 112 ! used by the operating system
.sect .text .sect .text
.base 0E02h ! where to start in the BBC micro .base 0x0E02 ! where to start in the BBC micro
! GENERAL PURPOSE ROUTINES ! GENERAL PURPOSE ROUTINES
start: start:
@ -176,7 +176,7 @@ start:
jsr Push ! push argc jsr Push ! push argc
jsr _m_a_i_n ! start the real program jsr _m_a_i_n ! start the real program
lda #0FFh lda #0x0FF
jsr WRCH ! send end of program to R423 jsr WRCH ! send end of program to R423
lda #3 lda #3
ldx #0 ldx #0

View file

@ -12,13 +12,13 @@
Inn: Inn:
stx ARTH ! save bit number (lowbyte) stx ARTH ! save bit number (lowbyte)
sta ARTH+1 ! save bit number (highbyte) sta ARTH+1 ! save bit number (highbyte)
and #80h and #0x80
beq 1f beq 1f
lda #0 ! bit number is negative lda #0 ! bit number is negative
sta ARTH+2 ! make it zero sta ARTH+2 ! make it zero
beq 3f beq 3f
1: txa 1: txa
and #07h ! get bit number mod 8 and #0x07 ! get bit number mod 8
tax tax
lda #1 lda #1
cpx #0 ! bit number = 0 cpx #0 ! bit number = 0

View file

@ -39,7 +39,7 @@ Mul:
sta ARTH+6 sta ARTH+6
sta ARTH+7 ! clear accumulator sta ARTH+7 ! clear accumulator
ldy #16 ldy #16
1: lda #1h 1: lda #0x01
bit ARTH bit ARTH
beq 2f ! multiplying by zero: no addition beq 2f ! multiplying by zero: no addition
clc clc
@ -59,11 +59,11 @@ Mul:
beq 3f ! unsigned multiply: so no shift in of signbit beq 3f ! unsigned multiply: so no shift in of signbit
lda ARTH+3 lda ARTH+3
bpl 3f bpl 3f
lda #40h lda #0x40
bit ARTH+7 bit ARTH+7
beq 3f beq 3f
lda ARTH+7 lda ARTH+7
ora #80h ora #0x80
sta ARTH+7 sta ARTH+7
3: dey 3: dey
bne 1b bne 1b

View file

@ -21,7 +21,7 @@ Mul4:
sta ARTH+14 sta ARTH+14
sta ARTH+15 ! clear accumulator sta ARTH+15 ! clear accumulator
ldy #32 ldy #32
1: lda #1h 1: lda #0x01
bit ARTH bit ARTH
beq 2f ! multiplying by zero: no addition beq 2f ! multiplying by zero: no addition
clc clc
@ -53,11 +53,11 @@ Mul4:
beq 3f ! it's unsigned: so no shift in of signbit beq 3f ! it's unsigned: so no shift in of signbit
lda ARTH+7 lda ARTH+7
bpl 3f bpl 3f
lda #40h lda #0x40
bit ARTH+15 bit ARTH+15
beq 3f beq 3f
lda ARTH+15 lda ARTH+15
ora #80h ora #0x80
sta ARTH+15 sta ARTH+15
3: dey 3: dey
bne 1b bne 1b

View file

@ -10,10 +10,10 @@
Ngi2: Ngi2:
eor #0FFh ! one's complement A eor #0x0FF ! one's complement A
tay tay
txa txa
eor #0FFh ! one's complement X eor #0x0FF ! one's complement X
tax tax
inx ! increment X inx ! increment X
bne 1f bne 1f

View file

@ -14,11 +14,11 @@ Ngi4:
stx ADDR stx ADDR
ldy #3 ldy #3
1: lda (ADDR),y 1: lda (ADDR),y
eor #0FFh ! one's complement lowbyte+y eor #0x0FF ! one's complement lowbyte+y
sta (ADDR),y sta (ADDR),y
dey dey
bpl 1b bpl 1b
ldx #0FDh ldx #0x0FD
iny iny
clc clc
lda (ADDR),y lda (ADDR),y

View file

@ -19,13 +19,13 @@ Printhex:
lsr a ! get four high bits lsr a ! get four high bits
jsr 1f jsr 1f
pla ! restore A pla ! restore A
and #0Fh ! get four low bits and #0x0F ! get four low bits
jsr 1f jsr 1f
rts rts
1: sed ! print in hex 1: sed ! print in hex
clc clc
adc #90h adc #0x90
adc #40h adc #0x40
cld cld
jmp WRCH jmp WRCH

View file

@ -21,7 +21,7 @@ Ror:
ror a ! rotate highbyte ror a ! rotate highbyte
ror Ytmp ! rotate lowbyte ror Ytmp ! rotate lowbyte
bcc 1f ! no carry bcc 1f ! no carry
ora #80h ! put carry in leftmost bit ora #0x80 ! put carry in leftmost bit
1: dey 1: dey
bne 2b bne 2b
ldx Ytmp ! get lowbyte ldx Ytmp ! get lowbyte

View file

@ -25,7 +25,7 @@ Ror4:
ror ARTH+1 ror ARTH+1
ror ARTH ror ARTH
bcc 1f ! no carry bcc 1f ! no carry
lda #80h ! put carry in leftmost bit lda #0x80 ! put carry in leftmost bit
ora ARTH+3 ora ARTH+3
sta ARTH+3 sta ARTH+3
1: dey 1: dey

View file

@ -15,7 +15,7 @@ Set:
sta ARTH+1 ! save bitnumber (highbyte) sta ARTH+1 ! save bitnumber (highbyte)
jsr Zer ! create n zerobytes jsr Zer ! create n zerobytes
lda ARTH lda ARTH
and #07h ! n mod 8 (bitnumber in byte) and #0x07 ! n mod 8 (bitnumber in byte)
tax tax
lda #1 lda #1
cpx #0 cpx #0