6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Sun Sep 22, 2024 12:36 pm

All times are UTC




Post new topic Reply to topic  [ 12 posts ] 
Author Message
 Post subject: Small (Dis)Assembler
PostPosted: Sat Sep 05, 2015 8:28 pm 
Offline

Joined: Mon Mar 25, 2013 9:26 pm
Posts: 183
Location: Germany
Hello everybody,

today my little project MOUSE made a big step forward to be a real computer. While waiting for the PCB I've ordered, I spent some hours writing code for the current breadboard version. I have now a tiny monitor program that is able to dump memory, jump to a specific address, soft-reset the computer and input a stream of hex values to a given address. Today I took the time to adjusted the code from the (VTL-2 language) to my layout. MOUSE. Programs can be send to the computer via serial connection (just copy paste the VTL code to the terminal that takes care to wait a few ms between the single characters).
All the current code fits in 2k of the 8k EEPROM I have installed. Now I'm looking for a simple assembler/disassembler that may take the rest of the EEPROM to have a second language to work with.

I found the 2KSA as a PDF but it would be hard to type in the complete code. Has anybody a small 65C02 (or 6502) dis-/assembler that can adopted to use simple getchr and putchr routines that I can use?

Mario.

_________________
How should I know what I think, until I hear what I've said.


Top
 Profile  
Reply with quote  
 Post subject: Re: Small (Dis)Assembler
PostPosted: Sun Sep 06, 2015 3:21 am 
Offline
User avatar

Joined: Fri Aug 30, 2002 9:02 pm
Posts: 1738
Location: Sacramento, CA
My SBC-2's OS fit in about 6k and included Apple ][ -like monitor, including disassembler and mini -assembler.

The source is located here: http://sbc.rictor.org/sbcos.html

It includes EhBASIC, which puts it over 8k, but that can be removed easily. If you are interested, I can help with any integration issues that you encounter.

Daryl

_________________
Please visit my website -> https://sbc.rictor.org/


Top
 Profile  
Reply with quote  
 Post subject: Re: Small (Dis)Assembler
PostPosted: Sun Sep 06, 2015 3:56 am 
Offline
User avatar

Joined: Sun Jun 30, 2013 10:26 pm
Posts: 1948
Location: Sacramento, CA, USA
Well done, Mario! It's nice to hear about VTL02 being put to good use, although I still haven't quite figured out why the German members here seem to like it more than the rest ;-)

A while back, a certain Mr. Wozniak wrote a dis-assembler (<500 bytes code and data), and a mini (no symbolic labels) assembler (<320 bytes of additional code when paired with the dis-assembler). You can find an OCR version here:

ftp://ftp.apple.asimov.net/pub/apple_II ... 20Info.pdf

Woz writes some tasty spaghetti code. SWEET 16 is there too, for an additional <375 bytes.

You still have enough ROM space left for a stripped-down (but easily expandable into RAM at cold start) Forth kernel, if you so desire.

How much RAM are you running now?

Mike B.


Top
 Profile  
Reply with quote  
 Post subject: Re: Small (Dis)Assembler
PostPosted: Sun Sep 06, 2015 5:56 am 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10938
Location: England
(Thanks for that PDF Mike, it contains several substantial pieces of 6502 software, both source and documentation:
Contents
* Apple II ROM (12 KB binary)
* Memory map of the Apple II ROMs
* Summary of Monitor Commands
* Red Book Monitor listing
* Red Book Sweet-16 listing
* WOZPAK Sweet-16 article by Steve Wozniak
* WOZPAK Sweet-16 article by Dick Sedgewick
* Red Book Mini-Assembler listing
* Red Book Floating point listing
* WOZPAK Floating point routines description
* DDJ Floating point article
* IA Floating point article
* SYM Monitor listing
* AIM Monitor listing
* AIM BASIC Language Reference Manual
)


Top
 Profile  
Reply with quote  
 Post subject: Re: Small (Dis)Assembler
PostPosted: Sun Sep 06, 2015 8:31 am 
Offline

Joined: Mon Mar 25, 2013 9:26 pm
Posts: 183
Location: Germany
Thanks for the reply.

@Mike: My first computer should have been a Z1013 what is a kind of small computer kit sold in the 80s in east Germany based on a U880 (Z80 clone). But as well as for a car you had to wait a long time for it. I ordered one for me but I never got it. There were also some homebrew receipts for tiny computers like this one : Ju+Te Computer also based in Z80 technology but with built in TINY BASIC (U883). Using VTL2 is like traveling back in time for me, because writing small programs in VTL is quite near to how using these old computer kits should have been.
Beside the fact, that having a higher language built in 1k of ROM is a really cool feature. Played the tic-tac-toe example over and over again with my self made piece of hardware. Even watching the thing calculating big numbers with the factorial demo was fun :-). Yes I like that little language

@Daryl: I already downloaded your sbcos some time ago, but I did not remember that. I added your uchess version to my "OS" after converting the code to ophis assembler syntax. I can start the game and reset it, but at a certain point it seems to branch to my VTL interpreter. The chess is located in my ROM, but I'm not sure if the game should be located in RAM.

