New patches: [unrevert anonymous**20050608123244] < > { hunk ./host/view.f 8 standard names. ) ( host interpreter ) -: ' ; -: ! h! ; -: @ h@ ; -: [']_ [h']_ ; -: c@ hc@ ; -: c! hc! ; +\ : ' ; +\ : ! h! ; +\ : @ h@ ; +\ : [']_ [h']_ ; +\ : c@ hc@ ; +\ : c! hc! ; ( target interpreter ) hunk ./host/view.f 16 -: '# ; -: here# there ; +\ : '# ; +\ : here# there ; ( these will be redefined by monitor.f ) hunk ./host/view.f 20 -: @# t@ ; -: !# t! ; +\ : @# t@ ; +\ : !# t! ; hunk ./src/badnop.c 603 goto check; } + +// direct lookup. mainly for bootstrapping. +void *lookup_direct(char *name){ + lookup_init(); + switch(lookup_tick(name)){ + case MATCH(0,0,HOST): + return iword->address; + case -1: + strcpy(word, name); + error_abort("undefined word during bootstrap."); + default: + lookup_continue(); + } +} item_t *rlookup(void *x){ hunk ./src/badnop.c 807 /* xt cache */ void *xt_exit; -void *xt_mark; -void *xt_accept; -void *xt_interpret; -void *xt_quit; -void *xt_jmp; +//void *xt_mark; +//void *xt_accept; +//void *xt_interpret; +//void *xt_quit; +//void *xt_jmp; void *xt_lit; void *xt_bar; hunk ./src/badnop.c 880 PRIM("exit", exit); xt_exit = last_xt; PRIM("enter", enter); PRIM("skip", skip); - PRIM("jmp", jmp); xt_jmp = last_xt; + PRIM("jmp", jmp); //xt_jmp = last_xt; PRIM("donext", donext); PRIM("skipz", skipz); PRIM("jnz", jmpnz); hunk ./src/badnop.c 917 PRIM("seed", seed); /* words & dict */ - PRIM("accept", accept); PRIM("buffer", buffer); PRIM("load", load); PRIM("(load)", _load); hunk ./src/badnop.c 961 /* interpretation + compilation */ - PRIM("accept", accept); xt_accept = last_xt; + PRIM("accept", accept); //xt_accept = last_xt; PRIM("(number)", _host_number); hunk ./src/badnop.c 963 - PRIM("interpret", interpret); xt_interpret = last_xt; + PRIM("interpret", interpret); //xt_interpret = last_xt; PRIM(":", colon); PRIM("(:)", colon1); PRIM("enter_", enterbar); hunk ./src/badnop.c 976 PRIM("]", compilemode); PRIM("execute", execute); PRIM("abort", abort); - PRIM("quit", quit); xt_quit = last_xt; + PRIM("quit", quit); //xt_quit = last_xt; PRIM("bye", bye); PRIM("hempty", empty); hunk ./src/badnop.c 979 - PRIM("hmark", mark); xt_mark = last_xt; + PRIM("hmark", mark); //xt_mark = last_xt; PRIM("(", comment); PRIM("(,", comment); PRIM("(_", comment); hunk ./src/badnop.c 1019 VARIABLE("", 0); xt_vtpush = last_xt; - // words(); print_wordlist(); - // macros(); print_wordlist(); +#define COLON(name) PRIM(name, enter) +#define C(name) COMPILE(lookup_direct(name)) + /* THREADED BOOTSTRAP CODE */ hunk ./src/badnop.c 1023 - /* compile boot code */ - ip = (void ***)host_top; // we'll start here - COMPILE(xt_mark); - - /* compile interpreter loop */ + COLON("interpreter"); interpreter_start = (void ***)host_top; hunk ./src/badnop.c 1025 - COMPILE(xt_accept); - COMPILE(xt_interpret); - COMPILE(xt_jmp); + C("accept"); C("interpret"); C("jmp"); COMPILE(interpreter_start); hunk ./src/badnop.c 1027 + + COLON("toplevel"); + ip = (void ***)host_top; // we'll start here + C("hmark"); C("jmp"); C("interpreter"); /* install c code error handler and jump to boot code */ hunk ./src/badnop.c 1157 case ',': case '_': case '#': + case '%': PUSH_DS(word[i-1]); default: PUSH_DS(0); } Context: [usb remarks doelie@zzz.kotnet.org**20050608115232] [changed monitor token names, added single line forth style comment, added cdc.f doelie@zzz.kotnet.org**20050608010805] [mangling stuff doelie@zzz.kotnet.org**20050606153505] [monitor changes doelie@zzz.kotnet.org**20050606151844] [mangling doc changes doelie@zzz.kotnet.org**20050606151828] [kernel interpreter label name changes doelie@zzz.kotnet.org**20050606151724] [unified target interpret semantics + synth14 measurements + 12f629 config bits doelie@zzz.kotnet.org**20050602022952] [words/macros/completions distinction doelie@zzz.kotnet.org**20050601185548] [fix idea split doelie@zzz.kotnet.org**20050531230216] [interpreter rewrite idea doelie@zzz.kotnet.org**20050531155155] [added completions hack doelie@zzz.kotnet.org**20050531143201] [raw terminal input doelie@zzz.kotnet.org**20050528161815] [stamp.hex -> johannes doelie@zzz.kotnet.org**20050524215901] [synth cleanup doelie@zzz.kotnet.org**20050523093137] [synth forth cleanup. seems to be stable now. doelie@zzz.kotnet.org**20050520132343] [usb stuff + synth cleanup doelie@zzz.kotnet.org**20050520111458] [started adding usb hid example code doelie@zzz.kotnet.org**20050519211952] [synth transient mods doelie@zzz.kotnet.org**20050518165732] [synth cleanup + prepare for decent transient controller doelie@zzz.kotnet.org**20050518120148] [synth interactive upload working doelie@zzz.kotnet.org**20050515145952] [synth14 eeprom programming timing and reset doelie@zzz.kotnet.org**20050513142207] [synth14 eeprom programming doelie@zzz.kotnet.org**20050513115903] [some monitor/incremental fixes doelie@zzz.kotnet.org**20050513113227] [synth14 synth as task doelie@zzz.kotnet.org**20050512235143] [8bit wavetable, pwm TMR0 measurement, probably timing problems + idea to fix them doelie@zzz.kotnet.org**20050511021035] [synth14 forth interpreter changes doelie@zzz.kotnet.org**20050510185623] [synth14 forth interpreter doelie@zzz.kotnet.org**20050510144539] [misc cleanup and hidden features + synth14 int/ext sync doelie@zzz.kotnet.org**20050510005402] [synth14 isr thinking doelie@zzz.kotnet.org**20050509161412] [14 bit if then -> skip bugfix doelie@zzz.kotnet.org**20050509140410] [added software boot block protection doelie@zzz.kotnet.org**20050508005825] [PORT/LAT confusion fixed + jumptable indirect fetch for stc14 draft doelie@zzz.kotnet.org**20050507221734] [orig picstamp draft 2 image org protect doelie@zzz.kotnet.org**20050507162849] [draft 2 picstamp doelie@zzz.kotnet.org**20050507162522] [synth14 comm switched on + 14bit dasm bit ins bugfix doelie@zzz.kotnet.org**20050507095410] [synth14 with aux seems to work better with opti doelie@zzz.kotnet.org**20050507000801] [jump table seems to work doelie@zzz.kotnet.org**20050506232944] [safety commit before xt table doelie@zzz.kotnet.org**20050506223848] [14bit dasm doelie@zzz.kotnet.org**20050506220327] [synth clock + comm in doelie@zzz.kotnet.org**20050506184136] [small 18f interpreter/monitor changes + fixed bug in host/macro.f with order of target/macro mode ]L doelie@zzz.kotnet.org**20050506132941] [monitor simplification + patch interrupt/reset vectors doelie@zzz.kotnet.org**20050505161830] [dictionary items and name strings in main buffer doelie@zzz.kotnet.org**20050504194259] [simplified monitor to not use interrupts doelie@zzz.kotnet.org**20050504013648] [pre xt changes doelie@zzz.kotnet.org**20050503171757] [small macro changes + interpreter shrinking doelie@zzz.kotnet.org**20050502142928] [some stc16 fixes + opti doelie@zzz.kotnet.org**20050502121738] [indirect access bugfixes doelie@zzz.kotnet.org**20050429184054] [shuffling + fix doelie@zzz.kotnet.org**20050429013526] [interrupt hacks doelie@zzz.kotnet.org**20050429003808] [see works with forth dumps doelie@zzz.kotnet.org**20050428213232] [disassembler doelie@zzz.kotnet.org**20050428201834] [interactive/incremental code cleanup doelie@zzz.kotnet.org**20050428171207] [interactive/incremental code cleanup doelie@zzz.kotnet.org**20050428164422] [some code shuffling and interactive additions doelie@zzz.kotnet.org**20050427234917] [16bit dasm doelie@zzz.kotnet.org**20050427184314] [monitor fixes doelie@zzz.kotnet.org**20050427154549] [added autoincrement mode doelie@zzz.kotnet.org**20050427141705] [removed link mode doelie@zzz.kotnet.org**20050427132546] [incremental update doelie@zzz.kotnet.org**20050427042410] [flash program and erase working doelie@zzz.kotnet.org**20050427025012] [more target interaction stuff doelie@zzz.kotnet.org**20050427013608] [1 ms transmit delay for wisp passthrough doelie@zzz.kotnet.org**20050426230824] [more dictionary lookup cleaning doelie@zzz.kotnet.org**20050426204803] [command completion and word/macro list doelie@zzz.kotnet.org**20050426204604] [command completion and word/macro list doelie@zzz.kotnet.org**20050426204127] [badnop.c interpret mode fixes and monitor additions doelie@zzz.kotnet.org**20050426151505] [interactive @ ! working doelie@zzz.kotnet.org**20050426132241] [compiler cleanup doelie@zzz.kotnet.org**20050426124208] [serial comm to 18f working doelie@zzz.kotnet.org**20050426114141] [oops, comm still not working doelie@zzz.kotnet.org**20050426113320] [serial comm with 18f working (mon.f) doelie@zzz.kotnet.org**20050425040948] [cflags doelie@zzz.kotnet.org**20050424220956] [machine constant cleanups doelie@zzz.kotnet.org**20050424214328] [lookup rewrite seems to work ok doelie@zzz.kotnet.org**20050424211822] [first try lookup rewrite doelie@zzz.kotnet.org**20050424204432] [hspll doelie@zzz.kotnet.org**20050424174554] [18f programmer fix + test ok doelie@zzz.kotnet.org**20050424160448] [18f programmer doelie@zzz.kotnet.org**20050424143326] [moved wisp forth stuff to wisp/ doelie@zzz.kotnet.org**20050424121140] [added while..repeat and removed pass,handle doelie@zzz.kotnet.org**20050422010802] [optimizations: push/pop for calls, dup/drop, store doelie@zzz.kotnet.org**20050421232849] [t@ t! bugfixes doelie@zzz.kotnet.org**20050421174506] [target forth saving doelie@zzz.kotnet.org**20050421170804] [cleanups and fixes for prev record doelie@zzz.kotnet.org**20050421164203] [cleanups and fixes for prev record doelie@zzz.kotnet.org**20050421164146] [target buffer in forth doelie@zzz.kotnet.org**20050421154239] [hex writing in forth doelie@zzz.kotnet.org**20050421014741] [16f628 blink-a-led working: stc+wisp modifications doelie@zzz.kotnet.org**20050420013233] [14 bit target cleanup: prepare for 16f628 doelie@zzz.kotnet.org**20050419191327] [literal opti doelie@zzz.kotnet.org**20050419002853] [jump snapping doelie@zzz.kotnet.org**20050418223757] [some if-then opti doelie@zzz.kotnet.org**20050418205124] [stc14 code reorg doelie@zzz.kotnet.org**20050418150702] [fixed cell/cells bug in compiler.f doelie@zzz.kotnet.org**20050418144525] [synth mods doelie@zzz.kotnet.org**20050417214558] [synth beatbox more simplification doelie@zzz.kotnet.org**20050416121523] [synth beatbox simplification doelie@zzz.kotnet.org**20050415170241] [synth beatbox some beats doelie@zzz.kotnet.org**20050415031823] [synth beatbox working more doelie@zzz.kotnet.org**20050415020206] [synth beatbox working doelie@zzz.kotnet.org**20050414215356] [synth added noise generator doelie@zzz.kotnet.org**20050414192050] [VM synth cleanup doelie@zzz.kotnet.org**20050414181048] [note VM synth first sign of life doelie@zzz.kotnet.org**20050414160815] [still non-working note VM synth doelie@zzz.kotnet.org**20050414044126] [non-working note VM synth doelie@zzz.kotnet.org**20050414022200] [wisp support working doelie@zzz.kotnet.org**20050413032213] [wisp stuff doelie@zzz.kotnet.org**20050412220934] [misc changes doelie@zzz.kotnet.org**20050412172148] [synth updates doelie@zzz.kotnet.org**20050412000012] [synth updates doelie@zzz.kotnet.org**20050411235814] [synth updates doelie@zzz.kotnet.org**20050411235138] [fractional multiply for b synth doelie@zzz.kotnet.org**20050411211201] [alternative synth using timer1 + some fractional multiply stuff doelie@zzz.kotnet.org**20050411175021] [14 bit synth stuff doelie@zzz.kotnet.org**20050411012739] [synth updates doelie@zzz.kotnet.org**20050410054935] [shiny happy people doelie@zzz.kotnet.org**20050410053156] [14bit stuff + synth app doelie@zzz.kotnet.org**20050410035728] [14bit forth sequencer and other stuff doelie@zzz.kotnet.org**20050409214631] [variable bugfix, config bits, 14bit stuff + testapp doelie@zzz.kotnet.org**20050408200149] [added modified wisp doelie@zzz.kotnet.org**20050408162727] [14bit cpu minforth doelie@zzz.kotnet.org**20050408162519] [task ideas, bit shifter and file renames doelie@zzz.kotnet.org**20050407212218] [dtc back online + moved stuff around doelie@zzz.kotnet.org**20050407190040] [14bit pic thoughts doelie@zzz.kotnet.org**20050407132730] [looping constructs + opti + task ideas doelie@zzz.kotnet.org**20050406223635] [flash programming + for..next opti doelie@zzz.kotnet.org**20050406202313] [macro mode doelie@zzz.kotnet.org**20050406143806] [compiler optimization doelie@zzz.kotnet.org**20050406132101] [moved some files around doelie@zzz.kotnet.org**20050406030217] [serial code and chains doelie@zzz.kotnet.org**20050406020956] [interrupts + serial code doelie@zzz.kotnet.org**20050406010225] [serial code cleanup + tasks idea doelie@zzz.kotnet.org**20050405163422] [buffer code cleanup doelie@zzz.kotnet.org**20050405144927] [badnop.c parsing words cleanup doelie@zzz.kotnet.org**20050405134635] [bootcode, monitor, serial, circular buffers doelie@zzz.kotnet.org**20050405012358] [cleanup, variable bugfix, if .. then optimizations doelie@zzz.kotnet.org**20050404170012] [condition generators doelie@zzz.kotnet.org**20050403232325] [code cleanup and bit ops doelie@zzz.kotnet.org**20050403215500] [resolved conflict doelie@zzz.kotnet.org**20050403171630] [pieter & johannes meeting doelie@zzz.kotnet.org**20050402172925] [serial code, cleanups, bit instructions doelie@zzz.kotnet.org**20050403124648] [assembler cleanups doelie@zzz.kotnet.org**20050402112743] [fixed tailcall and added for..next doelie@zzz.kotnet.org**20050402022358] [fixed lit tailcall if..then bugs and cleaned up big endian compiler doelie@zzz.kotnet.org**20050402000727] [cleanup + added vectors doelie@zzz.kotnet.org**20050401212532] [badnop.c cleanup doelie@zzz.kotnet.org**20050401183751] [tests and docs doelie@zzz.kotnet.org**20050401000728] [cleanup, missing file, stc tests doelie@zzz.kotnet.org**20050331230514] [removed postpone, added automacros doelie@zzz.kotnet.org**20050331215207] [some host/target cleanup + badnop.c cleanup doelie@zzz.kotnet.org**20050331210901] [sync doelie@zzz.kotnet.org**20050331155040] [fucked up a bit: todo: fix semicolon in listen doelie@zzz.kotnet.org**20050331154944] [tick cleanup, postpone and host/target cleanup doelie@zzz.kotnet.org**20050331145232] [2/ 2* clc pick execute doelie@zzz.kotnet.org**20050331003200] [renames doelie@zzz.kotnet.org**20050330230451] [stc data/prog memory access doelie@zzz.kotnet.org**20050330001806] [cleanup, prompt, macro list, target commands doelie@zzz.kotnet.org**20050329232606] [missing file doelie@zzz.kotnet.org**20050329224324] [dtc code cleanup doelie@zzz.kotnet.org**20050328214306] [moved arch specific defines to arch/ doelie@zzz.kotnet.org**20050328190233] [moved stc code stc doelie@zzz.kotnet.org**20050328190025] [moved compiler to comp/ doelie@zzz.kotnet.org**20050328185427] [cleanup + created asm dir with asm.f bra.f doelie@zzz.kotnet.org**20050328185125] [added big hack to emulate attribute instead of macro/word dictionary behaviour doelie@zzz.kotnet.org**20050328184035] [everything in one dict with target attribute doelie@zzz.kotnet.org**20050328152344] [pre dict unification doelie@zzz.kotnet.org**20050328143940] [interrupts context save/restore doelie@zzz.kotnet.org**20050327204319] [boot code, name changes and if..then doelie@zzz.kotnet.org**20050327164935] [control regs, cleanup and tests doelie@zzz.kotnet.org**20050327134552] [primitive factoring + memory ops bugfix doelie@zzz.kotnet.org**20050327113424] [changed host tick, fetch and store to more explicit name doelie@zzz.kotnet.org**20050326175046] [dtc program/data one address space doelie@zzz.kotnet.org**20050326173802] [dtc + and - working doelie@zzz.kotnet.org**20050326134518] [new DTC next (bigendian + wreg!=tos) doelie@zzz.kotnet.org**20050326125127] [dtc first working implementation doelie@zzz.kotnet.org**20050325160140] [dtc 16bit experiment doelie@zzz.kotnet.org**20050325062909] [docs + threaded forth ideas doelie@zzz.kotnet.org**20050325034223] [cleanup and name changes doelie@zzz.kotnet.org**20050325003659] [single peephole stack doelie@zzz.kotnet.org**20050325002428] [add more missing files doelie@zzz.kotnet.org**20050324230135] [missing stack.f doelie@zzz.kotnet.org**20050324225947] [cleanup + FSR shuffling doelie@zzz.kotnet.org**20050324205435] [some @/! confusion for non-literals doelie@zzz.kotnet.org**20050324165906] [poor mans dasm doelie@zzz.kotnet.org**20050324160644] [macro_data.f cleanup doelie@zzz.kotnet.org**20050324153056] [name changes doelie@zzz.kotnet.org**20050324150358] [cleanup, lit/stack bugfix for + etc, a,b stacks and relative calls/jumps doelie@zzz.kotnet.org**20050324145018] [stack juggling words doelie@zzz.kotnet.org**20050323185126] [cleanup + do loop doelie@zzz.kotnet.org**20050323185038] [removed swap macro - temp reg too ugly doelie@zzz.kotnet.org**20050323144740] [code cleanup doelie@zzz.kotnet.org**20050323144406] [makefile fix + scripts doelie@zzz.kotnet.org**20050322184011] [doc + todo doelie@zzz.kotnet.org**20050322173433] [logfile, badnop startup flags, interactive preload doelie@zzz.kotnet.org**20050322172311] [small fixes. dictionary cleanup. documentation + TODO doelie@zzz.kotnet.org**20050322163544] [changed & to ' and added -*- forth -*- headers doelie@zzz.kotnet.org**20050322150326] [last cvs commit 2 tom**20050322131404] [last cvs commit tom**20050322131334] [zenostuff tom**20040411171348] [stuff tom**20040410142502] [0_3 tom**20040407205533] [stuff tom**20040407185429] [control flow working tom**20040407170026] [first signs of a working itc compiler kernel tom**20040407004227] [readline tom**20040406000722] [stuff tom**20040405132902] [cleanup tom**20040405040655] [opti reset at target docolon + cleanup tom**20040404222423] [more weeding tom**20040404213254] [peephole opti fix : stacks tom**20040404205549] [stuff tom**20040404200258] [na script idee cleanup tom**20040404001636] [pre script delete tom**20040404000914] [endian fix tom**20040402200705] [stuff tom**20040402191645] [stuff tom**20040402001439] [dist tom**20040401232620] [cleanup tom**20040401213700] [stuff tom**20040401212225] [optimization bugfixes: drop/save, literal and tail call tom**20040401205535] [if then else working tom**20040401145259] [if then else working tom**20040401144647] [stuff tom**20040401142520] [forth tested on mingw and cygwin. todo: add newline fix for hex files tom**20040401141927] [asm symbols fix tom**20040401043001] [load store working tom**20040401035746] [drop/save peephole opti tom**20040401005554] [forth compiler produces even better working bootblock tom**20040331230428] [forth compiler produces working bootblock tom**20040331221119] [return stack fix tom**20040331191847] [hex dump ok tom**20040331164523] [target compiler working tom**20040331031455] [forth working tom**20040330182254] [forth stupid bug fix tom**20040330142259] [forth broken tom**20040330011119] [base forth first draft tom**20040329212559] [first sign of forth life tom**20040329201548] [interactivetest tom**20040329020350] [fcomp tom**20040328215828] [stuff tom**20040328190514] [forthstuff tom**20040328175037] [forthstuff tom**20040328173111] [forth stuff tom**20040328172012] [forth compiler tom**20040328034309] [perl stuff tom**20040327032025] [perl stuff tom**20040327030853] [midibox files tom**20040325215606] Patch bundle hash: 2906220371d274432d9bf231d077db66a675defd