Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!uunet!willett!ForthNet From: ForthNet@willett.UUCP (ForthNet articles from GEnie) Newsgroups: comp.lang.forth Subject: forth eng./68hc11 new micros Message-ID: <594.UUL1.3#5129@willett.UUCP> Date: 2 Mar 90 03:56:20 GMT Organization: Latest link in the ForthNet chain. (Pgh, PA) Lines: 96 Date: 02-28-90 (13:14) Number: 393 (Echo) To: ALL Refer#: NONE From: JACK BROWN Read: (N/A) Subj: FRANK'S 68HC11 FORTH ASM Status: PUBLIC MESSAGE Hi Frank, thought you might be interested in the changes that I had to make to get your 68HC11 assembler running on the F68HC11 from New Micros. I will copy the appropriate sections from the new file. I have not yet fully checked out that all works as it should, when I have done so I will upload the changed file. ( Modified to run on New Micros NMIX-0021 F68HC11 Board by ) ( Jack W. Brown ) ( *** Forth assembler for Motorola 68HC11 chip *** ) ( copyright 1989 Frank C. Sergeant ) ( JWB 25 02 90 Changed PUSH and POP to >R and R> ) ( JWB 26 02 90 Fixed Bug in definition of OP3, W, replaced with C, ) ( JWB 26 02 90 Added POP: POPTWO: PUSHD: and NEXT: entry points ) ( JWB 26 02 90 Modified CODE and END-CODE for F68HC11 ) ( JWB 26 02 90 Added NEXT macro. Changed FLIP to use MaxForth >< ) ( JWB 27 02 90 Changed PL, to 0>=, its a better name. ) ( JWB 27 02 90 Fixed problem with OP4 opcodes... Data fields ) ( were reversed and base opcodes incorrect. ) ( JWB 28 02 90 Changed A, and B, to AA, and AB, in LD ST and OR ) ( instructions, the standard Motorola syntax. ) ( was screen # 2 C:6811ASM.SCR ) HEX ( save this for any assembler variables, etc ) ASSEMBLER DEFINITIONS ( Added for Max Forth ) : FLIP ( hhll -- llhh ) >< ; ( -1 ) 0 CONSTANT INTEL ( change to zero for Motorola ) ( was screen # 6 C:6811ASM.SCR ) ( 2 operand opcodes, one of which is reg A or reg B ) ( * changed to Motorola syntax ) 86 OP2 LDAA, * C6 OP2 LDAB, * 8A OP2 ORAA, * CA OP2 ORAB, * 87 OP2 STAA, * C7 OP2 STAB, * ( was screen # 7 C:6811ASM.SCR ) ( 2 operand opcodes, one of which is a 16-bit reg ) HEX : OP3 ( c -) ( u | c -) yindexed? IF 18 C, THEN C@ mode @ + C, ( W, ******* ) ext? imm? OR IF W, ELSE C, THEN ext ; ( was screen # 11 C:6811ASM.SCR ) HEX ( The weird ones. The "normal" ones could have been) ( combined with these.) : OP4 ( y-pre-byte x-pre-byte normal-pre-byte opcode -) ( y-pre x-pre norm-pre opcode) ( Data fields below were reversed and base opcodes were wrong ) ( OP ,Y ,X - ) 83 CD 1A 1A OP4 CPD, 8C CD 0 0 OP4 CPX, 8C 18 1A 18 OP4 CPY, CE CD 0 0 OP4 LDX, CE 18 1A 18 OP4 LDY, CF CD 0 O OP4 STX, CF 18 1A 18 OP4 STY, 22 cc U>, 23 cc U<=, ( you might want to consider) 2A cc 0>=, 2B cc 0<, ( renaming some of these ) 20 cc ALWAYS, 21 cc NEVER, ( conditions ) 28 cc -OV, 29 cc OV, ( Frank PL, now 0>=, ) ( How to get some important entry points for terminating ) ( CODE definitions in MAX Forth V 3.3 ) ' DROP @ 2- @ 5 + @ CONSTANT NEXT: ' 2DROP @ 2- @ CONSTANT POPTWO: ' DROP @ 2- @ CONSTANT POP: ' DUP @ 2- @ 4 + @ CONSTANT PUSHD: ( Typical code definition sequence will be .... ) ( CODE ... op codes ... NEXT END-CODE ) : NEXT NEXT: JMP, ; VARIABLE SCONTEXT ( Place to save CONTEXT vocabulary. ) FORTH DEFINITIONS ( CODE and END-CODE modified for F68HC11 Max Forth V3.3 ) : CODE ( -) CREATE HERE DUP 2- ! CONTEXT @ [ ASSEMBLER ] SCONTEXT ! ext [COMPILE] ASSEMBLER ; ASSEMBLER DEFINITIONS : END-CODE ( - ) SCONTEXT @ CONTEXT ! ; FORTH DEFINITIONS DECIMAL NET/Mail : British Columbia Forth Board - Burnaby BC - (604)434-5886 ----- This message came from GEnie via willett through a semi-automated process. Report problems to: 'uunet!willett!dwp' or 'willett!dwp@gateway.sei.cmu.edu'