I have 32k RAM from 0x0000 to 0x7fff. The 6850 ACIA (115.2k baud) is located at $C000 and my ROM starts at $E000.

Mario.

UPDATE: I found the bug, branching to VTL. I had to rename some labels but forgot one "MOVE" in chess.asm. That caused the jump into the VTL interpreter.

_________________
How should I know what I think, until I hear what I've said.


Top
 Profile  
Reply with quote  
 Post subject: Re: Small (Dis)Assembler
PostPosted: Sun Sep 06, 2015 4:44 pm 
Offline

Joined: Mon Mar 25, 2013 9:26 pm
Posts: 183
Location: Germany
It's alive: https://www.youtube.com/watch?v=Ih2gI3Gpod8

_________________
How should I know what I think, until I hear what I've said.


Top
 Profile  
Reply with quote  
 Post subject: Re: Small (Dis)Assembler
PostPosted: Sun Sep 06, 2015 5:02 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10938
Location: England
Bravo!


Top
 Profile  
Reply with quote  
 Post subject: Re: Small (Dis)Assembler
PostPosted: Sun Sep 06, 2015 6:16 pm 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8390
Location: Midwestern USA
mkl0815 wrote:

Hey! Works pretty good! :D

_________________
x86?  We ain't got no x86.  We don't NEED no stinking x86!


Top
 Profile  
Reply with quote  
 Post subject: Re: Small (Dis)Assembler
PostPosted: Mon Sep 07, 2015 5:12 am 
Offline

Joined: Mon Mar 25, 2013 9:26 pm
Posts: 183
Location: Germany
@Mike: If you have a small (4k) forth kernel it would like to test and integrate it to my current OS.

Mario.

_________________
How should I know what I think, until I hear what I've said.


Top
 Profile  
Reply with quote  
 Post subject: Re: Small (Dis)Assembler
PostPosted: Mon Sep 07, 2015 8:01 am 
Offline
User avatar

Joined: Sun Jun 30, 2013 10:26 pm
Posts: 1948
Location: Sacramento, CA, USA
The Apple ][ version of figForth weighs in at 6201 bytes, but less than half of that consists of primitives. I have never attempted it, but I believe that I have heard of systems that keep just enough Forth in ROM to allow a cold start to quickly compile the rest of the system into RAM from secondary storage. I'm certainly NOT a Forth expert, so I'll leave the rest of the discussion to others with far more knowledge of the possibilities, or lack there-of.

Mike B.


Top
 Profile  
Reply with quote  
 Post subject: Re: Small (Dis)Assembler
PostPosted: Mon Sep 07, 2015 2:23 pm 
Offline
User avatar

Joined: Wed Feb 13, 2013 1:38 pm
Posts: 588
Location: Michigan, USA
mkl0815 wrote:

Very nice, Mario...


Top
 Profile  
Reply with quote  
 Post subject: Re: Small (Dis)Assembler
PostPosted: Mon Sep 14, 2015 5:58 am 
Offline

Joined: Mon Mar 25, 2013 9:26 pm
Posts: 183
Location: Germany
I found a 65C02 disassembler on github and modified it to work with my preferred ophis assembler and with my I/O routines.
It is not memory optimizes, so it takes about 1.5k, but it works.

Code:
MOUSE 65C02 micro computer (c) 2015
M-OS V0.3
READY.
MOUSE MON V 0.3


>h OK
commands:
b - execute brk
c - start microchess
d <addr> - disassemble from address
f <addr>:<addr> %val - fill memory with %val
g <addr> - jump to <addr>
h - this help
i <addr> - input <addr> input data to memory '.' ends the input
m <addr> %cols %rows - dump memory from address
o <addr>:<addr> - output memory range
r - jump to reset vector
v - start VTL2 language
 <addr> - 16bit address, %xx - 8 bit value
>d e000 OK
e000   a9 15       LDA   #$15
e002   85 00       STA   $00
e004   a9 e2       LDA   #$e2
e006   85 01       STA   $01
e008   20 7e f3    JSR   $f37e
e00b   20 bd e1    JSR   $e1bd
e00e   20 b1 e1    JSR   $e1b1
e011   20 93 f3    JSR   $f393
e014   b0 fb       BCS   $e011
e016   c9 0d       CMP   #$0d
e018   f0 14       BEQ   $e02e
e01a   c9 0a       CMP   #$0a
e01c   f0 10       BEQ   $e02e
e01e   20 8f f3    JSR   $f38f
e021   a6 0f       LDX   $0f
e023   95 10       STA   $10,X
e025   e8          INX
e026   86 0f       STX   $0f
e028   e0 20       CPX   #$20
e02a   f0 02       BEQ   $e02e
e02c   80 e3       BRA   $e011
e02e   a2 00       LDX   #$00
e030   b5 10       LDA   $10,X

_________________
How should I know what I think, until I hear what I've said.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 12 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 56 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: