Skip to content

Commit

Permalink
Fix ram bug.
Browse files Browse the repository at this point in the history
Move to serial console and second serial port for upload ready for VGA dev..
Get basic working over serial.
  • Loading branch information
mepearce committed Aug 15, 2020
1 parent 04b6f44 commit 136988a
Show file tree
Hide file tree
Showing 78 changed files with 10,640 additions and 32,950 deletions.
308 changes: 50 additions & 258 deletions main_tb_behav.wcfg

Large diffs are not rendered by default.

18,236 changes: 9,117 additions & 9,119 deletions roms/ehbasic/basic68k.L68

Large diffs are not rendered by default.

493 changes: 246 additions & 247 deletions roms/ehbasic/basic68k.S68

Large diffs are not rendered by default.

37 changes: 20 additions & 17 deletions roms/ehbasic/basic68k.X68
Original file line number Diff line number Diff line change
Expand Up @@ -70,50 +70,53 @@ nobrk EQU 0 * null response to INPUT causes a break
* RAM offset definitions

* Use this value to run out of ROM
* ORG $A00000
* ORG $00C000 * past the vectors in a real system
* Use this value to run out of RAM
ORG $000800 * past the vectors in a real system

* Use these two lines when running from ROM
*ram_addr EQU $02000 * RAM start address
*ram_size EQU $06000 * RAM size
prg_strt

* Use these two lines when running from RAM
ram_addr EQU $04000 * RAM start address
ram_size EQU $04000 * RAM size

ACIAC EQU $F00009
ACIAD EQU ACIAC+2
RDRF EQU 0 ; ACIAC Receive Data Register Full
TDRE EQU 1 ; ACIAC Transmit Data Register Empty


BRA code_start * For convenience, so you can start from first address

*************************************************************************************
*
* the following code is simulator specific, change to suit your system

* output character to the console from register d0.b


VEC_OUT
;MOVEM.L A0/D1,-(A7) * Save working registers
BTST.B #TDRE,ACIAC.L
BEQ.S VEC_OUT
MOVE.B D0,ACIAD.L
;MOVEM.L (A7)+,A0/D1 * Restore working registers
RTS


*************************************************************************************
*
* input a character from the console into register d0
* else return Cb=0 if there's no character available
* else return Cb=0 if theres no character available


VEC_IN
; MOVEM.L A0/D1,-(A7) * Save working registers
BTST.B #RDRF,ACIAC.L
BEQ.S RXNOTREADY
MOVE.B ACIAD.L,D0
; MOVEM.L (A7)+,A0/D1 * Restore working registers
ORI.b #1,CCR * Set the carry, flag we got a byte
RTS * Return
RXNOTREADY
;MOVEM.L (A7)+,A0/D1 * Restore working registers
ANDI.b #$FE,CCR * Clear the carry, flag character available
RTS
RTS

*************************************************************************************
*
Expand All @@ -136,7 +139,7 @@ VEC_SV
* turn off simulator key echo

code_start

* Set up ACIA parameters
LEA.L ACIAC,A0 * A0 points to console ACIA
MOVE.B #$15,(A0) * Set up ACIA1 constants (no IRQ,
* RTS* low, 8 bit, no parity, 1 stop)
Expand Down Expand Up @@ -181,7 +184,7 @@ LAB_sizok
MOVEA.l a0,a3 * copy RAM base to a3
ADDA.l d0,a0 * a0 is top of RAM
MOVE.l a0,Ememl(a3) * set end of mem
LEA ram_base(a3),sp * set stack to RAM start + 1k * set stack to RAM start + 1k
LEA ram_base(a3),sp * set stack to RAM start + 1k

MOVE.w #$4EF9,d0 * JMP opcode
MOVEA.l sp,a0 * point to start of vector table
Expand Down Expand Up @@ -313,7 +316,7 @@ LAB_UVER
ADD.l d0,d0 * .......$ .......& ........ .......0
SWAP d0 * ........ .......0 .......$ .......&
ROR.b #1,d0 * ........ .......0 .......$ &.......
LSR.w #1,d0 * ........ .......0 0....... $&.....­.
LSR.w #1,d0 * ........ .......0 0....... $&.....?.
AND.b #$C0,d0 * mask the type bits
MOVE.b d0,Dtypef(a3) * save the data type

Expand Down Expand Up @@ -970,7 +973,7 @@ LAB_1491
LEA des_sk(a3),a4 * reset descriptor stack pointer

MOVE.l (sp)+,d0 * pull return address
LEA ram_base(a3),sp * set stack to RAM start + 1k* set stack to RAM start + 1k, flush stack
LEA ram_base(a3),sp * set stack to RAM start + 1k, flush stack
MOVE.l d0,-(sp) * restore return address

MOVEQ #0,d0 * clear longword
Expand Down Expand Up @@ -3332,7 +3335,7 @@ LAB_1DD7
ADD.l d1,d1 * .......$ .......& ........ .......0
SWAP d1 * ........ .......0 .......$ .......&
ROR.b #1,d1 * ........ .......0 .......$ &.......
LSR.w #1,d1 * ........ .......0 0....... $&.....­.
LSR.w #1,d1 * ........ .......0 0....... $&.....?.
AND.b #$C0,d1 * mask the type bits
MOVE.b d1,Dtypef(a3) * save the data type

Expand Down Expand Up @@ -8996,7 +8999,7 @@ LAB_RMSG
dc.b $0D,$0A,'Ready',$0D,$0A,$00
LAB_SMSG
dc.b ' Bytes free',$0D,$0A,$0A
dc.b 'Matt Pearce Enhanced 68k BASIC Version 3.52',$0D,$0A,$00
dc.b 'Enhanced 68k BASIC Version 3.52',$0D,$0A,$00


*************************************************************************************
Expand Down
514 changes: 0 additions & 514 deletions roms/ehbasic/basic68k.hex

This file was deleted.

13 changes: 2 additions & 11 deletions roms/ehbasic/basic68k.inc
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@

* This lot is in RAM

ORG 100 * start of RAM
ORG 0 * start of RAM

ram_strt ds.l $300 * allow 1K for the stack, this should be plenty
ram_strt ds.l $100 * allow 1K for the stack, this should be plenty
* for any BASIC program that doesn't do something
* silly, it could even be much less.
ram_base
Expand Down Expand Up @@ -195,12 +195,3 @@ file_id ds.l 1 * load/save file ID

even * dummy even value and zero pad byte

prg_strt

* Use these two lines when running from ROM
*ram_addr EQU $01000 * RAM start address
*ram_size EQU $06000 * RAM size

* Use these two lines when running from RAM
ram_addr EQU $04000 * RAM start address
ram_size EQU $04000 * RAM size
Loading

0 comments on commit 136988a

Please sign in to comment.