libem_s.a
-adi.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
asp.s
cii.s
-cmi.s
-cmi4.s
cms.s
cmu.s
-cmu4.s
com.s
csa.s
csb.s
dup.s
-dvi.s
-dvi4.s
dvu.s
-dvu4.s
exg.s
exg2.s
gto.s
indir.s
inn.s
ior.s
-lar.s
lcs.s
-loi.s
-loi1.s
-loil.s
-lol.s
-los.s
lxa1.s
lxa2.s
lxl.s
-mli4.s
-mlu.s
-mlu4.s
-mon.s
-mul4.s
-ngi4.s
-printstack.s
-printhex.s
pro.s
read.s
-ret.s
-rmi.s
-rmi4.s
-div4.s
-rmu.s
-rmu4.s
-duv4.s
rol.s
rol4.s
ror.s
ror4.s
-rtt.s
-sar.s
-mli.s
-ngi.s
-sbi4.s
-addsub.s
-sdl.s
-set.s
sli.s
sli4.s
sri.s
sri4.s
-sti.s
-sti1.s
-stil.s
-blm.s
-stl.s
-sts.s
teq.s
-test2.s
-testFFh.s
tge.s
tgt.s
tle.s
tlt.s
tne.s
-dum_float.s
-trap.s
-ldi.s
-print.s
-write.s
xor.s
-zer.s
-zri.s
-locaddr.s
-data.s
-aar.s
-sbi.s
sta ADDR+3 ! address of first operand (highbyte)
sta SP+1
ldy #0
- ldx #0FCh ! do it 4 times
+ ldx #0x0FC ! do it 4 times
rts
lda #0 ! no sign extension here
tax
beq 2f
- 1: lda #0FFh ! sign extension here
+ 1: lda #0x0FF ! sign extension here
tax
2: jsr Push ! push twobyte integer
pla
Cmi:
jsr Sbi2 ! subtract operands (T - S)
bpl 1f ! S >= T
- lda #0FFh ! S < T
+ lda #0x0FF ! S < T
tax ! AX becomes -1
rts
1: beq 2f
jsr Pop ! get result (lowbyte+2, lowbyte+3)
tay ! test lowbyte+3
bpl 1f ! S >= T
- lda #0FFh ! S < T
+ lda #0x0FF ! S < T
tax ! AX becomes -1
rts
1: cmp #0 ! test lowbyte+3 on zero
4: lda #0 ! S > T
ldx #1
rts
- 1: lda #0FFh ! S < T
+ 1: lda #0xFF ! S < T
tax
rts
2: cpx EXG
2: lda #0 ! S > T
ldx #1
rts
- 3: lda #0FFh ! S < T
+ 3: lda #0x0FF ! S < T
tax
rts
sta ADDR ! address (lowbyte) of first byte
1: dey
lda (ADDR),y
- eor #0FFh ! one complement
+ eor #0x0FF ! one complement
sta (ADDR),y
tya
bne 1b ! do it n times
! The next three definitions are special for the
! BBC microcomputer
-WRCH = 0FFEEh ! This subroutine writes the character in
+WRCH = 0x0FFEE ! This subroutine writes the character in
! 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
-OSBYTE = 0FFF4h ! This subroutine performs miscelaneous
+OSBYTE = 0x0FFF4 ! This subroutine performs miscelaneous
! operating system calls
F_DUM = 0 ! Dummy floating point constant
Ebadmon = 25
Ebadlin = 26
Ebadgto = 27
-MON = 78D0h
+MON = 0x78D0
BASE = 240 ! This is the offset from the localbase
! for the second localbase
-STACKTh = 78h ! This is the top of the stack
-STACKTl = 0D0h
+STACKTh = 0x78 ! This is the top of the stack
+STACKTl = 0x0D0
! Some zeropage declarations
RESERVED: .space 112 ! used by the operating system
.sect .text
-.base 0E02h ! where to start in the BBC micro
+.base 0x0E02 ! where to start in the BBC micro
! GENERAL PURPOSE ROUTINES
start:
jsr Push ! push argc
jsr _m_a_i_n ! start the real program
- lda #0FFh
+ lda #0x0FF
jsr WRCH ! send end of program to R423
lda #3
ldx #0
Inn:
stx ARTH ! save bit number (lowbyte)
sta ARTH+1 ! save bit number (highbyte)
- and #80h
+ and #0x80
beq 1f
lda #0 ! bit number is negative
sta ARTH+2 ! make it zero
beq 3f
1: txa
- and #07h ! get bit number mod 8
+ and #0x07 ! get bit number mod 8
tax
lda #1
cpx #0 ! bit number = 0
sta ARTH+6
sta ARTH+7 ! clear accumulator
ldy #16
- 1: lda #1h
+ 1: lda #0x01
bit ARTH
beq 2f ! multiplying by zero: no addition
clc
beq 3f ! unsigned multiply: so no shift in of signbit
lda ARTH+3
bpl 3f
- lda #40h
+ lda #0x40
bit ARTH+7
beq 3f
lda ARTH+7
- ora #80h
+ ora #0x80
sta ARTH+7
3: dey
bne 1b
sta ARTH+14
sta ARTH+15 ! clear accumulator
ldy #32
- 1: lda #1h
+ 1: lda #0x01
bit ARTH
beq 2f ! multiplying by zero: no addition
clc
beq 3f ! it's unsigned: so no shift in of signbit
lda ARTH+7
bpl 3f
- lda #40h
+ lda #0x40
bit ARTH+15
beq 3f
lda ARTH+15
- ora #80h
+ ora #0x80
sta ARTH+15
3: dey
bne 1b
Ngi2:
- eor #0FFh ! one's complement A
+ eor #0x0FF ! one's complement A
tay
txa
- eor #0FFh ! one's complement X
+ eor #0x0FF ! one's complement X
tax
inx ! increment X
bne 1f
stx ADDR
ldy #3
1: lda (ADDR),y
- eor #0FFh ! one's complement lowbyte+y
+ eor #0x0FF ! one's complement lowbyte+y
sta (ADDR),y
dey
bpl 1b
- ldx #0FDh
+ ldx #0x0FD
iny
clc
lda (ADDR),y
lsr a ! get four high bits
jsr 1f
pla ! restore A
- and #0Fh ! get four low bits
+ and #0x0F ! get four low bits
jsr 1f
rts
1: sed ! print in hex
clc
- adc #90h
- adc #40h
+ adc #0x90
+ adc #0x40
cld
jmp WRCH
ror a ! rotate highbyte
ror Ytmp ! rotate lowbyte
bcc 1f ! no carry
- ora #80h ! put carry in leftmost bit
+ ora #0x80 ! put carry in leftmost bit
1: dey
bne 2b
ldx Ytmp ! get lowbyte
ror ARTH+1
ror ARTH
bcc 1f ! no carry
- lda #80h ! put carry in leftmost bit
+ lda #0x80 ! put carry in leftmost bit
ora ARTH+3
sta ARTH+3
1: dey
sta ARTH+1 ! save bitnumber (highbyte)
jsr Zer ! create n zerobytes
lda ARTH
- and #07h ! n mod 8 (bitnumber in byte)
+ and #0x07 ! n mod 8 (bitnumber in byte)
tax
lda #1
cpx #0