what uC do you prefer?

It was a lot of fun to do. I got started in actually trying my hand at thoroughly examining and modifying an existing BASIC interpreter that resided on an HP 2000F timesharing system, modifying the system to support time-shared assembly. Doing the assembler deepened some parsing concepts in me and taught me more about writing symbolic linkers (since I needed to write that, as well.) This was 1975. I believe I first read about PL/M in about 1977, from some Intel doc (I'd gotten interested in Intel, because I built an Altair 8800 from the kit.) I'd also been reading Wirth's 1976 book, Algorithms+Data Structures=Programs, where he talks about a very simple PL/0 example. I'd also secured and read fairly thoroughly, Aho and Ullman's 'Dragon Book,' actually named Principles of Compiler Design, probably in 1978. (I also bought the second edition when it came out in 1986 and still have that one on my shelf here.) I didn't get around to writing something close to PL/M, though, until some years later -- would have been early 1980's. And it wasn't for commercial use, it was more to 'complete the circle' of interest I had at the time in just learning about compiler development. I also wrote a toy c compiler around this time, as well. But I'm not, nor have I ever been, a trained professional compiler developer. I just enjoy knowing a little something about how they work inside.

Jon

Reply to
Jonathan Kirwan
Loading thread data ...

I think TI calls it RISC because it's not microcoded and executes single-word instructions in one clock. That seems fair to me, and it is very fast.

They do play some games to create addressing modes... it took me a while to figure it out, and was a bit miffed at the tricks. But it still looks like a good chip for a low-power, small, fast embedded thing. We're thinking about doing some 430-based solid-state relays maybe.

Motorola's 68K is another PDP-11 derivative, and they made the same decision to break the beautiful src/dst addressing symmetry in favor of a much bigger instruction set and 8/16/32/sometimes 64-bit ops. The only unrestricted 68K opcode is MOVE, where anything goes. Most dual-operand instructions allow only a register as the destination. They also added "immediate" instructions, like ADDI, so they could have general addressing on destinations. Still, it's light-years more elegant than an Intel or PIC architecture.

Coldfire is a RISC implementation of the very CISC, microcode-heavy

68K instruction set... no microcode, mostly single-clock execution, lots of gates!

I used to mentally assemble PDP-11 programs and toggle them in, the instruction set was that elegant. That's not likely on a 68K.

John

Reply to
John Larkin

I still like the idea of a usable front panel, with switches designed for human convenience. (None of those stupid metal bathandle things that were used on the Altair 8800 front panel, which caused callouses as though I were a heavy guitar player without a pick.) Some of the earlier PDP-11 systems included a great front panel. I also liked the HP 2116 front panel, as well -- lights inside the buttons, so that when you pressed the button the light inside it would either go on or off to indicate toggling the bit.

I also used to use an AM radio placed nearby to "hear" my programs. I learned to "understand" the sound of certain routines operating and could very easily detect a "crash."

Jon

Reply to
Jonathan Kirwan

It sounded like 'heavy metal'?

--
Service to my country? Been there, Done that, and I\'ve got my DD214 to
prove it.
Member of DAV #85.

Michael A. Terrell
Central Florida
Reply to
Michael A. Terrell

All this reminded me... I don't have a copy of "The Design of an Optimizing Compiler." It's a smallish book on the BLISS compiler, circa 1975. If anyone has a copy they want to sell off....

Jon

Reply to
Jonathan Kirwan

I agree 100%. If you can afford a professional C environment for PIC, that might make a difference, but the freely available PIC C compiler (SDCC) is crap. Being able to develop for AVR with a real toolchain is very nice.

Also, if you're cheap, it's much easier to build a simple AVR programmer than a simple PIC programmer.

Well, 32 registers instead of 1, real memory addressing modes, no banking, better access to the code space for data, ... One cycle per clock (not

1 per 4 clocks), almost all peripherals can operate on the input clock instead of only Fc/4. As far as available integrated peripherals, you may not find an advantage. I think PIC took an early lead in that area, and along with the 16F74 won the hobbiest market.
--
Ben Jackson AD7GD

http://www.ben.com/
Reply to
Ben Jackson

Quite right too - for the tiny devices with e.g. a stack dept of 8, I don't see how any HLL could be made to work properly.

You might be into this already? But a good plan is to build up a libraries of routines as macros. Then you can declare them in *any* order at the start (forward references are allowed - because they are not compiled).

Then insert them, as required, in your main code.

E.g.

; start of file called e.g. macro_library ;************************************************************************

; bulk left rotate

  • *

;********************

*

; Rotate 65 bits of table + C to the left. *

; The carry enters the lsb of table[0]. *

; table[7] outputs its msb into the carry. *

; *

; Entry: M......L M......L table[7] prepare C for rr into msb of table[7] *

; *

; Exit LM...... -->C table[0] C contains lsb that was in table[0] *

; LM...... *

; LM...... *

; LM...... *

; LM...... *

; LM...... *

; LM...... *

; CM...... table[7] *

;************************************************************************

blk_rr_tbl macro s ;bulk right rotate 65 bits, one bit

bk_rr_tbl s

; return

endm

bk_rr_tbl macro s

local bk_rr_tbl_10

bnk_tbl_end s

bk_rr_tbl_10

rrf INDF,f ;rotate C into msb-end from highest byte

decf FSR,f ;move down the table

skif_b3_changes s

goto bk_rr_tbl_10

endm

bnk_tbl_end macro s ;point FSR at table end

movlw (s + D'7')

movwf FSR

endm

;************************************************************************

; End of bulk right rotate *

;************************************************************************

;************************************************************************

; compare table macro

  • *

;**********************

*

; Compare one eight byte table with another 8 byte table. The tables *

; must lie on "MOD 8 boundaries" e.g. 0x40 or

0x48 * ; *

; Conditional assembly to ensure that the correct bxf and btfsx *

; instructions match the table's locations. *

; *

; Form: comp_tab(table[8],table[8]) *

; *

; Entry: bank_x == don't care *

; table == ((any_address MOD 8) ==

0) * ; *

; Exit: (table_x == table_y) ? Z == true : Z == false *

; bank_x == unaltered *

;************************************************************************

Compare_data macro s,d ;Compares 8 bytes of bank1 upper to lower

local compare_data_10

local compare_data_20

bnk_tbl_st s

compare_data_10

set_fsr_source

movf INDF,w ;get source

set_fsr_dest

subwf INDF,w ;compare

btfss STATUS,stat_Z_bit ;skif zero

goto compare_data_20 ;Exit, compare failed with Z=0

incf FSR,f

skif_b3_changes d

goto compare_data_10 ;

clrw ;set Z

compare_data_20

return

endm

;************************************************************************

; End of copare tables *

;************************************************************************

;************************************************************************

; copy table

  • *

;*************

*

; Copy one eight byte table to another 8 byte table. The tables must lie*

; on "MOD 8 boundaries" e.g. 0x40 or

0x48 * ; *

; Conditional assembly to ensure that the correct bxf and btfsx *

; instructions match the table's locations. *

; *

; Form: copy_tab(source, destination) *

; *

; Entry: bank_x == don't care *

; source == ((any_address MOD 8) ==

0) *

; destination == ((any_address MOD 8) ==

0) * ; *

; Exit: destination[7,0] == source[7,0] *

; bank_x == unaltered *

;************************************************************************

copy_tab macro s,d

local copy_tab_10

bnk_tbl_st s

copy_tab_10

set_fsr_source

movf INDF,w ;get source

set_fsr_dest

movwf INDF ;put destination

incf FSR,f

skif_b3_changes d

goto copy_tab_10

; return

endm

;************************************************************************

; End of copy_tab macro *

;************************************************************************

;************************************************************************

; clear table

  • *

;**************

*

; Clear eight byte table. The tables must lie on "MOD 8 boundaries" *

; e.g. 0x40 or

0x48 * ; *

; Conditional assembly to ensure that the correct bxf and btfsx *

; instructions match the table's locations. *

; *

; Form: clr_tab(source) *

; *

; Entry: bank_x == don't care *

; source == ((any_address MOD 8) ==

0) * ; *

; Exit: source[7,0] ==

0 *

; bank_x == unaltered *

;************************************************************************

clr_tab macro s

local clr_tab_10

bnk_tbl_st s

clr_tab_10

clrf INDF

incf FSR,f

skif_b3_changes s

goto clr_tab_10

return

endm

;************************************************************************

; End of clr_tab macro *

;************************************************************************

set_fsr_source macro

if((d & H'40') < (s & H'40')) ;

bsf FSR,6 ;

endif ;

if((d & H'20') < (s & H'20')) ;

bsf FSR,5 ;

endif ;

if((d & H'10') < (s & H'10')) ;

bsf FSR,4 ;

endif ;

if((d & H'08') < (s & H'08')) ;

bsf FSR,3 ;

endif ;

if((d & H'40') > (s & H'40')) ;

bcf FSR,6 ;

endif ;

if((d & H'20') > (s & H'20')) ;

bcf FSR,5 ;

endif ;

if((d & H'10') > (s & H'10')) ;

bcf FSR,4 ;

endif ;

if((d & H'08') > (s & H'08')) ;

bcf FSR,3 ;

endif ;

endm

set_fsr_dest macro

if((d & H'40') < (s & H'40')) ;

bcf FSR,6 ;

endif ;

if((d & H'20') < (s & H'20')) ;

bcf FSR,5 ;

endif ;

if((d & H'10') < (s & H'10')) ;

bcf FSR,4 ;

endif ;

if((d & H'08') < (s & H'08')) ;

bcf FSR,3 ;

endif ;

if((d & H'40') > (s & H'40')) ;

bsf FSR,6 ;

endif ;

if((d & H'20') > (s & H'20')) ;

bsf FSR,5 ;

endif ;

if((d & H'10') > (s & H'10')) ;

bsf FSR,4 ;

endif ;

if((d & H'08') > (s & H'08')) ;

bsf FSR,3 ;

endif ;

endm

skif_b3_changes macro t ;Insert apt btfsx instruction to suit parameter

if(D'8' & t) ;

btfsc FSR,3 ;if(bit 3) then insert this

else ;

btfss FSR,3 ;if(!bit 3) then insert this

endif

endm

;************************************************************************

; jumper: goto(here + offset_in_W)

  • *

;***********************************

*

; Computed goto (see AN556). *

; *

; Expects: W == offset *

; jumptable == concatenated to this macro *

; *

; Uses: temp *

;************************************************************************

jumper macro

local jumper_10

local jumptable

movwf temp

movlw LOW jumper_10

addwf temp,w

movlw HIGH jumper_10

btfsc STATUS,stat_C_bit

addlw D'1'

movwf PCLATH

movf temp,w

jumper_10

addwf PCL,f

jumptable ; jump table starts here.

endm

;************************************************************************

; End of jumper *

;************************************************************************

;************************************************************************

; End of macro library *

;************************************************************************

; end of file called e.g. macro_library

Cheers Robin

Reply to
Robin

All this reminded me... I don't have a copy of "The Design of an Optimizing Compiler." It's a smallish book on the BLISS compiler, circa 1975. If anyone has a copy they want to sell off....

Jon

You can get it used for $39.00. Too expensive?

formatting link

Allen

Reply to
Allen Bong

I asked this same question and received these many good replies:

--
John English
Reply to
John E.

No, but marked up, I think. (Yes, I'd already checked amazon and read something on that one about 'highlighting.' I'm looking for something that is in fine or better condition. If you look over the list at Amazon you will see the price is a bit higher by the time you see some comments that clearly note at least the idea of 'clean pages.') I also checked powells, which is a local outlet for me, and they don't have any at all.

And partly, I'm curious also about who exactly here might actually have a copy, as well. So there were two birds to strike in this comment, not just one.

Jon

Reply to
Jonathan Kirwan

All of my favorites are obsolete now, but I have to admit there wasn't all that much difference. I've done 8051, Z80, 68HC11, and 80186 professionally, and they all have their good points and less good points. ;-) For hobby stuff, I really liked the 6502, at least for its app as a keyboard scanner. ;-)

Oh, yeah, I once made a FIFO with an 8748.

But I've looked at PIC, and I wouldn't spec one even if I were under duress: Bank switching is Evil.

Cheers! Rich

Reply to
Rich Grise

Presumably, for reasons that aren't comprehensible to the unintelligent. ;-)

Hope This Helps! Rich

Reply to
Rich Grise

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.